mirror of
https://github.com/opencv/opencv.git
synced 2025-08-05 14:06:35 +08:00
Another fix for disable "conditional expression is constant"
This commit is contained in:
parent
3013b469fe
commit
591b1a7e70
@ -669,6 +669,7 @@ static bool ocl_boxFilter( InputArray _src, OutputArray _dst, int ddepth,
|
|||||||
|
|
||||||
size_t maxWorkItemSizes[32]; device.maxWorkItemSizes(maxWorkItemSizes);
|
size_t maxWorkItemSizes[32]; device.maxWorkItemSizes(maxWorkItemSizes);
|
||||||
size_t tryWorkItems = maxWorkItemSizes[0];
|
size_t tryWorkItems = maxWorkItemSizes[0];
|
||||||
|
bool dummy = true; // for make compiler happy
|
||||||
do {
|
do {
|
||||||
size_t BLOCK_SIZE = tryWorkItems;
|
size_t BLOCK_SIZE = tryWorkItems;
|
||||||
while (BLOCK_SIZE > 32 && BLOCK_SIZE >= (size_t)ksize.width * 2 && BLOCK_SIZE > (size_t)sz.width * 2)
|
while (BLOCK_SIZE > 32 && BLOCK_SIZE >= (size_t)ksize.width * 2 && BLOCK_SIZE > (size_t)sz.width * 2)
|
||||||
@ -709,15 +710,15 @@ static bool ocl_boxFilter( InputArray _src, OutputArray _dst, int ddepth,
|
|||||||
|
|
||||||
size_t kernelWorkGroupSize = kernel.workGroupSize();
|
size_t kernelWorkGroupSize = kernel.workGroupSize();
|
||||||
if (localsize[0] <= kernelWorkGroupSize)
|
if (localsize[0] <= kernelWorkGroupSize)
|
||||||
|
{
|
||||||
|
dummy = false;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (BLOCK_SIZE < kernelWorkGroupSize)
|
if (BLOCK_SIZE < kernelWorkGroupSize)
|
||||||
return false;
|
return false;
|
||||||
tryWorkItems = kernelWorkGroupSize;
|
tryWorkItems = kernelWorkGroupSize;
|
||||||
#pragma warning( push )
|
} while (dummy);
|
||||||
#pragma warning( disable : 4127 )
|
|
||||||
} while (true);
|
|
||||||
#pragma warning( pop )
|
|
||||||
|
|
||||||
_dst.create(sz, CV_MAKETYPE(ddepth, cn));
|
_dst.create(sz, CV_MAKETYPE(ddepth, cn));
|
||||||
UMat dst = _dst.getUMat();
|
UMat dst = _dst.getUMat();
|
||||||
|
Loading…
Reference in New Issue
Block a user