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

Use cuda::proclaim_return_type on device lambda. #2048

Merged
merged 1 commit into from
Dec 8, 2023

Conversation

bdice
Copy link
Contributor

@bdice bdice commented Dec 7, 2023

This PR is needed to change the one piece of RAFT that requires cuda::proclaim_return_type for compatibility with CCCL (Thrust) 2.2.0. This pulls out part of the diff of #1464, which we will be able to close in favor of a new PR after this is merged.

@bdice bdice requested a review from a team as a code owner December 7, 2023 03:13
@github-actions github-actions bot added the cpp label Dec 7, 2023
@bdice bdice added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Dec 7, 2023
@bdice bdice self-assigned this Dec 7, 2023
Comment on lines +112 to +121
return thrust::reduce(
thrust_policy,
buffer_.data(),
buffer_.data() + buffer_.size(),
value_type{0},
cuda::proclaim_return_type<value_type>([] __device__(auto left, auto right) {
auto abs_left = left > 0 ? left : -left;
auto abs_right = right > 0 ? right : -right;
return abs_left + abs_right;
}));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the only place in RAFT that uses a device lambda along with thrust?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can tell, yes. RAFT builds with only this change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I built cuGraph successfully with only this change, too.

@bdice bdice requested a review from divyegala December 8, 2023 17:59
@bdice
Copy link
Contributor Author

bdice commented Dec 8, 2023

/merge

@rapids-bot rapids-bot bot merged commit 5e80c1d into rapidsai:branch-24.02 Dec 8, 2023
61 checks passed
@bdice bdice deleted the cccl-2.2.0-support branch December 8, 2023 18:14
rapids-bot bot pushed a commit that referenced this pull request Dec 19, 2023
This PR updates RAFT to CCCL 2.2.0. Do not merge until all of RAPIDS is ready to update.

Depends on #2048.

Replaces #1464.

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

Approvers:
  - Vyas Ramasubramani (https://github.com/vyasr)
  - Robert Maynard (https://github.com/robertmaynard)

URL: #2049
ChristinaZ pushed a commit to ChristinaZ/raft that referenced this pull request Jan 17, 2024
This PR updates RAFT to CCCL 2.2.0. Do not merge until all of RAPIDS is ready to update.

Depends on rapidsai#2048.

Replaces rapidsai#1464.

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

Approvers:
  - Vyas Ramasubramani (https://github.com/vyasr)
  - Robert Maynard (https://github.com/robertmaynard)

URL: rapidsai#2049
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cpp improvement Improvement / enhancement to an existing function non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants