Fix the precision problem for TruncateDiv.
This commit is contained in:
parent
9757d9da18
commit
931a0b254e
|
@ -1117,8 +1117,8 @@ struct TruncateDivFunc {
|
|||
template <>
|
||||
struct TruncateDivFunc<half> {
|
||||
__device__ __forceinline__ half operator()(const half &lhs, const half &rhs) {
|
||||
float res = truncf(__half2float(lhs) / __half2float(rhs));
|
||||
return __float2half_rn(res);
|
||||
half res = __hdiv(lhs, rhs);
|
||||
return res;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue