Visual Studio 2015 writes CUDA keyword highlighting and automatic completion

The first step is to set the vc++ file support .cu;cuh; file in vs2015. Method: Tools -> Options -> Text Editor -> File Extension.
Get the interface as shown in the figure: Note that you can add vc++ type file extensions on the right side. This is my setting effect, and the operation does not need to be elaborated.

The second step is to set the directory of visual assist. In Tomato's c/c++ directory, select the custom option, and then include your cuda sdk directory, the effect is as follows:

 The third step is to set the supported file types of Pomodoro, similar to the first step. However, this time is to modify the value of the registry. Close VS before modifying.

Use the Win+R key combination to open the "Run" window and type in the regedit command (abbreviation for register edit)

Open the registry and find the following location: HKEY_CURRENT_USER\Software\Whole Tomato\Visual Assist X\VANet10. Find the ExtSource project on the right, right-click and select Modify, and add the following text after the original text: .cu;.cuh; After confirming, close the registry.

Reopen Visual Studio 2015, and Visual Assist X will start to support syntax highlighting and code completion of .cu and .cuh files. At this time, the CUDA function of the .cu file is highlighted, and using the function name symbol will automatically prompt the full name of the function, parameter types and other information.

The fourth step, after completing the above steps, you may find that there are wavy lines under some built-in variables. What happened?
Add this sentence: #include "device_launch_parameters.h", that's it. Cuda put the declaration of built-in variables under the header file.

Guess you like

Origin blog.csdn.net/qq_26751117/article/details/96993609