Skip to content

Use cuda::proclaim_return_type on device lambda.#2048

Merged
rapids-bot[bot] merged 1 commit into
NVIDIA:branch-24.02from
bdice:cccl-2.2.0-support
Dec 8, 2023
Merged

Use cuda::proclaim_return_type on device lambda.#2048
rapids-bot[bot] merged 1 commit into
NVIDIA:branch-24.02from
bdice:cccl-2.2.0-support

Conversation

@bdice

@bdice bdice commented Dec 7, 2023

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
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

bdice commented Dec 8, 2023

Copy link
Copy Markdown
Contributor Author

/merge

@rapids-bot rapids-bot Bot merged commit 5e80c1d into NVIDIA:branch-24.02 Dec 8, 2023
@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 NVIDIA#2048.

Replaces NVIDIA#1464.

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

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

URL: NVIDIA#2049
loulankxh pushed a commit to loulankxh/raft that referenced this pull request Oct 14, 2025
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 NVIDIA#1464, which we will be able to close in favor of a new PR after this is merged.

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

Approvers:
  - Divye Gala (https://github.com/divyegala)

URL: NVIDIA#2048
loulankxh pushed a commit to loulankxh/raft that referenced this pull request Oct 14, 2025
This PR updates RAFT to CCCL 2.2.0. Do not merge until all of RAPIDS is ready to update.

Depends on NVIDIA#2048.

Replaces NVIDIA#1464.

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

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

URL: NVIDIA#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