[oneDPL] Fixing zip_iterator for value_type and base() return#605
[oneDPL] Fixing zip_iterator for value_type and base() return#605danhoeflinger wants to merge 1 commit intomainfrom
value_type and base() return#605Conversation
Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
|
oneDPL has made significant progress in adding SYCL device copyable specializations for oneDPL's iterator types and wrapper functions. There was a question about whether this removes the need for a trivially copyable internal tuple for reference, value types, and the base iterator. I don't think it does. I've reviewed why it's important for I believe the original motivation was to support device copyability of types without adding to issues which arise when types contain device copyable but not trivially copyable members. Recent work on oneDPL's iterators and internal wrapper types has alleviated some of this within oneDPL. However, moving back to @rarutyun may better describe the original motivation, but I'll continue working to get some concrete cases. |
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.