Skip to content

Add DeviceAdjacentDifference::Subtract[Left|Right] overloads with two iterators#8588

Draft
bernhardmgruber wants to merge 7 commits intoNVIDIA:mainfrom
bernhardmgruber:adjacent_diff_two_iter
Draft

Add DeviceAdjacentDifference::Subtract[Left|Right] overloads with two iterators#8588
bernhardmgruber wants to merge 7 commits intoNVIDIA:mainfrom
bernhardmgruber:adjacent_diff_two_iter

Conversation

@bernhardmgruber
Copy link
Copy Markdown
Contributor

While working on #8492, I realized that Thrust uses a version of cub::DeviceAdjacentDifference that is not exposed in the public API: an overlapping version that uses dedicated input and output iterators. We only have an overload taking a single iterator (in-place) and another one taking two iterators but requiring the input and output range to not overlap.

I am still not entirely sure whether we want those overloads and if Thrust's logic is fully correct. Thrust's API mentions:

 *  \remark Note that \p result is permitted to be the same iterator as \p first. This is
 *          useful for computing differences "in place".

but it does not mention that the input/output ranges are not allowed to overlap in any other way. The parallel overloads in the PSTL do not allow that. So Thrust seems to support more use cases here.

This PR adds the corresponding CUB overloads for Thrust use case, so we can migrate it away from using the dispatch layer.

@copy-pr-bot
Copy link
Copy Markdown
Contributor

copy-pr-bot Bot commented Apr 21, 2026

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@github-project-automation github-project-automation Bot moved this to Todo in CCCL Apr 21, 2026
@cccl-authenticator-app cccl-authenticator-app Bot moved this from Todo to In Progress in CCCL Apr 21, 2026
@bernhardmgruber bernhardmgruber changed the title Adjacent diff two iter Add DeviceAdjacentDifference::Subtract[Left|Right] overloads with two iterators Apr 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

1 participant