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 shaders should now have syntax highlighting.
ps: 上面的内容来至 C:/Program Files/NVIDIA Corporation/NVIDIA CUDA SDK/doc/syntax_highlighting/visual_studio_8/readme.txt
在添加cu的时候,最好选择vc++的编辑器做为cu默认编辑器,这样就可以使用c/C++的规则来编辑cu文件
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 shaders should now have syntax highlighting.
ps: 上面的内容来至 C:/Program Files/NVIDIA Corporation/NVIDIA CUDA SDK/doc/syntax_highlighting/visual_studio_8/readme.txt
在添加cu的时候,最好选择vc++的编辑器做为cu默认编辑器,这样就可以使用c/C++的规则来编辑cu文件
本文介绍如何在Visual Studio 2005中为CUDA (.cu) 文件设置语法高亮显示。主要步骤包括:复制或追加usertype.dat文件到指定路径,通过工具->选项设置文件扩展名cu与C/C++编辑器关联。
1万+





