From aaed49e8d48212dd1f4db508715543b9b1ed6e63 Mon Sep 17 00:00:00 2001 From: Mark Harris <783069+harrism@users.noreply.github.com> Date: Wed, 7 Feb 2024 09:12:05 +0000 Subject: [PATCH 1/4] Automate header grouping and ordering with clang-format --- .clang-format | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.clang-format b/.clang-format index 26b9a5bf4..b36983d2e 100644 --- a/.clang-format +++ b/.clang-format @@ -71,8 +71,18 @@ ForEachMacros: - foreach - Q_FOREACH - BOOST_FOREACH -IncludeBlocks: Preserve -IncludeIsMainRegex: '([-_](test|unittest))?$' +IncludeBlocks: Regroup +IncludeCategories: + - Regex: '^"' # quoted includes + Priority: 1 + - Regex: '^ Date: Wed, 7 Feb 2024 09:15:27 +0000 Subject: [PATCH 2/4] Run new clang-format rules to change header grouping. --- .../cuda_stream_pool/cuda_stream_pool_bench.cpp | 3 +-- benchmarks/device_uvector/device_uvector_bench.cu | 2 -- .../multi_stream_allocations_bench.cu | 6 ++---- .../random_allocations/random_allocations.cpp | 3 +-- benchmarks/replay/replay.cpp | 13 +++++-------- benchmarks/utilities/log_parser.hpp | 6 +++--- include/rmm/cuda_stream.hpp | 2 +- include/rmm/cuda_stream_view.hpp | 4 ++-- include/rmm/detail/dynamic_load_runtime.hpp | 1 - include/rmm/detail/logging_assert.hpp | 3 ++- include/rmm/device_buffer.hpp | 4 ++-- include/rmm/device_uvector.hpp | 4 ++-- include/rmm/device_vector.hpp | 2 +- include/rmm/exec_policy.hpp | 2 +- include/rmm/mr/device/arena_memory_resource.hpp | 1 - .../rmm/mr/device/cuda_async_memory_resource.hpp | 5 ++--- .../mr/device/cuda_async_view_memory_resource.hpp | 5 ++--- include/rmm/mr/device/cuda_memory_resource.hpp | 3 +-- include/rmm/mr/device/detail/arena.hpp | 1 - .../detail/stream_ordered_memory_resource.hpp | 1 - .../rmm/mr/device/fixed_size_memory_resource.hpp | 5 ++--- include/rmm/mr/device/managed_memory_resource.hpp | 3 +-- include/rmm/mr/device/pool_memory_resource.hpp | 8 +++----- include/rmm/mr/device/thrust_allocator_adaptor.hpp | 6 +++--- include/rmm/mr/host/new_delete_resource.hpp | 3 +-- include/rmm/thrust_rmm_allocator.h | 2 +- python/rmm/_lib/_torch_allocator.cpp | 4 ++-- tests/cuda_stream_pool_tests.cpp | 3 +-- tests/cuda_stream_tests.cpp | 4 ++-- tests/device_buffer_tests.cu | 3 +-- tests/device_scalar_tests.cpp | 7 +++---- tests/logger_tests.cpp | 2 +- tests/mr/device/arena_mr_tests.cpp | 3 +-- tests/mr/device/callback_mr_tests.cpp | 6 +++--- tests/mr/device/mr_multithreaded_tests.cpp | 4 ++-- tests/mr/device/mr_ref_multithreaded_tests.cpp | 4 ++-- tests/mr/device/mr_ref_test.hpp | 4 ++-- tests/mr/device/polymorphic_allocator_tests.cpp | 7 ++++--- tests/mr/device/thrust_allocator_tests.cu | 1 - tests/mr/device/tracking_mr_tests.cpp | 1 - tests/mr/host/mr_ref_tests.cpp | 3 +-- tests/mr/host/mr_tests.cpp | 3 +-- 42 files changed, 65 insertions(+), 92 deletions(-) diff --git a/benchmarks/cuda_stream_pool/cuda_stream_pool_bench.cpp b/benchmarks/cuda_stream_pool/cuda_stream_pool_bench.cpp index 6710ffe50..5adf23354 100644 --- a/benchmarks/cuda_stream_pool/cuda_stream_pool_bench.cpp +++ b/benchmarks/cuda_stream_pool/cuda_stream_pool_bench.cpp @@ -17,9 +17,8 @@ #include #include -#include - #include +#include #include diff --git a/benchmarks/device_uvector/device_uvector_bench.cu b/benchmarks/device_uvector/device_uvector_bench.cu index 8b7f9a5ba..7181de325 100644 --- a/benchmarks/device_uvector/device_uvector_bench.cu +++ b/benchmarks/device_uvector/device_uvector_bench.cu @@ -27,9 +27,7 @@ #include #include - #include - #include #include diff --git a/benchmarks/multi_stream_allocations/multi_stream_allocations_bench.cu b/benchmarks/multi_stream_allocations/multi_stream_allocations_bench.cu index 4943e507f..e407476b0 100644 --- a/benchmarks/multi_stream_allocations/multi_stream_allocations_bench.cu +++ b/benchmarks/multi_stream_allocations/multi_stream_allocations_bench.cu @@ -14,8 +14,6 @@ * limitations under the License. */ -#include - #include #include #include @@ -28,9 +26,9 @@ #include #include -#include - #include +#include +#include #include diff --git a/benchmarks/random_allocations/random_allocations.cpp b/benchmarks/random_allocations/random_allocations.cpp index 2856cd323..57116743b 100644 --- a/benchmarks/random_allocations/random_allocations.cpp +++ b/benchmarks/random_allocations/random_allocations.cpp @@ -14,8 +14,6 @@ * limitations under the License. */ -#include - #include #include #include @@ -26,6 +24,7 @@ #include #include +#include #include #include diff --git a/benchmarks/replay/replay.cpp b/benchmarks/replay/replay.cpp index 253708ace..096adf37d 100644 --- a/benchmarks/replay/replay.cpp +++ b/benchmarks/replay/replay.cpp @@ -14,10 +14,6 @@ * limitations under the License. */ -#include -#include -#include - #include #include #include @@ -27,15 +23,16 @@ #include #include +#include +#include +#include +#include +#include #include #include #include #include -#include - -#include - #include #include #include diff --git a/benchmarks/utilities/log_parser.hpp b/benchmarks/utilities/log_parser.hpp index bc1aee47c..2283ace93 100644 --- a/benchmarks/utilities/log_parser.hpp +++ b/benchmarks/utilities/log_parser.hpp @@ -16,12 +16,12 @@ #pragma once -#include +#include "rapidcsv.h" + #include #include -#include "rapidcsv.h" - +#include #include #include #include diff --git a/include/rmm/cuda_stream.hpp b/include/rmm/cuda_stream.hpp index cb5654ac3..197095c39 100644 --- a/include/rmm/cuda_stream.hpp +++ b/include/rmm/cuda_stream.hpp @@ -16,13 +16,13 @@ #pragma once -#include #include #include #include #include +#include #include namespace rmm { diff --git a/include/rmm/cuda_stream_view.hpp b/include/rmm/cuda_stream_view.hpp index f8564b16b..51ac0880d 100644 --- a/include/rmm/cuda_stream_view.hpp +++ b/include/rmm/cuda_stream_view.hpp @@ -18,10 +18,10 @@ #include -#include - #include +#include + #include #include #include diff --git a/include/rmm/detail/dynamic_load_runtime.hpp b/include/rmm/detail/dynamic_load_runtime.hpp index 43626144a..9e67f9bbc 100644 --- a/include/rmm/detail/dynamic_load_runtime.hpp +++ b/include/rmm/detail/dynamic_load_runtime.hpp @@ -18,7 +18,6 @@ #include #include - #include #include diff --git a/include/rmm/detail/logging_assert.hpp b/include/rmm/detail/logging_assert.hpp index 321bddab8..7eb667211 100644 --- a/include/rmm/detail/logging_assert.hpp +++ b/include/rmm/detail/logging_assert.hpp @@ -20,9 +20,10 @@ // logger can be extremely expensive to compile, so we want to avoid including // it. #if !defined(NDEBUG) -#include #include #include + +#include #endif /** diff --git a/include/rmm/device_buffer.hpp b/include/rmm/device_buffer.hpp index 167d07c4b..7dc7a30e0 100644 --- a/include/rmm/device_buffer.hpp +++ b/include/rmm/device_buffer.hpp @@ -21,6 +21,8 @@ #include #include +#include + #include #include @@ -28,8 +30,6 @@ #include #include -#include - namespace rmm { /** * @addtogroup data_containers diff --git a/include/rmm/device_uvector.hpp b/include/rmm/device_uvector.hpp index 0750ef796..ff6a7d837 100644 --- a/include/rmm/device_uvector.hpp +++ b/include/rmm/device_uvector.hpp @@ -23,11 +23,11 @@ #include #include +#include + #include #include -#include - namespace rmm { /** * @addtogroup data_containers diff --git a/include/rmm/device_vector.hpp b/include/rmm/device_vector.hpp index 7caf5845b..64fd8b993 100644 --- a/include/rmm/device_vector.hpp +++ b/include/rmm/device_vector.hpp @@ -16,9 +16,9 @@ #pragma once +#include #include -#include #include namespace rmm { diff --git a/include/rmm/exec_policy.hpp b/include/rmm/exec_policy.hpp index 5acd062e3..a343afb8b 100644 --- a/include/rmm/exec_policy.hpp +++ b/include/rmm/exec_policy.hpp @@ -22,10 +22,10 @@ #pragma once #include +#include #include #include -#include #include #include diff --git a/include/rmm/mr/device/arena_memory_resource.hpp b/include/rmm/mr/device/arena_memory_resource.hpp index b274e0c18..680a7fdec 100644 --- a/include/rmm/mr/device/arena_memory_resource.hpp +++ b/include/rmm/mr/device/arena_memory_resource.hpp @@ -23,7 +23,6 @@ #include #include - #include #include diff --git a/include/rmm/mr/device/cuda_async_memory_resource.hpp b/include/rmm/mr/device/cuda_async_memory_resource.hpp index 69e23624d..1bd761eb2 100644 --- a/include/rmm/mr/device/cuda_async_memory_resource.hpp +++ b/include/rmm/mr/device/cuda_async_memory_resource.hpp @@ -19,13 +19,12 @@ #include #include #include +#include #include #include -#include -#include - #include +#include #include #include diff --git a/include/rmm/mr/device/cuda_async_view_memory_resource.hpp b/include/rmm/mr/device/cuda_async_view_memory_resource.hpp index 6c24cccc3..c07730f70 100644 --- a/include/rmm/mr/device/cuda_async_view_memory_resource.hpp +++ b/include/rmm/mr/device/cuda_async_view_memory_resource.hpp @@ -19,12 +19,11 @@ #include #include #include -#include - #include -#include +#include #include +#include #include #include diff --git a/include/rmm/mr/device/cuda_memory_resource.hpp b/include/rmm/mr/device/cuda_memory_resource.hpp index 0652d6360..16100b06a 100644 --- a/include/rmm/mr/device/cuda_memory_resource.hpp +++ b/include/rmm/mr/device/cuda_memory_resource.hpp @@ -15,10 +15,9 @@ */ #pragma once -#include - #include #include +#include #include diff --git a/include/rmm/mr/device/detail/arena.hpp b/include/rmm/mr/device/detail/arena.hpp index c7965ca34..edc637616 100644 --- a/include/rmm/mr/device/detail/arena.hpp +++ b/include/rmm/mr/device/detail/arena.hpp @@ -24,7 +24,6 @@ #include #include - #include #include diff --git a/include/rmm/mr/device/detail/stream_ordered_memory_resource.hpp b/include/rmm/mr/device/detail/stream_ordered_memory_resource.hpp index c7c8d9178..a3a8b7581 100644 --- a/include/rmm/mr/device/detail/stream_ordered_memory_resource.hpp +++ b/include/rmm/mr/device/detail/stream_ordered_memory_resource.hpp @@ -22,7 +22,6 @@ #include #include - #include #include diff --git a/include/rmm/mr/device/fixed_size_memory_resource.hpp b/include/rmm/mr/device/fixed_size_memory_resource.hpp index 296ef103c..d34ad8d7e 100644 --- a/include/rmm/mr/device/fixed_size_memory_resource.hpp +++ b/include/rmm/mr/device/fixed_size_memory_resource.hpp @@ -19,15 +19,14 @@ #include #include #include +#include #include #include -#include +#include #include #include -#include - #include #include #include diff --git a/include/rmm/mr/device/managed_memory_resource.hpp b/include/rmm/mr/device/managed_memory_resource.hpp index 708adad8e..ea43315de 100644 --- a/include/rmm/mr/device/managed_memory_resource.hpp +++ b/include/rmm/mr/device/managed_memory_resource.hpp @@ -15,10 +15,9 @@ */ #pragma once -#include - #include #include +#include #include diff --git a/include/rmm/mr/device/pool_memory_resource.hpp b/include/rmm/mr/device/pool_memory_resource.hpp index 5f70e73d1..d37982d00 100644 --- a/include/rmm/mr/device/pool_memory_resource.hpp +++ b/include/rmm/mr/device/pool_memory_resource.hpp @@ -19,20 +19,18 @@ #include #include #include +#include #include #include #include #include -#include +#include +#include #include #include #include -#include - -#include - #include #include #include diff --git a/include/rmm/mr/device/thrust_allocator_adaptor.hpp b/include/rmm/mr/device/thrust_allocator_adaptor.hpp index ece495c37..783f3c41f 100644 --- a/include/rmm/mr/device/thrust_allocator_adaptor.hpp +++ b/include/rmm/mr/device/thrust_allocator_adaptor.hpp @@ -16,16 +16,16 @@ #pragma once +#include #include #include -#include +#include + #include #include #include -#include - namespace rmm::mr { /** * @addtogroup device_resource_adaptors diff --git a/include/rmm/mr/host/new_delete_resource.hpp b/include/rmm/mr/host/new_delete_resource.hpp index ccb294d21..a48f61447 100644 --- a/include/rmm/mr/host/new_delete_resource.hpp +++ b/include/rmm/mr/host/new_delete_resource.hpp @@ -15,10 +15,9 @@ */ #pragma once -#include - #include #include +#include #include #include diff --git a/include/rmm/thrust_rmm_allocator.h b/include/rmm/thrust_rmm_allocator.h index 0b78d5497..ad71e107a 100644 --- a/include/rmm/thrust_rmm_allocator.h +++ b/include/rmm/thrust_rmm_allocator.h @@ -17,10 +17,10 @@ #pragma once #include +#include #include #include -#include #include namespace rmm { diff --git a/python/rmm/_lib/_torch_allocator.cpp b/python/rmm/_lib/_torch_allocator.cpp index 5e5b2dcb4..dc92e4639 100644 --- a/python/rmm/_lib/_torch_allocator.cpp +++ b/python/rmm/_lib/_torch_allocator.cpp @@ -14,12 +14,12 @@ * limitations under the License. */ -#include - #include #include #include +#include + // These signatures must match those required by CUDAPluggableAllocator in // github.com/pytorch/pytorch/blob/main/torch/csrc/cuda/CUDAPluggableAllocator.h // Since the loading is done at runtime via dlopen, no error checking diff --git a/tests/cuda_stream_pool_tests.cpp b/tests/cuda_stream_pool_tests.cpp index de17f8c3c..3943c56df 100644 --- a/tests/cuda_stream_pool_tests.cpp +++ b/tests/cuda_stream_pool_tests.cpp @@ -18,9 +18,8 @@ #include #include -#include - #include +#include struct CudaStreamPoolTest : public ::testing::Test { rmm::cuda_stream_pool pool{}; diff --git a/tests/cuda_stream_tests.cpp b/tests/cuda_stream_tests.cpp index 465e5d4c5..c9aaa6a87 100644 --- a/tests/cuda_stream_tests.cpp +++ b/tests/cuda_stream_tests.cpp @@ -17,13 +17,13 @@ #include #include #include -#include #include - #include #include +#include + struct CudaStreamTest : public ::testing::Test {}; TEST_F(CudaStreamTest, Equality) diff --git a/tests/device_buffer_tests.cu b/tests/device_buffer_tests.cu index c095eecf8..fb3439819 100644 --- a/tests/device_buffer_tests.cu +++ b/tests/device_buffer_tests.cu @@ -26,11 +26,10 @@ #include #include +#include #include #include -#include - namespace testing { namespace thrust = THRUST_NS_QUALIFIER; } // namespace testing diff --git a/tests/device_scalar_tests.cpp b/tests/device_scalar_tests.cpp index 5a7825533..e529d5c05 100644 --- a/tests/device_scalar_tests.cpp +++ b/tests/device_scalar_tests.cpp @@ -14,18 +14,17 @@ * limitations under the License. */ -#include - #include #include #include #include #include -#include - #include +#include +#include + #include #include #include diff --git a/tests/logger_tests.cpp b/tests/logger_tests.cpp index f6531bc59..5e3b2f899 100644 --- a/tests/logger_tests.cpp +++ b/tests/logger_tests.cpp @@ -15,11 +15,11 @@ */ #include "./byte_literals.hpp" -#include #include #include +#include #include #include diff --git a/tests/mr/device/arena_mr_tests.cpp b/tests/mr/device/arena_mr_tests.cpp index c8c60f7fb..1eb38888e 100644 --- a/tests/mr/device/arena_mr_tests.cpp +++ b/tests/mr/device/arena_mr_tests.cpp @@ -26,10 +26,9 @@ #include #include - -#include #include +#include #include #include diff --git a/tests/mr/device/callback_mr_tests.cpp b/tests/mr/device/callback_mr_tests.cpp index 95dac93ec..34a2cc8cc 100644 --- a/tests/mr/device/callback_mr_tests.cpp +++ b/tests/mr/device/callback_mr_tests.cpp @@ -16,19 +16,19 @@ #include "../../byte_literals.hpp" #include "../../mock_resource.hpp" + #include #include #include #include #include -#include - #include - #include #include +#include + namespace rmm::test { namespace { diff --git a/tests/mr/device/mr_multithreaded_tests.cpp b/tests/mr/device/mr_multithreaded_tests.cpp index 113b59e8f..704fec0de 100644 --- a/tests/mr/device/mr_multithreaded_tests.cpp +++ b/tests/mr/device/mr_multithreaded_tests.cpp @@ -16,8 +16,6 @@ #include "mr_test.hpp" -#include - #include #include #include @@ -25,6 +23,8 @@ #include #include +#include + #include #include diff --git a/tests/mr/device/mr_ref_multithreaded_tests.cpp b/tests/mr/device/mr_ref_multithreaded_tests.cpp index 48d642a32..b310766ab 100644 --- a/tests/mr/device/mr_ref_multithreaded_tests.cpp +++ b/tests/mr/device/mr_ref_multithreaded_tests.cpp @@ -16,8 +16,6 @@ #include "mr_ref_test.hpp" -#include - #include #include #include @@ -27,6 +25,8 @@ #include +#include + #include #include diff --git a/tests/mr/device/mr_ref_test.hpp b/tests/mr/device/mr_ref_test.hpp index f999e08f4..3a7719ef0 100644 --- a/tests/mr/device/mr_ref_test.hpp +++ b/tests/mr/device/mr_ref_test.hpp @@ -35,10 +35,10 @@ #include #include -#include - #include +#include + #include #include #include diff --git a/tests/mr/device/polymorphic_allocator_tests.cpp b/tests/mr/device/polymorphic_allocator_tests.cpp index 4c8346730..3b73d4a49 100644 --- a/tests/mr/device/polymorphic_allocator_tests.cpp +++ b/tests/mr/device/polymorphic_allocator_tests.cpp @@ -14,15 +14,16 @@ * limitations under the License. */ -#include - -#include #include #include #include #include #include +#include + +#include + namespace { struct allocator_test : public ::testing::Test { diff --git a/tests/mr/device/thrust_allocator_tests.cu b/tests/mr/device/thrust_allocator_tests.cu index 038f4b664..e25a2eece 100644 --- a/tests/mr/device/thrust_allocator_tests.cu +++ b/tests/mr/device/thrust_allocator_tests.cu @@ -23,7 +23,6 @@ #include #include - #include // explicit instantiation for test coverage purposes diff --git a/tests/mr/device/tracking_mr_tests.cpp b/tests/mr/device/tracking_mr_tests.cpp index 2af720d3f..65d2f955c 100644 --- a/tests/mr/device/tracking_mr_tests.cpp +++ b/tests/mr/device/tracking_mr_tests.cpp @@ -23,7 +23,6 @@ #include #include - #include namespace rmm::test { diff --git a/tests/mr/host/mr_ref_tests.cpp b/tests/mr/host/mr_ref_tests.cpp index 416641f18..0f11dc164 100644 --- a/tests/mr/host/mr_ref_tests.cpp +++ b/tests/mr/host/mr_ref_tests.cpp @@ -21,10 +21,9 @@ #include #include -#include - #include +#include #include #include diff --git a/tests/mr/host/mr_tests.cpp b/tests/mr/host/mr_tests.cpp index e0078c920..a06f800d9 100644 --- a/tests/mr/host/mr_tests.cpp +++ b/tests/mr/host/mr_tests.cpp @@ -21,10 +21,9 @@ #include #include -#include - #include +#include #include #include From 384d8c8d036d318da0e5b645e0533b56967d256c Mon Sep 17 00:00:00 2001 From: Mark Harris <783069+harrism@users.noreply.github.com> Date: Wed, 7 Feb 2024 23:15:58 +0000 Subject: [PATCH 3/4] Separate group for CCCL (thrust/cub/cuda) and CUDART includes --- .clang-format | 4 +++- benchmarks/cuda_stream_pool/cuda_stream_pool_bench.cpp | 3 ++- benchmarks/device_uvector/device_uvector_bench.cu | 3 ++- .../multi_stream_allocations_bench.cu | 3 ++- benchmarks/replay/replay.cpp | 9 +++++---- benchmarks/synchronization/synchronization.hpp | 3 ++- include/rmm/cuda_stream_view.hpp | 1 - include/rmm/detail/dynamic_load_runtime.hpp | 1 + include/rmm/device_buffer.hpp | 1 - include/rmm/mr/device/arena_memory_resource.hpp | 1 + include/rmm/mr/device/detail/arena.hpp | 1 + .../mr/device/detail/stream_ordered_memory_resource.hpp | 1 + include/rmm/mr/device/pool_memory_resource.hpp | 3 ++- include/rmm/mr/device/thrust_allocator_adaptor.hpp | 1 - include/rmm/mr/pinned_host_memory_resource.hpp | 1 - tests/cuda_stream_pool_tests.cpp | 1 + tests/cuda_stream_tests.cpp | 1 + tests/device_buffer_tests.cu | 3 ++- tests/device_scalar_tests.cpp | 2 +- tests/mr/device/thrust_allocator_tests.cu | 3 ++- tests/mr/host/mr_ref_tests.cpp | 2 +- tests/mr/host/mr_tests.cpp | 2 +- 22 files changed, 31 insertions(+), 19 deletions(-) diff --git a/.clang-format b/.clang-format index b36983d2e..74c37f464 100644 --- a/.clang-format +++ b/.clang-format @@ -77,7 +77,9 @@ IncludeCategories: Priority: 1 - Regex: '^ #include -#include #include +#include + #include static void BM_StreamPoolGetStream(benchmark::State& state) diff --git a/benchmarks/device_uvector/device_uvector_bench.cu b/benchmarks/device_uvector/device_uvector_bench.cu index 7181de325..36c9183f9 100644 --- a/benchmarks/device_uvector/device_uvector_bench.cu +++ b/benchmarks/device_uvector/device_uvector_bench.cu @@ -26,11 +26,12 @@ #include #include -#include #include #include #include +#include + #include #include diff --git a/benchmarks/multi_stream_allocations/multi_stream_allocations_bench.cu b/benchmarks/multi_stream_allocations/multi_stream_allocations_bench.cu index e407476b0..d38e89a3b 100644 --- a/benchmarks/multi_stream_allocations/multi_stream_allocations_bench.cu +++ b/benchmarks/multi_stream_allocations/multi_stream_allocations_bench.cu @@ -26,9 +26,10 @@ #include #include +#include + #include #include -#include #include diff --git a/benchmarks/replay/replay.cpp b/benchmarks/replay/replay.cpp index 096adf37d..5afed036a 100644 --- a/benchmarks/replay/replay.cpp +++ b/benchmarks/replay/replay.cpp @@ -23,15 +23,16 @@ #include #include +#include +#include +#include +#include + #include #include #include #include #include -#include -#include -#include -#include #include #include diff --git a/benchmarks/synchronization/synchronization.hpp b/benchmarks/synchronization/synchronization.hpp index 1f26beb37..596b3684b 100644 --- a/benchmarks/synchronization/synchronization.hpp +++ b/benchmarks/synchronization/synchronization.hpp @@ -61,9 +61,10 @@ #include // Google Benchmark library -#include #include +#include + class cuda_event_timer { public: /** diff --git a/include/rmm/cuda_stream_view.hpp b/include/rmm/cuda_stream_view.hpp index 51ac0880d..a34897df6 100644 --- a/include/rmm/cuda_stream_view.hpp +++ b/include/rmm/cuda_stream_view.hpp @@ -19,7 +19,6 @@ #include #include - #include #include diff --git a/include/rmm/detail/dynamic_load_runtime.hpp b/include/rmm/detail/dynamic_load_runtime.hpp index 9e67f9bbc..43626144a 100644 --- a/include/rmm/detail/dynamic_load_runtime.hpp +++ b/include/rmm/detail/dynamic_load_runtime.hpp @@ -18,6 +18,7 @@ #include #include + #include #include diff --git a/include/rmm/device_buffer.hpp b/include/rmm/device_buffer.hpp index 7dc7a30e0..4663b5733 100644 --- a/include/rmm/device_buffer.hpp +++ b/include/rmm/device_buffer.hpp @@ -22,7 +22,6 @@ #include #include - #include #include diff --git a/include/rmm/mr/device/arena_memory_resource.hpp b/include/rmm/mr/device/arena_memory_resource.hpp index 680a7fdec..b274e0c18 100644 --- a/include/rmm/mr/device/arena_memory_resource.hpp +++ b/include/rmm/mr/device/arena_memory_resource.hpp @@ -23,6 +23,7 @@ #include #include + #include #include diff --git a/include/rmm/mr/device/detail/arena.hpp b/include/rmm/mr/device/detail/arena.hpp index edc637616..c7965ca34 100644 --- a/include/rmm/mr/device/detail/arena.hpp +++ b/include/rmm/mr/device/detail/arena.hpp @@ -24,6 +24,7 @@ #include #include + #include #include diff --git a/include/rmm/mr/device/detail/stream_ordered_memory_resource.hpp b/include/rmm/mr/device/detail/stream_ordered_memory_resource.hpp index a3a8b7581..c7c8d9178 100644 --- a/include/rmm/mr/device/detail/stream_ordered_memory_resource.hpp +++ b/include/rmm/mr/device/detail/stream_ordered_memory_resource.hpp @@ -22,6 +22,7 @@ #include #include + #include #include diff --git a/include/rmm/mr/device/pool_memory_resource.hpp b/include/rmm/mr/device/pool_memory_resource.hpp index d37982d00..4f2d46a7c 100644 --- a/include/rmm/mr/device/pool_memory_resource.hpp +++ b/include/rmm/mr/device/pool_memory_resource.hpp @@ -26,11 +26,12 @@ #include #include -#include #include #include #include +#include + #include #include #include diff --git a/include/rmm/mr/device/thrust_allocator_adaptor.hpp b/include/rmm/mr/device/thrust_allocator_adaptor.hpp index 783f3c41f..f2b1a6027 100644 --- a/include/rmm/mr/device/thrust_allocator_adaptor.hpp +++ b/include/rmm/mr/device/thrust_allocator_adaptor.hpp @@ -21,7 +21,6 @@ #include #include - #include #include #include diff --git a/include/rmm/mr/pinned_host_memory_resource.hpp b/include/rmm/mr/pinned_host_memory_resource.hpp index e92b2985e..ee409dbac 100644 --- a/include/rmm/mr/pinned_host_memory_resource.hpp +++ b/include/rmm/mr/pinned_host_memory_resource.hpp @@ -21,7 +21,6 @@ #include #include - #include #include diff --git a/tests/cuda_stream_pool_tests.cpp b/tests/cuda_stream_pool_tests.cpp index 3943c56df..ad1d421d7 100644 --- a/tests/cuda_stream_pool_tests.cpp +++ b/tests/cuda_stream_pool_tests.cpp @@ -19,6 +19,7 @@ #include #include + #include struct CudaStreamPoolTest : public ::testing::Test { diff --git a/tests/cuda_stream_tests.cpp b/tests/cuda_stream_tests.cpp index c9aaa6a87..1cc068434 100644 --- a/tests/cuda_stream_tests.cpp +++ b/tests/cuda_stream_tests.cpp @@ -19,6 +19,7 @@ #include #include + #include #include diff --git a/tests/device_buffer_tests.cu b/tests/device_buffer_tests.cu index fb3439819..c095eecf8 100644 --- a/tests/device_buffer_tests.cu +++ b/tests/device_buffer_tests.cu @@ -26,10 +26,11 @@ #include #include -#include #include #include +#include + namespace testing { namespace thrust = THRUST_NS_QUALIFIER; } // namespace testing diff --git a/tests/device_scalar_tests.cpp b/tests/device_scalar_tests.cpp index e529d5c05..6f80a5de1 100644 --- a/tests/device_scalar_tests.cpp +++ b/tests/device_scalar_tests.cpp @@ -21,8 +21,8 @@ #include #include - #include + #include #include diff --git a/tests/mr/device/thrust_allocator_tests.cu b/tests/mr/device/thrust_allocator_tests.cu index e25a2eece..372d5c327 100644 --- a/tests/mr/device/thrust_allocator_tests.cu +++ b/tests/mr/device/thrust_allocator_tests.cu @@ -22,9 +22,10 @@ #include #include -#include #include +#include + // explicit instantiation for test coverage purposes template class rmm::mr::thrust_allocator; diff --git a/tests/mr/host/mr_ref_tests.cpp b/tests/mr/host/mr_ref_tests.cpp index 0f11dc164..49b5bf061 100644 --- a/tests/mr/host/mr_ref_tests.cpp +++ b/tests/mr/host/mr_ref_tests.cpp @@ -22,8 +22,8 @@ #include #include - #include + #include #include diff --git a/tests/mr/host/mr_tests.cpp b/tests/mr/host/mr_tests.cpp index a06f800d9..4daa80721 100644 --- a/tests/mr/host/mr_tests.cpp +++ b/tests/mr/host/mr_tests.cpp @@ -22,8 +22,8 @@ #include #include - #include + #include #include From bea71191d540de66150678ad0856085c42f19d5a Mon Sep 17 00:00:00 2001 From: Mark Harris Date: Tue, 20 Feb 2024 07:48:32 +0000 Subject: [PATCH 4/4] Match libcudf's groupings closer. --- .clang-format | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.clang-format b/.clang-format index 74c37f464..35ebdbfae 100644 --- a/.clang-format +++ b/.clang-format @@ -79,7 +79,7 @@ IncludeCategories: Priority: 2 - Regex: '^<(thrust|cub|cuda)/' # CCCL includes Priority: 3 - - Regex: '^<(cuda_runtime_api.h|device_types.h)' # CUDART includes + - Regex: '^<(cooperative_groups|cuco|cuda.h|cuda_runtime|device_types|math_constants|nvtx3)' # CUDA includes Priority: 3 - Regex: '^<.*\..*' # other system includes (e.g. with a '.') Priority: 4