arm64 fix: Replaced float value strong equal checks with check with tolerance#19128
Conversation
| // FIXME: use a comparison functor instead (after enabling OpenCL) | ||
| { | ||
| EXPECT_EQ(0, cvtest::norm(out_mat_ocv, out_mat_gapi, NORM_INF)); | ||
| EXPECT_LT(cvtest::norm(out_mat_ocv, out_mat_gapi, NORM_INF), 4e-6); |
There was a problem hiding this comment.
hmm in google tests' EXPECT(a,b) a is a golden reference usually, does this mean it should be EXPECT_GT(4e-6, norm..)) ?
There was a problem hiding this comment.
This rule is for _EQ only due to output messages (LT,LE,GT,GE doesn't require that)
There was a problem hiding this comment.
Why not EXPECT_FLOAT_EQ(0, cvtest::norm()) / EXPECT_NEAR() ? 4e-6 looks like a magic number to me.
| // FIXME: use a comparison functor instead (after enabling OpenCL) | ||
| { | ||
| EXPECT_EQ(0, cvtest::norm(out_mat_ocv, out_mat_gapi, NORM_INF)); | ||
| EXPECT_LT(cvtest::norm(out_mat_ocv, out_mat_gapi, NORM_INF), 4e-6); |
There was a problem hiding this comment.
Please put this ARM check under:
#if defined(__aarch64__) || defined(__arm__)
guard and keep original check "as is".
BTW, almost all failures on ARM64 are about the "Fluid" backend.
CPU (OpenCV) backend results should stay the same.
It make sense to G-API team implement the "FIXME" comment about the comparison functor as test parameter later.
| // FIXME: use a comparison functor instead (after enabling OpenCL) | ||
| { | ||
| EXPECT_EQ(0, cvtest::norm(out_mat_ocv, out_mat_gapi, NORM_INF)); | ||
| EXPECT_LT(cvtest::norm(out_mat_ocv, out_mat_gapi, NORM_INF), 4e-6); |
There was a problem hiding this comment.
Why not EXPECT_FLOAT_EQ(0, cvtest::norm()) / EXPECT_NEAR() ? 4e-6 looks like a magic number to me.
| // FIXME: use a comparison functor instead (after enabling OpenCL) | ||
| { | ||
| EXPECT_EQ(0, cvtest::norm(out_mat_ocv, out_mat_gapi, NORM_INF)); | ||
| EXPECT_LT(cvtest::norm(out_mat_ocv, out_mat_gapi, NORM_INF), 4e-6); |
1736ee2 to
edf0d83
Compare
edf0d83 to
009860e
Compare
Fixes: #19117
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.