opencv/modules/imgproc
Zhigang Gong 0b08d2559e fix potential race condition in canny.cl.
See the below code snippet:

while(l_counter != 0)
{
    int mod = l_counter % LOCAL_TOTAL;
    int pix_per_thr = l_counter / LOCAL_TOTAL + ((lid < mod) ? 1 : 0);

    for (int i = 0; i < pix_per_thr; ++i)
    {
        int index = atomic_dec(&l_counter) - 1;
        ....
    }
    ....
    barrier(CLK_LOCAL_MEM_FENCE);
}

If we don't put a barrier before the for loop, then there is a possiblity
that some work item enter this loop but the others are not, the the l_counter
will be reduced in the for loop and may be changed to zero, and the other
work items may can't enter the while loop. If this happens, it breaks the
barrier's rule which requires all the work items reach the same barrier.
And it may hang the GPU depends on the implementation of opencl platform.

This issue is raised at:
https://github.com/Itseez/opencv/issues/5175

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2016-03-15 19:11:15 +08:00
..
doc Added Subdiv2D class documentation 2016-03-01 23:08:48 +02:00
include/opencv2 Added separate hal::SepFilter2D class 2016-03-03 18:56:12 +03:00
misc/java Simple Moments class for Java 2015-12-16 10:53:14 +03:00
perf Visual Studio 2015 warning and test fixes 2015-10-20 12:48:37 +03:00
src fix potential race condition in canny.cl. 2016-03-15 19:11:15 +08:00
test fix logPolar/linearPolar 2016-03-03 18:33:11 +03:00
CMakeLists.txt Python support 2015-03-02 18:13:00 +03:00