Make transform_iterator
and permutation_iterator
device copyable for sycl 2020
#1386
Milestone
transform_iterator
and permutation_iterator
device copyable for sycl 2020
#1386
transform_iterator
defines a custom copy assignment operator which omits the copy assignment of its functor__my_unary_func_
. This copy assignment operator means thattransform_iterator
is not a trivially copyable class. However, defaulting or implicitly defining this copy assignment operator would impose a new requirement that the functor is copy assignable.transform_iterator
still is trivially copy constructible and trivially destructible, which allows it to work with SYCL kernels as if it were device copyable for the icpx implementation of SYCL. However, it is relying on behavior which is not explicitly defined in the SYCL 2020 spec.https://github.com/intel/llvm/blob/153ccbe4c38fc7392c2aff06d82c3f6666f57248/sycl/include/sycl/types.hpp#L2685
The plan is to use the method described at the bottom of this section https://registry.khronos.org/SYCL/specs/sycl-2020/html/sycl-2020.html#sec::device.copyable , to declare
transform_iterator
and the other fancy iterators explicitly "device copyable" (dependent on their template types). This should allow full SYCL 2020 device copyable status for all fancy iterators.The text was updated successfully, but these errors were encountered: