Skip to content

Commit

Permalink
exposed stream-ordering to join API
Browse files Browse the repository at this point in the history
  • Loading branch information
lamarrr committed Sep 11, 2024
1 parent 750adca commit ab2c643
Show file tree
Hide file tree
Showing 9 changed files with 111 additions and 65 deletions.
44 changes: 44 additions & 0 deletions cpp/include/cudf/join.hpp

Large diffs are not rendered by default.

74 changes: 25 additions & 49 deletions cpp/src/join/conditional_join.cu
Original file line number Diff line number Diff line change
Expand Up @@ -377,16 +377,12 @@ conditional_inner_join(table_view const& left,
table_view const& right,
ast::expression const& binary_predicate,
std::optional<std::size_t> output_size,
rmm::cuda_stream_view stream,
rmm::device_async_resource_ref mr)
{
CUDF_FUNC_RANGE();
return detail::conditional_join(left,
right,
binary_predicate,
detail::join_kind::INNER_JOIN,
output_size,
cudf::get_default_stream(),
mr);
return detail::conditional_join(
left, right, binary_predicate, detail::join_kind::INNER_JOIN, output_size, stream, mr);
}

std::pair<std::unique_ptr<rmm::device_uvector<size_type>>,
Expand All @@ -395,115 +391,95 @@ conditional_left_join(table_view const& left,
table_view const& right,
ast::expression const& binary_predicate,
std::optional<std::size_t> output_size,
rmm::cuda_stream_view stream,
rmm::device_async_resource_ref mr)
{
CUDF_FUNC_RANGE();
return detail::conditional_join(left,
right,
binary_predicate,
detail::join_kind::LEFT_JOIN,
output_size,
cudf::get_default_stream(),
mr);
return detail::conditional_join(
left, right, binary_predicate, detail::join_kind::LEFT_JOIN, output_size, stream, mr);
}

std::pair<std::unique_ptr<rmm::device_uvector<size_type>>,
std::unique_ptr<rmm::device_uvector<size_type>>>
conditional_full_join(table_view const& left,
table_view const& right,
ast::expression const& binary_predicate,
rmm::cuda_stream_view stream,
rmm::device_async_resource_ref mr)
{
CUDF_FUNC_RANGE();
return detail::conditional_join(left,
right,
binary_predicate,
detail::join_kind::FULL_JOIN,
{},
cudf::get_default_stream(),
mr);
return detail::conditional_join(
left, right, binary_predicate, detail::join_kind::FULL_JOIN, {}, stream, mr);
}

std::unique_ptr<rmm::device_uvector<size_type>> conditional_left_semi_join(
table_view const& left,
table_view const& right,
ast::expression const& binary_predicate,
std::optional<std::size_t> output_size,
rmm::cuda_stream_view stream,
rmm::device_async_resource_ref mr)
{
CUDF_FUNC_RANGE();
return detail::conditional_join_anti_semi(left,
right,
binary_predicate,
detail::join_kind::LEFT_SEMI_JOIN,
output_size,
cudf::get_default_stream(),
mr);
return detail::conditional_join_anti_semi(
left, right, binary_predicate, detail::join_kind::LEFT_SEMI_JOIN, output_size, stream, mr);
}

std::unique_ptr<rmm::device_uvector<size_type>> conditional_left_anti_join(
table_view const& left,
table_view const& right,
ast::expression const& binary_predicate,
std::optional<std::size_t> output_size,
rmm::cuda_stream_view stream,
rmm::device_async_resource_ref mr)
{
CUDF_FUNC_RANGE();
return detail::conditional_join_anti_semi(left,
right,
binary_predicate,
detail::join_kind::LEFT_ANTI_JOIN,
output_size,
cudf::get_default_stream(),
mr);
return detail::conditional_join_anti_semi(
left, right, binary_predicate, detail::join_kind::LEFT_ANTI_JOIN, output_size, stream, mr);
}

std::size_t conditional_inner_join_size(table_view const& left,
table_view const& right,
ast::expression const& binary_predicate,
rmm::cuda_stream_view stream,
rmm::device_async_resource_ref mr)
{
CUDF_FUNC_RANGE();
return detail::compute_conditional_join_output_size(
left, right, binary_predicate, detail::join_kind::INNER_JOIN, cudf::get_default_stream(), mr);
left, right, binary_predicate, detail::join_kind::INNER_JOIN, stream, mr);
}

std::size_t conditional_left_join_size(table_view const& left,
table_view const& right,
ast::expression const& binary_predicate,
rmm::cuda_stream_view stream,
rmm::device_async_resource_ref mr)
{
CUDF_FUNC_RANGE();
return detail::compute_conditional_join_output_size(
left, right, binary_predicate, detail::join_kind::LEFT_JOIN, cudf::get_default_stream(), mr);
left, right, binary_predicate, detail::join_kind::LEFT_JOIN, stream, mr);
}

