From ce5624cf8f09c040df37f8f9642e24bd7e10eae6 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Tue, 19 May 2026 12:23:21 -0500 Subject: [PATCH 1/4] Require C++20 --- cpp/CMakeLists.txt | 2 +- cpp/examples/basic/CMakeLists.txt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 06b6eb60a..a843c7249 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -134,7 +134,7 @@ set_target_properties( rmm PROPERTIES BUILD_RPATH "\$ORIGIN" INSTALL_RPATH "\$ORIGIN" - CXX_STANDARD 17 + CXX_STANDARD 20 CXX_STANDARD_REQUIRED ON CXX_VISIBILITY_PRESET hidden POSITION_INDEPENDENT_CODE ON diff --git a/cpp/examples/basic/CMakeLists.txt b/cpp/examples/basic/CMakeLists.txt index 374c087b3..fac03c9d1 100644 --- a/cpp/examples/basic/CMakeLists.txt +++ b/cpp/examples/basic/CMakeLists.txt @@ -1,5 +1,5 @@ # cmake-format: off -# SPDX-FileCopyrightText: Copyright (c) 2020-2025, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 # cmake-format: on @@ -23,6 +23,6 @@ rapids_cmake_build_type("Release") # Configure your project here add_executable(basic_example src/basic.cpp) target_link_libraries(basic_example PRIVATE rmm::rmm) -target_compile_features(basic_example PRIVATE cxx_std_17) +target_compile_features(basic_example PRIVATE cxx_std_20) install(TARGETS basic_example DESTINATION bin/examples/librmm) From f0f416a4325dfc949de807752e3418adbff4c545 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Wed, 20 May 2026 18:02:58 -0500 Subject: [PATCH 2/4] Set clang-format standard to C++20 --- .clang-format | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.clang-format b/.clang-format index 951a549d0..617f7310d 100644 --- a/.clang-format +++ b/.clang-format @@ -159,7 +159,7 @@ SpacesInContainerLiterals: true SpacesInCStyleCastParentheses: false SpacesInParentheses: false SpacesInSquareBrackets: false -Standard: c++17 +Standard: c++20 StatementMacros: - Q_UNUSED - QT_REQUIRE_VERSION From 465ace45ad211d10ec0d6cdc519599e5f8588905 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Wed, 1 Jul 2026 19:18:02 -0500 Subject: [PATCH 3/4] Apply C++20 clang-format changes --- cpp/tests/device_scalar_tests.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cpp/tests/device_scalar_tests.cpp b/cpp/tests/device_scalar_tests.cpp index 54e25e34e..74eb33d51 100644 --- a/cpp/tests/device_scalar_tests.cpp +++ b/cpp/tests/device_scalar_tests.cpp @@ -32,14 +32,16 @@ struct DeviceScalarTest : public ::testing::Test { DeviceScalarTest() : value{random_value()} {} template - requires std::is_same_v U random_value() + requires std::is_same_v + U random_value() { static std::bernoulli_distribution distribution{}; return distribution(generator); } template - requires(std::is_integral_v && not std::is_same_v) U random_value() + requires(std::is_integral_v && not std::is_same_v) + U random_value() { static std::uniform_int_distribution distribution{std::numeric_limits::lowest(), std::numeric_limits::max()}; @@ -47,7 +49,8 @@ struct DeviceScalarTest : public ::testing::Test { } template - requires std::is_floating_point_v U random_value() + requires std::is_floating_point_v + U random_value() { auto const mean{100}; auto const stddev{20}; From 539032d03264e482dd0e7b498c1322d04dfa2181 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Wed, 1 Jul 2026 19:19:38 -0500 Subject: [PATCH 4/4] Ignore SPDX comments in clang-format --- .clang-format | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.clang-format b/.clang-format index 617f7310d..dbbdbce1d 100644 --- a/.clang-format +++ b/.clang-format @@ -57,7 +57,7 @@ BreakConstructorInitializers: BeforeColon BreakInheritanceList: BeforeColon BreakStringLiterals: true ColumnLimit: 100 -CommentPragmas: '^ IWYU pragma:' +CommentPragmas: '(IWYU pragma:|SPDX-)' CompactNamespaces: false ConstructorInitializerAllOnOneLineOrOnePerLine: true # Kept the below 2 to be the same as `IndentWidth` to keep everything uniform