Skip to content

Commit

Permalink
Merge branch 'master' into gemm-quantize-x86
Browse files Browse the repository at this point in the history
  • Loading branch information
nihui authored Dec 5, 2024
2 parents 9a8d97c + a9553fc commit 8ec4d6f
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/test_unaryop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,26 @@ static int test_unaryop(const ncnn::Mat& _a)
// smaller range for tan asin acos
Randomize(a, -1.f, 1.f);
}
#if __powerpc__
// nearbyintf produces wrong result in halfway cases, why ?
// too troublesome to resolve the compiler or qemu problem
// so just skip them --- nihui
if (op_type == 18)
{
// drop 0.4 ~ 0.6
for (int i = 0; i < a.total(); i++)
{
float v = a[i];
float vv = fabs(v - (int)v);
while (vv > 0.4f && vv < 0.6f)
{
v = RandomFloat(-15, 15);
vv = fabs(v - (int)v);
}
a[i] = v;
}
}
#endif // __powerpc__

ncnn::ParamDict pd;
pd.set(0, op_type);
Expand Down

0 comments on commit 8ec4d6f

Please sign in to comment.