34 std::stringstream err;
35 for (
auto &pluginPath : pluginDirs) {
39 catch (
const std::exception &ex) {
40 err <<
"cannot load plugin: " << fileNameToString(name) <<
" from " << fileNameToString(pluginPath) <<
": " << ex.what() <<
", skipping\n";
43 THROW_IE_EXCEPTION <<
"Plugin " << fileNameToString(name) <<
" cannot be loaded: " << err.str() <<
"\n";
53 if (deviceName.find(
"HETERO:") == 0) {
57 ptr->SetConfig({ {
"TARGET_FALLBACK", deviceName.substr(7, deviceName.length() - 7) } }, &response);
72 if (InferenceEngine::OK !=
findPlugin({ device }, result, &desc)) {
76 std::stringstream err;
77 for (std::string& name : result.names) {
81 catch (
const std::exception &ex) {
82 err <<
"Tried load plugin : " << name <<
", error: " << ex.what() <<
"\n";
95 file_name_t
make_plugin_name(
const file_name_t &path,
const file_name_t &input)
const {
96 file_name_t separator =
97 #if defined _WIN32 || defined __CYGWIN__
107 separator = file_name_t();
109 return path + separator + input +
116 return path + separator +
"lib" + input +
".dylib";
118 return path + separator +
"lib" + input +
".so";
124 std::vector<file_name_t> pluginDirs;
#define THROW_IE_EXCEPTION
A macro used to throw the exception with a notable description.
Definition: ie_exception.hpp:22
InferenceEngine::details::SOPointer< IInferencePlugin > InferenceEnginePluginPtr
A C++ helper to work with objects created by the plugin. Implements different interfaces.
Definition: ie_plugin_ptr.hpp:50
TargetDevice
Describes known device types.
Definition: ie_device.hpp:23
Defines a message that contains a list of appropriate plugin names.
Definition: ie_device.hpp:113
file_name_t make_plugin_name(const file_name_t &path, const file_name_t &input) const
Creates path to the plugin.
Definition: ie_plugin_dispatcher.hpp:95
Definition: ie_argmax_layer.hpp:11
This class is a C++ API wrapper for IInferencePlugin. It can throw exceptions safely for the applicat...
Definition: ie_plugin_cpp.hpp:28
A header file contains a wrapper class for handling plugin instantiation and releasing resources...
InferenceEnginePluginPtr getSuitablePlugin(TargetDevice device) const
Loads a plugin from directories that is suitable for the device.
Definition: ie_plugin_dispatcher.hpp:69
Represents detailed information for an error.
Definition: ie_common.h:195
This is a class to load a suitable plugin.
Definition: ie_plugin_dispatcher.hpp:20
FindPluginResponse findPlugin(const FindPluginRequest &req)
Finds an appropriate plugin for requested target device.
InferencePlugin getPluginByDevice(const std::string &deviceName) const
Loads a plugin from directories that is suitable for the device string.
Definition: ie_plugin_dispatcher.hpp:50
char msg[256]
A character buffer that holds the detailed information for an error.
Definition: ie_common.h:199
This is a header file for the Inference Engine plugin C++ API.
PluginDispatcher(const std::vector< file_name_t > &pp)
A constructor.
Definition: ie_plugin_dispatcher.hpp:26
virtual InferencePlugin getPluginByName(const file_name_t &name) const
Loads a plugin from plugin directories.
Definition: ie_plugin_dispatcher.hpp:33