You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summary:
Add a reverse_iterator inside oneDPL which allows usage with the return of oneapi::dpl::begin() and oneapi::dpl::end().
Problem Statement:
Currently, the return from oneapi::dpl::begin() and oneapi::dpl::end() returns an iterator-like typed object. This is not compatible with std::reverse_iterator, although some implementations allow it to work (other result in compiler errors).
For types being processed on the way to SYCL kernels in the dpcpp, std::reverse_iterator is merely a marker used to generate a reverse_view_simple of the resulting processed wrapped type. However, some implementations of reverse_iterator have compile time checks of the capabilities of the types they wrap (MSVC STL for instance) which makes them incompatible with each other.
Preferred Solution:
It may be best for oneDPL to implement its own reverse_iterator which acts as a reverse iterator when used as one, but does not impose requirements that a type be a fully featured iterator if those functionalities are not used. This would allow users to use it safely with iterator types which may or may not involve the return of oneapi::dpl::begin() and oneapi::dpl::end().
It would need to be decided how it is best to make this implementation, and if there is any way to partially rely upon the implementation from the standard library. Perhaps oneDPL could make their own type which has partial specializations for the return types of oneapi::dpl::begin() and oneapi::dpl::end(), and otherwise just inherits std::reverse_iterator for other types.
The text was updated successfully, but these errors were encountered:
Summary:
Add a reverse_iterator inside oneDPL which allows usage with the return of
oneapi::dpl::begin()
andoneapi::dpl::end()
.Problem Statement:
Currently, the return from
oneapi::dpl::begin()
andoneapi::dpl::end()
returns an iterator-like typed object. This is not compatible withstd::reverse_iterator
, although some implementations allow it to work (other result in compiler errors).For types being processed on the way to SYCL kernels in the dpcpp,
std::reverse_iterator
is merely a marker used to generate areverse_view_simple
of the resulting processed wrapped type. However, some implementations ofreverse_iterator
have compile time checks of the capabilities of the types they wrap (MSVC STL for instance) which makes them incompatible with each other.Preferred Solution:
It may be best for oneDPL to implement its own
reverse_iterator
which acts as a reverse iterator when used as one, but does not impose requirements that a type be a fully featured iterator if those functionalities are not used. This would allow users to use it safely with iterator types which may or may not involve the return ofoneapi::dpl::begin()
andoneapi::dpl::end()
.It would need to be decided how it is best to make this implementation, and if there is any way to partially rely upon the implementation from the standard library. Perhaps oneDPL could make their own type which has partial specializations for the return types of
oneapi::dpl::begin()
andoneapi::dpl::end()
, and otherwise just inheritsstd::reverse_iterator
for other types.The text was updated successfully, but these errors were encountered: