Added possibility to configure TBB behavior in Perf tests --- now we can set the number of TBB threads in the perf tests either as console parameter perf_tbb_nthreads or

in a test itself using the method declare.tbb_threads(n).
This commit is contained in:
Leonid Beynenson
2011-10-31 16:22:05 +00:00
parent 1d5e407211
commit 59d89c7a7a
3 changed files with 34 additions and 1 deletions

View File

@@ -4,6 +4,10 @@
#include "opencv2/core/core.hpp"
#include "ts_gtest.h"
#ifdef HAVE_TBB
#include "tbb/task_scheduler_init.h"
#endif
#if defined(ANDROID) && defined(USE_ANDROID_LOGGING)
#include <android/log.h>
@@ -283,6 +287,7 @@ private:
_declareHelper& iterations(int n);
_declareHelper& time(double timeLimitSecs);
_declareHelper& tbb_threads(int n);
private:
TestBase* test;
_declareHelper(TestBase* t);
@@ -292,6 +297,10 @@ private:
};
friend class _declareHelper;
#ifdef HAVE_TBB
cv::Ptr<tbb::task_scheduler_init> p_tbb_initializer;
#endif
public:
_declareHelper declare;
};