Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
3bcbd2a0
Commit
3bcbd2a0
authored
Apr 30, 2019
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #14451 from alalek:fix_perf_calibation
parents
85ea37ac
cd492677
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
5 deletions
+13
-5
ts_perf.cpp
modules/ts/src/ts_perf.cpp
+13
-5
No files found.
modules/ts/src/ts_perf.cpp
View file @
3bcbd2a0
...
...
@@ -25,7 +25,7 @@ using namespace cvtest;
using
namespace
perf
;
int64
TestBase
::
timeLimitDefault
=
0
;
unsigned
int
TestBase
::
iterationsLimitDefault
=
(
unsigned
int
)(
-
1
)
;
unsigned
int
TestBase
::
iterationsLimitDefault
=
UINT_MAX
;
int64
TestBase
::
_timeadjustment
=
0
;
// Item [0] will be considered the default implementation.
...
...
@@ -1158,7 +1158,7 @@ void TestBase::Init(const std::vector<std::string> & availableImpls,
}
timeLimitDefault
=
param_time_limit
==
0.0
?
1
:
(
int64
)(
param_time_limit
*
cv
::
getTickFrequency
());
iterationsLimitDefault
=
param_force_samples
==
0
?
(
unsigned
)(
-
1
)
:
param_force_samples
;
iterationsLimitDefault
=
param_force_samples
==
0
?
UINT_MAX
:
param_force_samples
;
_timeadjustment
=
_calibrate
();
}
...
...
@@ -1197,9 +1197,13 @@ enum PERF_STRATEGY TestBase::getCurrentModulePerformanceStrategy()
int64
TestBase
::
_calibrate
()
{
CV_TRACE_FUNCTION
();
if
(
iterationsLimitDefault
<=
1
)
return
0
;
class
_helper
:
public
::
perf
::
TestBase
{
public
:
public
:
_helper
()
{
testStrategy
=
PERF_STRATEGY_BASE
;
}
performance_metrics
&
getMetrics
()
{
return
calcMetrics
();
}
virtual
void
TestBody
()
{}
virtual
void
PerfTestBody
()
...
...
@@ -1210,13 +1214,17 @@ int64 TestBase::_calibrate()
cv
::
Mat
b
(
2048
,
2048
,
CV_32S
,
cv
::
Scalar
(
2
));
declare
.
time
(
30
);
double
s
=
0
;
for
(
declare
.
iterations
(
20
);
next
()
&&
startTimer
();
stopTimer
())
declare
.
iterations
(
20
);
minIters
=
nIters
=
20
;
for
(;
next
()
&&
startTimer
();
stopTimer
())
s
+=
a
.
dot
(
b
);
declare
.
time
(
s
);
//self calibration
SetUp
();
for
(
declare
.
iterations
(
1000
);
next
()
&&
startTimer
();
stopTimer
()){}
declare
.
iterations
(
1000
);
minIters
=
nIters
=
1000
;
for
(
int
iters
=
0
;
next
()
&&
startTimer
();
iters
++
,
stopTimer
())
{
/*std::cout << iters << nIters << std::endl;*/
}
}
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment