From 4716f13135e9379fb5f89badeb1966ca77af81e3 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Thu, 7 Sep 2023 10:46:54 -0700 Subject: [PATCH 1/4] Remove the mr from the base fixture --- cpp/include/cudf_test/base_fixture.hpp | 24 +---- cpp/tests/column/factories_test.cpp | 137 +++++++------------------ cpp/tests/copying/split_tests.cpp | 17 +-- cpp/tests/scalar/factories_test.cpp | 37 +++---- cpp/tests/wrappers/timestamps_test.cu | 13 +-- 5 files changed, 66 insertions(+), 162 deletions(-) diff --git a/cpp/include/cudf_test/base_fixture.hpp b/cpp/include/cudf_test/base_fixture.hpp index 05319e03003..a29ac092c83 100644 --- a/cpp/include/cudf_test/base_fixture.hpp +++ b/cpp/include/cudf_test/base_fixture.hpp @@ -47,17 +47,7 @@ namespace test { * class MyTestFixture : public cudf::test::BaseFixture {}; * ``` */ -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; } -}; +class BaseFixture : public ::testing::Test {}; /** * @brief Base test fixture that takes a parameter. @@ -68,17 +58,7 @@ class BaseFixture : public ::testing::Test { * ``` */ template -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; } -}; +class BaseFixtureWithParam : public ::testing::TestWithParam {}; template struct uniform_distribution_impl {}; diff --git a/cpp/tests/column/factories_test.cpp b/cpp/tests/column/factories_test.cpp index 95706ad9e37..b06d097647d 100644 --- a/cpp/tests/column/factories_test.cpp +++ b/cpp/tests/column/factories_test.cpp @@ -37,7 +37,6 @@ class ColumnFactoryTest : public cudf::test::BaseFixture { public: cudf::size_type size() { return _size; } - rmm::cuda_stream_view stream() { return cudf::get_default_stream(); } }; template @@ -47,11 +46,8 @@ TYPED_TEST_SUITE(NumericFactoryTest, cudf::test::NumericTypes); TYPED_TEST(NumericFactoryTest, EmptyNoMask) { - auto column = cudf::make_numeric_column(cudf::data_type{cudf::type_to_id()}, - 0, - cudf::mask_state::UNALLOCATED, - this->stream(), - this->mr()); + auto column = cudf::make_numeric_column( + cudf::data_type{cudf::type_to_id()}, 0, cudf::mask_state::UNALLOCATED); EXPECT_EQ(column->type(), cudf::data_type{cudf::type_to_id()}); EXPECT_EQ(column->size(), 0); EXPECT_EQ(0, column->null_count()); @@ -62,11 +58,8 @@ TYPED_TEST(NumericFactoryTest, EmptyNoMask) TYPED_TEST(NumericFactoryTest, EmptyAllValidMask) { - auto column = cudf::make_numeric_column(cudf::data_type{cudf::type_to_id()}, - 0, - cudf::mask_state::ALL_VALID, - this->stream(), - this->mr()); + auto column = cudf::make_numeric_column( + cudf::data_type{cudf::type_to_id()}, 0, cudf::mask_state::ALL_VALID); EXPECT_EQ(column->type(), cudf::data_type{cudf::type_to_id()}); EXPECT_EQ(column->size(), 0); EXPECT_EQ(0, column->null_count()); @@ -77,11 +70,8 @@ TYPED_TEST(NumericFactoryTest, EmptyAllValidMask) TYPED_TEST(NumericFactoryTest, EmptyAllNullMask) { - auto column = cudf::make_numeric_column(cudf::data_type{cudf::type_to_id()}, - 0, - cudf::mask_state::ALL_NULL, - this->stream(), - this->mr()); + auto column = cudf::make_numeric_column( + cudf::data_type{cudf::type_to_id()}, 0, cudf::mask_state::ALL_NULL); EXPECT_EQ(column->type(), cudf::data_type{cudf::type_to_id()}); EXPECT_EQ(column->size(), 0); EXPECT_EQ(0, column->null_count()); @@ -92,11 +82,8 @@ TYPED_TEST(NumericFactoryTest, EmptyAllNullMask) TYPED_TEST(NumericFactoryTest, NoMask) { - auto column = cudf::make_numeric_column(cudf::data_type{cudf::type_to_id()}, - this->size(), - cudf::mask_state::UNALLOCATED, - this->stream(), - this->mr()); + auto column = cudf::make_numeric_column( + cudf::data_type{cudf::type_to_id()}, this->size(), cudf::mask_state::UNALLOCATED); EXPECT_EQ(column->type(), cudf::data_type{cudf::type_to_id()}); EXPECT_EQ(column->size(), this->size()); EXPECT_EQ(0, column->null_count()); @@ -107,11 +94,8 @@ TYPED_TEST(NumericFactoryTest, NoMask) TYPED_TEST(NumericFactoryTest, UnitializedMask) { - auto column = cudf::make_numeric_column(cudf::data_type{cudf::type_to_id()}, - this->size(), - cudf::mask_state::UNINITIALIZED, - this->stream(), - this->mr()); + auto column = cudf::make_numeric_column( + cudf::data_type{cudf::type_to_id()}, this->size(), cudf::mask_state::UNINITIALIZED); EXPECT_EQ(column->type(), cudf::data_type{cudf::type_to_id()}); EXPECT_EQ(column->size(), this->size()); EXPECT_TRUE(column->nullable()); @@ -120,11 +104,8 @@ TYPED_TEST(NumericFactoryTest, UnitializedMask) TYPED_TEST(NumericFactoryTest, AllValidMask) { - auto column = cudf::make_numeric_column(cudf::data_type{cudf::type_to_id()}, - this->size(), - cudf::mask_state::ALL_VALID, - this->stream(), - this->mr()); + auto column = cudf::make_numeric_column( + cudf::data_type{cudf::type_to_id()}, this->size(), cudf::mask_state::ALL_VALID); EXPECT_EQ(column->type(), cudf::data_type{cudf::type_to_id()}); EXPECT_EQ(column->size(), this->size()); EXPECT_EQ(0, column->null_count()); @@ -135,11 +116,8 @@ TYPED_TEST(NumericFactoryTest, AllValidMask) TYPED_TEST(NumericFactoryTest, AllNullMask) { - auto column = cudf::make_numeric_column(cudf::data_type{cudf::type_to_id()}, - this->size(), - cudf::mask_state::ALL_NULL, - this->stream(), - this->mr()); + auto column = cudf::make_numeric_column( + cudf::data_type{cudf::type_to_id()}, this->size(), cudf::mask_state::ALL_NULL); EXPECT_EQ(column->type(), cudf::data_type{cudf::type_to_id()}); EXPECT_EQ(column->size(), this->size()); EXPECT_EQ(this->size(), column->null_count()); @@ -154,9 +132,7 @@ TYPED_TEST(NumericFactoryTest, NullMaskAsParm) auto column = cudf::make_numeric_column(cudf::data_type{cudf::type_to_id()}, this->size(), std::move(null_mask), - this->size(), - this->stream(), - this->mr()); + this->size()); EXPECT_EQ(column->type(), cudf::data_type{cudf::type_to_id()}); EXPECT_EQ(column->size(), this->size()); EXPECT_EQ(this->size(), column->null_count()); @@ -167,12 +143,8 @@ TYPED_TEST(NumericFactoryTest, NullMaskAsParm) TYPED_TEST(NumericFactoryTest, NullMaskAsEmptyParm) { - auto column = cudf::make_numeric_column(cudf::data_type{cudf::type_to_id()}, - this->size(), - rmm::device_buffer{}, - 0, - this->stream(), - this->mr()); + auto column = cudf::make_numeric_column( + cudf::data_type{cudf::type_to_id()}, this->size(), rmm::device_buffer{}, 0); EXPECT_EQ(column->type(), cudf::data_type{cudf::type_to_id()}); EXPECT_EQ(column->size(), this->size()); EXPECT_EQ(0, column->null_count()); @@ -188,11 +160,8 @@ class NonNumericFactoryTest : public ColumnFactoryTest, TEST_P(NonNumericFactoryTest, NonNumericThrow) { auto construct = [this]() { - auto column = cudf::make_numeric_column(cudf::data_type{GetParam()}, - this->size(), - cudf::mask_state::UNALLOCATED, - this->stream(), - this->mr()); + auto column = cudf::make_numeric_column( + cudf::data_type{GetParam()}, this->size(), cudf::mask_state::UNALLOCATED); }; EXPECT_THROW(construct(), cudf::logic_error); } @@ -208,11 +177,8 @@ TYPED_TEST_SUITE(FixedWidthFactoryTest, cudf::test::FixedWidthTypes); TYPED_TEST(FixedWidthFactoryTest, EmptyNoMask) { - auto column = cudf::make_fixed_width_column(cudf::data_type{cudf::type_to_id()}, - 0, - cudf::mask_state::UNALLOCATED, - this->stream(), - this->mr()); + auto column = cudf::make_fixed_width_column( + cudf::data_type{cudf::type_to_id()}, 0, cudf::mask_state::UNALLOCATED); EXPECT_EQ(column->type(), cudf::data_type{cudf::type_to_id()}); } @@ -235,11 +201,8 @@ TYPED_TEST(EmptyFactoryTest, Empty) TYPED_TEST(FixedWidthFactoryTest, EmptyAllValidMask) { - auto column = cudf::make_fixed_width_column(cudf::data_type{cudf::type_to_id()}, - 0, - cudf::mask_state::ALL_VALID, - this->stream(), - this->mr()); + auto column = cudf::make_fixed_width_column( + cudf::data_type{cudf::type_to_id()}, 0, cudf::mask_state::ALL_VALID); EXPECT_EQ(column->type(), cudf::data_type{cudf::type_to_id()}); EXPECT_EQ(column->size(), 0); EXPECT_EQ(0, column->null_count()); @@ -250,11 +213,8 @@ TYPED_TEST(FixedWidthFactoryTest, EmptyAllValidMask) TYPED_TEST(FixedWidthFactoryTest, EmptyAllNullMask) { - auto column = cudf::make_fixed_width_column(cudf::data_type{cudf::type_to_id()}, - 0, - cudf::mask_state::ALL_NULL, - this->stream(), - this->mr()); + auto column = cudf::make_fixed_width_column( + cudf::data_type{cudf::type_to_id()}, 0, cudf::mask_state::ALL_NULL); EXPECT_EQ(column->type(), cudf::data_type{cudf::type_to_id()}); EXPECT_EQ(column->size(), 0); EXPECT_EQ(0, column->null_count()); @@ -265,11 +225,8 @@ TYPED_TEST(FixedWidthFactoryTest, EmptyAllNullMask) TYPED_TEST(FixedWidthFactoryTest, NoMask) { - auto column = cudf::make_fixed_width_column(cudf::data_type{cudf::type_to_id()}, - this->size(), - cudf::mask_state::UNALLOCATED, - this->stream(), - this->mr()); + auto column = cudf::make_fixed_width_column( + cudf::data_type{cudf::type_to_id()}, this->size(), cudf::mask_state::UNALLOCATED); EXPECT_EQ(column->type(), cudf::data_type{cudf::type_to_id()}); EXPECT_EQ(column->size(), this->size()); EXPECT_EQ(0, column->null_count()); @@ -280,11 +237,8 @@ TYPED_TEST(FixedWidthFactoryTest, NoMask) TYPED_TEST(FixedWidthFactoryTest, UnitializedMask) { - auto column = cudf::make_fixed_width_column(cudf::data_type{cudf::type_to_id()}, - this->size(), - cudf::mask_state::UNINITIALIZED, - this->stream(), - this->mr()); + auto column = cudf::make_fixed_width_column( + cudf::data_type{cudf::type_to_id()}, this->size(), cudf::mask_state::UNINITIALIZED); EXPECT_EQ(column->type(), cudf::data_type{cudf::type_to_id()}); EXPECT_EQ(column->size(), this->size()); EXPECT_TRUE(column->nullable()); @@ -293,11 +247,8 @@ TYPED_TEST(FixedWidthFactoryTest, UnitializedMask) TYPED_TEST(FixedWidthFactoryTest, AllValidMask) { - auto column = cudf::make_fixed_width_column(cudf::data_type{cudf::type_to_id()}, - this->size(), - cudf::mask_state::ALL_VALID, - this->stream(), - this->mr()); + auto column = cudf::make_fixed_width_column( + cudf::data_type{cudf::type_to_id()}, this->size(), cudf::mask_state::ALL_VALID); EXPECT_EQ(column->type(), cudf::data_type{cudf::type_to_id()}); EXPECT_EQ(column->size(), this->size()); EXPECT_EQ(0, column->null_count()); @@ -308,11 +259,8 @@ TYPED_TEST(FixedWidthFactoryTest, AllValidMask) TYPED_TEST(FixedWidthFactoryTest, AllNullMask) { - auto column = cudf::make_fixed_width_column(cudf::data_type{cudf::type_to_id()}, - this->size(), - cudf::mask_state::ALL_NULL, - this->stream(), - this->mr()); + auto column = cudf::make_fixed_width_column( + cudf::data_type{cudf::type_to_id()}, this->size(), cudf::mask_state::ALL_NULL); EXPECT_EQ(column->type(), cudf::data_type{cudf::type_to_id()}); EXPECT_EQ(column->size(), this->size()); EXPECT_EQ(this->size(), column->null_count()); @@ -327,9 +275,7 @@ TYPED_TEST(FixedWidthFactoryTest, NullMaskAsParm) auto column = cudf::make_fixed_width_column(cudf::data_type{cudf::type_to_id()}, this->size(), std::move(null_mask), - this->size(), - this->stream(), - this->mr()); + this->size()); EXPECT_EQ(column->type(), cudf::data_type{cudf::type_to_id()}); EXPECT_EQ(column->size(), this->size()); EXPECT_EQ(this->size(), column->null_count()); @@ -340,12 +286,8 @@ TYPED_TEST(FixedWidthFactoryTest, NullMaskAsParm) TYPED_TEST(FixedWidthFactoryTest, NullMaskAsEmptyParm) { - auto column = cudf::make_fixed_width_column(cudf::data_type{cudf::type_to_id()}, - this->size(), - rmm::device_buffer{}, - 0, - this->stream(), - this->mr()); + auto column = cudf::make_fixed_width_column( + cudf::data_type{cudf::type_to_id()}, this->size(), rmm::device_buffer{}, 0); EXPECT_EQ(column->type(), cudf::data_type{cudf::type_to_id()}); EXPECT_EQ(column->size(), this->size()); EXPECT_EQ(0, column->null_count()); @@ -361,11 +303,8 @@ class NonFixedWidthFactoryTest : public ColumnFactoryTest, TEST_P(NonFixedWidthFactoryTest, NonFixedWidthThrow) { auto construct = [this]() { - auto column = cudf::make_fixed_width_column(cudf::data_type{GetParam()}, - this->size(), - cudf::mask_state::UNALLOCATED, - this->stream(), - this->mr()); + auto column = cudf::make_fixed_width_column( + cudf::data_type{GetParam()}, this->size(), cudf::mask_state::UNALLOCATED); }; EXPECT_THROW(construct(), cudf::logic_error); } diff --git a/cpp/tests/copying/split_tests.cpp b/cpp/tests/copying/split_tests.cpp index 7a5c738dc12..842ba801df0 100644 --- a/cpp/tests/copying/split_tests.cpp +++ b/cpp/tests/copying/split_tests.cpp @@ -2304,13 +2304,14 @@ TEST_F(ContiguousSplitTableCornerCases, OutBufferToSmall) { // internally, contiguous split chunks GPU work in 1MB contiguous copies // so the output buffer must be 1MB or larger. - EXPECT_THROW(cudf::chunked_pack::create({}, 1 * 1024, mr()), cudf::logic_error); + EXPECT_THROW(cudf::chunked_pack::create({}, 1 * 1024), cudf::logic_error); } TEST_F(ContiguousSplitTableCornerCases, ChunkSpanTooSmall) { - auto chunked_pack = cudf::chunked_pack::create({}, 1 * 1024 * 1024, mr()); - rmm::device_buffer buff(1 * 1024, cudf::get_default_stream(), mr()); + auto chunked_pack = cudf::chunked_pack::create({}, 1 * 1024 * 1024); + rmm::device_buffer buff( + 1 * 1024, cudf::test::get_default_stream(), rmm::mr::get_current_device_resource()); cudf::device_span too_small(static_cast(buff.data()), buff.size()); std::size_t copied = 0; // throws because we created chunked_contig_split with 1MB, but we are giving @@ -2321,8 +2322,9 @@ TEST_F(ContiguousSplitTableCornerCases, ChunkSpanTooSmall) TEST_F(ContiguousSplitTableCornerCases, EmptyTableHasNextFalse) { - auto chunked_pack = cudf::chunked_pack::create({}, 1 * 1024 * 1024, mr()); - rmm::device_buffer buff(1 * 1024 * 1024, cudf::get_default_stream(), mr()); + auto chunked_pack = cudf::chunked_pack::create({}, 1 * 1024 * 1024); + rmm::device_buffer buff( + 1 * 1024 * 1024, cudf::test::get_default_stream(), rmm::mr::get_current_device_resource()); cudf::device_span bounce_buff(static_cast(buff.data()), buff.size()); EXPECT_EQ(chunked_pack->has_next(), false); // empty input table std::size_t copied = 0; @@ -2334,9 +2336,10 @@ TEST_F(ContiguousSplitTableCornerCases, ExhaustedHasNextFalse) { cudf::test::strings_column_wrapper a{"abc", "def", "ghi", "jkl", "mno", "", "st", "uvwx"}; cudf::table_view t({a}); - rmm::device_buffer buff(1 * 1024 * 1024, cudf::get_default_stream(), mr()); + rmm::device_buffer buff( + 1 * 1024 * 1024, cudf::test::get_default_stream(), rmm::mr::get_current_device_resource()); cudf::device_span bounce_buff(static_cast(buff.data()), buff.size()); - auto chunked_pack = cudf::chunked_pack::create(t, buff.size(), mr()); + auto chunked_pack = cudf::chunked_pack::create(t, buff.size()); EXPECT_EQ(chunked_pack->has_next(), true); std::size_t copied = chunked_pack->next(bounce_buff); EXPECT_EQ(copied, chunked_pack->get_total_contiguous_size()); diff --git a/cpp/tests/scalar/factories_test.cpp b/cpp/tests/scalar/factories_test.cpp index febae11832d..7da5c408a48 100644 --- a/cpp/tests/scalar/factories_test.cpp +++ b/cpp/tests/scalar/factories_test.cpp @@ -26,22 +26,17 @@ #include -class ScalarFactoryTest : public cudf::test::BaseFixture { - public: - rmm::cuda_stream_view stream() { return cudf::get_default_stream(); } -}; +class ScalarFactoryTest : public cudf::test::BaseFixture {}; template -struct NumericScalarFactory : public ScalarFactoryTest { - static constexpr auto factory = cudf::make_numeric_scalar; -}; +struct NumericScalarFactory : public ScalarFactoryTest {}; TYPED_TEST_SUITE(NumericScalarFactory, cudf::test::NumericTypes); TYPED_TEST(NumericScalarFactory, FactoryDefault) { std::unique_ptr s = - this->factory(cudf::data_type{cudf::type_to_id()}, this->stream(), this->mr()); + cudf::make_numeric_scalar(cudf::data_type{cudf::type_to_id()}); EXPECT_EQ(s->type(), cudf::data_type{cudf::type_to_id()}); EXPECT_FALSE(s->is_valid()); @@ -50,7 +45,7 @@ TYPED_TEST(NumericScalarFactory, FactoryDefault) TYPED_TEST(NumericScalarFactory, TypeCast) { std::unique_ptr s = - this->factory(cudf::data_type{cudf::type_to_id()}, this->stream(), this->mr()); + cudf::make_numeric_scalar(cudf::data_type{cudf::type_to_id()}); auto numeric_s = static_cast*>(s.get()); @@ -62,16 +57,14 @@ TYPED_TEST(NumericScalarFactory, TypeCast) } template -struct TimestampScalarFactory : public ScalarFactoryTest { - static constexpr auto factory = cudf::make_timestamp_scalar; -}; +struct TimestampScalarFactory : public ScalarFactoryTest {}; TYPED_TEST_SUITE(TimestampScalarFactory, cudf::test::TimestampTypes); TYPED_TEST(TimestampScalarFactory, FactoryDefault) { std::unique_ptr s = - this->factory(cudf::data_type{cudf::type_to_id()}, this->stream(), this->mr()); + cudf::make_timestamp_scalar(cudf::data_type{cudf::type_to_id()}); EXPECT_EQ(s->type(), cudf::data_type{cudf::type_to_id()}); EXPECT_FALSE(s->is_valid()); @@ -80,7 +73,7 @@ TYPED_TEST(TimestampScalarFactory, FactoryDefault) TYPED_TEST(TimestampScalarFactory, TypeCast) { std::unique_ptr s = - this->factory(cudf::data_type{cudf::type_to_id()}, this->stream(), this->mr()); + cudf::make_timestamp_scalar(cudf::data_type{cudf::type_to_id()}); auto numeric_s = static_cast*>(s.get()); @@ -92,9 +85,7 @@ TYPED_TEST(TimestampScalarFactory, TypeCast) } template -struct DefaultScalarFactory : public ScalarFactoryTest { - static constexpr auto factory = cudf::make_default_constructed_scalar; -}; +struct DefaultScalarFactory : public ScalarFactoryTest {}; using MixedTypes = cudf::test::Concat; TYPED_TEST_SUITE(DefaultScalarFactory, MixedTypes); @@ -102,7 +93,7 @@ TYPED_TEST_SUITE(DefaultScalarFactory, MixedTypes); TYPED_TEST(DefaultScalarFactory, FactoryDefault) { std::unique_ptr s = - this->factory(cudf::data_type{cudf::type_to_id()}, this->stream(), this->mr()); + cudf::make_default_constructed_scalar(cudf::data_type{cudf::type_to_id()}); EXPECT_EQ(s->type(), cudf::data_type{cudf::type_to_id()}); EXPECT_FALSE(s->is_valid()); @@ -111,7 +102,7 @@ TYPED_TEST(DefaultScalarFactory, FactoryDefault) TYPED_TEST(DefaultScalarFactory, TypeCast) { std::unique_ptr s = - this->factory(cudf::data_type{cudf::type_to_id()}, this->stream(), this->mr()); + cudf::make_default_constructed_scalar(cudf::data_type{cudf::type_to_id()}); auto numeric_s = static_cast*>(s.get()); @@ -129,8 +120,7 @@ TYPED_TEST(FixedWidthScalarFactory, ValueProvided) { TypeParam value = cudf::test::make_type_param_scalar(54); - std::unique_ptr s = - cudf::make_fixed_width_scalar(value, this->stream(), this->mr()); + std::unique_ptr s = cudf::make_fixed_width_scalar(value); auto numeric_s = static_cast*>(s.get()); @@ -150,9 +140,8 @@ TYPED_TEST(FixedPointScalarFactory, ValueProvided) using namespace numeric; using decimalXX = TypeParam; - auto const rep_value = static_cast(123); - auto const s = - cudf::make_fixed_point_scalar(123, scale_type{-2}, this->stream(), this->mr()); + auto const rep_value = static_cast(123); + auto const s = cudf::make_fixed_point_scalar(123, scale_type{-2}); auto const fp_s = static_cast*>(s.get()); auto const expected_dtype = cudf::data_type{cudf::type_to_id(), -2}; diff --git a/cpp/tests/wrappers/timestamps_test.cu b/cpp/tests/wrappers/timestamps_test.cu index e6c65b4e0e4..f7d3df18ffd 100644 --- a/cpp/tests/wrappers/timestamps_test.cu +++ b/cpp/tests/wrappers/timestamps_test.cu @@ -38,7 +38,6 @@ template struct ChronoColumnTest : public cudf::test::BaseFixture { - rmm::cuda_stream_view stream() { return cudf::get_default_stream(); } cudf::size_type size() { return cudf::size_type(100); } cudf::data_type type() { return cudf::data_type{cudf::type_to_id()}; } }; @@ -188,9 +187,7 @@ TYPED_TEST(ChronoColumnTest, ChronoFactoryNullMaskAsParm) auto column = make_fixed_width_column(cudf::data_type{cudf::type_to_id()}, this->size(), std::move(null_mask), - this->size(), - this->stream(), - this->mr()); + this->size()); EXPECT_EQ(column->type(), cudf::data_type{cudf::type_to_id()}); EXPECT_EQ(column->size(), this->size()); EXPECT_EQ(this->size(), column->null_count()); @@ -202,12 +199,8 @@ TYPED_TEST(ChronoColumnTest, ChronoFactoryNullMaskAsParm) TYPED_TEST(ChronoColumnTest, ChronoFactoryNullMaskAsEmptyParm) { rmm::device_buffer null_mask{}; - auto column = make_fixed_width_column(cudf::data_type{cudf::type_to_id()}, - this->size(), - std::move(null_mask), - 0, - this->stream(), - this->mr()); + auto column = make_fixed_width_column( + cudf::data_type{cudf::type_to_id()}, this->size(), std::move(null_mask), 0); EXPECT_EQ(column->type(), cudf::data_type{cudf::type_to_id()}); EXPECT_EQ(column->size(), this->size()); From 2201bc1ced331d4867307bbbee31244aeba46002 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Thu, 7 Sep 2023 15:10:05 -0700 Subject: [PATCH 2/4] 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 {}; From 00fad03ec829d845078daadebcd71511e572c098 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Fri, 8 Sep 2023 13:44:02 -0700 Subject: [PATCH 3/4] Revert "Try reverting base_fixture change" This reverts commit 2201bc1ced331d4867307bbbee31244aeba46002. --- cpp/include/cudf_test/base_fixture.hpp | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/cpp/include/cudf_test/base_fixture.hpp b/cpp/include/cudf_test/base_fixture.hpp index 05319e03003..a29ac092c83 100644 --- a/cpp/include/cudf_test/base_fixture.hpp +++ b/cpp/include/cudf_test/base_fixture.hpp @@ -47,17 +47,7 @@ namespace test { * class MyTestFixture : public cudf::test::BaseFixture {}; * ``` */ -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; } -}; +class BaseFixture : public ::testing::Test {}; /** * @brief Base test fixture that takes a parameter. @@ -68,17 +58,7 @@ class BaseFixture : public ::testing::Test { * ``` */ template -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; } -}; +class BaseFixtureWithParam : public ::testing::TestWithParam {}; template struct uniform_distribution_impl {}; From 550c112c6af77267e81dab990e627f3233c8f6fb Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Fri, 8 Sep 2023 16:39:49 -0700 Subject: [PATCH 4/4] Revert "Revert "Try reverting base_fixture change"" This reverts commit 00fad03ec829d845078daadebcd71511e572c098. --- 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 {};