From a8c1ba313686d40914f6e33c8f1157279931d71a Mon Sep 17 00:00:00 2001 From: David Wendt Date: Wed, 22 Mar 2023 18:19:19 -0400 Subject: [PATCH] Fix gtest column utility comparator diff reporting --- cpp/tests/utilities/column_utilities.cu | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/cpp/tests/utilities/column_utilities.cu b/cpp/tests/utilities/column_utilities.cu index 3a94aac1cc9..133ca99b31f 100644 --- a/cpp/tests/utilities/column_utilities.cu +++ b/cpp/tests/utilities/column_utilities.cu @@ -543,7 +543,7 @@ struct column_comparator_impl { auto const comparator = cudf::experimental::row::equality::two_table_comparator{ lhs_tview, rhs_tview, cudf::get_default_stream()}; - auto const has_nulls = cudf::has_nested_nulls(lhs_tview) or cudf::has_nested_nulls(rhs_tview); + auto const has_nulls = cudf::has_nulls(lhs_tview) or cudf::has_nulls(rhs_tview); auto const device_comparator = comparator.equal_to(cudf::nullate::DYNAMIC{has_nulls}); @@ -556,18 +556,22 @@ struct column_comparator_impl { lhs_row_indices.size(), cudf::get_default_stream()); // worst case: everything different auto input_iter = thrust::make_counting_iterator(0); + auto diff_map = rmm::device_uvector(lhs_row_indices.size(), cudf::get_default_stream()); + thrust::transform( rmm::exec_policy(cudf::get_default_stream()), input_iter, input_iter + lhs_row_indices.size(), - differences.begin(), + diff_map.begin(), ComparatorType( *d_lhs_row_indices, *d_rhs_row_indices, fp_ulps, device_comparator, *d_lhs, *d_rhs)); - auto diff_iter = thrust::remove(rmm::exec_policy(cudf::get_default_stream()), - differences.begin(), - differences.end(), - 0); // remove the zero entries + auto diff_iter = thrust::copy_if(rmm::exec_policy(cudf::get_default_stream()), + input_iter, + input_iter + lhs_row_indices.size(), + diff_map.begin(), + differences.begin(), + thrust::identity{}); differences.resize(thrust::distance(differences.begin(), diff_iter), cudf::get_default_stream()); // shrink back down