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:
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.
clang –x=CUDA in the public LLVM trunk is something experimental done outside of NVIDIA; you should contact the llvm-dev alias with questions.
NVCC doesn't support emitting LLVM IR.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With