diff --git a/include/rmm/mr/device/binning_memory_resource.hpp b/include/rmm/mr/device/binning_memory_resource.hpp index a0cf6bf40..56e2958e8 100644 --- a/include/rmm/mr/device/binning_memory_resource.hpp +++ b/include/rmm/mr/device/binning_memory_resource.hpp @@ -169,8 +169,6 @@ class binning_memory_resource final : public device_memory_resource { /** * @brief Deallocate memory pointed to by \p p. * - * @throws nothing - * * @param ptr Pointer to be deallocated * @param bytes The size in bytes of the allocation. This must be equal to the * value of `bytes` that was passed to the `allocate` call that returned `p`. 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 1d6829cb5..c7c8d9178 100644 --- a/include/rmm/mr/device/detail/stream_ordered_memory_resource.hpp +++ b/include/rmm/mr/device/detail/stream_ordered_memory_resource.hpp @@ -226,8 +226,6 @@ class stream_ordered_memory_resource : public crtp, public device_ /** * @brief Deallocate memory pointed to by `p`. * - * @throws nothing - * * @param p Pointer to be deallocated * @param size The size in bytes of the allocation to deallocate * @param stream The stream in which to order this deallocation diff --git a/include/rmm/mr/pinned_host_memory_resource.hpp b/include/rmm/mr/pinned_host_memory_resource.hpp index 0748302c2..e92b2985e 100644 --- a/include/rmm/mr/pinned_host_memory_resource.hpp +++ b/include/rmm/mr/pinned_host_memory_resource.hpp @@ -29,6 +29,12 @@ namespace rmm::mr { +/** + * @addtogroup memory_resources + * @{ + * @file + */ + /** * @brief Memory resource class for allocating pinned host memory. * @@ -45,9 +51,9 @@ class pinned_host_memory_resource { /** * @brief Allocates pinned host memory of size at least \p bytes bytes. * - * @throws `rmm::out_of_memory` if the requested allocation could not be fulfilled due to to a + * @throws rmm::out_of_memory if the requested allocation could not be fulfilled due to to a * CUDA out of memory error. - * @throws `rmm::bad_alloc` if the requested allocation could not be fulfilled due to any other + * @throws rmm::bad_alloc if the requested allocation could not be fulfilled due to any other * reason. * * @param bytes The size, in bytes, of the allocation. @@ -71,8 +77,6 @@ class pinned_host_memory_resource { /** * @brief Deallocate memory pointed to by \p ptr of size \p bytes bytes. * - * @throws Nothing. - * * @param ptr Pointer to be deallocated. * @param bytes Size of the allocation. * @param alignment Alignment in bytes. Default alignment is used if unspecified. @@ -90,9 +94,9 @@ class pinned_host_memory_resource { * * @note Stream argument is ignored and behavior is identical to allocate. * - * @throws `rmm::out_of_memory` if the requested allocation could not be fulfilled due to to a + * @throws rmm::out_of_memory if the requested allocation could not be fulfilled due to to a * CUDA out of memory error. - * @throws `rmm::bad_alloc` if the requested allocation could not be fulfilled due to any other + * @throws rmm::bad_alloc if the requested allocation could not be fulfilled due to any other * error. * * @param bytes The size, in bytes, of the allocation. @@ -109,9 +113,9 @@ class pinned_host_memory_resource { * * @note Stream argument is ignored and behavior is identical to allocate. * - * @throws `rmm::out_of_memory` if the requested allocation could not be fulfilled due to to a + * @throws rmm::out_of_memory if the requested allocation could not be fulfilled due to to a * CUDA out of memory error. - * @throws `rmm::bad_alloc` if the requested allocation could not be fulfilled due to any other + * @throws rmm::bad_alloc if the requested allocation could not be fulfilled due to any other * error. * * @param bytes The size, in bytes, of the allocation. @@ -131,8 +135,6 @@ class pinned_host_memory_resource { * * @note Stream argument is ignored and behavior is identical to deallocate. * - * @throws Nothing. - * * @param ptr Pointer to be deallocated. * @param bytes Size of the allocation. * @param stream CUDA stream on which to perform the deallocation (ignored). @@ -150,8 +152,6 @@ class pinned_host_memory_resource { * * @note Stream argument is ignored and behavior is identical to deallocate. * - * @throws Nothing. - * * @param ptr Pointer to be deallocated. * @param bytes Size of the allocation. * @param alignment Alignment in bytes. @@ -199,4 +199,6 @@ class pinned_host_memory_resource { static_assert(cuda::mr::async_resource_with); + +/** @} */ // end of group } // namespace rmm::mr diff --git a/include/rmm/resource_ref.hpp b/include/rmm/resource_ref.hpp new file mode 100644 index 000000000..a363f9b50 --- /dev/null +++ b/include/rmm/resource_ref.hpp @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2024, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#pragma once + +#include + +namespace rmm { + +/** + * @addtogroup memory_resources + * @{ + * @file + */ + +/** + * @brief Alias for a `cuda::mr::async_resource_ref` with the property + * `cuda::mr::device_accessible`. + */ +using device_async_resource_ref = cuda::mr::async_resource_ref; + +/** @} */ // end of group +} // namespace rmm diff --git a/tests/device_buffer_tests.cu b/tests/device_buffer_tests.cu index f73be0201..ef858bc62 100644 --- a/tests/device_buffer_tests.cu +++ b/tests/device_buffer_tests.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2022, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -58,7 +59,7 @@ struct DeviceBufferTest : public ::testing::Test { }; using resources = ::testing::Types; -using async_resource_ref = cuda::mr::async_resource_ref; +using async_resource_ref = rmm::device_async_resource_ref; TYPED_TEST_CASE(DeviceBufferTest, resources); diff --git a/tests/device_uvector_tests.cpp b/tests/device_uvector_tests.cpp index 3c042a437..590b857aa 100644 --- a/tests/device_uvector_tests.cpp +++ b/tests/device_uvector_tests.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2020-2022, NVIDIA CORPORATION. + * Copyright (c) 2020-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,12 +15,13 @@ * limitations under the License. */ -#include -#include - #include #include #include +#include + +#include +#include // explicit instantiation for test coverage purposes. template class rmm::device_uvector; @@ -31,7 +32,7 @@ struct TypedUVectorTest : ::testing::Test { }; using TestTypes = ::testing::Types; -using async_resource_ref = cuda::mr::async_resource_ref; +using async_resource_ref = rmm::device_async_resource_ref; TYPED_TEST_CASE(TypedUVectorTest, TestTypes); diff --git a/tests/mr/device/mr_ref_test.hpp b/tests/mr/device/mr_ref_test.hpp index 9826c10be..2684042d7 100644 --- a/tests/mr/device/mr_ref_test.hpp +++ b/tests/mr/device/mr_ref_test.hpp @@ -33,6 +33,7 @@ #include #include #include +#include #include @@ -45,7 +46,7 @@ #include using resource_ref = cuda::mr::resource_ref; -using async_resource_ref = cuda::mr::async_resource_ref; +using async_resource_ref = rmm::device_async_resource_ref; namespace rmm::test { diff --git a/tests/mr/device/thrust_allocator_tests.cu b/tests/mr/device/thrust_allocator_tests.cu index ed8875cbe..4f5c76b09 100644 --- a/tests/mr/device/thrust_allocator_tests.cu +++ b/tests/mr/device/thrust_allocator_tests.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2021, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ #include #include #include +#include #include @@ -32,7 +33,7 @@ namespace rmm::test { namespace { struct allocator_test : public mr_test {}; -using async_resource_ref = cuda::mr::async_resource_ref; +using async_resource_ref = rmm::device_async_resource_ref; TEST_P(allocator_test, first) {