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

stable_distinct public api now has a stream parameter #16068

Merged
1 change: 0 additions & 1 deletion cpp/include/cudf/detail/stream_compaction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ std::unique_ptr<table> distinct(table_view const& input,
/**
* @copydoc cudf::stable_distinct
*
robertmaynard marked this conversation as resolved.
Show resolved Hide resolved
* @param stream CUDA stream used for device memory operations and kernel launches.
*/
std::unique_ptr<table> stable_distinct(table_view const& input,
std::vector<size_type> const& keys,
Expand Down
2 changes: 2 additions & 0 deletions cpp/include/cudf/stream_compaction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ std::unique_ptr<column> distinct_indices(
* @param keep Copy any, first, last, or none of the found duplicates
* @param nulls_equal Flag to specify whether null elements should be considered as equal
* @param nans_equal Flag to specify whether NaN elements should be considered as equal
* @param stream CUDA stream used for device memory operations and kernel launches.
* @param mr Device memory resource used to allocate the returned table
* @return Table with distinct rows, preserving input order
*/
Expand All @@ -329,6 +330,7 @@ std::unique_ptr<table> stable_distinct(
duplicate_keep_option keep = duplicate_keep_option::KEEP_ANY,
null_equality nulls_equal = null_equality::EQUAL,
nan_equality nans_equal = nan_equality::ALL_EQUAL,
rmm::cuda_stream_view stream = cudf::get_default_stream(),
ttnghia marked this conversation as resolved.
Show resolved Hide resolved
rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource());

/**
Expand Down
28 changes: 14 additions & 14 deletions cpp/src/lists/set_operations.cu
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,13 @@ std::unique_ptr<column> intersect_distinct(lists_column_view const& lhs,
rmm::mr::get_current_device_resource());

// A stable algorithm is required to ensure that list labels remain contiguous.
auto out_table = cudf::detail::stable_distinct(intersect_table->view(),
{0, 1}, // indices of key columns
duplicate_keep_option::KEEP_ANY,
nulls_equal,
nans_equal,
stream,
mr);
auto out_table = cudf::stable_distinct(intersect_table->view(),
robertmaynard marked this conversation as resolved.
Show resolved Hide resolved
{0, 1}, // indices of key columns
duplicate_keep_option::KEEP_ANY,
nulls_equal,
nans_equal,
stream,
mr);

auto const num_rows = lhs.size();
auto out_offsets = reconstruct_offsets(out_table->get_column(0).view(), num_rows, stream, mr);
Expand Down Expand Up @@ -246,13 +246,13 @@ std::unique_ptr<column> difference_distinct(lists_column_view const& lhs,
rmm::mr::get_current_device_resource());

// A stable algorithm is required to ensure that list labels remain contiguous.
auto out_table = cudf::detail::stable_distinct(difference_table->view(),
{0, 1}, // indices of key columns
duplicate_keep_option::KEEP_ANY,
nulls_equal,
nans_equal,
stream,
mr);
auto out_table = cudf::stable_distinct(difference_table->view(),
{0, 1}, // indices of key columns
duplicate_keep_option::KEEP_ANY,
nulls_equal,
nans_equal,
stream,
mr);

auto const num_rows = lhs.size();
auto out_offsets = reconstruct_offsets(out_table->get_column(0).view(), num_rows, stream, mr);
Expand Down
14 changes: 7 additions & 7 deletions cpp/src/lists/stream_compaction/distinct.cu
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ std::unique_ptr<column> distinct(lists_column_view const& input,
generate_labels(input, child.size(), stream, rmm::mr::get_current_device_resource());

auto const distinct_table =
cudf::detail::stable_distinct(table_view{{labels->view(), child}}, // input table
std::vector<size_type>{0, 1}, // keys
duplicate_keep_option::KEEP_ANY,
nulls_equal,
nans_equal,
stream,
mr);
cudf::stable_distinct(table_view{{labels->view(), child}}, // input table
std::vector<size_type>{0, 1}, // keys
duplicate_keep_option::KEEP_ANY,
nulls_equal,
nans_equal,
stream,
mr);

auto out_offsets =
reconstruct_offsets(distinct_table->get_column(0).view(), input.size(), stream, mr);
Expand Down
4 changes: 2 additions & 2 deletions cpp/src/stream_compaction/stable_distinct.cu
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@ std::unique_ptr<table> stable_distinct(table_view const& input,
duplicate_keep_option keep,
null_equality nulls_equal,
nan_equality nans_equal,
rmm::cuda_stream_view stream,
rmm::device_async_resource_ref mr)
{
CUDF_FUNC_RANGE();
return detail::stable_distinct(
input, keys, keep, nulls_equal, nans_equal, cudf::get_default_stream(), mr);
return detail::stable_distinct(input, keys, keep, nulls_equal, nans_equal, stream, mr);
robertmaynard marked this conversation as resolved.
Show resolved Hide resolved
}

} // namespace cudf
Loading