Open pogevip opened 3 years ago
You should add a .clangd
file
CompileFlags:
Add:
- -std=c++11
- --cuda-path=/usr/local/cuda
- --cuda-gpu-arch=sm_61
- -L/usr/local/cuda/lib64
- -I/usr/local/cuda/include
clangd seems to not working on windows though...
Also, clangd 11.0+ is needed.
looks like not work on windows until now
@Wongboo It works, but you need to carefully configure it though...
@cloudhan , how's your configuration file?
This should work:
.clangd
file:
CompileFlags:
Add:
- -std=c++14
- --cuda-path=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.1
- --cuda-gpu-arch=sm_61
- -LC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.1\lib\x64
- -IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.1\include
You must not quote your path and must not escape the backslash in the path. Pretty weird here, though.
And you should set your .cu
file to cpp mode via vscode's "Chang Language Mode".
@cloudhan, thank you for your code, I think vscode-clangd may make some improvement: vscode-clangd should work under cuda and cuda-cpp language mode
-LC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.1\lib\x64
and -IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.1\include
from configuration, which still works. My final question is my environment variable already have CUDA_PATH
, can I simple write something like -xcuda
to use CUDA_PATH
?Some improvements are being discussed in https://reviews.llvm.org/D114326. Feel free to state your opinions there.