From 115f0d44be2f580a61c0d2ced4146b8111c00c9a Mon Sep 17 00:00:00 2001 From: db Date: Wed, 21 Feb 2024 13:44:39 -0600 Subject: [PATCH 1/2] Add host_resource_ref and async_host_resource ref as aliases to cudf::mr::resource_ref and cudf::mr::async_resource_ref, respectively. --- include/rmm/resource_ref.hpp | 12 ++++++++++++ tests/mr/host/mr_ref_tests.cpp | 5 +++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/include/rmm/resource_ref.hpp b/include/rmm/resource_ref.hpp index a363f9b50..5219ff616 100644 --- a/include/rmm/resource_ref.hpp +++ b/include/rmm/resource_ref.hpp @@ -31,5 +31,17 @@ namespace rmm { */ using device_async_resource_ref = cuda::mr::async_resource_ref; +/** + * @brief Alias for a `cuda::mr::resource_ref` with the property + * `cuda::mr::host_accessible`. + */ +using host_resource_ref = cuda::mr::resource_ref; + +/** + * @brief Alias for a `cuda::mr::async_resource_ref` with the property + * `cuda::mr::host_accessible`. + */ +using host_async_resource_ref = cuda::mr::async_resource_ref; + /** @} */ // end of group } // namespace rmm diff --git a/tests/mr/host/mr_ref_tests.cpp b/tests/mr/host/mr_ref_tests.cpp index 416641f18..15d80a5b3 100644 --- a/tests/mr/host/mr_ref_tests.cpp +++ b/tests/mr/host/mr_ref_tests.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include @@ -73,7 +74,7 @@ struct allocation { template struct MRRefTest : public ::testing::Test { MemoryResourceType mr; - cuda::mr::resource_ref ref; + rmm::host_resource_ref ref; MRRefTest() : mr{}, ref{mr} {} }; @@ -249,7 +250,7 @@ TYPED_TEST(MRRefTest, UnsupportedAlignmentTest) TEST(PinnedResource, isPinned) { rmm::mr::pinned_memory_resource mr; - cuda::mr::resource_ref ref{mr}; + rmm::host_resource_ref ref{mr}; void* ptr{nullptr}; EXPECT_NO_THROW(ptr = ref.allocate(100)); EXPECT_TRUE(is_pinned_memory(ptr)); From 708abca22e4a2c4644065bf3bf9ea0b3e2f66ba2 Mon Sep 17 00:00:00 2001 From: db Date: Thu, 22 Feb 2024 10:12:25 -0600 Subject: [PATCH 2/2] Add several more resource_ref and async_resource_ref aliases. --- include/rmm/resource_ref.hpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/include/rmm/resource_ref.hpp b/include/rmm/resource_ref.hpp index 5219ff616..e71613fe9 100644 --- a/include/rmm/resource_ref.hpp +++ b/include/rmm/resource_ref.hpp @@ -25,6 +25,12 @@ namespace rmm { * @file */ +/** + * @brief Alias for a `cuda::mr::resource_ref` with the property + * `cuda::mr::device_accessible`. + */ +using device_resource_ref = cuda::mr::resource_ref; + /** * @brief Alias for a `cuda::mr::async_resource_ref` with the property * `cuda::mr::device_accessible`. @@ -43,5 +49,19 @@ using host_resource_ref = cuda::mr::resource_ref; */ using host_async_resource_ref = cuda::mr::async_resource_ref; +/** + * @brief Alias for a `cuda::mr::resource_ref` with the properties + * `cuda::mr::host_accessible` and `cuda::mr::device_accessible`. + */ +using host_device_resource_ref = + cuda::mr::resource_ref; + +/** + * @brief Alias for a `cuda::mr::async_resource_ref` with the properties + * `cuda::mr::host_accessible` and `cuda::mr::device_accessible`. + */ +using host_device_async_resource_ref = + cuda::mr::async_resource_ref; + /** @} */ // end of group } // namespace rmm