1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 07:13:02 +04:00

core(parallel): plugins support

This commit is contained in:
Alexander Alekhin
2021-02-03 22:04:35 +00:00
parent e5d78960c6
commit cc73c36e32
35 changed files with 1509 additions and 354 deletions
+1 -26
View File
@@ -46,6 +46,7 @@
#include <opencv2/core/utils/trace.private.hpp>
#include "opencv2/core/parallel/parallel_backend.hpp"
#include "parallel/parallel.hpp"
#if defined _WIN32 || defined WINCE
#include <windows.h>
@@ -158,32 +159,6 @@ namespace cv {
ParallelLoopBody::~ParallelLoopBody() {}
namespace parallel {
static int numThreads = -1;
static
std::shared_ptr<ParallelForAPI>& getCurrentParallelForAPI()
{
static std::shared_ptr<ParallelForAPI> g_currentParallelForAPI;
return g_currentParallelForAPI;
}
ParallelForAPI::~ParallelForAPI()
{
// nothing
}
void setParallelForBackend(const std::shared_ptr<ParallelForAPI>& api, bool propagateNumThreads)
{
getCurrentParallelForAPI() = api;
if (propagateNumThreads && api)
{
setNumThreads(numThreads);
}
}
} // namespace
using namespace cv::parallel;
namespace {