Skip to content

Instantly share code, notes, and snippets.

@trxcllnt
Created June 7, 2022 02:35
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save trxcllnt/dad9565a1cfd54aedbe8fcf052a7cd45 to your computer and use it in GitHub Desktop.
Save trxcllnt/dad9565a1cfd54aedbe8fcf052a7cd45 to your computer and use it in GitHub Desktop.
basic `clangd` C/C++/CUDA config
# Apply this config conditionally to all C files
If:
PathMatch: .*\.(c|h)$
CompileFlags:
Compiler: /usr/bin/gcc
---
# Apply this config conditionally to all C++ files
If:
PathMatch: .*\.(c|h)pp
CompileFlags:
Compiler: /usr/bin/g++
---
# Apply this config conditionally to all CUDA files
If:
PathMatch: .*\.cuh?
CompileFlags:
Compiler: /usr/local/cuda/bin/nvcc
---
# Tweak the clangd parse settings for all files
CompileFlags:
Add:
# report all errors
- "-ferror-limit=0"
Remove:
# strip CUDA fatbin args
- "-Xfatbin*"
# strip CUDA arch flags
- "-gencode*"
- "--generate-code*"
# strip CUDA flags unknown to clang
- "-ccbin*"
- "--compiler-options*"
- "--expt-extended-lambda"
- "--expt-relaxed-constexpr"
- "-forward-unknown-to-host-compiler"
- "-Werror=cross-execution-space-call"
Hover:
ShowAKA: No
InlayHints:
Enabled: No
Diagnostics:
Suppress:
- "variadic_device_fn"
- "attributes_not_allowed"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment