Commit d92a883d authored by Dmitry Kurtaev's avatar Dmitry Kurtaev

Different way to reset Myriad device

parent a67228cd
...@@ -103,7 +103,7 @@ public: ...@@ -103,7 +103,7 @@ public:
#ifdef HAVE_INF_ENGINE #ifdef HAVE_INF_ENGINE
static inline bool checkIETarget(Target target) static inline bool checkIETarget(Target target)
{ {
#if INF_ENGINE_VER_MAJOR_GT(INF_ENGINE_RELEASE_2019R3) #if INF_ENGINE_VER_MAJOR_GE(INF_ENGINE_RELEASE_2019R3)
// Lightweight detection // Lightweight detection
const std::vector<std::string> devices = getCore().GetAvailableDevices(); const std::vector<std::string> devices = getCore().GetAvailableDevices();
for (std::vector<std::string>::const_iterator i = devices.begin(); i != devices.end(); ++i) for (std::vector<std::string>::const_iterator i = devices.begin(); i != devices.end(); ++i)
......
...@@ -573,7 +573,7 @@ InferenceEngine::Core& getCore() ...@@ -573,7 +573,7 @@ InferenceEngine::Core& getCore()
#if !defined(OPENCV_DNN_IE_VPU_TYPE_DEFAULT) #if !defined(OPENCV_DNN_IE_VPU_TYPE_DEFAULT)
static bool detectMyriadX_() static bool detectMyriadX_()
{ {
#if INF_ENGINE_VER_MAJOR_GT(INF_ENGINE_RELEASE_2019R3) #if INF_ENGINE_VER_MAJOR_GE(INF_ENGINE_RELEASE_2019R3)
// Lightweight detection // Lightweight detection
InferenceEngine::Core& ie = getCore(); InferenceEngine::Core& ie = getCore();
const std::vector<std::string> devices = ie.GetAvailableDevices(); const std::vector<std::string> devices = ie.GetAvailableDevices();
...@@ -1067,8 +1067,14 @@ void resetMyriadDevice() ...@@ -1067,8 +1067,14 @@ void resetMyriadDevice()
#if INF_ENGINE_VER_MAJOR_LE(INF_ENGINE_RELEASE_2019R1) #if INF_ENGINE_VER_MAJOR_LE(INF_ENGINE_RELEASE_2019R1)
getSharedPlugins().erase("MYRIAD"); getSharedPlugins().erase("MYRIAD");
#else #else
// To unregister both "MYRIAD" and "HETERO:MYRIAD,CPU" plugins // Unregister both "MYRIAD" and "HETERO:MYRIAD,CPU" plugins
getCore() = InferenceEngine::Core(); InferenceEngine::Core& ie = getCore();
try
{
ie.UnregisterPlugin("MYRIAD");
ie.UnregisterPlugin("HETERO");
}
catch (...) {}
#endif #endif
#endif // HAVE_INF_ENGINE #endif // HAVE_INF_ENGINE
} }
......
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