diff --git a/modules/core/src/mathfuncs.cpp b/modules/core/src/mathfuncs.cpp index 90e0d74a49..f78eca9dbb 100644 --- a/modules/core/src/mathfuncs.cpp +++ b/modules/core/src/mathfuncs.cpp @@ -2057,10 +2057,15 @@ static bool ocl_pow(InputArray _src, double power, OutputArray _dst) ocl::KernelArg srcarg = ocl::KernelArg::ReadOnlyNoSize(src), dstarg = ocl::KernelArg::WriteOnly(dst, cn); - if (depth == CV_32F) - k.args(srcarg, dstarg, (float)power); + if (issqrt) + k.args(srcarg, dstarg); else - k.args(srcarg, dstarg, power); + { + if (depth == CV_32F) + k.args(srcarg, dstarg, (float)power); + else + k.args(srcarg, dstarg, power); + } size_t globalsize[2] = { dst.cols * cn, dst.rows }; return k.run(2, globalsize, NULL, false);