I'm running VSCodium with the clangd extension, and I'd like to have proper CUDA highlighting (e.g. __device__
and __host__
keywords are understood). I ran CMake to generate the compile_commands.json
file, and it includes CUDA-specific keywords (e.g. --cuda-gpu-arch=sm_52
, --cuda-path=/usr/local/cuda
). However, clangd still gives me the squiggle underline on CUDA-specific keywords. It seems like if clangd is just using the clang compiler to understand the source code, then clangd should work with CUDA (given that clang was able to compile the CUDA code).
So, is there any way to get clangd to work for CUDA? And if so, how do I do it via VSCodium?
Edit: As it turns out, the CUDA code highlighting works on the directly linked files (with a .cu
extension), but it does not work on one of the included header files (with a .hpp
extension). How do I get the text-highlighting to work on the header file?