提交 3e55d705 编写于 作者: R Roman Donchenko 提交者: OpenCV Buildbot

Merge pull request #1823 from ilya-lavrenov:ocl_abs_sum

......@@ -394,12 +394,16 @@ Scalar cv::ocl::sum(const oclMat &src)
Scalar cv::ocl::absSum(const oclMat &src)
{
if (!src.clCxt->supportsFeature(FEATURE_CL_DOUBLE) && src.depth() == CV_64F)
int sdepth = src.depth();
if (!src.clCxt->supportsFeature(FEATURE_CL_DOUBLE) && sdepth == CV_64F)
{
CV_Error(CV_OpenCLDoubleNotSupported, "Selected device doesn't support double");
return cv::Scalar::all(0);
}
if (sdepth == CV_8U || sdepth == CV_16U)
return sum(src);
static sumFunc functab[3] =
{
arithmetic_sum<int>,
......@@ -407,7 +411,7 @@ Scalar cv::ocl::absSum(const oclMat &src)
arithmetic_sum<double>
};
int ddepth = std::max(src.depth(), CV_32S);
int ddepth = std::max(sdepth, CV_32S);
sumFunc func = functab[ddepth - CV_32S];
return func(src, ABS_SUM, ddepth);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册