您的位置:首页 > 其它

Mac OS X下编译CUDA6例子时出现关于switch的warning的解决办法

2014-07-20 10:51 465 查看
Mac OS X 10.9上无论通过make还是用NSight都会出现类似下面这个warning:

$ make
/Developer/NVIDIA/CUDA-5.5/bin/nvcc -ccbin /usr/bin/clang -I../../common/inc -m64 -Xcompiler -arch -Xcompiler x86_64 -Xcompiler -stdlib=libstdc++ -gencode arch=compute_10,code=sm_10 -gencode arch=compute_20,code=sm_20 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=\"sm_35,compute_35\" -o asyncAPI.o -c asyncAPI.cu
../../common/inc/helper_cuda.h:68:9: warning: 13 enumeration values not handled in switch:
'cudaErrorAssert', 'cudaErrorTooManyPeers', 'cudaErrorHostMemoryAlreadyRegistered'...
[-Wswitch]
switch (error)
^
1 warning generated.
解决办法就是安装或者重新安装xcode命令行工具: terminal中运行xcode-select --install。会跳出一个对话框问你是否安装,点确定就可以自动下载和安装了。如果以前装过,但还是出现这个warning,再安装一遍就行了,速度很快。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