[LLVMdev] Cuda programs on LLVM

Che-Liang Chiou clchiou at gmail.com
Tue Aug 16 00:21:26 PDT 2011


Hi Adarsh,

Justin has uploaded some sample codes of how to work with the LLVM PTX
backend: https://github.com/jholewinski/llvm-ptx-samples

Basically, you have to write a C++ program that explicitly loads CUDA
"bytecodes". And, as Ralf pointed out, since we do not have a LLVM
CUDA frontend, your CUDA kernels have to be looked like C++. That
means, it is not a 100% syntactically correct CUDA codes.

Regards,
Che-Liang

On Tue, Aug 16, 2011 at 1:09 AM, Ralf Karrenberg <Chareos at gmx.de> wrote:
> Hi Adarsh,
>
> to my knowledge there is no publicly available CUDA-Frontend for LLVM yet.
> The work of Helge Rhodin you mentioned is on the backend-side: It allows
> to generate PTX code from LLVM IR. It is still being maintained,
> although I think the currently available source code is a little outdated.
> There is also a PTX backend in the current version of LLVM that makes
> use of LLVM's backend-infrastructure (our approach is similar to the
> C-backend).
>
> Best,
> Ralf
>
> Am 15.08.2011 11:20, schrieb Adarsh HV:
>> Hello ,
>> How to execute a cuda program using llvm?
>>   More specifically, nvcc produces some temporary files during its
>> compilation. I want to convert the .cu.cpp to .ll format and optimize
>> it. The .cu.cpp file contains typedefs and enums used by cuda runtime
>> and also the host part of the code
>>   and the ptx file  contains the kernel definition. How can i run the
>> program after optimization? Will Rhodin be of any help in doing so?
>> Thank you:)
>>
>>
>>
>> _______________________________________________
>> LLVM Developers mailing list
>> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>




More information about the llvm-dev mailing list