From 27def4f217ae96dc7affabdba46e8cdc7c043eec Mon Sep 17 00:00:00 2001 From: Mark Harris <783069+harrism@users.noreply.github.com> Date: Wed, 24 Jan 2024 01:08:28 +0000 Subject: [PATCH 1/3] Deprecate supports_get_mem_info and get_mem_info. --- .../rmm/mr/device/device_memory_resource.hpp | 27 +++++++------------ 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/include/rmm/mr/device/device_memory_resource.hpp b/include/rmm/mr/device/device_memory_resource.hpp index fd8a71c80..f3bdd0032 100644 --- a/include/rmm/mr/device/device_memory_resource.hpp +++ b/include/rmm/mr/device/device_memory_resource.hpp @@ -306,7 +306,12 @@ class device_memory_resource { * * @return bool true if the resource supports get_mem_info, false otherwise. */ - [[nodiscard]] virtual bool supports_get_mem_info() const noexcept { return false; }; + [[deprecated("Use rmm::available_device_memory instead.")]] // + [[nodiscard]] virtual bool + supports_get_mem_info() const noexcept + { + return false; + }; /** * @brief Queries the amount of free and total memory for the resource. @@ -316,9 +321,11 @@ class device_memory_resource { * @returns a pair containing the free memory in bytes in .first and total amount of memory in * .second */ - [[nodiscard]] std::pair get_mem_info(cuda_stream_view stream) const + [[deprecated("Use rmm::available_device_memory instead.")]] // + [[nodiscard]] std::pair + get_mem_info(cuda_stream_view stream) const { - return do_get_mem_info(stream); + return {0, 0}; } /** @@ -374,20 +381,6 @@ class device_memory_resource { { return this == &other; } - - /** - * @brief Get free and available memory for memory resource - * - * @throws std::runtime_error if we could not get free / total memory - * - * @param stream the stream being executed on - * @return std::pair with available and free memory for resource - */ - [[nodiscard]] virtual std::pair do_get_mem_info( - cuda_stream_view stream) const - { - return {0, 0}; - } }; static_assert(cuda::mr::async_resource_with); /** @} */ // end of group From 958ecaa76dcccaf1d6a4716af5acd1c23fcf3dd7 Mon Sep 17 00:00:00 2001 From: Mark Harris <783069+harrism@users.noreply.github.com> Date: Wed, 24 Jan 2024 01:11:04 +0000 Subject: [PATCH 2/3] Add deprecated docs. --- include/rmm/mr/device/device_memory_resource.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/rmm/mr/device/device_memory_resource.hpp b/include/rmm/mr/device/device_memory_resource.hpp index f3bdd0032..906480d45 100644 --- a/include/rmm/mr/device/device_memory_resource.hpp +++ b/include/rmm/mr/device/device_memory_resource.hpp @@ -304,6 +304,8 @@ class device_memory_resource { /** * @brief Query whether the resource supports the get_mem_info API. * + * @deprecated Use rmm::available_device_memory instead. + * * @return bool true if the resource supports get_mem_info, false otherwise. */ [[deprecated("Use rmm::available_device_memory instead.")]] // @@ -316,6 +318,8 @@ class device_memory_resource { /** * @brief Queries the amount of free and total memory for the resource. * + * @deprecated Use rmm::available_device_memory instead. + * * @param stream the stream whose memory manager we want to retrieve * * @returns a pair containing the free memory in bytes in .first and total amount of memory in From 12afc30543a1a1bfdedaecb29737e1fe837d5122 Mon Sep 17 00:00:00 2001 From: Mark Harris <783069+harrism@users.noreply.github.com> Date: Wed, 24 Jan 2024 01:11:20 +0000 Subject: [PATCH 3/3] Remove from pinned_host_memory_resource --- .../rmm/mr/pinned_host_memory_resource.hpp | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/include/rmm/mr/pinned_host_memory_resource.hpp b/include/rmm/mr/pinned_host_memory_resource.hpp index c51af4182..0748302c2 100644 --- a/include/rmm/mr/pinned_host_memory_resource.hpp +++ b/include/rmm/mr/pinned_host_memory_resource.hpp @@ -177,26 +177,6 @@ class pinned_host_memory_resource { */ bool operator!=(const pinned_host_memory_resource&) const { return false; } - /** - * @brief Query whether the resource supports reporting free and available memory. - * - * @return false - */ - static bool supports_get_mem_info() { return false; } - - /** - * @brief Query the total amount of memory and free memory available for allocation by this - * resource. - * - * @throws nothing - * - * @return std::pair containing 0 for both total and free memory. - */ - [[nodiscard]] static std::pair get_mem_info(cuda::stream_ref) noexcept - { - return {0, 0}; - } - /** * @brief Enables the `cuda::mr::device_accessible` property *