It is convenient to have Intellisense turned on for CUDA source files in Visual Studio. This enables autocompletion while typing code and navigation while investigating code. The navigation is especially useful since the programmer can seamlessly navigate between C/C++ and CUDA code using Go to Definition and similar commands.
To turn on Intellisense in Visual Studio 2008 for CUDA source files:
Close all instances of Visual Studio.
Open Registry Editor and navigate to
In the value of the name
NCB Default C/C++ Extensions, append the text
.cu;.cuh;.cl; This instructs Intellisense to build its database for CUDA source files too.
.ncb file in your Visual Studio project directory. Open your CUDA project in Visual Studio, Intellisense will rebuild its database, this time it will include the CUDA source files.
Clicking Go to Definition or F12 on a CUDA runtime function call (like
cudaMalloc) may not work. If you want such functionality, include the CUDA header file that has those declarations. For example,
cuda_runtime.h needs to be included for most runtime calls.
Note: Related information and files can be found in the
Tried with: Visual Studio 2008