diff --git a/sycl/include/sycl/detail/vector_convert.hpp b/sycl/include/sycl/detail/vector_convert.hpp index c4bd584be80da..3af216e495509 100644 --- a/sycl/include/sycl/detail/vector_convert.hpp +++ b/sycl/include/sycl/detail/vector_convert.hpp @@ -804,13 +804,9 @@ NativeToT ConvertToBF16(NativeFromT val) { /// conversion kind. It is expected to be \c DataT template argument of a vector /// we are trying to convert \a to /// \tparam NativeFromT \b scalar or \b vector internal type corresponding to -/// \c FromT, which is used to hold vector data. It is expected to be -/// vec::vector_t of a vector we are trying to convert \a from -/// if VecSize > 1, or result of detail::ConvertToOpenCLType_t +/// \c FromT, which is used to hold vector data. /// \tparam NativeToT \b scalar or \b vector internal type corresponding to -/// \c ToT, which is used to hold vector data. It is expected to be -/// vec::vector_t of a vector we are trying to convert \a from -/// if VecSize > 1, or result of detail::ConvertToOpenCLType_t +/// \c ToT /// /// \note Each pair of types FromT, ToT and NativeFromT, NativeToT can't contain /// the same type, because there are no no-op convert instructions in SPIR-V. @@ -911,9 +907,6 @@ vec vec::convert() const { using OpenCLVecT = OpenCLT __attribute__((ext_vector_type(NumElements))); using OpenCLVecR = OpenCLR __attribute__((ext_vector_type(NumElements))); - auto NativeVector = sycl::bit_cast(*this); - using ConvertTVecType = typename vec::vector_t; - // Whole vector conversion can only be done, if: constexpr bool canUseNativeVectorConvert = #ifdef __NVPTX__ @@ -923,11 +916,6 @@ vec vec::convert() const { false && #endif NumElements > 1 && - // - vec storage has an equivalent OpenCL native vector it is - // implicitly convertible to. There are some corner cases where it - // is not the case with char, long and long long types. - std::is_convertible_v && - std::is_convertible_v && // - it is not a signed to unsigned (or vice versa) conversion // see comments within 'convertImpl' for more details; !detail::is_sint_to_from_uint::value && @@ -939,8 +927,9 @@ vec vec::convert() const { !std::is_same_v; if constexpr (canUseNativeVectorConvert) { - auto val = detail::convertImpl(NativeVector); + auto val = + detail::convertImpl(bit_cast(*this)); Result.m_Data = sycl::bit_cast(val); } else #endif // __SYCL_DEVICE_ONLY__