!48792 Fix the precision problem for TruncateDiv
Merge pull request !48792 from zhanzhan/truncatediv
This commit is contained in:
commit
5b6ffcf7ce
|
@ -1123,8 +1123,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