Made predux_min and predux_max on fp16 less noisy

This commit is contained in:
Benoit Steiner 2016-05-11 17:37:34 -07:00
parent 9091351dbe
commit 56a1757d74

View File

@ -245,7 +245,7 @@ template<> EIGEN_DEVICE_FUNC inline half predux_max<half2>(const half2& a) {
#else #else
float a1 = __low2float(a); float a1 = __low2float(a);
float a2 = __high2float(a); float a2 = __high2float(a);
return half(__float2half_rn(numext::maxi(a1, a2))); return a1 > a2 ? __low2half(a) : __high2half(a);
#endif #endif
} }
@ -257,7 +257,7 @@ template<> EIGEN_DEVICE_FUNC inline half predux_min<half2>(const half2& a) {
#else #else
float a1 = __low2float(a); float a1 = __low2float(a);
float a2 = __high2float(a); float a2 = __high2float(a);
return half(__float2half_rn(numext::mini(a1, a2))); return a1 < a2 ? __low2half(a) : __high2half(a);
#endif #endif
} }