为什么出现:warning: The 'compute_10' and 'sm_10' architectures are deprecated

平台: Mac OS X 10.9 (Mavericks).

CUDA 版本: 6.0.x

编译自带的samples的时候,每次都出现一个warning, 以0_Simple的vecAdd为例,执行make后得到:

/Developer/NVIDIA/CUDA-6.0/bin/nvcc -ccbin clang -I../../common/inc  -m64  -Xcompiler -arch -Xcompiler x86_64  -gencode arch=compute_10,code=sm_10 -gencode arch=compute_20,code=sm_20 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_32,code=sm_32 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_50,code=compute_50 -o vectorAdd.o -c vectorAdd.cu
nvcc warning : The 'compute_10' and 'sm_10' architectures are deprecated, and may be removed in a future release.
/Developer/NVIDIA/CUDA-6.0/bin/nvcc -ccbin clang   -m64  -Xcompiler -arch -Xcompiler x86_64  -Xlinker -rpath -Xlinker /Developer/NVIDIA/CUDA-6.0/lib  -gencode arch=compute_10,code=sm_10 -gencode arch=compute_20,code=sm_20 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_32,code=sm_32 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_50,code=compute_50 -o vectorAdd vectorAdd.o 
nvcc warning : The 'compute_10' and 'sm_10' architectures are deprecated, and may be removed in a future release.
mkdir -p ../../bin/x86_64/darwin/release
cp vectorAdd ../../bin/x86_64/darwin/release

其中warning所说的compute_10和sm_10指的是compute capability 1.0,也就是没有检测到cuda显卡时候的情况。注意到make实际执行命令行参数:

-gencode arch=compute_10,code=sm_10 -gencode arch=compute_20,code=sm_20 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_32,code=sm_32 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_50,code=compute_50


可以看到,生产的代码的目标平台架构涵盖了10,20,...所有的情况。这说明,samples中的CmakeList.txt文件中没有自动监测平台架构的语句,导致了把所有可能的平台架构都包含进去了。这才有了上面的warning,告诉你以后的CUDA版本中将取消对1.0情况的支持,提醒你考虑程序的兼容性。


用nsight做cuda程序的时候,会如下图提示你选择,因此不会出现这个warning.

为什么出现:warning: The 'compute_10' and 'sm_10' architectures are deprecated_第1张图片



你可能感兴趣的:(OSX,并行计算,CUDA,Eclipse)