How can I get syntax highlighting for a .cu file in Visual Studio?

12,875

Solution 1

Follow these steps.

  • Copy usertype.dat from Program Files\NVIDIA Corporation\NVIDIA CUDA SDK\doc\syntax_highlighting\visual_studio_8 to Program Files\Microsoft Visual Studio 8\Common7\IDE.
  • Start Visual Studio and go to Tools -> Options -> Text Editor -> File Extension
  • In the extension box type "cu" and select "Microsoft Visual C++" in the drop down.
  • Restart.

Solution 2

Install Parallel Nsight, It will do it automatically.

Solution 3

(Visual Studio 2015, v14.0)

  1. Menu: Tools > Options
  2. Sidebar: Text Editor > File Extension
  3. Enter 'cu' for extension, select 'C++' for editor, click 'add'.
  4. Re-open file with 'cu' extension
Share:
12,875
ztdep
Author by

ztdep

computational everyday

Updated on July 29, 2022

Comments

  • ztdep
    ztdep over 1 year

    I am studying CUDA based on the Visual Studio 2008. Could you please tell me how to make syntax highlighting appear in a .cu file?