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

RFC for zip_view implementation, for oneDPL C++20 #1931

Open
wants to merge 31 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
09bd199
[oneDPL][rfc][zip_view] + draft
MikeDvorskiy Nov 4, 2024
b56c860
Update README.md
MikeDvorskiy Nov 27, 2024
761ecb7
Update README.md
MikeDvorskiy Nov 29, 2024
7ef15f4
Update README.md
MikeDvorskiy Nov 29, 2024
e792b5b
Update README.md
MikeDvorskiy Nov 29, 2024
786d5c5
Update README.md
MikeDvorskiy Nov 29, 2024
171e5fe
Update README.md
MikeDvorskiy Nov 29, 2024
f9a2e45
[oneDPL][rfc][ranges][zip_view] + Implementation design proposal
MikeDvorskiy Dec 2, 2024
4a701fc
+ spelling fix
MikeDvorskiy Dec 3, 2024
cc3eac4
+ spelling fix
MikeDvorskiy Dec 3, 2024
52acfac
+Implementation proposal
MikeDvorskiy Dec 4, 2024
526a603
Delete rfcs/experimental/zip_view/README.md
MikeDvorskiy Dec 4, 2024
518aee0
Update README.md
MikeDvorskiy Dec 4, 2024
234dbdb
Update rfcs/proposed/zip_view/README.md
MikeDvorskiy Dec 17, 2024
c20ef9f
Update rfcs/proposed/zip_view/README.md
MikeDvorskiy Dec 17, 2024
aec760b
Update rfcs/proposed/zip_view/README.md
MikeDvorskiy Dec 17, 2024
9ab570b
Update rfcs/proposed/zip_view/README.md
MikeDvorskiy Dec 17, 2024
300e13c
Update rfcs/proposed/zip_view/README.md
MikeDvorskiy Dec 17, 2024
f51297e
Update rfcs/proposed/zip_view/README.md
MikeDvorskiy Dec 17, 2024
4cade93
Update rfcs/proposed/zip_view/README.md
MikeDvorskiy Dec 17, 2024
7b882fb
Update rfcs/proposed/zip_view/README.md
MikeDvorskiy Dec 17, 2024
2e9c98d
Update rfcs/proposed/zip_view/README.md
MikeDvorskiy Dec 17, 2024
214dcde
Update rfcs/proposed/zip_view/README.md
MikeDvorskiy Dec 18, 2024
1f7b132
Update README.md
MikeDvorskiy Dec 20, 2024
720f1d2
Update README.md
MikeDvorskiy Jan 15, 2025
416010b
Update README.md
MikeDvorskiy Jan 15, 2025
28aed7e
Update README.md
MikeDvorskiy Jan 15, 2025
1ce2407
Update README.md
MikeDvorskiy Jan 15, 2025
20d82e8
Update README.md
MikeDvorskiy Feb 24, 2025
87a32a8
Update README.md
MikeDvorskiy Feb 24, 2025
c629dff
Update README.md
MikeDvorskiy Feb 24, 2025
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
Prev Previous commit
Next Next commit
Update rfcs/proposed/zip_view/README.md
Co-authored-by: Dmitriy Sobolev <Dmitriy.Sobolev@intel.com>
MikeDvorskiy and dmitriy-sobolev authored Dec 17, 2024
commit 9ab570b9f6c9280a4eefad02798a402acae73684
2 changes: 1 addition & 1 deletion rfcs/proposed/zip_view/README.md
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ where each element is represented as a tuple containing corresponding elements f
the resulting range is a tuple containing one element from each of the input ranges. This can be particularly
useful for iterating over multiple collections in parallel. `std::ranges::zip_view` was introduced in C++23,
but many developers are still using C++20 standard. So, oneDPL introduces `oneapi::dpl::ranges::zip_view`,
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this feature going to be experimental? If yes, I guess the namespace should be oneapi::dpl::experimental::ranges::zip_view.

Copy link
Contributor Author

@MikeDvorskiy MikeDvorskiy Dec 17, 2024

Choose a reason for hiding this comment

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

Regarding to experimental namespace here. I don't know... It depends on RFC process. This document is a proposal in the product or to be productized - that's a goal. So, experimental word looks weird.

