未验证 提交 e07faf34 编写于 作者: baiyu33's avatar baiyu33 提交者: GitHub

change abs() to fabs() for float args on ARM (#2374)

For compatiblity for old compilers such as ndk-r16b.
`fabs()` keeps result stable.

ref: https://github.com/Tencent/ncnn/issues/2372
上级 14ba6980
......@@ -768,7 +768,7 @@ struct unary_op_abs_fp16s
{
__fp16 operator()(const __fp16& x) const
{
return (__fp16)abs(x);
return (__fp16)fabs(x);
}
};
......@@ -1127,7 +1127,7 @@ struct unary_op_abs
{
float operator()(const float& x) const
{
return abs(x);
return fabs(x);
}
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册