Skip to content

Commit 29c5856

Browse files
authored
Automate include grouping order with clang format (#491)
1 parent ca0934f commit 29c5856

File tree

87 files changed

+153
-175
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+153
-175
lines changed

.clang-format

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ AlignTrailingComments: true
1515
AllowAllArgumentsOnNextLine: true
1616
AllowAllConstructorInitializersOnNextLine: true
1717
AllowAllParametersOfDeclarationOnNextLine: true
18-
AllowShortBlocksOnASingleLine: true
18+
AllowShortBlocksOnASingleLine: true
1919
AllowShortCaseLabelsOnASingleLine: true
2020
AllowShortEnumsOnASingleLine: true
2121
AllowShortFunctionsOnASingleLine: All
@@ -27,7 +27,7 @@ AlwaysBreakAfterDefinitionReturnType: None
2727
AlwaysBreakAfterReturnType: None
2828
AlwaysBreakBeforeMultilineStrings: true
2929
AlwaysBreakTemplateDeclarations: Yes
30-
BinPackArguments: false
30+
BinPackArguments: false
3131
BinPackParameters: false
3232
BraceWrapping:
3333
AfterClass: false
@@ -71,8 +71,24 @@ ForEachMacros:
7171
- foreach
7272
- Q_FOREACH
7373
- BOOST_FOREACH
74-
IncludeBlocks: Preserve
75-
IncludeIsMainRegex: '([-_](test|unittest))?$'
74+
IncludeBlocks: Regroup
75+
IncludeCategories:
76+
- Regex: '^"' # quoted includes
77+
Priority: 1
78+
- Regex: '^<(benchmark_defaults|benchmark_utils|test_utils)' # benchmark/test includes
79+
Priority: 2
80+
- Regex: '^<cuco/' # cuco includes
81+
Priority: 3
82+
- Regex: '^<nvbench/' # nvbench includes
83+
Priority: 4
84+
- Regex: '^<(thrust|cub|cuda)/' # CCCL includes
85+
Priority: 5
86+
- Regex: '^<(cooperative_groups|cuda.h|cuda_runtime|device_types|math_constants|nvtx3)' # CUDA includes
87+
Priority: 6
88+
- Regex: '^<.*\..*' # other system includes (e.g. with a '.')
89+
Priority: 7
90+
- Regex: '^<[^.]+' # STL includes (no '.')
91+
Priority: 8
7692
IndentCaseLabels: true
7793
IndentPPDirectives: None
7894
IndentWidth: 2
File renamed without changes.
File renamed without changes.

benchmarks/distinct_count_estimator_bench.cu

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,19 @@
1414
* limitations under the License.
1515
*/
1616

17-
#include <defaults.hpp>
18-
#include <utils.hpp>
17+
#include <benchmark_defaults.hpp>
18+
#include <benchmark_utils.hpp>
1919

2020
#include <cuco/distinct_count_estimator.cuh>
2121
#include <cuco/static_set.cuh>
2222
#include <cuco/utility/key_generator.cuh>
2323

2424
#include <nvbench/nvbench.cuh>
2525

26+
#include <cuda/functional>
2627
#include <thrust/device_vector.h>
2728
#include <thrust/iterator/transform_iterator.h>
2829

29-
#include <cuda/functional>
30-
3130
#include <cmath>
3231
#include <cstddef>
3332

benchmarks/hash_bench.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
#include <defaults.hpp>
17+
#include <benchmark_defaults.hpp>
1818

1919
#include <cuco/hash_functions.cuh>
2020

benchmarks/hash_table/dynamic_map/contains_bench.cu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
* limitations under the License.
1515
*/
1616

17-
#include <defaults.hpp>
18-
#include <utils.hpp>
17+
#include <benchmark_defaults.hpp>
18+
#include <benchmark_utils.hpp>
1919

2020
#include <cuco/dynamic_map.cuh>
2121
#include <cuco/utility/key_generator.cuh>

benchmarks/hash_table/dynamic_map/erase_bench.cu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
* limitations under the License.
1515
*/
1616

17-
#include <defaults.hpp>
18-
#include <utils.hpp>
17+
#include <benchmark_defaults.hpp>
18+
#include <benchmark_utils.hpp>
1919

2020
#include <cuco/dynamic_map.cuh>
2121
#include <cuco/utility/key_generator.cuh>

benchmarks/hash_table/dynamic_map/find_bench.cu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
* limitations under the License.
1515
*/
1616

17-
#include <defaults.hpp>
18-
#include <utils.hpp>
17+
#include <benchmark_defaults.hpp>
18+
#include <benchmark_utils.hpp>
1919

2020
#include <cuco/dynamic_map.cuh>
2121
#include <cuco/utility/key_generator.cuh>

benchmarks/hash_table/dynamic_map/insert_bench.cu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
* limitations under the License.
1515
*/
1616

17-
#include <defaults.hpp>
18-
#include <utils.hpp>
17+
#include <benchmark_defaults.hpp>
18+
#include <benchmark_utils.hpp>
1919

2020
#include <cuco/dynamic_map.cuh>
2121
#include <cuco/utility/key_generator.cuh>

benchmarks/hash_table/static_map/contains_bench.cu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
* limitations under the License.
1515
*/
1616

17-
#include <defaults.hpp>
18-
#include <utils.hpp>
17+
#include <benchmark_defaults.hpp>
18+
#include <benchmark_utils.hpp>
1919

2020
#include <cuco/static_map.cuh>
2121
#include <cuco/utility/key_generator.cuh>

0 commit comments

Comments
 (0)