[SYCLomatic] Fix for device_iterator trivial copyable (and device copyable) #2850
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.
device_iterator
(USM available) is meant to be passed directly into sycl kernels, but was not technically sycl device-copyable, because of a non-default copy assignment operator (making it lose trivially copyable).This non-default function is actually unnecessary, and can be defaulted with the same result. Making it default ensures trivial copyability and therefore sycl device-copyable. A requirement of sycl-device copyable was added to oneDPL "passed directly" types to conform to the SYCL specification.
Added tests in oneapi-src/SYCLomatic-test#915 to confirm sycl device-copyable for
device_iterator
and similar types.Note:
This leaves in place an (I think unused) API for the copy constructor which doesn't make a lot of sense, but is there to match the USM_NONE version with an explicit template argument to describe the access mode of a buffer we are copying from. We could consider removing this API but I don't want to remove a public API in this PR. It is orthogonal to trivial copyability here.