From cb4267cb38434abb7115fe68a2ab1aa3946c0ac2 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Tue, 3 Dec 2013 01:08:12 +0400 Subject: [PATCH] ts/perf: int -> enum WarmUpType --- modules/ts/include/opencv2/ts/ts_perf.hpp | 24 +++++++++++------------ modules/ts/src/ts_perf.cpp | 22 ++++++++++----------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/modules/ts/include/opencv2/ts/ts_perf.hpp b/modules/ts/include/opencv2/ts/ts_perf.hpp index 3fc980ad00..40f3c951c7 100644 --- a/modules/ts/include/opencv2/ts/ts_perf.hpp +++ b/modules/ts/include/opencv2/ts/ts_perf.hpp @@ -288,7 +288,7 @@ protected: //_declareHelper declare; - enum + enum WarmUpType { WARMUP_READ, WARMUP_WRITE, @@ -297,7 +297,7 @@ protected: }; void reportMetrics(bool toJUnitXML = false); - static void warmup(cv::InputOutputArray a, int wtype = WARMUP_READ); + static void warmup(cv::InputOutputArray a, WarmUpType wtype = WARMUP_READ); performance_metrics& calcMetrics(); void RunPerfTestBody(); @@ -327,23 +327,23 @@ private: static int64 _timeadjustment; static int64 _calibrate(); - static void warmup_impl(cv::Mat m, int wtype); + static void warmup_impl(cv::Mat m, WarmUpType wtype); static int getSizeInBytes(cv::InputArray a); static cv::Size getSize(cv::InputArray a); - static void declareArray(SizeVector& sizes, cv::InputOutputArray a, int wtype = 0); + static void declareArray(SizeVector& sizes, cv::InputOutputArray a, WarmUpType wtype); class CV_EXPORTS _declareHelper { public: - _declareHelper& in(cv::InputOutputArray a1, int wtype = WARMUP_READ); - _declareHelper& in(cv::InputOutputArray a1, cv::InputOutputArray a2, int wtype = WARMUP_READ); - _declareHelper& in(cv::InputOutputArray a1, cv::InputOutputArray a2, cv::InputOutputArray a3, int wtype = WARMUP_READ); - _declareHelper& in(cv::InputOutputArray a1, cv::InputOutputArray a2, cv::InputOutputArray a3, cv::InputOutputArray a4, int wtype = WARMUP_READ); + _declareHelper& in(cv::InputOutputArray a1, WarmUpType wtype = WARMUP_READ); + _declareHelper& in(cv::InputOutputArray a1, cv::InputOutputArray a2, WarmUpType wtype = WARMUP_READ); + _declareHelper& in(cv::InputOutputArray a1, cv::InputOutputArray a2, cv::InputOutputArray a3, WarmUpType wtype = WARMUP_READ); + _declareHelper& in(cv::InputOutputArray a1, cv::InputOutputArray a2, cv::InputOutputArray a3, cv::InputOutputArray a4, WarmUpType wtype = WARMUP_READ); - _declareHelper& out(cv::InputOutputArray a1, int wtype = WARMUP_WRITE); - _declareHelper& out(cv::InputOutputArray a1, cv::InputOutputArray a2, int wtype = WARMUP_WRITE); - _declareHelper& out(cv::InputOutputArray a1, cv::InputOutputArray a2, cv::InputOutputArray a3, int wtype = WARMUP_WRITE); - _declareHelper& out(cv::InputOutputArray a1, cv::InputOutputArray a2, cv::InputOutputArray a3, cv::InputOutputArray a4, int wtype = WARMUP_WRITE); + _declareHelper& out(cv::InputOutputArray a1, WarmUpType wtype = WARMUP_WRITE); + _declareHelper& out(cv::InputOutputArray a1, cv::InputOutputArray a2, WarmUpType wtype = WARMUP_WRITE); + _declareHelper& out(cv::InputOutputArray a1, cv::InputOutputArray a2, cv::InputOutputArray a3, WarmUpType wtype = WARMUP_WRITE); + _declareHelper& out(cv::InputOutputArray a1, cv::InputOutputArray a2, cv::InputOutputArray a3, cv::InputOutputArray a4, WarmUpType wtype = WARMUP_WRITE); _declareHelper& iterations(unsigned int n); _declareHelper& time(double timeLimitSecs); diff --git a/modules/ts/src/ts_perf.cpp b/modules/ts/src/ts_perf.cpp index d1c03ccd7a..1b95b1ac42 100644 --- a/modules/ts/src/ts_perf.cpp +++ b/modules/ts/src/ts_perf.cpp @@ -851,7 +851,7 @@ TestBase::TestBase(): declare(this) #endif -void TestBase::declareArray(SizeVector& sizes, cv::InputOutputArray a, int wtype) +void TestBase::declareArray(SizeVector& sizes, cv::InputOutputArray a, WarmUpType wtype) { if (!a.empty()) { @@ -862,7 +862,7 @@ void TestBase::declareArray(SizeVector& sizes, cv::InputOutputArray a, int wtype ADD_FAILURE() << " Uninitialized input/output parameters are not allowed for performance tests"; } -void TestBase::warmup(cv::InputOutputArray a, int wtype) +void TestBase::warmup(cv::InputOutputArray a, WarmUpType wtype) { if (a.empty()) return; if (a.kind() != cv::_InputArray::STD_VECTOR_MAT && a.kind() != cv::_InputArray::STD_VECTOR_VECTOR) @@ -974,7 +974,7 @@ bool TestBase::next() return has_next; } -void TestBase::warmup_impl(cv::Mat m, int wtype) +void TestBase::warmup_impl(cv::Mat m, WarmUpType wtype) { switch(wtype) { @@ -1411,14 +1411,14 @@ TestBase::_declareHelper& TestBase::_declareHelper::runs(unsigned int runsNumber return *this; } -TestBase::_declareHelper& TestBase::_declareHelper::in(cv::InputOutputArray a1, int wtype) +TestBase::_declareHelper& TestBase::_declareHelper::in(cv::InputOutputArray a1, WarmUpType wtype) { if (!test->times.empty()) return *this; TestBase::declareArray(test->inputData, a1, wtype); return *this; } -TestBase::_declareHelper& TestBase::_declareHelper::in(cv::InputOutputArray a1, cv::InputOutputArray a2, int wtype) +TestBase::_declareHelper& TestBase::_declareHelper::in(cv::InputOutputArray a1, cv::InputOutputArray a2, WarmUpType wtype) { if (!test->times.empty()) return *this; TestBase::declareArray(test->inputData, a1, wtype); @@ -1426,7 +1426,7 @@ TestBase::_declareHelper& TestBase::_declareHelper::in(cv::InputOutputArray a1, return *this; } -TestBase::_declareHelper& TestBase::_declareHelper::in(cv::InputOutputArray a1, cv::InputOutputArray a2, cv::InputOutputArray a3, int wtype) +TestBase::_declareHelper& TestBase::_declareHelper::in(cv::InputOutputArray a1, cv::InputOutputArray a2, cv::InputOutputArray a3, WarmUpType wtype) { if (!test->times.empty()) return *this; TestBase::declareArray(test->inputData, a1, wtype); @@ -1435,7 +1435,7 @@ TestBase::_declareHelper& TestBase::_declareHelper::in(cv::InputOutputArray a1, return *this; } -TestBase::_declareHelper& TestBase::_declareHelper::in(cv::InputOutputArray a1, cv::InputOutputArray a2, cv::InputOutputArray a3, cv::InputOutputArray a4, int wtype) +TestBase::_declareHelper& TestBase::_declareHelper::in(cv::InputOutputArray a1, cv::InputOutputArray a2, cv::InputOutputArray a3, cv::InputOutputArray a4, WarmUpType wtype) { if (!test->times.empty()) return *this; TestBase::declareArray(test->inputData, a1, wtype); @@ -1445,14 +1445,14 @@ TestBase::_declareHelper& TestBase::_declareHelper::in(cv::InputOutputArray a1, return *this; } -TestBase::_declareHelper& TestBase::_declareHelper::out(cv::InputOutputArray a1, int wtype) +TestBase::_declareHelper& TestBase::_declareHelper::out(cv::InputOutputArray a1, WarmUpType wtype) { if (!test->times.empty()) return *this; TestBase::declareArray(test->outputData, a1, wtype); return *this; } -TestBase::_declareHelper& TestBase::_declareHelper::out(cv::InputOutputArray a1, cv::InputOutputArray a2, int wtype) +TestBase::_declareHelper& TestBase::_declareHelper::out(cv::InputOutputArray a1, cv::InputOutputArray a2, WarmUpType wtype) { if (!test->times.empty()) return *this; TestBase::declareArray(test->outputData, a1, wtype); @@ -1460,7 +1460,7 @@ TestBase::_declareHelper& TestBase::_declareHelper::out(cv::InputOutputArray a1, return *this; } -TestBase::_declareHelper& TestBase::_declareHelper::out(cv::InputOutputArray a1, cv::InputOutputArray a2, cv::InputOutputArray a3, int wtype) +TestBase::_declareHelper& TestBase::_declareHelper::out(cv::InputOutputArray a1, cv::InputOutputArray a2, cv::InputOutputArray a3, WarmUpType wtype) { if (!test->times.empty()) return *this; TestBase::declareArray(test->outputData, a1, wtype); @@ -1469,7 +1469,7 @@ TestBase::_declareHelper& TestBase::_declareHelper::out(cv::InputOutputArray a1, return *this; } -TestBase::_declareHelper& TestBase::_declareHelper::out(cv::InputOutputArray a1, cv::InputOutputArray a2, cv::InputOutputArray a3, cv::InputOutputArray a4, int wtype) +TestBase::_declareHelper& TestBase::_declareHelper::out(cv::InputOutputArray a1, cv::InputOutputArray a2, cv::InputOutputArray a3, cv::InputOutputArray a4, WarmUpType wtype) { if (!test->times.empty()) return *this; TestBase::declareArray(test->outputData, a1, wtype);