Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to enable syntax highlighting for CUDA 4.0 in Visual Studio 2010?

Direct Question: Is it possible to enable syntax highlighting for CUDA 4.0 in Visual Studio 2010, and if so, how does one do it?

Background: I tried to follow this guide, got IntelliSense working, but ran into a problem. Apparently CUDA 4 does not create a "C:\Users\\AppData\Local\NVIDIA Corporation\NVIDIA GPU Computing SDK 4.0" directory and I have been unable to find any other files on my computer pertaining to CUDA syntax highlighting under Visual Studio. If anyone knows how to enable syntax highlighting or where to find the NVIDIA-provided keyword list, I would be very grateful. One solution I can think of would be to install CUDA 3.2 and use its "usertype.dat" file, but my one concern is that it would highlight deprecated keywords. If that's the case and the only way to enable syntax highlighting, I suppose I'll just wait for the official CUDA 4 release. Once again, thanks! : )

like image 693
Carlos Daniel Gadea Omelchenko Avatar asked Apr 12 '11 22:04

Carlos Daniel Gadea Omelchenko


2 Answers

See this blog post I wrote on adding this for CUDA 3.2. I'm now using 4.0 RC and I don't think anything has changed in these steps although you're right about the usertype.dat file. You could manually edit this to add/remove new keywords.

http://www.ademiller.com/blogs/tech/2010/10/visual-studio-2010-adding-intellisense-support-for-cuda-c/

like image 125
Ade Miller Avatar answered Nov 15 '22 07:11

Ade Miller


For CUDA 5 I found the "usertype.dat" in

C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.0\doc\syntax_highlighting\visual_studio_8

Thanks.

like image 33
smiron Avatar answered Nov 15 '22 07:11

smiron