Skip to content

Commit

Permalink
Merge pull request opencv#3181 from akarsakov:ocl_mul_scale_test_fix
Browse files Browse the repository at this point in the history
alalek committed Sep 2, 2014

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
2 parents a125cd6 + ec827be commit 7dd666e
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions modules/core/test/ocl/test_arithm.cpp
Original file line number Diff line number Diff line change
@@ -175,9 +175,12 @@ PARAM_TEST_CASE(ArithmTestBase, MatDepth, Channels, bool)
UMAT_UPLOAD_OUTPUT_PARAMETER(dst2);
}

void Near(double threshold = 0.)
void Near(double threshold = 0., bool relative = false)
{
OCL_EXPECT_MATS_NEAR(dst1, threshold);
if (!relative)
OCL_EXPECT_MATS_NEAR(dst1, threshold);
else
OCL_EXPECT_MATS_NEAR_RELATIVE(dst1, threshold);
}

void Near1(double threshold = 0.)
@@ -341,7 +344,10 @@ 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);
if (udst1_roi.depth() >= CV_32F)
Near(1e-6, true);
else
Near(1);
}
}

0 comments on commit 7dd666e

Please sign in to comment.