Open Source Computer Vision Library
Go to file
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
.github move GitHub templates into .github folder 2016-03-04 14:20:25 +03:00
3rdparty make Xcode 7.2 happy. 2016-01-13 20:19:19 +08:00
apps missing break statement 2016-03-04 09:41:13 +01:00
cmake Merge pull request #6060 from alalek:fix_opencl_opengl_sharing_6052 2016-02-16 07:10:02 +00:00
data Fix the missing - in file. 2016-02-18 11:28:41 +01:00
doc Removed older libraries pointing to 2.4 in eclipse tutorial docs 2016-03-14 12:09:56 +01:00
include include available modules only 2016-01-20 13:07:46 +03:00
modules fix potential race condition in canny.cl. 2016-03-15 19:11:15 +08:00
platforms Merge pull request #5923 from powderluv:master 2016-01-14 12:07:02 +00:00
samples train_svmsgd.cpp : float response 2016-03-14 08:09:36 +01:00
.gitattributes Made changes to OpenCVFindMatlab suggested by SpecLad 2013-09-14 13:32:15 +10:00
.gitignore Improved thrust interop tutorial. 2015-09-24 09:32:38 -04:00
.tgitconfig Add tgit.icon project config 2014-02-26 17:46:52 +08:00
CMakeLists.txt cmake: remove non-ascii symbols 2016-02-09 14:44:05 +03:00
CONTRIBUTING.md add link to contributing guidelines 2015-09-17 14:15:20 +02:00
LICENSE Update license year range to 2016 2016-01-18 10:11:01 +05:30
README.md Removed gittip link 2016-02-08 11:04:19 +03:00

OpenCV: Open Source Computer Vision Library

Resources

Contributing

Please read before starting work on a pull request: https://github.com/Itseez/opencv/wiki/How_to_contribute

Summary of guidelines:

  • One pull request per issue;
  • Choose the right base branch;
  • Include tests and documentation;
  • Clean up "oops" commits before submitting;
  • Follow the coding style guide.