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:
nluehr 2017-11-21 10:47:00 -08:00 committed by David Tellenbach
parent 89a86ed422
commit 4707c3aa86

View File

@ -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
}