用clang编译CUDA [英] Compiling CUDA with clang
问题描述
我是 LLVM 新手.听说clang支持CUDA.如何使用 clang 编译 CUDA?我是否必须进行一些配置更改或包含任何特定的头文件?我在网上找不到有关此的任何信息.有可能吗?
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't find any information on this on the web. Is it possible at all?
现在,当我尝试使用 clang as 编译一个虚拟 cuda 程序时
Right now when I try to compile a dummy cuda program with clang as
clang -I /usr/local/cuda/include filename.cu
我收到以下错误
unknown type name '__global__'
__global__ void nothing(int *A)
感谢任何帮助!顺便说一句,我在 Mac 上运行它.
any help is appreciated! btw i am running it in a mac.
推荐答案
2016-05-01 更新:clang 现在支持 CUDA.请参阅@rivanvx 的回答.
CUDA 编译器基于 LLVM.Clang 虽然也是基于 LLVM,但不支持 CUDA.
The CUDA compiler is based on LLVM. Clang, though also based on LLVM, does not support CUDA.
这篇关于用clang编译CUDA的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!