Skip to content

Add public operator<<(ostream, cub::KeyValuePair) - #8335

Merged
bernhardmgruber merged 2 commits into
NVIDIA:mainfrom
bernhardmgruber:fix_pair
Apr 9, 2026
Merged

bernhardmgruber merged 2 commits into
NVIDIA:mainfrom
bernhardmgruber:fix_pair

Conversation

@bernhardmgruber

@bernhardmgruber bernhardmgruber commented Apr 9, 2026 •

Copy link
Copy Markdown
Contributor

And delete the internal one and the redundant operator==.

And delete redundant operator==
@bernhardmgruber
bernhardmgruber requested a review from a team as a code owner April 9, 2026 07:56
@github-project-automation github-project-automation Bot moved this to Todo in CCCL Apr 9, 2026
@cccl-authenticator-app cccl-authenticator-app Bot moved this from Todo to In Review in CCCL Apr 9, 2026
@bernhardmgruber bernhardmgruber changed the title Add operator<<(ostream, cub::KeyValuePair) Add public operator<<(ostream, cub::KeyValuePair) Apr 9, 2026
Comment thread cub/test/catch2_test_device_reduce.cuh Resolved
@github-project-automation github-project-automation Bot moved this from In Review to In Progress in CCCL Apr 9, 2026

template <typename Key, typename Value>
__host__ __device__ __forceinline__ bool
operator==(const KeyValuePair<Key, Value>& lhs, const KeyValuePair<Key, Value>& rhs)

@gonidelis gonidelis Apr 9, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

my minimal-background-check understanding tells me that KeyValuePair should be history in the near future so I am not gonna be firm with my review but since we removed the operator== definition from here (good) why didn't we add it in cub/cub/util_type.cuh?

is it not needed even? why was it added in the first place?

i am no blocking the pr on this though, lgtm

@bernhardmgruber bernhardmgruber Apr 9, 2026 •

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.

that KeyValuePair should be history in the near future

I made multiple attempts already, but the difficulty is that it can be used as the value type of output iterators by the users of arg extrema algorithms (DeviceReduce::ArgMin e.g.). It's also hard coded into ArgIndexInputIterator which is public and used throughput the extrema implementation.

I agree to should die in favor of cuda::std::pair.

@gonidelis
gonidelis requested a review from miscco April 9, 2026 09:52
@github-actions

This comment has been minimized.

@github-actions

github-actions Bot commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

🥳 CI Workflow Results

🟩 Finished in 3h 38m: Pass: 100%/269 | Total: 9d 14h | Max: 2h 07m | Hits: 50%/176999

See results here.

@github-project-automation github-project-automation Bot moved this from In Progress to In Review in CCCL Apr 9, 2026
@bernhardmgruber
bernhardmgruber merged commit d2e8d15 into NVIDIA:main Apr 9, 2026
569 of 578 checks passed
@github-project-automation github-project-automation Bot moved this from In Review to Done in CCCL Apr 9, 2026
@bernhardmgruber
bernhardmgruber deleted the fix_pair branch April 9, 2026 14:00
jainishmehta pushed a commit to jainishmehta/cccl that referenced this pull request Apr 19, 2026
Co-authored-by: gonidelis <ggonidelis@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants