-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.clangd
More file actions
115 lines (106 loc) · 2.5 KB
/
.clangd
File metadata and controls
115 lines (106 loc) · 2.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# Point clangd at the clangd-specific build directory
CompileFlags:
CompilationDatabase: build/clangd
# Regular C++ files - explicitly remove any CUDA flags that might be inferred
---
If:
PathMatch: .*\.(cpp|hpp|h)$
CompileFlags:
Remove:
- -xcuda
- -x cuda
- --cuda-gpu-arch=*
- --cuda-host-only
- --cuda-device-only
- -fcuda-is-device
- --offload-arch=*
- -fgpu-rdc
Add:
- -xc++
# CUDA kernel files (device code) - analyze with device-only mode
# These contain __global__ functions that run on GPU
---
If:
PathMatch: .*/kernels/.*\.cu$
CompileFlags:
Remove:
- --expt-relaxed-constexpr
- -Xcompiler=*
- -G
Add:
- -xcuda
- --cuda-gpu-arch=sm_120
- --cuda-device-only
Diagnostics:
Suppress:
- variadic_device_fn
- attributes_not_allowed
- note_previous_decl
# CUDA kernel headers - also device code
---
If:
PathMatch: .*/kernels/.*\.cuh$
CompileFlags:
Remove:
- --expt-relaxed-constexpr
- -Xcompiler=*
- -G
Add:
- -xcuda
- --cuda-gpu-arch=sm_120
- --cuda-device-only
Diagnostics:
Suppress:
- variadic_device_fn
- attributes_not_allowed
- undeclared_var_use_suggest
# CUDA host files (kernel launchers, memory management) - analyze with host-only mode
# These contain code that runs on CPU and calls kernels
---
If:
PathMatch: .*\.cu$
PathExclude: .*/kernels/.*
CompileFlags:
Remove:
- --expt-relaxed-constexpr
- -Xcompiler=*
- -G
Add:
- -xcuda
- --cuda-gpu-arch=sm_120
- --cuda-host-only
Diagnostics:
Suppress:
- variadic_device_fn
- attributes_not_allowed
# clangd has issues resolving some templates in CUDA host-only mode
# These are false positives - the actual Clang build succeeds
- ovl_no_viable_function_in_call
- no_member
- template_arg_list_constraints_not_satisfied
# ODR violations from CUDA host/device compilation seeing headers differently
- module_odr_violation_function
- module_odr_violation_definition
# __noinline__ macro conflict between CUDA and libstdc++
- undeclared_var_use_suggest
- typename_invalid_functionspec
- expected_expression
- note_previous_decl
# CUDA utility headers (non-kernel) - host code
---
If:
PathMatch: .*\.cuh$
PathExclude: .*/kernels/.*
CompileFlags:
Remove:
- --expt-relaxed-constexpr
- -Xcompiler=*
- -G
Add:
- -xcuda
- --cuda-gpu-arch=sm_120
- --cuda-host-only
Diagnostics:
Suppress:
- variadic_device_fn
- attributes_not_allowed