std::size_t conditional_left_semi_join_size(table_view const& left,
table_view const& right,
ast::expression const& binary_predicate,
rmm::cuda_stream_view stream,
rmm::device_async_resource_ref mr)
{
CUDF_FUNC_RANGE();
return detail::compute_conditional_join_output_size(left,
right,
binary_predicate,
detail::join_kind::LEFT_SEMI_JOIN,
cudf::get_default_stream(),
mr);
return detail::compute_conditional_join_output_size(
left, right, binary_predicate, detail::join_kind::LEFT_SEMI_JOIN, stream, mr);
}

std::size_t conditional_left_anti_join_size(table_view const& left,
table_view const& right,
ast::expression const& binary_predicate,
rmm::cuda_stream_view stream,
rmm::device_async_resource_ref mr)
{
CUDF_FUNC_RANGE();
return detail::compute_conditional_join_output_size(left,
right,
binary_predicate,
detail::join_kind::LEFT_ANTI_JOIN,
cudf::get_default_stream(),
mr);
return detail::compute_conditional_join_output_size(
left, right, binary_predicate, detail::join_kind::LEFT_ANTI_JOIN, stream, mr);
}

} // namespace cudf
3 changes: 2 additions & 1 deletion cpp/src/join/cross_join.cu
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,11 @@ std::unique_ptr<cudf::table> cross_join(cudf::table_view const& left,

std::unique_ptr<cudf::table> cross_join(cudf::table_view const& left,
cudf::table_view const& right,
rmm::cuda_stream_view stream,
rmm::device_async_resource_ref mr)
{
CUDF_FUNC_RANGE();
return detail::cross_join(left, right, cudf::get_default_stream(), mr);
return detail::cross_join(left, right, stream, mr);
}

} // namespace cudf
9 changes: 6 additions & 3 deletions cpp/src/join/join.cu
Original file line number Diff line number Diff line change
Expand Up @@ -120,32 +120,35 @@ std::pair<std::unique_ptr<rmm::device_uvector<size_type>>,
inner_join(table_view const& left,
table_view const& right,
null_equality compare_nulls,
rmm::cuda_stream_view stream,
rmm::device_async_resource_ref mr)
{
CUDF_FUNC_RANGE();
return detail::inner_join(left, right, compare_nulls, cudf::get_default_stream(), mr);
return detail::inner_join(left, right, compare_nulls, stream, mr);
}

std::pair<std::unique_ptr<rmm::device_uvector<size_type>>,
std::unique_ptr<rmm::device_uvector<size_type>>>
left_join(table_view const& left,
table_view const& right,
null_equality compare_nulls,
rmm::cuda_stream_view stream,
rmm::device_async_resource_ref mr)
{
CUDF_FUNC_RANGE();
return detail::left_join(left, right, compare_nulls, cudf::get_default_stream(), mr);
return detail::left_join(left, right, compare_nulls, stream, mr);
}

std::pair<std::unique_ptr<rmm::device_uvector<size_type>>,
std::unique_ptr<rmm::device_uvector<size_type>>>
full_join(table_view const& left,
table_view const& right,
null_equality compare_nulls,
rmm::cuda_stream_view stream,
rmm::device_async_resource_ref mr)
{
CUDF_FUNC_RANGE();
return detail::full_join(left, right, compare_nulls, cudf::get_default_stream(), mr);
return detail::full_join(left, right, compare_nulls, stream, mr);
}

} // namespace cudf
15 changes: 10 additions & 5 deletions cpp/src/join/mixed_join.cu
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,7 @@ mixed_inner_join(
ast::expression const& binary_predicate,
null_equality compare_nulls,
std::optional<std::pair<std::size_t, device_span<size_type const>>> const output_size_data,
rmm::cuda_stream_view stream,
rmm::device_async_resource_ref mr)
{
CUDF_FUNC_RANGE();
Expand All @@ -495,7 +496,7 @@ mixed_inner_join(
compare_nulls,
detail::join_kind::INNER_JOIN,
output_size_data,
cudf::get_default_stream(),
stream,
mr);
}

Expand All @@ -506,6 +507,7 @@ std::pair<std::size_t, std::unique_ptr<rmm::device_uvector<size_type>>> mixed_in
table_view const& right_conditional,
ast::expression const& binary_predicate,
null_equality compare_nulls,
rmm::cuda_stream_view stream,
rmm::device_async_resource_ref mr)
{
CUDF_FUNC_RANGE();
Expand All @@ -516,7 +518,7 @@ std::pair<std::size_t, std::unique_ptr<rmm::device_uvector<size_type>>> mixed_in
binary_predicate,
compare_nulls,
detail::join_kind::INNER_JOIN,
cudf::get_default_stream(),
stream,
mr);
}

