mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-07-24 22:04:28 +08:00
Fix incorrect integer cast in predux<half2>().
Bug corrupts results on Maxwell and earlier GPU architectures. (cherry picked from commit dd6de618c3fda4275aff3a57c590f82b6e628ac1)
This commit is contained in:
parent
89a86ed422
commit
4707c3aa86
@ -230,7 +230,7 @@ template<> __device__ EIGEN_STRONG_INLINE Eigen::half predux<half2>(const half2&
|
||||
#else
|
||||
float a1 = __low2float(a);
|
||||
float a2 = __high2float(a);
|
||||
return Eigen::half(half_impl::raw_uint16_to_half(__float2half_rn(a1 + a2)));
|
||||
return Eigen::half(__float2half_rn(a1 + a2));
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -264,7 +264,7 @@ template<> __device__ EIGEN_STRONG_INLINE Eigen::half predux_mul<half2>(const ha
|
||||
#else
|
||||
float a1 = __low2float(a);
|
||||
float a2 = __high2float(a);
|
||||
return Eigen::half(half_impl::raw_uint16_to_half(__float2half_rn(a1 * a2)));
|
||||
return Eigen::half(__float2half_rn(a1 * a2));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user