diff --git a/projects/clr/hipamd/include/hip/amd_detail/amd_hip_vector_types.h b/projects/clr/hipamd/include/hip/amd_detail/amd_hip_vector_types.h index 58bc9daf6e..f6ffc1d5ed 100644 --- a/projects/clr/hipamd/include/hip/amd_detail/amd_hip_vector_types.h +++ b/projects/clr/hipamd/include/hip/amd_detail/amd_hip_vector_types.h @@ -1061,32 +1061,47 @@ template struct is_scalar : public integral_constant to HIP_vector_type */ template - __forceinline__ __HOST_DEVICE__ typename std::enable_if<(rankT == 1 && rankU >= rankT), + __forceinline__ __HOST_DEVICE__ typename std::enable_if<(rankT == 1 && rankU >= 1), const HIP_vector_type>::type __hipMapVector(const HIP_vector_type& u) { return HIP_vector_type(static_cast(u.x)); }; template - __forceinline__ __HOST_DEVICE__ typename std::enable_if<(rankT == 2 && rankU >= rankT), + __forceinline__ __HOST_DEVICE__ typename std::enable_if<(rankT == 2 && rankU == 1), const HIP_vector_type>::type __hipMapVector(const HIP_vector_type& u) { - return HIP_vector_type(static_cast(u.x), static_cast(u.y)); + return HIP_vector_type (static_cast(u.x), static_cast(0)); }; template - __forceinline__ __HOST_DEVICE__ typename std::enable_if<(rankT == 3 && rankU >= rankT), + __forceinline__ __HOST_DEVICE__ typename std::enable_if<(rankT == 2 && rankU >= 2), const HIP_vector_type>::type __hipMapVector(const HIP_vector_type& u) { - return HIP_vector_type(static_cast(u.x), static_cast(u.y), - static_cast(u.z)); + return HIP_vector_type (static_cast(u.x), static_cast(u.y)); }; template - __forceinline__ __HOST_DEVICE__ typename std::enable_if<(rankT == 4 && rankU >= rankT), + __forceinline__ __HOST_DEVICE__ typename std::enable_if<(rankT == 4 && rankU == 1), + const HIP_vector_type>::type + __hipMapVector(const HIP_vector_type& u) { + return HIP_vector_type (static_cast(u.x), static_cast(0), + static_cast(0), static_cast(0)); + }; + + template + __forceinline__ __HOST_DEVICE__ typename std::enable_if<(rankT == 4 && rankU == 2), const HIP_vector_type>::type __hipMapVector(const HIP_vector_type& u) { return HIP_vector_type(static_cast(u.x), static_cast(u.y), + static_cast(0), static_cast(0)); + }; + + template + __forceinline__ __HOST_DEVICE__ typename std::enable_if<(rankT == 4 && rankU == 4), + const HIP_vector_type>::type + __hipMapVector(const HIP_vector_type& u) { + return HIP_vector_type (static_cast(u.x), static_cast(u.y), static_cast(u.z), static_cast(u.w)); };