Skip to content

Handle const and reference scan accumulator types #736

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

Merged
merged 1 commit into from
May 12, 2025

Conversation

umfranzw
Copy link
Collaborator

@umfranzw umfranzw commented May 9, 2025

We recently updated the default accumulator types for rocprim::inclusive_scan, deterministic_inclusive_scan, exclusive_scan, and deterministic_exclusive_scan.

The update set the default type to the return type of the scan operator. The scan operator can return a type that is const or a reference. This is problematic because internally, the scan algorithm need to create instances of the accumulator type and periodically update their value. It also needs to create pointers of the accumulator type.

This change fixes the problem by stripping any const or reference from the accumulator type before it is passed to the internal scan implementation function.

We recently updated the default accumulator types for
rocprim::inclusive_scan, deterministic_inclusive_scan,
exclusive_scan, and deterministic_exclusive_scan.

The update set the default type to the return type of the
scan operator. The scan operator can return a type that
is const or a reference. This is problematic because internally,
the scan algorithm need to create instances of the accumulator
type and periodically update their value. It also needs to create
pointers of the accumulator type.

This change fixes the problem by stripping any const or reference
from the accumulator type before it is passed to the internal
scan implementation function.
Copy link
Collaborator

@stanleytsang-amd stanleytsang-amd left a comment

Choose a reason for hiding this comment

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

LGTM pending CI checks

@umfranzw umfranzw merged commit 7347b9d into ROCm:develop May 12, 2025
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants