diff --git a/cpp/include/cudf_test/stream_checking_resource_adaptor.hpp b/cpp/include/cudf_test/stream_checking_resource_adaptor.hpp index d1841ff42a1..cafde6ca7d5 100644 --- a/cpp/include/cudf_test/stream_checking_resource_adaptor.hpp +++ b/cpp/include/cudf_test/stream_checking_resource_adaptor.hpp @@ -20,6 +20,7 @@ #include #include +#include #include @@ -58,11 +59,14 @@ class stream_checking_resource_adaptor final : public rmm::mr::device_memory_res default; /** - * @brief Return pointer to the upstream resource. + * @brief Returns the wrapped upstream resource * - * @return Pointer to the upstream resource. + * @return The wrapped upstream resource */ - Upstream* get_upstream() const noexcept { return upstream_; } + [[nodiscard]] rmm::device_async_resource_ref get_upstream_resource() const noexcept + { + return upstream_; + } private: /** @@ -110,8 +114,8 @@ class stream_checking_resource_adaptor final : public rmm::mr::device_memory_res { if (this == &other) { return true; } auto cast = dynamic_cast const*>(&other); - return cast != nullptr ? upstream_->is_equal(*cast->get_upstream()) - : upstream_->is_equal(other); + if (cast == nullptr) { return upstream_->is_equal(other); } + return get_upstream_resource() == cast->get_upstream_resource(); } /**