diff --git a/cpp/include/rmm/detail/cccl_adaptors.hpp b/cpp/include/rmm/detail/cccl_adaptors.hpp index dc8fb4132..d8f6999e0 100644 --- a/cpp/include/rmm/detail/cccl_adaptors.hpp +++ b/cpp/include/rmm/detail/cccl_adaptors.hpp @@ -5,7 +5,6 @@ #pragma once #include -#include #include #include #include diff --git a/cpp/include/rmm/detail/cuda_memory_resource.hpp b/cpp/include/rmm/detail/cuda_memory_resource.hpp deleted file mode 100644 index 23c21a10f..000000000 --- a/cpp/include/rmm/detail/cuda_memory_resource.hpp +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION. - * SPDX-License-Identifier: Apache-2.0 - */ -#pragma once - -#include - -#if CCCL_MAJOR_VERSION < 3 || (CCCL_MAJOR_VERSION == 3 && CCCL_MINOR_VERSION < 2) -#error "RMM requires CCCL version 3.2 or newer." -#endif - -#include - -#include - -namespace RMM_NAMESPACE { -namespace detail { -namespace polyfill { - -template -inline constexpr bool resource = cuda::mr::synchronous_resource; -template -inline constexpr bool resource_with = cuda::mr::synchronous_resource_with; -template -inline constexpr bool async_resource = cuda::mr::resource; -template -inline constexpr bool async_resource_with = cuda::mr::resource_with; - -} // namespace polyfill -} // namespace detail -} // namespace RMM_NAMESPACE diff --git a/cpp/include/rmm/detail/export.hpp b/cpp/include/rmm/detail/export.hpp index 4ee1aaa46..4befc195f 100644 --- a/cpp/include/rmm/detail/export.hpp +++ b/cpp/include/rmm/detail/export.hpp @@ -1,10 +1,16 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2024, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include + +#if CCCL_MAJOR_VERSION < 3 || (CCCL_MAJOR_VERSION == 3 && CCCL_MINOR_VERSION < 3) +#error "RMM requires CCCL version 3.3 or newer." +#endif + // Macros used for defining symbol visibility, only GLIBC is supported #if (defined(__GNUC__) && !defined(__MINGW32__) && !defined(__MINGW64__)) #define RMM_EXPORT __attribute__((visibility("default"))) diff --git a/cpp/include/rmm/mr/cuda_async_managed_memory_resource.hpp b/cpp/include/rmm/mr/cuda_async_managed_memory_resource.hpp index 3582108a2..1437b0ca0 100644 --- a/cpp/include/rmm/mr/cuda_async_managed_memory_resource.hpp +++ b/cpp/include/rmm/mr/cuda_async_managed_memory_resource.hpp @@ -118,12 +118,12 @@ class cuda_async_managed_memory_resource final : public device_memory_resource { }; // static property checks -static_assert(rmm::detail::polyfill::resource); -static_assert(rmm::detail::polyfill::async_resource); -static_assert(rmm::detail::polyfill::resource_with); -static_assert(rmm::detail::polyfill::async_resource_with); +static_assert(cuda::mr::synchronous_resource); +static_assert(cuda::mr::resource); +static_assert(cuda::mr::synchronous_resource_with); +static_assert( + cuda::mr::resource_with); /** @} */ // end of group } // namespace mr diff --git a/cpp/include/rmm/mr/device_memory_resource.hpp b/cpp/include/rmm/mr/device_memory_resource.hpp index e2781edfb..965ddb7b1 100644 --- a/cpp/include/rmm/mr/device_memory_resource.hpp +++ b/cpp/include/rmm/mr/device_memory_resource.hpp @@ -6,11 +6,12 @@ #include #include -#include #include #include #include +#include + #include #include @@ -276,12 +277,11 @@ class device_memory_resource { }; // static property checks -static_assert(rmm::detail::polyfill::resource); -static_assert(rmm::detail::polyfill::async_resource); -static_assert( - rmm::detail::polyfill::resource_with); +static_assert(cuda::mr::synchronous_resource); +static_assert(cuda::mr::resource); static_assert( - rmm::detail::polyfill::async_resource_with); + cuda::mr::synchronous_resource_with); +static_assert(cuda::mr::resource_with); /** @} */ // end of group } // namespace mr diff --git a/cpp/include/rmm/mr/is_resource_adaptor.hpp b/cpp/include/rmm/mr/is_resource_adaptor.hpp index 2e8447743..34da2d9c0 100644 --- a/cpp/include/rmm/mr/is_resource_adaptor.hpp +++ b/cpp/include/rmm/mr/is_resource_adaptor.hpp @@ -1,12 +1,12 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once -#include #include +#include #include namespace RMM_NAMESPACE { @@ -29,7 +29,7 @@ template inline constexpr bool is_resource_adaptor< Resource, cuda::std::void_t().get_upstream_resource())>> = - rmm::detail::polyfill::resource; + cuda::mr::synchronous_resource; /** @} */ // end of group } // namespace mr diff --git a/cpp/include/rmm/mr/pinned_host_memory_resource.hpp b/cpp/include/rmm/mr/pinned_host_memory_resource.hpp index a80128159..684786457 100644 --- a/cpp/include/rmm/mr/pinned_host_memory_resource.hpp +++ b/cpp/include/rmm/mr/pinned_host_memory_resource.hpp @@ -7,7 +7,6 @@ #include #include #include -#include #include #include #include @@ -132,9 +131,9 @@ class pinned_host_memory_resource final : public device_memory_resource { } }; -static_assert(rmm::detail::polyfill::async_resource_with); +static_assert(cuda::mr::resource_with); /** @} */ // end of group } // namespace mr diff --git a/cpp/include/rmm/mr/system_memory_resource.hpp b/cpp/include/rmm/mr/system_memory_resource.hpp index 132ad934b..b2c646d5f 100644 --- a/cpp/include/rmm/mr/system_memory_resource.hpp +++ b/cpp/include/rmm/mr/system_memory_resource.hpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once @@ -154,10 +154,8 @@ class system_memory_resource final : public device_memory_resource { }; // static property checks -static_assert( - rmm::detail::polyfill::async_resource_with); -static_assert( - rmm::detail::polyfill::async_resource_with); +static_assert(cuda::mr::resource_with); +static_assert(cuda::mr::resource_with); /** @} */ // end of group } // namespace mr } // namespace RMM_NAMESPACE diff --git a/cpp/include/rmm/mr/thrust_allocator_adaptor.hpp b/cpp/include/rmm/mr/thrust_allocator_adaptor.hpp index 6ed9c8539..80194a18e 100644 --- a/cpp/include/rmm/mr/thrust_allocator_adaptor.hpp +++ b/cpp/include/rmm/mr/thrust_allocator_adaptor.hpp @@ -1,12 +1,11 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2025, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once #include -#include #include #include #include diff --git a/cpp/tests/device_scalar_tests.cpp b/cpp/tests/device_scalar_tests.cpp index a2bed1712..a3a3d275c 100644 --- a/cpp/tests/device_scalar_tests.cpp +++ b/cpp/tests/device_scalar_tests.cpp @@ -1,10 +1,9 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2019-2025, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #include -#include #include #include #include diff --git a/cpp/tests/mock_resource.hpp b/cpp/tests/mock_resource.hpp index 0bd81ae7b..b65d1ea4d 100644 --- a/cpp/tests/mock_resource.hpp +++ b/cpp/tests/mock_resource.hpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #pragma once @@ -21,7 +21,6 @@ class mock_resource : public rmm::mr::device_memory_resource { }; // static property checks -static_assert( - rmm::detail::polyfill::async_resource_with); +static_assert(cuda::mr::resource_with); } // namespace rmm::test diff --git a/cpp/tests/mr/adaptor_tests.cpp b/cpp/tests/mr/adaptor_tests.cpp index a3e849801..6cdbb9a6f 100644 --- a/cpp/tests/mr/adaptor_tests.cpp +++ b/cpp/tests/mr/adaptor_tests.cpp @@ -5,7 +5,6 @@ #include "../byte_literals.hpp" -#include #include #include #include @@ -57,23 +56,23 @@ using adaptors = ::testing::Types, tracking_resource_adaptor>; // static property checks -static_assert(rmm::detail::polyfill::resource_with, - cuda::mr::device_accessible>); +static_assert(cuda::mr::synchronous_resource_with, + cuda::mr::device_accessible>); static_assert( - rmm::detail::polyfill::resource_with, - cuda::mr::device_accessible>); -static_assert(rmm::detail::polyfill::resource_with, - cuda::mr::device_accessible>); -static_assert(rmm::detail::polyfill::resource_with, - cuda::mr::device_accessible>); -static_assert(rmm::detail::polyfill::resource_with, - cuda::mr::device_accessible>); -static_assert(rmm::detail::polyfill::resource_with, - cuda::mr::device_accessible>); -static_assert(rmm::detail::polyfill::resource_with, - cuda::mr::device_accessible>); -static_assert(rmm::detail::polyfill::resource_with, - cuda::mr::device_accessible>); + cuda::mr::synchronous_resource_with, + cuda::mr::device_accessible>); +static_assert(cuda::mr::synchronous_resource_with, + cuda::mr::device_accessible>); +static_assert(cuda::mr::synchronous_resource_with, + cuda::mr::device_accessible>); +static_assert(cuda::mr::synchronous_resource_with, + cuda::mr::device_accessible>); +static_assert(cuda::mr::synchronous_resource_with, + cuda::mr::device_accessible>); +static_assert(cuda::mr::synchronous_resource_with, + cuda::mr::device_accessible>); +static_assert(cuda::mr::synchronous_resource_with, + cuda::mr::device_accessible>); template struct AdaptorTest : public ::testing::Test { diff --git a/cpp/tests/mr/arena_mr_tests.cpp b/cpp/tests/mr/arena_mr_tests.cpp index 5cd4f561f..0c288d9db 100644 --- a/cpp/tests/mr/arena_mr_tests.cpp +++ b/cpp/tests/mr/arena_mr_tests.cpp @@ -45,8 +45,7 @@ class mock_memory_resource : public rmm::mr::device_memory_resource { }; // static property checks -static_assert( - rmm::detail::polyfill::async_resource_with); +static_assert(cuda::mr::resource_with); using rmm::mr::detail::arena::block; using rmm::mr::detail::arena::byte_span; diff --git a/cpp/tests/mr/cuda_async_mr_tests.cpp b/cpp/tests/mr/cuda_async_mr_tests.cpp index c46ee91ee..fb1034a37 100644 --- a/cpp/tests/mr/cuda_async_mr_tests.cpp +++ b/cpp/tests/mr/cuda_async_mr_tests.cpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -16,9 +16,8 @@ namespace { using cuda_async_mr = rmm::mr::cuda_async_memory_resource; // static property checks -static_assert(rmm::detail::polyfill::resource_with); -static_assert( - rmm::detail::polyfill::async_resource_with); +static_assert(cuda::mr::synchronous_resource_with); +static_assert(cuda::mr::resource_with); class AsyncMRTest : public ::testing::Test { protected: diff --git a/cpp/tests/mr/cuda_async_view_mr_tests.cpp b/cpp/tests/mr/cuda_async_view_mr_tests.cpp index 3475bac1c..5ee0a5879 100644 --- a/cpp/tests/mr/cuda_async_view_mr_tests.cpp +++ b/cpp/tests/mr/cuda_async_view_mr_tests.cpp @@ -1,10 +1,9 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #include -#include #include #include @@ -16,10 +15,8 @@ namespace { using cuda_async_view_mr = rmm::mr::cuda_async_view_memory_resource; // static property checks -static_assert( - rmm::detail::polyfill::resource_with); -static_assert( - rmm::detail::polyfill::async_resource_with); +static_assert(cuda::mr::synchronous_resource_with); +static_assert(cuda::mr::resource_with); TEST(PoolTest, UsePool) { diff --git a/cpp/tests/mr/host_mr_ref_tests.cpp b/cpp/tests/mr/host_mr_ref_tests.cpp index ff87abee9..73e330546 100644 --- a/cpp/tests/mr/host_mr_ref_tests.cpp +++ b/cpp/tests/mr/host_mr_ref_tests.cpp @@ -1,12 +1,11 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ #include "../byte_literals.hpp" #include -#include #include #include @@ -81,8 +80,8 @@ struct MRRefTest : public ::testing::Test { using resources = ::testing::Types; // static property checks -static_assert(rmm::detail::polyfill::resource_with); +static_assert(cuda::mr::synchronous_resource_with); TYPED_TEST_SUITE(MRRefTest, resources); diff --git a/cpp/tests/mr/pool_mr_tests.cpp b/cpp/tests/mr/pool_mr_tests.cpp index e956d7a12..3ff854068 100644 --- a/cpp/tests/mr/pool_mr_tests.cpp +++ b/cpp/tests/mr/pool_mr_tests.cpp @@ -200,8 +200,8 @@ class fake_async_resource { }; // static property checks -static_assert(rmm::detail::polyfill::resource); -static_assert(rmm::detail::polyfill::resource>); +static_assert(cuda::mr::synchronous_resource); +static_assert(cuda::mr::synchronous_resource>); // Ensure that we forward the property if it is there class fake_async_resource_device_accessible : public fake_async_resource { diff --git a/cpp/tests/mr/system_mr_tests.cu b/cpp/tests/mr/system_mr_tests.cu index 6e28818bb..5ff49e274 100644 --- a/cpp/tests/mr/system_mr_tests.cu +++ b/cpp/tests/mr/system_mr_tests.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION. * SPDX-License-Identifier: Apache-2.0 */ @@ -48,14 +48,14 @@ void touch_on_gpu(void* ptr, std::size_t size) using system_mr = rmm::mr::system_memory_resource; // static property checks -static_assert(rmm::detail::polyfill::resource_with); -static_assert(rmm::detail::polyfill::async_resource_with); +static_assert(cuda::mr::synchronous_resource_with); +static_assert(cuda::mr::resource_with); using headroom_mr = rmm::mr::sam_headroom_memory_resource; // static property checks -static_assert(rmm::detail::polyfill::resource_with); -static_assert(rmm::detail::polyfill::async_resource_with); +static_assert(cuda::mr::synchronous_resource_with); +static_assert(cuda::mr::resource_with); class SystemMRTest : public ::testing::Test { protected: