clangd / vscode-clangd

Visual Studio Code extension for clangd
https://marketplace.visualstudio.com/items?itemName=llvm-vs-code-extensions.vscode-clangd
MIT License
637 stars 113 forks source link

Help! Anyone know how to configure clangd.arguments or any other way to support CUDA intellisense #532

Open Aklice-new opened 1 year ago

Aklice-new commented 1 year ago

Does anyone know how to use vscode-clangd to support *.cu files, I search many blogs about it, I've try to create .clangd file in the root directory of the project or add "--cuda" in to clangd.arguments, but neither worked. So does anyone know how to do that? I'll be very grateful.

HighCommander4 commented 1 year ago

You might find some helpful tips in https://github.com/clangd/vscode-clangd/issues/125

Aklice-new commented 1 year ago

You might find some helpful tips in #125

Thanks you for reply, I have tried to add .clangd file into the project like below : ├── 3rd ├── build ├── .clangd ├── .clang-format ├── CMakeLists.txt ├── config ├── include ├── main.cpp ├── src └── .vscode and the .clangd file is : CompileFlags: Add:

But when I want to jump to the header file, it still cant work

2023-09-17 13-55-20 的屏幕截图

HighCommander4 commented 1 year ago

--cuda-path=/usr/local/cuda/bin/ ... -LC:/usr/local/cuda/lib64

That doesn't look right. /usr/local/cuda/bin/ is a Unix path. C:/usr/local/cuda/lib64 is a Windows path. What OS are you on?

Aklice-new commented 1 year ago

--cuda-path=/usr/local/cuda/bin/ ... -LC:/usr/local/cuda/lib64

That doesn't look right. /usr/local/cuda/bin/ is a Unix path. C:/usr/local/cuda/lib64 is a Windows path. What OS are you on?

I’m on Ubuntu , Unix

HighCommander4 commented 1 year ago

I’m on Ubuntu , Unix

Ok, so C: should definitely not appear in the paths present in the compile flags.

levihuayuzhang commented 10 months ago

Seems llvm only partially support to 11.8 so far. I guess this is an upstream problem. Use cpptools and nsight extension instead?