Expand All @@ -530,6 +532,7 @@ mixed_left_join(
ast::expression const& binary_predicate,
null_equality compare_nulls,
std::optional<std::pair<std::size_t, device_span<size_type const>>> const output_size_data,
rmm::cuda_stream_view stream,
rmm::device_async_resource_ref mr)
{
CUDF_FUNC_RANGE();
Expand All @@ -541,7 +544,7 @@ mixed_left_join(
compare_nulls,
detail::join_kind::LEFT_JOIN,
output_size_data,
cudf::get_default_stream(),
stream,
mr);
}

Expand All @@ -552,6 +555,7 @@ std::pair<std::size_t, std::unique_ptr<rmm::device_uvector<size_type>>> mixed_le
table_view const& right_conditional,
ast::expression const& binary_predicate,
null_equality compare_nulls,
rmm::cuda_stream_view stream,
rmm::device_async_resource_ref mr)
{
CUDF_FUNC_RANGE();
Expand All @@ -562,7 +566,7 @@ std::pair<std::size_t, std::unique_ptr<rmm::device_uvector<size_type>>> mixed_le
binary_predicate,
compare_nulls,
detail::join_kind::LEFT_JOIN,
cudf::get_default_stream(),
stream,
mr);
}

Expand All @@ -576,6 +580,7 @@ mixed_full_join(
ast::expression const& binary_predicate,
null_equality compare_nulls,
std::optional<std::pair<std::size_t, device_span<size_type const>>> const output_size_data,
rmm::cuda_stream_view stream,
rmm::device_async_resource_ref mr)
{
CUDF_FUNC_RANGE();
Expand All @@ -587,7 +592,7 @@ mixed_full_join(
compare_nulls,
detail::join_kind::FULL_JOIN,
output_size_data,
cudf::get_default_stream(),
stream,
mr);
}

Expand Down
6 changes: 4 additions & 2 deletions cpp/src/join/mixed_join_semi.cu
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ std::unique_ptr<rmm::device_uvector<size_type>> mixed_left_semi_join(
table_view const& right_conditional,
ast::expression const& binary_predicate,
null_equality compare_nulls,
rmm::cuda_stream_view stream,
rmm::device_async_resource_ref mr)
{
CUDF_FUNC_RANGE();
Expand All @@ -277,7 +278,7 @@ std::unique_ptr<rmm::device_uvector<size_type>> mixed_left_semi_join(
binary_predicate,
compare_nulls,
detail::join_kind::LEFT_SEMI_JOIN,
cudf::get_default_stream(),
stream,
mr);
}

Expand All @@ -288,6 +289,7 @@ std::unique_ptr<rmm::device_uvector<size_type>> mixed_left_anti_join(
table_view const& right_conditional,
ast::expression const& binary_predicate,
null_equality compare_nulls,
rmm::cuda_stream_view stream,
rmm::device_async_resource_ref mr)
{
CUDF_FUNC_RANGE();
Expand All @@ -298,7 +300,7 @@ std::unique_ptr<rmm::device_uvector<size_type>> mixed_left_anti_join(
binary_predicate,
compare_nulls,
detail::join_kind::LEFT_ANTI_JOIN,
cudf::get_default_stream(),
stream,
mr);
}

Expand Down
6 changes: 4 additions & 2 deletions cpp/src/join/semi_join.cu
Original file line number Diff line number Diff line change
Expand Up @@ -98,22 +98,24 @@ std::unique_ptr<rmm::device_uvector<cudf::size_type>> left_semi_join(
cudf::table_view const& left,
cudf::table_view const& right,
null_equality compare_nulls,
rmm::cuda_stream_view stream,
rmm::device_async_resource_ref mr)
{
CUDF_FUNC_RANGE();
return detail::left_semi_anti_join(
detail::join_kind::LEFT_SEMI_JOIN, left, right, compare_nulls, cudf::get_default_stream(), mr);
detail::join_kind::LEFT_SEMI_JOIN, left, right, compare_nulls, stream, mr);
}

std::unique_ptr<rmm::device_uvector<cudf::size_type>> left_anti_join(
cudf::table_view const& left,
cudf::table_view const& right,
null_equality compare_nulls,
rmm::cuda_stream_view stream,
rmm::device_async_resource_ref mr)
{
CUDF_FUNC_RANGE();
return detail::left_semi_anti_join(
detail::join_kind::LEFT_ANTI_JOIN, left, right, compare_nulls, cudf::get_default_stream(), mr);
detail::join_kind::LEFT_ANTI_JOIN, left, right, compare_nulls, stream, mr);
}

} // namespace cudf
Loading

0 comments on commit ab2c643

Please sign in to comment.