Switched to TEST_CYCLE_MULTIRUN for fast tests
authorAnna Kogan <anna.kogan@itseez.com>
Wed, 6 Feb 2013 10:53:33 +0000 (14:53 +0400)
committerAnna Kogan <anna.kogan@itseez.com>
Wed, 20 Feb 2013 13:05:54 +0000 (17:05 +0400)
modules/core/perf/perf_compare.cpp
modules/core/perf/perf_convertTo.cpp
modules/core/perf/perf_mat.cpp
modules/core/perf/perf_merge.cpp
modules/core/perf/perf_split.cpp
modules/core/perf/perf_stat.cpp
modules/imgproc/perf/perf_cvt_color.cpp
modules/imgproc/perf/perf_threshold.cpp

index 32f8ba7..5fb755d 100644 (file)
@@ -52,7 +52,8 @@ PERF_TEST_P( Size_MatType_CmpType, compareScalar,
 
     declare.in(src1, src2, WARMUP_RNG).out(dst);
 
-    TEST_CYCLE() cv::compare(src1, src2, dst, cmpType);
+    int runs = (sz.width <= 640) ? 8 : 1;
+    TEST_CYCLE_MULTIRUN(runs) cv::compare(src1, src2, dst, cmpType);
 
     SANITY_CHECK(dst);
 }
index c4e832f..8007361 100644 (file)
@@ -29,9 +29,9 @@ PERF_TEST_P( Size_DepthSrc_DepthDst_Channels_alpha, convertTo,
     Mat src(sz, CV_MAKETYPE(depthSrc, channels));
     randu(src, 0, 255);
     Mat dst(sz, CV_MAKETYPE(depthDst, channels));
-    declare.iterations(500);
 
-    TEST_CYCLE() src.convertTo(dst, depthDst, alpha);
+    int runs = (sz.width <= 640) ? 8 : 1;
+    TEST_CYCLE_MULTIRUN(runs) src.convertTo(dst, depthDst, alpha);
 
     SANITY_CHECK(dst, alpha == 1.0 ? 1e-12 : 1e-7);
 }
index 3749feb..79a3ecd 100644 (file)
@@ -18,7 +18,8 @@ PERF_TEST_P(Size_MatType, Mat_Eye,
 
     declare.out(diagonalMatrix);
 
-    TEST_CYCLE()
+    int runs = (size.width <= 640) ? 15 : 5;
+    TEST_CYCLE_MULTIRUN(runs)
     {
         diagonalMatrix = Mat::eye(size, type);
     }
@@ -38,7 +39,8 @@ PERF_TEST_P(Size_MatType, Mat_Zeros,
 
     declare.out(zeroMatrix);
 
-    TEST_CYCLE()
+    int runs = (size.width <= 640) ? 15 : 5;
+    TEST_CYCLE_MULTIRUN(runs)
     {
         zeroMatrix = Mat::zeros(size, type);
     }
index d10cc81..d82941a 100644 (file)
@@ -30,7 +30,8 @@ PERF_TEST_P( Size_SrcDepth_DstChannels, merge,
     }
 
     Mat dst;
-    TEST_CYCLE() merge( (vector<Mat> &)mv, dst );
+    int runs = (sz.width <= 640) ? 8 : 1;
+    TEST_CYCLE_MULTIRUN(runs) merge( (vector<Mat> &)mv, dst );
 
     SANITY_CHECK(dst, 1e-12);
 }
\ No newline at end of file
index f5de9b6..df9095f 100644 (file)
@@ -26,8 +26,8 @@ PERF_TEST_P( Size_Depth_Channels, split,
     randu(m, 0, 255);
 
     vector<Mat> mv;
-
-    TEST_CYCLE() split(m, (vector<Mat>&)mv);
+    int runs = (sz.width <= 640) ? 8 : 1;
+    TEST_CYCLE_MULTIRUN(runs) split(m, (vector<Mat>&)mv);
 
     SANITY_CHECK(mv, 1e-12);
 }
index 79e849e..b7fc43d 100644 (file)
@@ -97,7 +97,8 @@ PERF_TEST_P(Size_MatType, countNonZero, testing::Combine( testing::Values( TYPIC
 
     declare.in(src, WARMUP_RNG);
 
-    TEST_CYCLE() cnt = countNonZero(src);
+    int runs = (sz.width <= 640) ? 8 : 1;
+    TEST_CYCLE_MULTIRUN(runs) cnt = countNonZero(src);
 
     SANITY_CHECK(cnt);
 }
index 3919539..fd1d045 100644 (file)
@@ -299,10 +299,10 @@ PERF_TEST_P(Size_CvtMode2, cvtColorYUV420,
     Mat src(sz.height + sz.height / 2, sz.width, CV_8UC(ch.scn));
     Mat dst(sz, CV_8UC(ch.dcn));
 
-    declare.time(100);
     declare.in(src, WARMUP_RNG).out(dst);
 
-    TEST_CYCLE() cvtColor(src, dst, mode, ch.dcn);
+    int runs = (sz.width <= 640) ? 8 : 1;
+    TEST_CYCLE_MULTIRUN(runs) cvtColor(src, dst, mode, ch.dcn);
 
     SANITY_CHECK(dst, 1);
 }
index dd1602c..8727b63 100644 (file)
@@ -31,9 +31,9 @@ PERF_TEST_P(Size_MatType_ThreshType, threshold,
     double maxval = theRNG().uniform(1, 254);
 
     declare.in(src, WARMUP_RNG).out(dst);
-    declare.iterations(500);
 
-    TEST_CYCLE() threshold(src, dst, thresh, maxval, threshType);
+    int runs = (sz.width <= 640) ? 8 : 1;
+    TEST_CYCLE_MULTIRUN(runs) threshold(src, dst, thresh, maxval, threshType);
 
     SANITY_CHECK(dst);
 }