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 {};