Skip to content

Commit

Permalink
Fix Kernel::run to prevent localsize > globalsize
Browse files Browse the repository at this point in the history
  • Loading branch information
dkurt committed Sep 19, 2018
1 parent fad4797 commit efceafc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/core/src/ocl.cpp
Expand Up @@ -3078,7 +3078,7 @@ bool Kernel::run(int dims, size_t _globalsize[], size_t _localsize[],
dims == 1 ? 64 : dims == 2 ? (i == 0 ? 256 : 8) : dims == 3 ? (8>>(int)(i>0)) : 1;
CV_Assert( val > 0 );
total *= _globalsize[i];
if (_globalsize[i] == 1)
if (_globalsize[i] == 1 && !_localsize)
val = 1;
globalsize[i] = divUp(_globalsize[i], (unsigned int)val) * val;
}
Expand Down

0 comments on commit efceafc

Please sign in to comment.