Skip to content

Commit

Permalink
Use provided memory resource for allocating mixed join results. (#16153)
Browse files Browse the repository at this point in the history
This PR fixes a few places where certain code paths for mixed joins are not using the user-provided memory resource.

Authors:
  - Bradley Dice (https://github.com/bdice)

Approvers:
  - Mark Harris (https://github.com/harrism)
  - David Wendt (https://github.com/davidwendt)

URL: #16153
  • Loading branch information
bdice authored Jul 2, 2024
1 parent 04e3aa9 commit 31ed9fd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
7 changes: 2 additions & 5 deletions cpp/src/join/mixed_join.cu
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,7 @@ mixed_join(
// Left and full joins all return all the row indices from
// left with a corresponding NULL from the right.
case join_kind::LEFT_JOIN:
case join_kind::FULL_JOIN:
return get_trivial_left_join_indices(
left_conditional, stream, rmm::mr::get_current_device_resource());
case join_kind::FULL_JOIN: return get_trivial_left_join_indices(left_conditional, stream, mr);
// Inner joins return empty output because no matches can exist.
case join_kind::INNER_JOIN:
return std::pair(std::make_unique<rmm::device_uvector<size_type>>(0, stream, mr),
Expand All @@ -100,8 +98,7 @@ mixed_join(
std::make_unique<rmm::device_uvector<size_type>>(0, stream, mr));
// Full joins need to return the trivial complement.
case join_kind::FULL_JOIN: {
auto ret_flipped = get_trivial_left_join_indices(
right_conditional, stream, rmm::mr::get_current_device_resource());
auto ret_flipped = get_trivial_left_join_indices(right_conditional, stream, mr);
return std::pair(std::move(ret_flipped.second), std::move(ret_flipped.first));
}
default: CUDF_FAIL("Invalid join kind."); break;
Expand Down
4 changes: 1 addition & 3 deletions cpp/src/join/mixed_join_semi.cu
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,7 @@ std::unique_ptr<rmm::device_uvector<size_type>> mixed_join_semi(
// Anti and semi return all the row indices from left
// with a corresponding NULL from the right.
case join_kind::LEFT_ANTI_JOIN:
return get_trivial_left_join_indices(
left_conditional, stream, rmm::mr::get_current_device_resource())
.first;
return get_trivial_left_join_indices(left_conditional, stream, mr).first;
// Inner and left semi joins return empty output because no matches can exist.
case join_kind::LEFT_SEMI_JOIN:
return std::make_unique<rmm::device_uvector<size_type>>(0, stream, mr);
Expand Down

0 comments on commit 31ed9fd

Please sign in to comment.