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][ranges] + zip_view implementation for C++20 #1877

Open
wants to merge 88 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 80 commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
86359d6
[oneDPL][ranges][zip_view] + initial implementation of standard compl…
MikeDvorskiy Sep 17, 2024
93a1b42
[oneDPL][ranges][zip_view] + missing arithmetic operations for zip_vi…
MikeDvorskiy Sep 18, 2024
ed5d9bf
[oneDPL][ranges][zip_view] + return type fix for operator*()
MikeDvorskiy Sep 20, 2024
a5f68a1
[oneDPL][ranges][tuple] + const assignment operator overload
MikeDvorskiy Sep 24, 2024
24b12bb
[oneDPL][ranges][zip_view] + test
MikeDvorskiy Sep 24, 2024
ed50010
[oneDPL][ranges][zip_view] + apply_to_tuple instead of std::apply; st…
MikeDvorskiy Sep 24, 2024
f9cee36
[oneDPL][ranges][zip_view] + changes in the test
MikeDvorskiy Sep 25, 2024
3307237
[oneDPL][ranges][zip_view] -> oneapi::dpl::ranges
MikeDvorskiy Sep 25, 2024
7222dcf
[oneDPL][ranges][zip_view][test] -> oneapi::dpl::ranges
MikeDvorskiy Sep 25, 2024
ff77abc
[oneDPL][ranges][zip_view] + file header and guards
MikeDvorskiy Sep 25, 2024
32552e8
[oneDPL][ranges][zip_view] + apply_to_tuple instead of std::apply; st…
MikeDvorskiy Sep 25, 2024
28124a1
[oneDPL][ranges][zip_view] + begin_imp, end_impl to reduce code dupli…
MikeDvorskiy Sep 26, 2024
8e3e4bf
Revert "[oneDPL][ranges][zip_view] + begin_imp, end_impl to reduce co…
MikeDvorskiy Sep 26, 2024
127f41e
[oneDPL][ranges][zip_view][test] + minor changes
MikeDvorskiy Sep 27, 2024
6b3f64c
[oneDPL][ranges][zip_view] + minor changes
MikeDvorskiy Oct 7, 2024
22fa2e4
[oneDPL][ranges][zip_view] + #include "tuple_impl.h"
MikeDvorskiy Oct 9, 2024
a7a086d
[oneDPL][ranges][zip_view][test] + test_zip_view_base_op()
MikeDvorskiy Oct 22, 2024
7c88be6
[oneDPL][ranges][zip_view] + implementation fix for 'operator-' betwe…
MikeDvorskiy Oct 18, 2024
0a763a3
Update include/oneapi/dpl/pstl/zip_view_impl.h
MikeDvorskiy Oct 21, 2024
a5513f3
Update include/oneapi/dpl/pstl/zip_view_impl.h
MikeDvorskiy Oct 21, 2024
0baed00
Update include/oneapi/dpl/pstl/zip_view_impl.h
MikeDvorskiy Oct 21, 2024
9f9b857
Update include/oneapi/dpl/pstl/zip_view_impl.h
MikeDvorskiy Oct 21, 2024
7fbc430
Update include/oneapi/dpl/pstl/zip_view_impl.h
MikeDvorskiy Oct 21, 2024
946cf2a
Update include/oneapi/dpl/pstl/zip_view_impl.h
MikeDvorskiy Oct 21, 2024
0b7f380
Update include/oneapi/dpl/pstl/zip_view_impl.h
MikeDvorskiy Oct 21, 2024
28aa293
Update include/oneapi/dpl/pstl/zip_view_impl.h
MikeDvorskiy Oct 21, 2024
4e04664
Update include/oneapi/dpl/pstl/zip_view_impl.h
MikeDvorskiy Oct 21, 2024
cfa875c
[oneDPL][ranges][zip_view] + std::get usage
MikeDvorskiy Oct 21, 2024
4cbfe57
[oneDPL][ranges][zip_view] + 'std::forward<decltype(__args)>(__args)'…
MikeDvorskiy Oct 21, 2024
cfa29c0
[oneDPL][ranges][zip_view] + 'minor change' for const/non const type …
MikeDvorskiy Oct 21, 2024
1131a2c
[oneDPL][ranges][zip_view] + fix operator<=> implementation
MikeDvorskiy Oct 22, 2024
5d5ceb8
[oneDPL][ranges][zip_view][test] removed cbegin(), cend() test cases …
MikeDvorskiy Oct 25, 2024
be339cf
[oneDPL][ranges][zip_view][test] + front(), back() methods check
MikeDvorskiy Oct 25, 2024
b62e65c
[oneDPL][ranges][zip_view][test] + empty constructor call check
MikeDvorskiy Oct 29, 2024
0f023d0
[oneDPL][ranges][zip_view][test] + ;
MikeDvorskiy Oct 30, 2024
c3388db
[oneDPL][ranges][zip_view][test] const for compare_with_sentinels
MikeDvorskiy Nov 4, 2024
02eb5ea
[oneDPL][ranges][zip_view][test] a fix for zip_view::iterator::operator-
MikeDvorskiy Nov 6, 2024
3c8d9f5
[oneDPL][rfc][zip_view] + std::ranges::range_reference_t usage; it f…
MikeDvorskiy Nov 8, 2024
70d8f81
[oneDPL][ranges][zip_view][test] + minor changes
MikeDvorskiy Nov 8, 2024
f6f62a1
[oneDPL][zip_view] + minor improvements
MikeDvorskiy Nov 15, 2024
cfd9660
[oneDPL][ranges][zip_view][test] + EXPECT_TRUE usage
MikeDvorskiy Nov 19, 2024
b5fbf9e
[oneDPL][ranges][zip_view] + operator oneapi::dpl::zip_iterator<Itera…
MikeDvorskiy Dec 2, 2024
5a9976b
[oneDPL][ranges][zip_view][test] + check conversion to oneapi::dpl::z…
MikeDvorskiy Dec 2, 2024
a256c9a
[oneDPL][ranges][zip_view][test] + EXPECT_TRUE usage
MikeDvorskiy Dec 5, 2024
bb03833
[oneDPL][ranges][zip_view] + clang format
MikeDvorskiy Jan 16, 2025
72aa720
[oneDPL][ranges][zip_view][test] + result checks
MikeDvorskiy Jan 16, 2025
9c6bfa6
[oneDPL][ranges][zip_view] + LLVM tests for ranges::zip_view (from C+…
MikeDvorskiy Feb 5, 2025
08984c5
[oneDPL][ranges][zip_view] + __simple_view_concep. a fix for operator==
MikeDvorskiy Feb 7, 2025
11094e3
[oneDPL][ranges][zip_view][test] LLVM test begin.pass adaptation for …
MikeDvorskiy Feb 7, 2025
b935f84
[oneDPL][ranges][zip_view] + fix for end() and compare_equal
MikeDvorskiy Feb 7, 2025
bd2fc48
[oneDPL][ranges][zip_view][test] LLVM test end.pass adaptation for on…
MikeDvorskiy Feb 7, 2025
15866b6
[oneDPL][ranges][zip_view] + fix an error in zip_fn
MikeDvorskiy Feb 7, 2025
04f05e7
[oneDPL][ranges][zip_view][test] LLVM test cpo.pass adaptation for on…
MikeDvorskiy Feb 7, 2025
501ddf2
[oneDPL][ranges][zip_view] + implementation fixes
MikeDvorskiy Feb 10, 2025
e7b7c90
[oneDPL][ranges][zip_view][test] LLVM test borrowing.compile.pass ada…
MikeDvorskiy Feb 10, 2025
7e3791b
[oneDPL][ranges][zip_view] + explicit for constructor
MikeDvorskiy Feb 10, 2025
e9fa3ed
[oneDPL][ranges][zip_view][test] LLVM test сtad.compile.pass adaptati…
MikeDvorskiy Feb 10, 2025
1e56735
[oneDPL][ranges][zip_view][test] LLVM test сtor.default.pass adaptati…
MikeDvorskiy Feb 10, 2025
5e8bd60
[oneDPL][ranges][zip_view][test] LLVM test general.pass and ctor.view…
MikeDvorskiy Feb 10, 2025
c339d19
[oneDPL][ranges][zip_view] + correct implementation of method 'size()…
MikeDvorskiy Feb 10, 2025
2106c65
[oneDPL][ranges][zip_view][test] another couple of LLVM tests adapta…
MikeDvorskiy Feb 10, 2025
a5a8480
[oneDPL][ranges][zip_view] + arithmetic operation fixes
MikeDvorskiy Feb 12, 2025
eb5f579
[oneDPL][ranges][zip_view][test] LLVM test arithmetict.pass adaptatio…
MikeDvorskiy Feb 12, 2025
d5f5616
[oneDPL][ranges][zip_view] + fixes in private zip_view::iterator cons…
MikeDvorskiy Feb 12, 2025
9b0852d
[oneDPL][ranges][zip_view][test] compare.pass test adaptation for oneDPL
MikeDvorskiy Feb 12, 2025
953eb3f
[oneDPL][ranges][zip_view] + fixes in apply_to_tuple using
MikeDvorskiy Feb 12, 2025
8e427fb
[oneDPL][ranges][zip_view][test] another LLVM test portion were adopt…
MikeDvorskiy Feb 12, 2025
0eb08b6
[oneDPL][ranges][zip_view] + iter_move friend method
MikeDvorskiy Feb 13, 2025
a766030
[oneDPL][ranges][zip_view][test] another couple of LLVM tests adapta…
MikeDvorskiy Feb 13, 2025
a2942ee
[oneDPL][ranges][zip_view] + iter_swap friend method
MikeDvorskiy Feb 13, 2025
3de9dd1
[oneDPL][ranges][zip_view][test] LLVM test iter_swap.pass adaptation …
MikeDvorskiy Feb 13, 2025
9f5f2d3
[oneDPL][ranges][zip_view] + fix: public inheritance for class iterat…
MikeDvorskiy Feb 13, 2025
35bc5dd
[oneDPL][ranges][zip_view][test] another LLVM test adaptation for on…
MikeDvorskiy Feb 13, 2025
6923b5e
[oneDPL][ranges][zip_view][test] another couple of LLVM tests adapta…
MikeDvorskiy Feb 13, 2025
e4f2002
[oneDPL][ranges][zip_view][test] + test cases disabling #if __GNUC__ …
MikeDvorskiy Feb 13, 2025
612b5ae
[oneDPL][ranges][tuple] + a fix for default. According to std::tuple:…
MikeDvorskiy Feb 17, 2025
1e8dad9
[oneDPL][ranges][zip_view] + a fix: __maybe_const usage.
MikeDvorskiy Feb 17, 2025
dce5f5e
[oneDPL][ranges][zip_view][test] another LLVM tests adaptation for o…
MikeDvorskiy Feb 17, 2025
69771a3
[oneDPL][ranges][zip_view][test] minor changes for begin.pass test
MikeDvorskiy Feb 17, 2025
175dffb
[oneDPL][ranges][zip_view][test] the tests renamed: + prefix "zip_view."
MikeDvorskiy Feb 17, 2025
6ff5b7a
[oneDPL] a fixe for __pattern_walk2 implementation in case of forward…
MikeDvorskiy Feb 17, 2025
7381003
[oneDPL][ranges][zip_view] removed spaces
MikeDvorskiy Feb 17, 2025
5ae1d7c
Revert "[oneDPL] a fixe for __pattern_walk2 implementation in case of…
MikeDvorskiy Feb 18, 2025
1b16802
[oneDPL][ranges][zip_view][test] additional LLVM tests adaptation for…
MikeDvorskiy Feb 19, 2025
6e774ca
[oneDPL][ranges][tuple] + a fix for Value-initializes all elements of…
MikeDvorskiy Feb 18, 2025
c2156af
[oneDPL][ranges][zip_view][test] + #include "support/test_config.h"
MikeDvorskiy Feb 18, 2025
11c8521
[oneDPL][ranges][tuple] + a fix for the internal tuple default constr…
MikeDvorskiy Feb 19, 2025
8894166
[oneDPL][ranges][zip_view] + namespace views = ranges::views;
MikeDvorskiy Feb 19, 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
3 changes: 3 additions & 0 deletions include/oneapi/dpl/pstl/ranges_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
#include <ranges>
#endif

//oneapi::dpl::ranges::zip_view support for C++20
#include "zip_view_impl.h"

#include "utils_ranges.h"
#if _ONEDPL_BACKEND_SYCL
# include "hetero/dpcpp/utils_ranges_sycl.h"
Expand Down
13 changes: 11 additions & 2 deletions include/oneapi/dpl/pstl/tuple_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -385,8 +385,8 @@ inline constexpr bool __enable_comparison_op_v =
template <typename T1, typename... T>
struct tuple<T1, T...>
{
oneapi::dpl::__internal::__copy_assignable_holder<T1> holder;
tuple<T...> next;
oneapi::dpl::__internal::__copy_assignable_holder<T1> holder{};
tuple<T...> next{};
Copy link
Contributor

Choose a reason for hiding this comment

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

I propose to add comment why {} are required since it is not trivial.


using tuple_type = ::std::tuple<T1, T...>;

Expand Down Expand Up @@ -501,6 +501,15 @@ struct tuple<T1, T...>
return *this;
}

template <typename U1, typename... U>
tuple&
operator=(const tuple<U1, U...>& other) const
{
holder.value = other.holder.value;
next = other.next;
return *this;
}
Comment on lines +507 to +514
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like it is not const in practice, and I don't understand how a const operator= makes sense in the first place.
What am I missing?

Copy link
Contributor

Choose a reason for hiding this comment

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

It makes sense when we assign constant tuple objects of non-constant references:
https://godbolt.org/z/TP8Gzhvxb (Failing with C++20, but works in C++23)


// if T1 is deduced with reference, compiler generates deleted operator= and,
// since "template operator=" is not considered as operator= overload
// the deleted operator= has a preference during lookup
Expand Down
Loading
Loading