diff --git a/modules/ocl/src/imgproc.cpp b/modules/ocl/src/imgproc.cpp index e3b3d25227..5ffb9dcf8e 100644 --- a/modules/ocl/src/imgproc.cpp +++ b/modules/ocl/src/imgproc.cpp @@ -1661,7 +1661,7 @@ Size cv::ocl::ConvolveBuf::estimateBlockSize(Size result_size, Size /*templ_size int width = (result_size.width + 2) / 3; int height = (result_size.height + 2) / 3; width = std::min(width, result_size.width); - height = std::min(height, result_size.height); + height = std::min(height, result_size.height); return Size(width, height); } @@ -1714,7 +1714,7 @@ static void convolve_run_fft(const oclMat &image, const oclMat &templ, oclMat &r Size result_roi_size(std::min(x + block_size.width, result.cols) - x, std::min(y + block_size.height, result.rows) - y); - + Rect roi1(x, y, result_roi_size.width, result_roi_size.height); Rect roi2(0, 0, result_roi_size.width, result_roi_size.height); @@ -1727,6 +1727,9 @@ static void convolve_run_fft(const oclMat &image, const oclMat &templ, oclMat &r #else CV_Error(CV_StsNotImplemented, "OpenCL DFT is not implemented"); +#define UNUSED(x) (void)(x); + UNUSED(image) UNUSED(templ) UNUSED(result) UNUSED(ccorr) UNUSED(buf) +#undef UNUSED #endif } static void convolve_run(const oclMat &src, const oclMat &temp1, oclMat &dst, String kernelName, const char **kernelString) diff --git a/modules/ocl/src/match_template.cpp b/modules/ocl/src/match_template.cpp index 9dee1f4ea7..77f7b1d637 100644 --- a/modules/ocl/src/match_template.cpp +++ b/modules/ocl/src/match_template.cpp @@ -112,6 +112,9 @@ namespace cv else return false; #else +#define UNUSED(x) (void)(x); + UNUSED(method) UNUSED(depth) UNUSED(size) +#undef UNUSED return true; #endif } diff --git a/modules/ocl/src/opencl/imgproc_mulAndScaleSpectrums.cl b/modules/ocl/src/opencl/imgproc_mulAndScaleSpectrums.cl index 7d3774d070..86d4e5d520 100644 --- a/modules/ocl/src/opencl/imgproc_mulAndScaleSpectrums.cl +++ b/modules/ocl/src/opencl/imgproc_mulAndScaleSpectrums.cl @@ -54,16 +54,16 @@ inline cfloat conjf(cfloat a) return (cfloat)( a.x, - a.y ); } -__kernel void - mulAndScaleSpectrumsKernel( - __global const cfloat* a, - __global const cfloat* b, - float scale, - __global cfloat* dst, - uint cols, - uint rows, +__kernel void +mulAndScaleSpectrumsKernel( + __global const cfloat* a, + __global const cfloat* b, + float scale, + __global cfloat* dst, + uint cols, + uint rows, uint mstep - ) +) { const uint x = get_global_id(0); const uint y = get_global_id(1); @@ -74,16 +74,16 @@ __kernel void dst[idx] = (cfloat)( v.x * scale, v.y * scale ); } } -__kernel void - mulAndScaleSpectrumsKernel_CONJ( - __global const cfloat* a, - __global const cfloat* b, - float scale, - __global cfloat* dst, - uint cols, - uint rows, +__kernel void +mulAndScaleSpectrumsKernel_CONJ( + __global const cfloat* a, + __global const cfloat* b, + float scale, + __global cfloat* dst, + uint cols, + uint rows, uint mstep - ) +) { const uint x = get_global_id(0); const uint y = get_global_id(1); diff --git a/modules/ocl/test/test_fft.cpp b/modules/ocl/test/test_fft.cpp index d19a471328..030ea1ff1a 100644 --- a/modules/ocl/test/test_fft.cpp +++ b/modules/ocl/test/test_fft.cpp @@ -226,7 +226,7 @@ TEST_P(Convolve_DFT, Accuracy) cv::ocl::oclMat dst; cv::ocl::convolve(cv::ocl::oclMat(src), cv::ocl::oclMat(kernel), dst, ccorr); - + cv::Mat dst_gold; convolveDFT(src, kernel, dst_gold, ccorr);