Skip to content

Commit

Permalink
now the tests pass with loop_times==30
Browse files Browse the repository at this point in the history
  • Loading branch information
vpisarev committed Aug 13, 2014
1 parent 30111a7 commit d97f9fc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
3 changes: 0 additions & 3 deletions modules/core/src/arithm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
10 changes: 6 additions & 4 deletions modules/core/src/copy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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)
{
Expand All @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions modules/core/test/ocl/test_arithm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down Expand Up @@ -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);
}
}

Expand Down

0 comments on commit d97f9fc

Please sign in to comment.