Skip to content

[oneDPL] Add more parallel range algorithms #614

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 5 commits into from
May 2, 2025

Conversation

akukanov
Copy link
Contributor

@akukanov akukanov commented Feb 28, 2025

As a follow-up to the oneDPL RFC proposal uxlfoundation/oneDPL#2037, this PR adds new parallel range algorithm signatures to the specification: fill, generate, move, replace, replace_if, remove, remove_if, mismatch, minmax_element, minmax, min, max, find_first_of, find_end, is_sorted_until.

@akukanov akukanov force-pushed the onedpl-ranges-more-algorithms branch from bc0b61a to c286144 Compare February 28, 2025 17:45
Copy link
Contributor

@danhoeflinger danhoeflinger left a comment

Choose a reason for hiding this comment

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

LGTM,
I confirmed that these signatures match p3179r7, other than the noted differences involving usage in const expressions, and sizing of both ranges for mismatch.

@akukanov
Copy link
Contributor Author

The most recent change removes generate from the list, as there are unresolved concerns for it in the C++ LWG review of P3179.

Copy link

@MikeDvorskiy MikeDvorskiy left a comment

Choose a reason for hiding this comment

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

LGTM

std::ranges::random_access_range R2, typename Pred = std::ranges::equal_to,
typename Proj1 = std::identity, typename Proj2 = std::identity>
requires oneapi::dpl::is_execution_policy_v<std::remove_cvref_t<ExecutionPolicy>> &&
(std::ranges::sized_range<R1> || std::ranges::sized_range<R2>) &&
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we going to keep it like that? Or are we going to make a change to &&? I think we had this conversation but I don't remember what we ended up with...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We will keep it like that, it's described in the differences - see https://github.com/uxlfoundation/oneAPI-spec/pull/610/files



// find_end
template<typename ExecutionPolicy, std::ranges::random_access_range R1,
Copy link
Contributor

Choose a reason for hiding this comment

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

Overall, I think we need to introduce execution-policy exposition-only concept at some point (not in this PR) to just simplify the specification. We can do it at any point because I don't consider it a breaking change anyhow

Copy link
Contributor

@danhoeflinger danhoeflinger left a comment

Choose a reason for hiding this comment

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

Reapproving after removal of generate

@akukanov akukanov merged commit 0d15166 into uxlfoundation:main May 2, 2025
3 checks passed
@akukanov akukanov deleted the onedpl-ranges-more-algorithms branch May 2, 2025 23:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants