From 5cb8619eca7d7bd1d9144c76fae6f951a21f5c49 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Fri, 10 Jul 2020 14:29:21 +0000 Subject: [PATCH] dnn(ie): enable KEY_CPU_THREADS_NUM for Windows --- modules/dnn/src/op_inf_engine.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/dnn/src/op_inf_engine.cpp b/modules/dnn/src/op_inf_engine.cpp index 7020e3b0a9..43fb5999d9 100644 --- a/modules/dnn/src/op_inf_engine.cpp +++ b/modules/dnn/src/op_inf_engine.cpp @@ -831,18 +831,18 @@ void InfEngineBackendNet::initPlugin(InferenceEngine::CNNNetwork& net) CV_LOG_INFO(NULL, "DNN-IE: Can't register OpenCV custom layers extension: " << e.what()); } #endif -#ifndef _WIN32 // Limit the number of CPU threads. #if INF_ENGINE_VER_MAJOR_LE(INF_ENGINE_RELEASE_2019R1) +#ifndef _WIN32 enginePtr->SetConfig({{ InferenceEngine::PluginConfigParams::KEY_CPU_THREADS_NUM, format("%d", getNumThreads()), }}, 0); +#endif // _WIN32 #else if (device_name == "CPU") ie.SetConfig({{ InferenceEngine::PluginConfigParams::KEY_CPU_THREADS_NUM, format("%d", getNumThreads()), }}, device_name); -#endif #endif } #if INF_ENGINE_VER_MAJOR_LE(INF_ENGINE_RELEASE_2019R1)