as far as i know, with installaion Nsight Visual Studio Code Edition and c/c++ tools, we can easily write cuda code, but i use clangd for autocomplete,intelliSense, when i install clagd in vscode , i have to close c/c++:
"C_Cpp.intelliSenseEngine": "disabled",
after close C_Cpp.intelliSenseEngine, clangd just give me a lot of errors in cu file (my project can compile success):
here is my command:
cmake -S . -B build -GNinja
the compile_coammands.json:
[
{
"directory": "E:/test/build",
"command": "C:\\PROGRA~1\\NVIDIA~2\\CUDA\\v11.8\\bin\\nvcc.exe -forward-unknown-to-host-compiler -IE:\\test\\build\\_deps\\json-src\\include -isystem E:\\test\\build\\_deps\\opencv-src\\include -D_WINDOWS -Xcompiler=\" /EHsc\" -Xcompiler=\" -Zi -Ob0 -Od /RTC1\" -std=c++17 \"--generate-code=arch=compute_52,code=[compute_52,sm_52]\" -Xcompiler=-MDd -x cu -c E:\\test\\app.cu -o CMakeFiles\\mod.dir\\app.cu.obj -Xcompiler=-FdTARGET_COMPILE_PDB,-FS",
"file": "E:\\test\\app.cu",
"output": "CMakeFiles\\mod.dir\\app.cu.obj"
}
]
clangd plugin log:
can anyone help me to solve this? or
what is the bset practice with vscode clangd plugin and cu project