Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
bd66f76f
Commit
bd66f76f
authored
Jan 24, 2020
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #16356 from alalek:dnn_ie_prevent_plugins_unloading
parents
504cd8a9
6670e6b0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
1 deletion
+35
-1
op_inf_engine.cpp
modules/dnn/src/op_inf_engine.cpp
+35
-1
No files found.
modules/dnn/src/op_inf_engine.cpp
View file @
bd66f76f
...
@@ -563,11 +563,45 @@ static std::map<std::string, InferenceEngine::InferenceEnginePluginPtr>& getShar
...
@@ -563,11 +563,45 @@ static std::map<std::string, InferenceEngine::InferenceEnginePluginPtr>& getShar
return
sharedPlugins
;
return
sharedPlugins
;
}
}
#else
#else
InferenceEngine
::
Core
&
getCore
()
static
bool
init_IE_plugins
()
{
// load and hold IE plugins
static
InferenceEngine
::
Core
*
init_core
=
new
InferenceEngine
::
Core
();
// 'delete' is never called
(
void
)
init_core
->
GetAvailableDevices
();
return
true
;
}
static
InferenceEngine
::
Core
&
create_IE_Core_instance
()
{
{
static
InferenceEngine
::
Core
core
;
static
InferenceEngine
::
Core
core
;
return
core
;
return
core
;
}
}
static
InferenceEngine
::
Core
&
create_IE_Core_pointer
()
{
// load and hold IE plugins
static
InferenceEngine
::
Core
*
core
=
new
InferenceEngine
::
Core
();
// 'delete' is never called
return
*
core
;
}
InferenceEngine
::
Core
&
getCore
()
{
// to make happy memory leak tools use:
// - OPENCV_DNN_INFERENCE_ENGINE_HOLD_PLUGINS=0
// - OPENCV_DNN_INFERENCE_ENGINE_CORE_LIFETIME_WORKAROUND=0
static
bool
param_DNN_INFERENCE_ENGINE_HOLD_PLUGINS
=
utils
::
getConfigurationParameterBool
(
"OPENCV_DNN_INFERENCE_ENGINE_HOLD_PLUGINS"
,
true
);
static
bool
init_IE_plugins_
=
param_DNN_INFERENCE_ENGINE_HOLD_PLUGINS
&&
init_IE_plugins
();
CV_UNUSED
(
init_IE_plugins_
);
static
bool
param_DNN_INFERENCE_ENGINE_CORE_LIFETIME_WORKAROUND
=
utils
::
getConfigurationParameterBool
(
"OPENCV_DNN_INFERENCE_ENGINE_CORE_LIFETIME_WORKAROUND"
,
#ifdef _WIN32
true
#else
false
#endif
);
static
InferenceEngine
::
Core
&
core
=
param_DNN_INFERENCE_ENGINE_CORE_LIFETIME_WORKAROUND
?
create_IE_Core_pointer
()
:
create_IE_Core_instance
();
return
core
;
}
#endif
#endif
#if !defined(OPENCV_DNN_IE_VPU_TYPE_DEFAULT)
#if !defined(OPENCV_DNN_IE_VPU_TYPE_DEFAULT)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment