Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Implement consistent scan accumulation per P0571 #1170

Closed
alliepiper opened this issue May 27, 2020 · 1 comment · Fixed by #1176
Closed

Implement consistent scan accumulation per P0571 #1170

alliepiper opened this issue May 27, 2020 · 1 comment · Fixed by #1176
Assignees

Comments

@alliepiper
Copy link
Collaborator

Not all backends use the same accumulator type when performing scans, and as a result, TBB scan tests are currently failing in master.

All backends and tests should be updated to determine the intermediate type as defined in proposal P0571.

This will likely be addressed as part of #1158.

@alliepiper
Copy link
Collaborator Author

Per cppreference, we'll also need to add the thrust::plus<void> c++14 specialization that deduces T, since accum and *first may have different types.

alliepiper added a commit to alliepiper/thrust that referenced this issue May 29, 2020
TBB's scan was implemented differently than the other backends, leading
to some failing unit tests.

This patch fixes these inconsistencies by making the following changes:

- Follow P0571's guidance regarding accumulator variable type.
  - https://wg21.link/P0571
  - The accumulator's type is now:
    - The type of the user-supplied initial value (if provided), or
    - The input iterator's value type if no initial value.
- Follow C++ standard guidance for default binary operator type.
  - https://eel.is/c++draft/exclusive.scan#1
  - Thrust binary/unary functors now specialize a default void template
    parameter. Types are deduced and forwarded transparently.
  - Updated the scan's default binary operator to the new
    `thrust::plus<>` specialization.
- The `intermediate_type_from_function_and_iterators` helper is no
  longer needed and has been removed.

Closes NVIDIA#1170.
alliepiper added a commit to alliepiper/thrust that referenced this issue Jun 8, 2020
TBB's scan was implemented differently than the other backends, leading
to some failing unit tests.

This patch fixes these inconsistencies by making the following changes:

- Follow P0571's guidance regarding accumulator variable type.
  - https://wg21.link/P0571
  - The accumulator's type is now:
    - The type of the user-supplied initial value (if provided), or
    - The input iterator's value type if no initial value.
- Follow C++ standard guidance for default binary operator type.
  - https://eel.is/c++draft/exclusive.scan#1
  - Thrust binary/unary functors now specialize a default void template
    parameter. Types are deduced and forwarded transparently.
  - Updated the scan's default binary operator to the new
    `thrust::plus<>` specialization.
- The `intermediate_type_from_function_and_iterators` helper is no
  longer needed and has been removed.

Closes NVIDIA#1170.
alliepiper added a commit that referenced this issue Jun 8, 2020
TBB's scan was implemented differently than the other backends, leading
to some failing unit tests.

This patch fixes these inconsistencies by making the following changes:

- Follow P0571's guidance regarding accumulator variable type.
  - https://wg21.link/P0571
  - The accumulator's type is now:
    - The type of the user-supplied initial value (if provided), or
    - The input iterator's value type if no initial value.
- Follow C++ standard guidance for default binary operator type.
  - https://eel.is/c++draft/exclusive.scan#1
  - Thrust binary/unary functors now specialize a default void template
    parameter. Types are deduced and forwarded transparently.
  - Updated the scan's default binary operator to the new
    `thrust::plus<>` specialization.
- The `intermediate_type_from_function_and_iterators` helper is no
  longer needed and has been removed.

Closes #1170.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant