Updated by Andrey Kamaev over 12 years ago

Some OpenCL based OpenCV code (in stereoKernel, but probably in some other places) has the OpenCL barrier accessed under the branch condition. See the following sample below where InitColSSD function has a barrier inside.

<pre><code class="cpp">

===================================

if (col_ssd_extra > 0)
if (x_tex + BLOCK_W < cwidth)
InitColSSD(x_tex + BLOCK_W, y_tex, img_step, left, right,d, col_ssd_extra radius);
</code></pre>


====================================
And according with OpenCL spec at the barrier ALL kernels should stop waiting for ALL other kernels to arrive to the barrier. And in this scenario it never happens resulting in the test system hang-up.
The bug may be seen not on all systems cause some OpenCL implementations may kill the hanging kernels after some amount of time. However this is NOT OpenCL default and specified behavior so the bug needs to be fixed.
The simplest way to reproduce it is to run @opencv_ocl\ocl\opencv\modules\gpu\test\test_calib3d.cpp@ opencv_ocl\ocl\opencv\modules\gpu\test\test_calib3d.cpp on Intel OpenCL enabled system

Back