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
[SYCL] Switch to use plain array in sycl::vec in more cases (#17804)
### Cherry-pick of: #17656 and some
changes to resolve merge conflicts & make it work.
The problem with using `std::array` in `sycl::vec` is that we cannot
compile it in some environments (namely, Windows) because the former may
use something that is illegal in SYCL device code.
#17025 fixed that, but only did so under preview breaking
changes mode, which does not satisfy some of our customers immediately.
This PR introduces two main changes:
- it allows to opt-in for new behavior through passing
`-D__SYCL_USE_NEW_VEC_IMPL=1` macro without using
`-fpreview-breaking-changes` flag. That allows for a more gradual opt-in
from customers who are interested in this fix
- it switches the imlpementation to use the new approach with C-style
arrays if their size and alignment is the same as for the corresponding
`std::array` - in that case their memory layout is expected to be
absolutely the same and therefore it should be safe to use the new
approach without fear of some ABI incompatibilities. This allows for
customers to benefit from the fix without specifying any extra macro
(which should be the case for the most common platforms out there)
Co-authored-by: Alexey Sachkov <alexey.sachkov@intel.com>
0 commit comments