Replace __float2half_rn with __float2half

The latter provides a consistent definition for CUDA 8.0 and 9.0.
This commit is contained in:
nluehr 2017-11-28 10:15:46 -08:00
parent d0b028e173
commit aefd5fd5c4

View File

@ -231,7 +231,7 @@ template<> __device__ EIGEN_STRONG_INLINE Eigen::half predux<half2>(const half2&
#else #else
float a1 = __low2float(a); float a1 = __low2float(a);
float a2 = __high2float(a); float a2 = __high2float(a);
return Eigen::half(__float2half_rn(a1 + a2)); return Eigen::half(__float2half(a1 + a2));
#endif #endif
} }
@ -265,7 +265,7 @@ template<> __device__ EIGEN_STRONG_INLINE Eigen::half predux_mul<half2>(const ha
#else #else
float a1 = __low2float(a); float a1 = __low2float(a);
float a2 = __high2float(a); float a2 = __high2float(a);
return Eigen::half(__float2half_rn(a1 * a2)); return Eigen::half(__float2half(a1 * a2));
#endif #endif
} }