fix not-found backend library issue
[platform/core/multimedia/inference-engine-interface.git] / src / inference_engine_common_impl.cpp
index 3467ee0..a51ae07 100644 (file)
@@ -378,6 +378,16 @@ namespace Common
                        mProfiler.Start(IE_PROFILER_MEMORY);
                }
 
+               if (!config->backend_name.empty()) {
+                       // if backend name is "mlapi" then backend path is decided by a given backend_type.
+                       // Otherwise, backend_name has higher priority than backend_type.
+                       // So other backend name(not mlapi) is given then set backend_type to -1
+                       // so that the backend path can be decided by a given backend_name.
+                       // TODO. drop backend_type later because only one path should exist for one purpose.
+                       if (config->backend_name.compare("mlapi") != 0)
+                               config->backend_type = -1;
+               }
+
                // If backend_type of config is -1 then update it according to backend_name.
                if (config->backend_type == -1) {
                        std::map<std::string,int> BackendTable;