Relax accuracy requirement on OpenCL MinEigenVal corner kernel test.
authorAaron Greig <aaron.greig@codeplay.com>
Fri, 26 Mar 2021 12:11:49 +0000 (12:11 +0000)
committerAaron Greig <aaron.greig@codeplay.com>
Mon, 29 Mar 2021 11:06:02 +0000 (12:06 +0100)
The MinEigenVal path through the corner.cl kernel makes use of native_sqrt,
a math builtin function which has implementation defined accuracy.

Partially addresses issue #9821

modules/imgproc/test/ocl/test_imgproc.cpp

index f5a3fef89cc2ec4b607b25a0337b6cd2cd963f30..35185d339fbbaca7183f36d9156ebaff09a9cf70 100644 (file)
@@ -234,7 +234,10 @@ OCL_TEST_P(CornerMinEigenVal, Mat)
         OCL_OFF(cv::cornerMinEigenVal(src_roi, dst_roi, blockSize, apertureSize, borderType));
         OCL_ON(cv::cornerMinEigenVal(usrc_roi, udst_roi, blockSize, apertureSize, borderType));
 
-        Near(1e-5, true);
+        if (ocl::Device::getDefault().isIntel())
+          Near(1e-5, true);
+        else
+          Near(0.1, true);  // using native_* OpenCL functions may lose accuracy
     }
 }