-
-
Notifications
You must be signed in to change notification settings - Fork 56.5k
Arm: fix the test failure of OCL_Imgproc/CLAHETest.Accuracy on ODROID-XU4 #11408
Copy link
Copy link
Closed
Description
System information (version)
- OpenCV => recent master ( 61edcee )
- Operating System / Platform => Ubuntu 16.04 Arm ODROID-XU4 + Mali T628
- Compiler => GCC 5.4.0
Detailed description
- The test
OCL_Imgproc/CLAHETest.Accuracywas failing on ODROID-XU4
OpenCV version: 3.4.1-dev
OpenCV VCS version: 3.4.1-314-g61edcee
Build type: release
Parallel framework: pthreads
CPU features: neon
[ INFO:0] Initialize OpenCL runtime...
OpenCL Platforms:
ARM Platform
iGPU: Mali-T628 (OpenCL 1.2 v1.r17p0-01rel0.a881d28363cdb20f0017ed13c980967e)
(sniip)
[==========] 24 tests from 1 test case ran. (625 ms total)
[ PASSED ] 22 tests.
[ FAILED ] 2 tests, listed below:
[ FAILED ] OCL_Imgproc/CLAHETest.Accuracy/18, where GetParam() = (8x64, 10, false)
[ FAILED ] OCL_Imgproc/CLAHETest.Accuracy/19, where GetParam() = (8x64, 10, true)
- But this test failure didn't happen on other "Mali" devices, such as Tinker Board, Firefly RK3399.
- More than that, the test did pass on ODROID-XU4, randomly
OpenCV version: 3.4.1-dev
OpenCV VCS version: 3.4.1-314-g61edcee
Build type: release
Parallel framework: pthreads
CPU features: neon
[ INFO:0] Initialize OpenCL runtime...
OpenCL Platforms:
ARM Platform
iGPU: Mali-T628 (OpenCL 1.2 v1.r17p0-01rel0.a881d28363cdb20f0017ed13c980967e)
(sniip)
[==========] 24 tests from 1 test case ran. (490 ms total)
[ PASSED ] 24 tests.
- I could figure out that the result from GPU was varying, when the CPU version kept still.
- Reading the source code of clahe.cl, I realized there is a race condition in the reduction
barrier(CLK_LOCAL_MEM_FENCE);
if (tid < 8)
{
#endif
smem[tid] += smem[tid + 8];
smem[tid] += smem[tid + 4];
smem[tid] += smem[tid + 2];
smem[tid] += smem[tid + 1];
}
- I add more lock in between the add, and so far, the random failure didn't happen after 100 iterations of
opencv_test_imgproc - I'll send a PR later.
Steps to reproduce
- Run
opencv_test_imgprocon ODROID-XU4
Reactions are currently unavailable