Skip to content

Commit

Permalink
[SYCL] Workaround for seg fault in vec::convert<> for OpenCL CPU at…
Browse files Browse the repository at this point in the history
… 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.
  • Loading branch information
uditagarwal97 authored Jul 11, 2024
1 parent c30769b commit da02e02
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sycl/include/sycl/vector_preview.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -489,9 +489,9 @@ class vec : public detail::vec_arith<DataT, NumElements> {
!std::is_same_v<convertT, bool>;

if constexpr (canUseNativeVectorConvert) {
Result.m_Data = sycl::bit_cast<decltype(Result.m_Data)>(
detail::convertImpl<T, R, roundingMode, NumElements, OpenCLVecT,
OpenCLVecR>(NativeVector));
auto val = detail::convertImpl<T, R, roundingMode, NumElements, OpenCLVecT,
OpenCLVecR>(NativeVector);
Result.m_Data = sycl::bit_cast<decltype(Result.m_Data)>(val);
} else
#endif // __SYCL_DEVICE_ONLY__
{
Expand Down

0 comments on commit da02e02

Please sign in to comment.