现在的位置: 首页 > 综合 > 正文

Want pretty syntax highlighting when editing your .cu files in Visual Studio?

2013年08月21日 ⁄ 综合 ⁄ 共 689字 ⁄ 字号 评论关闭

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文件

抱歉!评论已关闭.