Clangd treats .cu files as CUDA only, so host‑side C++ features like <format> and <chrono> aren’t recognized by default. The long‑term fix should be to tell clangd to use your GCC toolchain and enable modern C++ explicitly:
If:
PathMatch: ".*\\.cu"
CompileFlags:
Add:
- -std=c++20
- --gcc-toolchain=/usr
This way clangd parses host code with C++20 and finds the right headers automatically, without any silenced warnings and such. It’s future‑proof since clangd will follow your toolchain instead of hard‑coded paths.
(PS: All comments appreciated, I’m new around here)