Commit 96a2f80b authored by Dmitry Kurtaev's avatar Dmitry Kurtaev

Limit number of threads in CPU plugin of IE by OpenCV's getNumThreads

parent 24790e40
......@@ -460,6 +460,12 @@ void InfEngineBackendNet::initPlugin(InferenceEngine::ICNNNetwork& net)
CV_LOG_WARNING(NULL, "DNN-IE: Can't load extension plugin (extra layers for some networks). Specify path via OPENCV_DNN_IE_EXTRA_PLUGIN_PATH parameter");
}
// Some of networks can work without a library of extra layers.
#ifndef _WIN32
// Limit the number of CPU threads.
enginePtr->SetConfig({{
InferenceEngine::PluginConfigParams::KEY_CPU_THREADS_NUM, format("%d", getNumThreads()),
}}, 0);
#endif
}
plugin = InferenceEngine::InferencePlugin(enginePtr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment