[ACCEPTED]-Compiling CUDA with clang-llvm-clang
Accepted answer
Thanks to contributions from Google and 7 others, Clang now supports building CUDA. Command 6 line parameters are slightly different from 5 nvcc
, though. According to the official documentation, assuming your 4 file is named axpy.cu
, the basic usage is:
$ clang++ axpy.cu -o axpy --cuda-gpu-arch=<GPU arch> \
-L<CUDA install path>/<lib64 or lib> \
-lcudart_static -ldl -lrt -pthread
Note 3 that using Clang for compiling CUDA still 2 requires that you have the proprietary CUDA 1 runtime from the NVIDIA CUDA toolkit installed.
2016-05-01 Update: clang now supports CUDA. See @rivanvx' answer.
The CUDA compiler is based on LLVM. Clang, though 1 also based on LLVM, does not support CUDA.
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.