Merge pull request #1549 from ilya-lavrenov:ocl_perf_norm

pull/1542/merge
Andrey Pavlenko 11 years ago committed by OpenCV Buildbot
commit b396916cdb
  1. 21
      modules/ocl/perf/perf_norm.cpp

@ -51,18 +51,21 @@ using std::tr1::get;
///////////// norm//////////////////////// ///////////// norm////////////////////////
typedef TestBaseWithParam<Size> normFixture; typedef tuple<Size, MatType> normParams;
typedef TestBaseWithParam<normParams> normFixture;
PERF_TEST_P(normFixture, DISABLED_norm, OCL_TYPICAL_MAT_SIZES) // TODO doesn't work properly PERF_TEST_P(normFixture, norm, testing::Combine(
OCL_TYPICAL_MAT_SIZES,
OCL_PERF_ENUM(CV_8UC1, CV_32FC1)))
{ {
const Size srcSize = GetParam(); const normParams params = GetParam();
const std::string impl = getSelectedImpl(); const Size srcSize = get<0>(params);
const int type = get<1>(params);
double value = 0.0; double value = 0.0;
const double eps = CV_MAT_DEPTH(type) == CV_8U ? DBL_EPSILON : 1e-3;
Mat src1(srcSize, CV_8UC1), src2(srcSize, CV_8UC1); Mat src1(srcSize, type), src2(srcSize, type);
declare.in(src1, src2); declare.in(src1, src2, WARMUP_RNG);
randu(src1, 0, 1);
randu(src2, 0, 1);
if (RUN_OCL_IMPL) if (RUN_OCL_IMPL)
{ {
@ -70,7 +73,7 @@ PERF_TEST_P(normFixture, DISABLED_norm, OCL_TYPICAL_MAT_SIZES) // TODO doesn't w
OCL_TEST_CYCLE() value = cv::ocl::norm(oclSrc1, oclSrc2, NORM_INF); OCL_TEST_CYCLE() value = cv::ocl::norm(oclSrc1, oclSrc2, NORM_INF);
SANITY_CHECK(value); SANITY_CHECK(value, eps);
} }
else if (RUN_PLAIN_IMPL) else if (RUN_PLAIN_IMPL)
{ {

Loading…
Cancel
Save