Skip to content

Commit da02e02

Browse files
[SYCL] Workaround for seg fault in vec::convert<> for OpenCL CPU at O0 (#14498)
There seems to be a bug in CodeGen for OpenCL CPU which causes a seg-fault in `vec::convert<>`, when converting to `vec<long, 8>` at O0. To unblock #14317, this PR proposes a non-functional change as a workaround for the CodeGen bug.
1 parent c30769b commit da02e02

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sycl/include/sycl/vector_preview.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -489,9 +489,9 @@ class vec : public detail::vec_arith<DataT, NumElements> {
489489
!std::is_same_v<convertT, bool>;
490490

491491
if constexpr (canUseNativeVectorConvert) {
492-
Result.m_Data = sycl::bit_cast<decltype(Result.m_Data)>(
493-
detail::convertImpl<T, R, roundingMode, NumElements, OpenCLVecT,
494-
OpenCLVecR>(NativeVector));
492+
auto val = detail::convertImpl<T, R, roundingMode, NumElements, OpenCLVecT,
493+
OpenCLVecR>(NativeVector);
494+
Result.m_Data = sycl::bit_cast<decltype(Result.m_Data)>(val);
495495
} else
496496
#endif // __SYCL_DEVICE_ONLY__
497497
{

0 commit comments

Comments
 (0)