You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An example where such a diagnostic would have been helpful (besides just being pedantic):
A kernel that only reads the buffer is enqueued after the cgh.copy. If the code had the correct access mode for copying, it would have been possible to execute the kernel and copy the data simultaneously. With the wrong access mode as in the example above, the code works, but the kernel is scheduled to wait for the data copy to complete. A simple static_asserthere would have warned the user of their mistake and of missed optimization opportunity.
The text was updated successfully, but these errors were encountered:
This patch introduces compile-time checks to cl::sycl::handler::copy
functions that ensure the correctness of accessors' access mode
(section 4.8.6 of SYCL-1.2.1 specification).
This patch introduces compile-time checks to cl::sycl::handler::copy
functions that ensure the correctness of accessors' access mode
(section 4.8.6 of SYCL-1.2.1 specification).
This issue is not about a bug, but imperfect handling of bad user code.
Per both SYCL-1.2.1 and SYCL-2020 (provisional), the source accessor to
handler::copy
must be eitherread
orread_write
.However, the code below compiles and runs fine with the mode set to
discard_write
orwrite
.An example where such a diagnostic would have been helpful (besides just being pedantic):
A kernel that only reads the buffer is enqueued after the
cgh.copy
. If the code had the correct access mode for copying, it would have been possible to execute the kernel and copy the data simultaneously. With the wrong access mode as in the example above, the code works, but the kernel is scheduled to wait for the data copy to complete. A simplestatic_assert
here would have warned the user of their mistake and of missed optimization opportunity.The text was updated successfully, but these errors were encountered: