From 2201bc1ced331d4867307bbbee31244aeba46002 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Thu, 7 Sep 2023 15:10:05 -0700 Subject: [PATCH] Try reverting base_fixture change --- cpp/include/cudf_test/base_fixture.hpp | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/cpp/include/cudf_test/base_fixture.hpp b/cpp/include/cudf_test/base_fixture.hpp index a29ac092c83..05319e03003 100644 --- a/cpp/include/cudf_test/base_fixture.hpp +++ b/cpp/include/cudf_test/base_fixture.hpp @@ -47,7 +47,17 @@ namespace test { * class MyTestFixture : public cudf::test::BaseFixture {}; * ``` */ -class BaseFixture : public ::testing::Test {}; +class BaseFixture : public ::testing::Test { + rmm::mr::device_memory_resource* _mr{rmm::mr::get_current_device_resource()}; + + public: + /** + * @brief Returns pointer to `device_memory_resource` that should be used for + * all tests inheriting from this fixture + * @return pointer to memory resource + */ + rmm::mr::device_memory_resource* mr() { return _mr; } +}; /** * @brief Base test fixture that takes a parameter. @@ -58,7 +68,17 @@ class BaseFixture : public ::testing::Test {}; * ``` */ template -class BaseFixtureWithParam : public ::testing::TestWithParam {}; +class BaseFixtureWithParam : public ::testing::TestWithParam { + rmm::mr::device_memory_resource* _mr{rmm::mr::get_current_device_resource()}; + + public: + /** + * @brief Returns pointer to `device_memory_resource` that should be used for + * all tests inheriting from this fixture + * @return pointer to memory resource + */ + rmm::mr::device_memory_resource* mr() const { return _mr; } +}; template struct uniform_distribution_impl {};