Skip to content

Commit c9c759f

Browse files
committed
ocl: fix moments global_size (should be >= local_size)
1 parent cc626a3 commit c9c759f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

modules/imgproc/src/moments.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,8 @@ static bool ocl_moments( InputArray _src, Moments& m, bool binary)
510510
int ntiles = xtiles*ytiles;
511511
UMat umbuf(1, ntiles*K, CV_32S);
512512

513-
size_t globalsize[] = {(size_t)xtiles, (size_t)sz.height}, localsize[] = {1, TILE_SIZE};
513+
size_t globalsize[] = {(size_t)xtiles, std::max((size_t)TILE_SIZE, (size_t)sz.height)};
514+
size_t localsize[] = {1, TILE_SIZE};
514515
bool ok = k.args(ocl::KernelArg::ReadOnly(src),
515516
ocl::KernelArg::PtrWriteOnly(umbuf),
516517
xtiles).run(2, globalsize, localsize, true);

0 commit comments

Comments
 (0)