我已经尝试了三天将CUDA内核编译成LLVM IR,但是一直无法成功。我已经修改了langoptions.cpp
并在构造函数中添加了CUDA=1;
,但是clang仍然给我报错,提示CUDA语法错误(例如_synchthreads()调用)。我已经做了以下几点:
- downloaded llvm (including clang) modified langoptions.cpp (CUDA=1; in the constructor), and installed it.
- installed CUDA toolkit 4.1 and CUDA SDK.
compiled a CUDA example using clang using:
clang -I${CUDA_HOME}/include -I${CUDA_SDK_INC} ~/workspace/cuda_example/mis_kernel.cu -S -emit-llvm -o ~/workspace/cuda_example/a.ll
正如我所说,它不起作用。