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

Make transform_iterator and permutation_iterator device copyable for sycl 2020 #1386

Closed
danhoeflinger opened this issue Jan 26, 2024 · 0 comments · Fixed by #1394
Closed
Assignees
Milestone

Comments

@danhoeflinger
Copy link
Contributor

danhoeflinger commented Jan 26, 2024

transform_iterator defines a custom copy assignment operator which omits the copy assignment of its functor __my_unary_func_. This copy assignment operator means that transform_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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant