Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove cudf::test::print calls from libcudf gtests #12604

Merged
merged 12 commits into from
Jan 31, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions cpp/tests/copying/split_tests.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019-2022, NVIDIA CORPORATION.
* Copyright (c) 2019-2023, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -1268,9 +1268,6 @@ thrust::make_counting_iterator(10000));
thrust::make_counting_iterator(expected.num_columns()),
[&expected, &result](cudf::size_type i){

// printf("col: ");
// cudf::test::print(result.table.column(i));
// printf("\n");
CUDF_TEST_EXPECT_COLUMNS_EQUIVALENT(expected.column(i), result.table.column(i));
});
},
Expand Down
34 changes: 1 addition & 33 deletions cpp/tests/join/join_tests.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019-2022, NVIDIA CORPORATION.
* Copyright (c) 2019-2023, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -341,14 +341,6 @@ TEST_F(JoinTest, FullJoinOnNulls)
auto result_sort_order = cudf::sorted_order(result->view());
auto sorted_result = cudf::gather(result->view(), *result_sort_order);

#if 0
std::cout << "Actual Results:\n";
cudf::test::print(sorted_result->get_column(0).view(), std::cout, ",\t\t");
cudf::test::print(sorted_result->get_column(1).view(), std::cout, ",\t\t");
cudf::test::print(sorted_result->get_column(2).view(), std::cout, ",\t\t");
cudf::test::print(sorted_result->get_column(3).view(), std::cout, ",\t\t");
#endif

column_wrapper<int32_t> col_gold_0{{ 3, -1, -1, -1},
{ 1, 0, 0, 0}};
strcol_wrapper col_gold_1{{ "s0", "s1", "", ""},
Expand All @@ -373,14 +365,6 @@ TEST_F(JoinTest, FullJoinOnNulls)
auto gold_sort_order = cudf::sorted_order(gold.view());
auto sorted_gold = cudf::gather(gold.view(), *gold_sort_order);

#if 0
std::cout << "Expected Results:\n";
cudf::test::print(sorted_gold->get_column(0).view(), std::cout, ",\t\t");
cudf::test::print(sorted_gold->get_column(1).view(), std::cout, ",\t\t");
cudf::test::print(sorted_gold->get_column(2).view(), std::cout, ",\t\t");
cudf::test::print(sorted_gold->get_column(3).view(), std::cout, ",\t\t");
#endif

CUDF_TEST_EXPECT_TABLES_EQUIVALENT(*sorted_gold, *sorted_result);

// Repeat test with compare_nulls_equal=false,
Expand Down Expand Up @@ -631,14 +615,6 @@ TEST_F(JoinTest, LeftJoinOnNulls)
auto result_sort_order = cudf::sorted_order(result->view());
auto sorted_result = cudf::gather(result->view(), *result_sort_order);

#if 0
std::cout << "Actual Results:\n";
cudf::test::print(sorted_result->get_column(0).view(), std::cout, ",\t\t");
cudf::test::print(sorted_result->get_column(1).view(), std::cout, ",\t\t");
cudf::test::print(sorted_result->get_column(2).view(), std::cout, ",\t\t");
cudf::test::print(sorted_result->get_column(3).view(), std::cout, ",\t\t");
#endif

column_wrapper<int32_t> col_gold_0{{ 3, -1, 2},
{ 1, 0, 1}};
strcol_wrapper col_gold_1({ "s0", "s1", "s2"},
Expand All @@ -664,14 +640,6 @@ TEST_F(JoinTest, LeftJoinOnNulls)
auto gold_sort_order = cudf::sorted_order(gold.view());
auto sorted_gold = cudf::gather(gold.view(), *gold_sort_order);

#if 0
std::cout << "Expected Results:\n";
cudf::test::print(sorted_gold->get_column(0).view(), std::cout, ",\t\t");
cudf::test::print(sorted_gold->get_column(1).view(), std::cout, ",\t\t");
cudf::test::print(sorted_gold->get_column(2).view(), std::cout, ",\t\t");
cudf::test::print(sorted_gold->get_column(3).view(), std::cout, ",\t\t");
#endif

CUDF_TEST_EXPECT_TABLES_EQUIVALENT(*sorted_gold, *sorted_result);

// Repeat test with compare_nulls_equal=false,
Expand Down
12 changes: 3 additions & 9 deletions cpp/tests/sort/rank_test.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020-2022, NVIDIA CORPORATION.
* Copyright (c) 2020-2023, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -37,18 +37,13 @@ void run_rank_test(cudf::table_view input,
cudf::order column_order,
cudf::null_policy null_handling,
cudf::null_order null_precedence,
bool percentage,
bool debug = false)
bool percentage)
{
int i = 0;
for (auto&& input_column : input) {
// Rank
auto got_rank_column =
cudf::rank(input_column, method, column_order, null_handling, null_precedence, percentage);
if (debug) {
cudf::test::print(got_rank_column->view());
std::cout << "\n";
}
CUDF_TEST_EXPECT_COLUMNS_EQUAL(expected.column(i), got_rank_column->view());
i++;
}
Expand Down Expand Up @@ -101,8 +96,7 @@ struct Rank : public cudf::test::BaseFixture {
std::get<0>(input_arg),
std::get<1>(input_arg),
std::get<2>(input_arg),
percentage,
false);
percentage);
}
}
};
Expand Down
2 changes: 0 additions & 2 deletions cpp/tests/sort/sort_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -932,12 +932,10 @@ TYPED_TEST(Sort, MoreLists)
{
lcw col{lcw{lcw{}, lcw{-729297378, -627961465}},
lcw{lcw{{0}, null_at(0)}, lcw{881899016, -1415270016}}};
cudf::test::print(col);

{
cudf::test::fixed_width_column_wrapper<int32_t> expected{{0, 1}};
auto result = cudf::sorted_order(cudf::table_view({col}));
cudf::test::print(cudf::table_view({col}).column(0));
CUDF_TEST_EXPECT_COLUMNS_EQUAL(expected, *result);
}
}
Expand Down