From 462c3c25a9c9f19790b68965862794327e1f15c6 Mon Sep 17 00:00:00 2001 From: Alexander Karsakov Date: Thu, 6 Nov 2014 16:23:02 +0300 Subject: [PATCH] Removed incorrect using of rootn() and powr() in ocl_pow --- modules/core/src/mathfuncs.cpp | 4 ++-- modules/core/src/opencl/arithm.cl | 10 ---------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/modules/core/src/mathfuncs.cpp b/modules/core/src/mathfuncs.cpp index 949682f..1c045f3 100644 --- a/modules/core/src/mathfuncs.cpp +++ b/modules/core/src/mathfuncs.cpp @@ -2478,8 +2478,8 @@ static bool ocl_pow(InputArray _src, double power, OutputArray _dst, if (depth == CV_64F && !doubleSupport) return false; - bool issqrt = std::abs(power - 0.5) < DBL_EPSILON, nonnegative = power >= 0; - const char * const op = issqrt ? "OP_SQRT" : is_ipower ? nonnegative ? "OP_POWN" : "OP_ROOTN" : nonnegative ? "OP_POWR" : "OP_POW"; + bool issqrt = std::abs(power - 0.5) < DBL_EPSILON; + const char * const op = issqrt ? "OP_SQRT" : is_ipower ? "OP_POWN" : "OP_POW"; ocl::Kernel k("KF", ocl::core::arithm_oclsrc, format("-D dstT=%s -D depth=%d -D rowsPerWI=%d -D %s -D UNARY_OP%s", diff --git a/modules/core/src/opencl/arithm.cl b/modules/core/src/opencl/arithm.cl index 3450666..0b81d76 100644 --- a/modules/core/src/opencl/arithm.cl +++ b/modules/core/src/opencl/arithm.cl @@ -277,16 +277,6 @@ #elif defined OP_POW #define PROCESS_ELEM storedst(pow(srcelem1, srcelem2)) -#elif defined OP_ROOTN -#define PROCESS_ELEM storedst(rootn(srcelem1, srcelem2)) - -#elif defined OP_POWR -#if depth == 5 -#define PROCESS_ELEM storedst(native_powr(srcelem1, srcelem2)) -#else -#define PROCESS_ELEM storedst(powr(srcelem1, srcelem2)) -#endif - #elif defined OP_POWN #undef workT #define workT int -- 2.7.4