Talking about the next stage of our doing with zip_view, yes we would like to have it in the experimental namespace first.

Copy link
Contributor

@dmitriy-sobolev dmitriy-sobolev Dec 17, 2024

Choose a reason for hiding this comment

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

I guess you expect the feature to be productized fast, similarly to the C++20 range support. Hence, having experimental namespace will impair user experience due to the changes it involves.

Does it make sense to treat it as an extension straight away with "supported" as the next stage? Do you feel confident regarding the current design?

Copy link
Contributor

Choose a reason for hiding this comment

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

My understanding here was that we were shooting for full product status for the ranges MVP APIs including zip_view after the experience of the existing experimental ranges APIs. We already have an experimental zip_view that has been around for some time now.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, indeed, thanks for reminding about oneapi::dpl::experimental::ranges::zip_view. Then, "supported" stage looks better than "experimental" as the next target.

Talking about the next stage of our doing with zip_view, yes we would like to have it in the experimental namespace first.

Could you elaborate why you prefer "experimental" stage?

Copy link
Contributor Author

@MikeDvorskiy MikeDvorskiy Dec 18, 2024

Choose a reason for hiding this comment

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

Basically, there is an internal utility - oneapi::dpl::__ranges::zip_view in using everywhere in the internal oneDPL implementation with C++17 support.
Also oneapi::dpl::__ranges::zip_view is injected into oneapi::dpl::experimental::ranges namespace.
oneapi::dpl::experimental::ranges::zip_view is used in 4 places in oneDPL impl... and probably in a user'code, because it is a public name.

So, I would propose 1) for _ONEDPL_CPP20_RANGES_PRESENT mode to have the proposed new zip_view in the oneapi::dpl::experimental::ranges namespace and 2) injection of existing oneapi::dpl::__ranges::zip_view into oneapi::dpl::experimental::ranges otherwise (in case of C++17).

1a) the "old" oneapi::dpl::__ranges::zip_view has public "tuple()" method... and it used in the following context:
std::get<0>(__in_rng.tuple()), Actually, it is not correct. Should be an oneDPL internal analog of std::views::elements<0>(__in_rng) IMHO.

@akukanov , @danhoeflinger , @dmitriy-sobolev what do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

In theory, we have license to change "experimental" things, as you suggest (in C++20 in this case).

What we need to be careful of is that the existing zip_view has been stable for a long time, and I think used in non-experimental production code internally. I think we need to confirm and be sure that we are not introducing breaking changes into non-experimental code, and that any breaking changes to the experimental zip_view with C++20 enabled are well described and kept to a minimum.

As far as the RFC is concerned, we need to make it clear here the plan for how it will coexist with what already exists (basically what you describe above).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the existing zip_view has been stable for a long time

The existing zip_view doesn't work with C++ standard ranges. That's why we need new one for _ONEDPL_CPP20_RANGES_PRESENT mode.

Copy link
Contributor

@danhoeflinger danhoeflinger Dec 19, 2024

Choose a reason for hiding this comment

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

Yes that makes sense. My reason for stating its stability is not to argue that a new version isn't needed, but merely to say that users may have more of an expectation to treat the existing implementation as a "supported" feature rather than an "experimental" feature, because we have basically treated it as such.
Therefore, changes may take them by surprise. We are not doing anything wrong by changing it, as it is experimental, we just need to be aware that it may affect users.

Copy link
Contributor

Choose a reason for hiding this comment

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

So, I would propose 1) for _ONEDPL_CPP20_RANGES_PRESENT mode to have the proposed new zip_view in the oneapi::dpl::experimental::ranges namespace and 2) injection of existing oneapi::dpl::__ranges::zip_view into oneapi::dpl::experimental::ranges otherwise (in case of C++17).

If the experimental algos based on non-standard views are available for C++20, this can still be a breaking change I am afraid.

We can go with e.g. oneapi::dpl::ranges::zip_view_experimental, I guess. It's ugly and does not follow the convention, but the intent is clear.

which the same API and functionality as `std::ranges::zip_view`.
with the same API and functionality as `std::ranges::zip_view`.

### Key Requirements
`oneapi::dpl::ranges::zip_view` should be: