From 780bf8fe93b31ba1356fb3d578748af7ee84c26e Mon Sep 17 00:00:00 2001 From: Mark Harris <783069+harrism@users.noreply.github.com> Date: Mon, 22 Jan 2024 23:37:33 +0000 Subject: [PATCH] Remove get_mem_info funcitons from custom memory resources --- .../stream_checking_resource_adaptor.hpp | 27 +------------------ java/src/main/native/src/RmmJni.cpp | 14 +--------- 2 files changed, 2 insertions(+), 39 deletions(-) diff --git a/cpp/include/cudf_test/stream_checking_resource_adaptor.hpp b/cpp/include/cudf_test/stream_checking_resource_adaptor.hpp index e18400422aa..90a8c2ccc2f 100644 --- a/cpp/include/cudf_test/stream_checking_resource_adaptor.hpp +++ b/cpp/include/cudf_test/stream_checking_resource_adaptor.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023, NVIDIA CORPORATION. + * Copyright (c) 2022-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. @@ -71,16 +71,6 @@ class stream_checking_resource_adaptor final : public rmm::mr::device_memory_res */ bool supports_streams() const noexcept override { return upstream_->supports_streams(); } - /** - * @brief Query whether the resource supports the get_mem_info API. - * - * @return Whether or not the upstream resource supports get_mem_info - */ - bool supports_get_mem_info() const noexcept override - { - return upstream_->supports_get_mem_info(); - } - private: /** * @brief Allocates memory of size at least `bytes` using the upstream @@ -131,21 +121,6 @@ class stream_checking_resource_adaptor final : public rmm::mr::device_memory_res : upstream_->is_equal(other); } - /** - * @brief Get free and available memory from upstream resource. - * - * @throws `rmm::cuda_error` if unable to retrieve memory info. - * @throws `cudf::logic_error` if attempted on a default stream - * - * @param stream Stream on which to get the mem info. - * @return std::pair with available and free memory for resource - */ - std::pair do_get_mem_info(rmm::cuda_stream_view stream) const override - { - verify_stream(stream); - return upstream_->get_mem_info(stream); - } - /** * @brief Throw an error if the provided stream is invalid. * diff --git a/java/src/main/native/src/RmmJni.cpp b/java/src/main/native/src/RmmJni.cpp index 3c49d153cb6..b92d9e4e891 100644 --- a/java/src/main/native/src/RmmJni.cpp +++ b/java/src/main/native/src/RmmJni.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2023, 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. @@ -96,8 +96,6 @@ class tracking_resource_adaptor final : public base_tracking_resource_adaptor { return scoped_max_total_allocated; } - bool supports_get_mem_info() const noexcept override { return resource->supports_get_mem_info(); } - bool supports_streams() const noexcept override { return resource->supports_streams(); } private: @@ -144,10 +142,6 @@ class tracking_resource_adaptor final : public base_tracking_resource_adaptor { scoped_allocated -= size; } } - - std::pair do_get_mem_info(rmm::cuda_stream_view stream) const override { - return resource->get_mem_info(stream); - } }; template @@ -213,8 +207,6 @@ class java_event_handler_memory_resource : public device_memory_resource { device_memory_resource *get_wrapped_resource() { return resource; } - bool supports_get_mem_info() const noexcept override { return resource->supports_get_mem_info(); } - bool supports_streams() const noexcept override { return resource->supports_streams(); } private: @@ -277,10 +269,6 @@ class java_event_handler_memory_resource : public device_memory_resource { } } - std::pair do_get_mem_info(rmm::cuda_stream_view stream) const override { - return resource->get_mem_info(stream); - } - protected: JavaVM *jvm; jobject handler_obj;