[oneDPL] Fixing zip_iterator for value_type and base() return
#605
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The existing
zip_iteratorclass specification usesstd::tupleas thevalue_typeand also the return ofbase().This is problematic for device copyability for dpcpp device backend and is not how oneDPL has implemented
zip_iteratorfor quite some time.std::tupleis not required to be trivially copyable, which causes pain when dealing withzip_iteratorand SYCL kernels, requiringis_device_copyablespecializations for any types which are composed ofzip_iterator::value_type.We currently leave
pointerasstd::tuple(it is still astd::tuplein our implementation), but could consider changing it in this PR to be more broad in case of future changes.pointerseems less of an issue from a device copyable standpoint, but it still may be nice to use a consistent unspecified tuple across the type, and changing it here would give more freedom in the future.I view this as a bugfix for the specification, rather than a breaking change, but that is of course up for discussion.