Skip to content

Commit 50b9a5a

Browse files
committed
ts(perf): initialize ThreadPool
1 parent 230f22b commit 50b9a5a

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

modules/ts/src/ts_perf.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1212,6 +1212,18 @@ int64 TestBase::_calibrate()
12121212
}
12131213
};
12141214

1215+
// Initialize ThreadPool
1216+
class _dummyParallel : public ParallelLoopBody
1217+
{
1218+
public:
1219+
void operator()(const cv::Range& range) const
1220+
{
1221+
// nothing
1222+
CV_UNUSED(range);
1223+
}
1224+
};
1225+
parallel_for_(cv::Range(0, 1000), _dummyParallel());
1226+
12151227
_timeadjustment = 0;
12161228
_helper h;
12171229
h.PerfTestBody();
@@ -1838,6 +1850,8 @@ void TestBase::SetUp()
18381850

18391851
if (param_threads >= 0)
18401852
cv::setNumThreads(param_threads);
1853+
else
1854+
cv::setNumThreads(-1);
18411855

18421856
#ifdef __ANDROID__
18431857
if (param_affinity_mask)

0 commit comments

Comments
 (0)