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

Deprecate DeviceSegmentedReduce::Arg{Min,Max} interface that returns result as cub::KeyValuePair #3482

Open
elstehle opened this issue Jan 22, 2025 · 0 comments
Assignees

Comments

@elstehle
Copy link
Collaborator

elstehle commented Jan 22, 2025

After thinking about this more, I came to the conclusion that returning an Array-of-Structs (AoS) is actually preferable for the DeviceSegmentedReduce. It is flexible in the sense that users can write to an AoS or, using a zip or transform iterator, writing to two distinct output iterators.

While it would be possible to also implement both versions with an interface that takes two distinct iterators, one for the extrema and one for their indexes by using an iterator like proposed in #3698, it would likely be less efficient, as it would require two memory transactions for writing the two members. Whereas, this scenario could be done in a single memory transaction writing the whole (extremum, index)-tuple at once, when using the single output iterator.

Ultimately, we want to transition to returning a ::cuda::std::pair or ::cuda::std::tuple instead of a cub::KeyValuePair.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

1 participant