1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 07:13:02 +04:00

added cv::sqrt to T-API (using built-in sqrt OpenCL function)

This commit is contained in:
Ilya Lavrenov
2013-12-12 18:01:30 +04:00
parent b43d6b6858
commit 1d6715e58a
2 changed files with 23 additions and 2 deletions
+5 -2
View File
@@ -2041,9 +2041,12 @@ static bool ocl_pow(InputArray _src, double power, OutputArray _dst)
(depth == CV_64F && !doubleSupport) )
return false;
bool issqrt = std::abs(power - 0.5) < DBL_EPSILON;
const char * const op = issqrt ? "OP_SQRT" : "OP_POW";
ocl::Kernel k("KF", ocl::core::arithm_oclsrc,
format("-D dstT=%s -D OP_POW -D UNARY_OP%s", ocl::typeToStr(CV_MAKE_TYPE(depth, 1)),
doubleSupport ? " -D DOUBLE_SUPPORT" : ""));
format("-D dstT=%s -D %s -D UNARY_OP%s", ocl::typeToStr(CV_MAKE_TYPE(depth, 1)),
op, doubleSupport ? " -D DOUBLE_SUPPORT" : ""));
if (k.empty())
return false;