I've been trying for three days to compile a CUDA kernel into llvm IR and I couldn't do it. I've changed langoptions.cpp
and added CUDA=1;
in the constructor , but still the clang give me Error messages for cuda syntax (like _synchthreads() call).
I've done the following:
- 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
and as I said it doesn't work.