[cfe-dev] Cuda Refactoing

Jacques Pienaar via cfe-dev cfe-dev at lists.llvm.org
Wed Sep 30 06:58:29 PDT 2015


Hey Bahram,

For the first part (recognize CUDA tokens), look in the clang/test/SemaCUDA
directory for how clang is invoked to parse CUDA tokens
(clang/test/SemaCUDA/function-target-hd.cu shows invocation variants).
There is also some support already to query the AST for CUDA nodes. For
example, a kernel launch (<<<,>>>) is matched by the AST
matcher cudaKernelCallExpr.

Can you expand more on the bitcode part? I'm not quite following the flow
of what your tool does, i.e., what does it take as input and what do you
wish to generate with it?

Best,

Jacques

On Wed, Sep 30, 2015 at 3:25 AM, Manuel Klimek <klimek at google.com> wrote:

> +jacques to pull in the right people to get you started
>
> On Wed, Sep 30, 2015 at 11:48 AM Bahram Yarahmadi via cfe-dev <
> cfe-dev at lists.llvm.org> wrote:
>
>>
>>
>> On Wed, Sep 30, 2015 at 11:37 AM, Bahram Yarahmadi <
>> bahram.yarahmadi at gmail.com> wrote:
>>
>>>  Hello everyone,
>>> I want to write a tool to do some modification in a Cuda C program ,my
>>> program must receive a cuda c program as its input and then do some
>>> modification on its AST and then in its bitcode
>>> I have a problem in reading such files (.cu) clang does not recognize
>>> some tokens in cuda C language (like <<<)  and it does not generate a
>>> proper output for kernel functions after i try to transfer my bitcode to
>>> ptx ,
>>> Does anyone here that have a good manual that can help me out through
>>> this pipeline  ?
>>>
>>>
>>> Special thanck in advance,
>>>
>>>
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150930/c0b2ad5b/attachment.html>


More information about the cfe-dev mailing list