Code Yarns β€πŸ‘¨β€πŸ’»
Tech Blog ❖ Personal Blog

CUDA: Syntax Highlighting in Visual Studio

πŸ“… 2011-Jan-25 ⬩ ✍️ Ashwin Nanjappa ⬩ πŸ“š Archive

It is painful to work with CUDA source files (*.cu) in Visual Studio without syntax highlighting. Nvidia provides a usertype.dat file that can be used for this purpose. Here is how:

  1. Install the GPU Computing SDK. Note that this is not the same as the CUDA Toolkit, which is a prerequisite for the SDK. The SDK installs into the %NVSDKCOMPUTE_ROOT% directory. On Windows 7, typically this is C:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK 3.2

  2. Go to theΒ %NVSDKCOMPUTE_ROOT%\C\doc\syntax_highlighting\visual_studio_8 directory. Use the usertype.dat file that is here and follow the instructions in the Readme.txt file that is here.

  3. Restart Visual Studio.

Tried with: CUDA 3.2