CUDA vc2005环境配置方法总结
2008-06-01 16:20
417 查看
安装CUDA SDK
安装CUDA toolkit 安装CUDA驱动。
配置相应的环境变量:CUDA_BIN_PATH=C:/CUDA/BIN;
CUDA_INC_PATH=C:/CUDA/INCLUDE; CUDA_LIB_PATH=.;C:/CUDA/lib;C:/CUDA/lib/cuda.lib;C:/CUDA/lib/cudart.lib;
解压cuda_build_rule.zip得到cuda.rules。(目录中最好没有中文)新建工程。
在工程上右键选custom build rules->Find Existing,选中cuda.rules,点击ok。现在可以像编译.c/.cpp一样编译.cu了。
在工程目录下新建文本文件,存为.cu格式,增加到工程中,编辑代码。
在.cu文件上右键选属性,你将会看到多出来一个CUDA目录。说明以上操作成功。在工程属性里,[C/C++]à[General]àAdditional Include Directories 添加 $CUDA_INC_PATH 在工程属性里,[Linker]à[General]àAdditional Library Directories 添加 $CUDA_LIB_PATH 在工程属性里,[Linker]à[Input]àAdditional Dependencies 添加 c:/CUDA/lib/cudart.lib 重新编译工程。
Visual Assist 添加支持*.cu文件
1. 打开注册表,在HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/VisualStudio/8.0/Languages/File Extensions/ 下面添加子键 .cu 然后copy .cpp的键值到.cu。这样才能表示cu也是VS下的VC的工程文件。 2. 打开注册表HKEY_CURRENT_USER/Software/Whole Tomato/Visual Assist X/VANet8 在ExtSource键添加键值.cu。
3. 打开Visual Assist属性,在projects 的C/C++ Directories custom下面添加CUDA的头文件目录,这样才能在Visual Assist 生成规则的时候找到CUDA自身的特殊定义才能生成Visual Assist的关键字,如__global__.
Want pretty syntax highlighting when editing your .cu files in Visual Studio? Heres how: --- Visual Studio .Net 2005 / Visual Studio 8:
1. If you don't have a usertype.dat file in your "Microsoft Visual Studio 8/Common7/IDE" folder, then copy the included usertype.dat file there. If you do, append the contents of the included usertype.dat onto the end of the "Microsoft Visual Studio 8/Common7/IDE/usertype.dat"
2. Start Visual Studio 8. Select the menu "Tools->Options...". Open "Text Editor" in the tree view on the left, and click on "File Extension". Type cu in the "Extension" box, and click "Add". Click "OK" on the dialog box.
3. Restart Visual Studio and your CUDA code should now have syntax highlighting. (CUDA guide中的方法,试过但并不好使)
安装CUDA toolkit 安装CUDA驱动。
配置相应的环境变量:CUDA_BIN_PATH=C:/CUDA/BIN;
CUDA_INC_PATH=C:/CUDA/INCLUDE; CUDA_LIB_PATH=.;C:/CUDA/lib;C:/CUDA/lib/cuda.lib;C:/CUDA/lib/cudart.lib;
解压cuda_build_rule.zip得到cuda.rules。(目录中最好没有中文)新建工程。
在工程上右键选custom build rules->Find Existing,选中cuda.rules,点击ok。现在可以像编译.c/.cpp一样编译.cu了。
在工程目录下新建文本文件,存为.cu格式,增加到工程中,编辑代码。
在.cu文件上右键选属性,你将会看到多出来一个CUDA目录。说明以上操作成功。在工程属性里,[C/C++]à[General]àAdditional Include Directories 添加 $CUDA_INC_PATH 在工程属性里,[Linker]à[General]àAdditional Library Directories 添加 $CUDA_LIB_PATH 在工程属性里,[Linker]à[Input]àAdditional Dependencies 添加 c:/CUDA/lib/cudart.lib 重新编译工程。
Visual Assist 添加支持*.cu文件
1. 打开注册表,在HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/VisualStudio/8.0/Languages/File Extensions/ 下面添加子键 .cu 然后copy .cpp的键值到.cu。这样才能表示cu也是VS下的VC的工程文件。 2. 打开注册表HKEY_CURRENT_USER/Software/Whole Tomato/Visual Assist X/VANet8 在ExtSource键添加键值.cu。
3. 打开Visual Assist属性,在projects 的C/C++ Directories custom下面添加CUDA的头文件目录,这样才能在Visual Assist 生成规则的时候找到CUDA自身的特殊定义才能生成Visual Assist的关键字,如__global__.
Want pretty syntax highlighting when editing your .cu files in Visual Studio? Heres how: --- Visual Studio .Net 2005 / Visual Studio 8:
1. If you don't have a usertype.dat file in your "Microsoft Visual Studio 8/Common7/IDE" folder, then copy the included usertype.dat file there. If you do, append the contents of the included usertype.dat onto the end of the "Microsoft Visual Studio 8/Common7/IDE/usertype.dat"
2. Start Visual Studio 8. Select the menu "Tools->Options...". Open "Text Editor" in the tree view on the left, and click on "File Extension". Type cu in the "Extension" box, and click "Add". Click "OK" on the dialog box.
3. Restart Visual Studio and your CUDA code should now have syntax highlighting. (CUDA guide中的方法,试过但并不好使)
相关文章推荐
- 7、oracle vm virtualbox & ubuntu-14.04 应用环境配置方法总结
- 【嗨兴科技】Android 3.0.1 图解配置NDK开发环境以及Hello Word To JNI方法总结
- linux下配置jdk环境变量的三种方法总结
- 在VC2005下配置OGRE环境时,遇到的问题总结
- ios app应用开发环境配置方法总结
- linux下配置jdk环境变量的三种方法总结
- 总结pyspark在windows7环境下的搭建方法,pycharm的配置方法
- 把动态SQL结果集转化为视图查询的方法(运行环境:SQL2005以上版本)
- docker网络配置方法总结
- SQL2005 SQL2008 远程连接配置方法 -erro26
- Visual Studio 2010 环境下 配置LibCurl with SSL 方法
- endeca虚拟机环境配置总结
- java和tomcat在windows上环境变量配置方法
- tomcat 和java环境配置的一些总结
- Ubuntu12.04下配置java环境总结
- OpenCV 2.3.x/2.4.x在Visual Studio 2005/2008、Visual Studio 2010和Visual Studio 2012配置方法详解
- H3C各种型号交换机端口镜像配置方法总结
- 游戏引擎Andengine总结(一):AndEngine环境配置及extension,AndEngineExamples导入
- VC环境下(非QT环境)使用Qt的配置方法
- PHP环境下utf8乱码的解决方法---apache/php配置问题