I regularly code in CUDA on Windows using Visual Studio.
Whilst coding it would be nice for the intellisense popup to show me relevant popups.
But 90% of what it shows me is useless WINAPI stuff, which has no relevance whatsoever in CUDA code, even on the __host__
(that runs in console mode).
For example:
For context, I never #include
any WinAPI stuff, only
#include <cuda.h>
#include <cuda/atomics>
But still I get this useless WINAPI stuff.
Is there a way to exclude all the WinAPI include folders from the symbol lookup, so that intellisense does not show them in the completion suggestions?
Or alternatively, can I limit the suggestions to just the CUDA include folders and my own code?
Update
I disable Windows.h
only for intellisense by altering this file like so:
#ifndef __INTELLISENSE__
//rest of Windows.h
#endif /* __INTELLISENSE__ */
After saving (needs admin privileges) and restarting VS 2022, I get:
Only my code and the CUDA API, much better...
can I limit the suggestions to just the CUDA include folders and my own code?
I think yes. You can right-click on the project node in Solution Explorer and select Properties
then customize #include paths
for the current configuration and platform.
Select the Include Directories
line and click the dropdown on the right, choose <Edit>
,click New Line
. You can add your CUDA include folders to here. The default values for build macros are VC_IncludePath
and $(WindowsSDK_IncludePath)
.
Is there a way to exclude all the WinAPI include folders from the symbol lookup
Based on this old ticket, new version VS will include Win32 API intellisence automatically. I have an idea, if you backup and remove the windows.h
file in the following folder,Win32 API should not be detected.
C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um