Relax accuracy requirements in the OpenCL sqrt perf arithmetic test.#19810
Conversation
|
|
||
| SANITY_CHECK(dst, 1e-6, ERROR_RELATIVE); | ||
| if (ocl::Device::getDefault().isIntel()) | ||
| Near(1e-6, true); |
There was a problem hiding this comment.
is it intentional that this is different from the number in test_imgproc.cpp?
There was a problem hiding this comment.
Yes.
Perf tests should not verify accuracy in the accurate way (or even they should not perform that at all)
There was a problem hiding this comment.
this is checking for more accuracy than the test_imgproc.cpp test, I can make the number here the same as test_imgproc? or I could remove the if and leave only SANITY_CHECK(dst, 0.1, ERROR_RELATIVE);
1946458 to
4d2e035
Compare
| // defined accuracy. We know intel devices have accurate native_sqrt, but | ||
| // otherwise stick to a relaxed sanity check. For types larger than 32 bits | ||
| // we can do the accuracy check for all devices as normal. | ||
| if ((CV_MAT_DEPTH(type) == CV_32F && ocl::Device::getDefault().isIntel()) || |
There was a problem hiding this comment.
Need to properly handle case with disabled OpenCL (use strict variant of check tolerance):
#ifdef HAVE_OPENCL
bool strictCheck = !ocl::useOpenCL() || ocl::Device::getDefault().isIntel();
#else
bool strictCheck = true;
#endif
if (... strictCheck ...)
strict;
else
relax;
There was a problem hiding this comment.
looks like this whole file is wrapped in #ifdef HAVE_OPENCL
There was a problem hiding this comment.
ocl::useOpenCL() check is still necessary. #ifdef HAVE_INTEL doesn't help in all cases (compile with OpenCL, but run with OPENCV_OPENCL_RUNTIME=disabled)
In such scenario CPU code is run, so we need to apply strict "old" check.
Similar regression is introduced by this PR: #19793
There was a problem hiding this comment.
Aahh makes sense, sorry about that. Should be fixed now
4d2e035 to
08e8de6
Compare
08e8de6 to
bf8860f
Compare
Also bring perf_imgproc CornerMinEigenVal accuracy requirements in line with the test_imgproc accuracy requirements on that test and fix indentation on the latter. Partially addresses issue opencv#9821
bf8860f to
f3f4609
Compare
Also bring perf_imgproc CornerMinEigenVal accuracy requirements in line with
the test_imgproc accuracy requirements on that test and fix indentation on
the latter.
Partially addresses issue #9821
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.