enable clang as CUDA compiler
clang has had CUDA support starting from version 3.9: http://llvm.org/docs/CompileCudaWithLLVM.html
The following are the minimum changes needed wrt a standard C++ file in order to compile CUDA code with clang (see more here: http://llvm.org/docs/CompileCudaWithLLVM.html#compiling-cuda-code):
-
pass compiler flags: --cuda-path=${CUDA_TOOLKIT_ROOT_DIR}
(can use FindCUDA to detect) -
link flags -lcudart
or-lcudart_static
(and the appropriate paths) -
[ - pass compiler flag to switch on CUDA mode -x cuda
]
For basic support it would be enough to enable compilation of .cu files and adding extra cache variable for additional compiler flags.