42 Info(
TargetDevice device, std::string name) : device(device), name(name){}
44 static const std::vector<Info> & getAll() {
45 #define DECL_DEVICE(device_type) {TargetDevice::e##device_type, #device_type}
47 static std::vector<Info> g_allDeviceInfos = {
49 DECL_DEVICE(Balanced),
59 return g_allDeviceInfos;
63 static TargetDevice fromStr(
const std::string &deviceName) {
64 static std::map<std::string, InferenceEngine::TargetDevice> deviceFromNameMap = {
65 {
"CPU", InferenceEngine::TargetDevice::eCPU },
66 {
"GPU", InferenceEngine::TargetDevice::eGPU },
67 {
"FPGA", InferenceEngine::TargetDevice::eFPGA },
68 {
"MYRIAD", InferenceEngine::TargetDevice::eMYRIAD },
69 {
"HDDL", InferenceEngine::TargetDevice::eHDDL },
70 {
"GNA", InferenceEngine::TargetDevice::eGNA },
71 {
"BALANCED", InferenceEngine::TargetDevice::eBalanced },
72 {
"HETERO", InferenceEngine::TargetDevice::eHETERO }
74 auto val = deviceFromNameMap.find(deviceName);
75 return val != deviceFromNameMap.end() ? val->second : InferenceEngine::TargetDevice::eDefault;
79 auto res = std::find_if(getAll().cbegin(), getAll().cend(), [&](
const Info & info){
80 return device == info.device;
82 if (res == getAll().cend()) {
83 return "Unknown device";
85 return res->name.c_str();
95 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:113
Definition: ie_argmax_layer.hpp:11
StatusCode
This enum contains codes for all possible return values of the interface functions.
Definition: ie_common.h:172
Defines a message that contains the TargetDevice object to find a plugin for.
Definition: ie_device.hpp:102
TargetDevice device
object of TargetDevice to find a plugin for
Definition: ie_device.hpp:106
Represents detailed information for an error.
Definition: ie_common.h:195
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:94
Describes the relationship between the enumerator type and the actual device's name.
Definition: ie_device.hpp:38
std::vector< std::string > names
A list of appropriate plugin names.
Definition: ie_device.hpp:117
This is a header file with common inference engine definitions.