-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy path.clang-format
More file actions
141 lines (127 loc) · 3.6 KB
/
Copy path.clang-format
File metadata and controls
141 lines (127 loc) · 3.6 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
---
Language: Cpp
Standard: c++20
# Indentation
TabWidth: 4
IndentWidth: 4
UseTab: Never
IndentPPDirectives: None
IndentWrappedFunctionNames: false
NamespaceIndentation: None
# Empty lines
KeepEmptyLinesAtTheStartOfBlocks: false
MaxEmptyLinesToKeep: 1
# Line length
ColumnLimit: 100
# Line endings
DeriveLineEnding: false
LineEnding: LF
# Breaking and Penalties
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Attach
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakInheritanceList: BeforeColon
BreakStringLiterals: false
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
# Spacing and padding
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
SpaceAfterLogicalNot: false
SpaceAfterControlStatementKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: false
SpaceInEmptyParentheses: false
SpacesInAngles: false
SpacesInContainerLiterals: false
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesBeforeTrailingComments: 1
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeSquareBrackets: false
SpacesInSquareBrackets: false
SpaceBeforeCaseColon: false
# Brace placement
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterStruct: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: false
Cpp11BracedListStyle: true
# Function definitions
# BreakAfterReturnType: AllDefinitions
AlwaysBreakAfterDefinitionReturnType: All
AttributeMacros:
- __host__
- __device__
- __hostdev__
- __global__
- __forceinline__
- __shared__
- __launch_bounds__
# Alignment
AlignConsecutiveAssignments: true
AlignConsecutiveBitFields: true
AlignConsecutiveDeclarations: false
AlignConsecutiveMacros: true
AlignEscapedNewlines: Left
AlignOperands: true
AlignTrailingComments:
Kind: Always
OverEmptyLines: 2
# Single line allowances
BinPackParameters: false
BinPackArguments: false
AllowAllArgumentsOnNextLine: true
AllowAllConstructorInitializersOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: true
AllowShortCaseLabelsOnASingleLine: true
AllowShortEnumsOnASingleLine: true
AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: false
AllowShortLambdasOnASingleLine: true
AllowShortLoopsOnASingleLine: false
# Sorting
IncludeBlocks: Regroup
IncludeIsMainRegex: "$"
IncludeCategories:
- Regex: '^<pybind11/' # pybind11 includes
Priority: 0
- Regex: '^"' # quoted includes
Priority: 1
- Regex: '^<fvdb/' # fvdb includes
Priority: 2
- Regex: '^<nanovdb/' # nanovdb includes
Priority: 3
- Regex: '^<(torch|c10|THC|ATen)/' # torch includes
Priority: 4
- Regex: '^<(thrust|cub|cuda)/' # CCCL includes
Priority: 5
- Regex: '^<(cooperative_groups|cuco|cuda.h|cuda_|device_types|math_constants|nvtx3|cute)' # CUDA includes
Priority: 6
- Regex: '^<.*\..*' # other system includes (e.g. with a '.')
Priority: 7
- Regex: '^<[^.]+' # STL includes (no '.')
Priority: 8
IncludeIsMainSourceRegex: "$"
SortIncludes: true
SortUsingDeclarations: true