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,再安装一遍就行了,速度很快。
$ 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,再安装一遍就行了,速度很快。
相关文章推荐
- cuda8.0使用nvcc编译程序出现warning:The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated的解决办法
- 在CentOS下编译最新CUDA5.5例子代码出错解决办法
- Mac下使用Eclipse编译C/C++文件出现 launch failed, binary not found 错误的解决办法
- 关于android开发中编译时出现“No Launcher activity found!”的解决办法
- 关于Visual Studio 2013 编译 multi-byte character set MFC程序出现 MSB8031 错误的解决办法
- 在MAC OS X 10.9下编译CUDA 5.5例子程序出错解决方案
- 【Mac os x 下配置Intellij IDEA + Tomcat 出现权限问题的解决办法】
- VS2008编译DirectX SDK 2004 summer版的Sound例子程序出现的libcp.lib找不到的问题的解决办法
- 关于Matlab编译生成jar包时出现错误的解决办法
- [Mac]关于mac的LaunchPad出现相同图标解决办法
- Mac OS X下使用MySQL出现中文乱码的解决办法
- 【游戏开发备注之一】关于Cocos2dx_v1.x版本iphone与Android运行出现图片白块、添加GameCenter报错问题及编译Android闪退的解决办法&&CCLOG与CClog的区别
- 关于Visual Studio 2013 编译 multi-byte character set MFC程序出现 MSB8031 错误的解决办法
- 关于C++程序编译出现error C2143: syntax error : missing ';' before 'type'的解决办法
- 关于Visual Studio 2013 编译 multi-byte character set MFC程序出现 MSB8031 错误的解决办法
- 关于Visual Studio 2013 编译 multi-byte character set MFC程序出现 MSB8031 错误的解决办法
- MDK中编译出现warning: function "xxx" declared implicitly 警告的解决办法
- 关于Visual Studio 2013 编译 multi-byte character set MFC程序出现 MSB8031 错误的解决办法
- 关于MAC下php出现:Call to undefined function Think\imagettftext()的解决办法
- 关于Visual Studio 2013 编译 multi-byte character set MFC程序出现 MSB8031 错误的解决办法