43 Info(
TargetDevice device, std::string name) : device(device), name(name){}
45 static const std::vector<Info> & getAll() {
46 #define DECL_DEVICE(device_type) {TargetDevice::e##device_type, #device_type}
48 static std::vector<Info> g_allDeviceInfos = {
50 DECL_DEVICE(Balanced),
61 return g_allDeviceInfos;
65 static TargetDevice fromStr(
const std::string &deviceName) {
66 static std::map<std::string, InferenceEngine::TargetDevice> deviceFromNameMap = {
67 {
"CPU", InferenceEngine::TargetDevice::eCPU },
68 {
"GPU", InferenceEngine::TargetDevice::eGPU },
69 {
"FPGA", InferenceEngine::TargetDevice::eFPGA },
70 {
"MYRIAD", InferenceEngine::TargetDevice::eMYRIAD },
71 {
"HDDL", InferenceEngine::TargetDevice::eHDDL },
72 {
"GNA", InferenceEngine::TargetDevice::eGNA },
73 {
"BALANCED", InferenceEngine::TargetDevice::eBalanced },
74 {
"HETERO", InferenceEngine::TargetDevice::eHETERO },
75 {
"KMB", InferenceEngine::TargetDevice::eKMB }
77 auto val = deviceFromNameMap.find(deviceName);
78 return val != deviceFromNameMap.end() ? val->second : InferenceEngine::TargetDevice::eDefault;
82 auto res = std::find_if(getAll().cbegin(), getAll().cend(), [&](
const Info & info){
83 return device == info.device;
85 if (res == getAll().cend()) {
86 return "Unknown device";
88 return res->name.c_str();
98 return TargetDeviceInfo::name(device);
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:116
Definition: ie_argmax_layer.hpp:11
StatusCode
This enum contains codes for all possible return values of the interface functions.
Definition: ie_common.h:175
Defines a message that contains the TargetDevice object to find a plugin for.
Definition: ie_device.hpp:105
TargetDevice device
object of TargetDevice to find a plugin for
Definition: ie_device.hpp:109
Represents detailed information for an error.
Definition: ie_common.h:198
FindPluginResponse findPlugin(const FindPluginRequest &req)
Finds an appropriate plugin for requested target device.
The macro defines a symbol import/export mechanism essential for Microsoft Windows(R) OS...
const char * getDeviceName(TargetDevice device)
Returns the device name.
Definition: ie_device.hpp:97
Describes the relationship between the enumerator type and the actual device's name.
Definition: ie_device.hpp:39
std::vector< std::string > names
A list of appropriate plugin names.
Definition: ie_device.hpp:120
This is a header file with common inference engine definitions.