NVIDIA / NVIDIA/cccl

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

Open
#3,482 0 comments 0 reactions 1 assignee Claimed by @elstehle View on GitHub
Dominant language
C++
Stars
2.5k
Forks
486
Avg merge
2d 6h
Merged PRs (30d)
295

Description

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 https://github.com/NVIDIA/cccl/issues/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`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.