Skip to content
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

[oneDPL][rfc][ranges] proposal for implementation of the second part of range based API for oneDPL #2037

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions rfcs/proposed/range_algorithms/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Support the second portion of the oneDPL Range APIs

## Introduction
Based on statistics (observing C++ code within github.com) for the usage of popular algorithms, the following
range-based APIs are suggested to be implemented next in oneDPL.
`fill`, `generate`, `move`, `replace`, `replace_if`, `remove`, `remove_if`, `mismatch`, `minmax_element`, `minmax`,
`min`, `max`, `find_first_of`, `find_end`, `is_sorted_until`

## Motivations
The feature is proposed as the next step of range-based API support for oneDPL.

### Key Requirements
- The range-based signatures for the mentioned API should correspond to the proposal for C++ parallel range algorithms, P3179.
(https://wg21.link/p3179)
Copy link
Contributor

Choose a reason for hiding this comment

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

As an exception to this rule, we might have mismatch to follow equal and transform in the oneDPL specification and allow only one of the two ranges to be sized.

I am still thinking of the best way to handle this.

- The proposed implementation should support all oneDPL execution policies: `seq`, `unseq`, `par`, `par_unseq` and `a device policy`.

### Implementation proposal
- The implementation is supposed to rely on existing range-based or iterator-based algorithm patterns, which are already
implemented in oneDPL.
- Several algorithms described in P3179 have slightly different semantics. To implement these, some existing algorithm patterns
might require modifications or new versions.

### Test coverage

- It should be called with both small and large data sizes and with all the policies mentioned above.
Copy link
Contributor

@akukanov akukanov Feb 12, 2025

Choose a reason for hiding this comment

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

Does it make sense to also mention what kinds of input and output ranges (containers, views, etc.) will be tested?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it does.
I think we need to write down it here explicitly...

- Output data, return type, and value should be checked/compared with the reference result
computed by the corresponding serial std::ranges algorithm or by a custom implemented serial version
in case of different semantics.