I am new to LLVM. I heard that clang supports CUDA. How do I compile CUDA using clang? Do I have to make some config changes or include any specific header files? I couldn\'
Thanks to contributions from Google and others, Clang now supports building CUDA. Command line parameters are slightly different from nvcc
, though. According to the official documentation, assuming your file is named axpy.cu
, the basic usage is:
$ clang++ axpy.cu -o axpy --cuda-gpu-arch= \
-L/ \
-lcudart_static -ldl -lrt -pthread
Note that using Clang for compiling CUDA still requires that you have the proprietary CUDA runtime from the NVIDIA CUDA toolkit installed.