Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate rmm::mr::device_memory_resource::get_mem_info() and supports_get_mem_info(). #1436

Merged
merged 3 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 14 additions & 17 deletions include/rmm/mr/device/device_memory_resource.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,21 +304,32 @@ 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.
*/
[[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.
*
* @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
* .second
*/
[[nodiscard]] std::pair<std::size_t, std::size_t> get_mem_info(cuda_stream_view stream) const
[[deprecated("Use rmm::available_device_memory instead.")]] //
[[nodiscard]] std::pair<std::size_t, std::size_t>
get_mem_info(cuda_stream_view stream) const
{
return do_get_mem_info(stream);
return {0, 0};
}

/**
Expand Down Expand Up @@ -374,20 +385,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<std::size_t, std::size_t> do_get_mem_info(
cuda_stream_view stream) const
{
return {0, 0};
}
};
static_assert(cuda::mr::async_resource_with<device_memory_resource, cuda::mr::device_accessible>);
/** @} */ // end of group
Expand Down
20 changes: 0 additions & 20 deletions include/rmm/mr/pinned_host_memory_resource.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::size_t, std::size_t> get_mem_info(cuda::stream_ref) noexcept
{
return {0, 0};
}

/**
* @brief Enables the `cuda::mr::device_accessible` property
*
Expand Down