Merge pull request #3095 from vpisarev:restore_ocl_div_mul_and_repeat

This commit is contained in:
Vadim Pisarevsky 2014-08-13 13:56:19 +00:00
commit 12c69ad490
3 changed files with 8 additions and 9 deletions

View File

@ -1491,9 +1491,6 @@ static bool ocl_arithm_op(InputArray _src1, InputArray _src2, OutputArray _dst,
if (!doubleSupport && (depth2 == CV_64F || depth1 == CV_64F))
return false;
if( (oclop == OCL_OP_MUL_SCALE || oclop == OCL_OP_DIV_SCALE) && (depth1 >= CV_32F || depth2 >= CV_32F || ddepth >= CV_32F) )
return false;
int kercn = haveMask || haveScalar ? cn : ocl::predictOptimalVectorWidth(_src1, _src2, _dst);
int scalarcn = kercn == 3 ? 4 : kercn, rowsPerWI = d.isIntel() ? 4 : 1;

View File

@ -762,7 +762,7 @@ void flip( InputArray _src, OutputArray _dst, int flip_mode )
flipHoriz( dst.data, dst.step, dst.data, dst.step, dst.size(), esz );
}
/*#ifdef HAVE_OPENCL
#if defined HAVE_OPENCL && !defined __APPLE__
static bool ocl_repeat(InputArray _src, int ny, int nx, OutputArray _dst)
{
@ -790,7 +790,7 @@ static bool ocl_repeat(InputArray _src, int ny, int nx, OutputArray _dst)
return k.run(2, globalsize, NULL, false);
}
#endif*/
#endif
void repeat(InputArray _src, int ny, int nx, OutputArray _dst)
{
@ -800,8 +800,10 @@ void repeat(InputArray _src, int ny, int nx, OutputArray _dst)
Size ssize = _src.size();
_dst.create(ssize.height*ny, ssize.width*nx, _src.type());
/*CV_OCL_RUN(_dst.isUMat(),
ocl_repeat(_src, ny, nx, _dst))*/
#if !defined __APPLE__
CV_OCL_RUN(_dst.isUMat(),
ocl_repeat(_src, ny, nx, _dst))
#endif
Mat src = _src.getMat(), dst = _dst.getMat();
Size dsize = dst.size();

View File

@ -341,7 +341,7 @@ OCL_TEST_P(Mul, Mat_Scalar_Scale)
OCL_OFF(cv::multiply(src1_roi, val, dst1_roi, val[0]));
OCL_ON(cv::multiply(usrc1_roi, val, udst1_roi, val[0]));
Near(udst1_roi.depth() >= CV_32F ? 1e-2 : 1);
Near(udst1_roi.depth() >= CV_32F ? 2e-2 : 1);
}
}
@ -397,7 +397,7 @@ OCL_TEST_P(Div, Mat_Scale)
OCL_OFF(cv::divide(src1_roi, src2_roi, dst1_roi, val[0]));
OCL_ON(cv::divide(usrc1_roi, usrc2_roi, udst1_roi, val[0]));
Near(udst1_roi.depth() >= CV_32F ? 4e-3 : 1);
Near(udst1_roi.depth() >= CV_32F ? 2e-2 : 1);
}
}