Apply ov::execution_devices to GPU & CPU & AUTO BATCH & MULTI (#14109)

* Apply ov::execution_devices to GPU & CPU & AUTO BATCH & MULTI

* Apply ov::execution_devices to GNA

Co-authored-by: yanlan song <bell.song@intel.com>
This commit is contained in:
Wang Wangwangandyanlan song authored and GitHub committed 2022-12-28 10:41:50 +04:00
1 parent 31d91033d9
commit b8636222c3
14 files changed
+110 -14

No files matched your search

+6 -1
View File
@@ -164,7 +164,12 @@ IE::Parameter AutoExecutableNetwork::GetMetric(const std::string& name) const {
if (i == 0 && !_autoSchedule->_loadContext[CPU].executableNetwork._ptr) {
continue;
} else {
exeDevices.push_back(_autoSchedule->_loadContext[i].workName.substr(_autoSchedule->_loadContext[i].workName.find(":") + 1));
std::string exeDevices_string = _autoSchedule->_loadContext[i].workName.substr(_autoSchedule->_loadContext[i].workName.find(":") + 1);
std::stringstream ss(exeDevices_string);
std::string item;
while (getline(ss, item, ',')) {
exeDevices.push_back(item);
}
break;
}
}
@@ -102,7 +102,8 @@ IE::Parameter MultiExecutableNetwork::GetMetric(const std::string& name) const {
// Configs
// device priority can be changed on-the-fly in MULTI
ov::PropertyName{ov::device::priorities.name(), ov::PropertyMutability::RW}
ov::PropertyName{ov::device::priorities.name(), ov::PropertyMutability::RW},
ov::PropertyName{ov::execution_devices.name(), ov::PropertyMutability::RO}
};
} else if (name == ov::optimal_number_of_infer_requests) {
unsigned int res = 0u;
@@ -133,6 +134,12 @@ IE::Parameter MultiExecutableNetwork::GetMetric(const std::string& name) const {
} else if (name == METRIC_KEY(SUPPORTED_CONFIG_KEYS)) {
std::vector<std::string> configKeys = {IE::MultiDeviceConfigParams::KEY_MULTI_DEVICE_PRIORITIES};
IE_SET_METRIC_RETURN(SUPPORTED_CONFIG_KEYS, configKeys);
} else if (name == ov::execution_devices) {
std::vector<std::string> exeDevices = {};
for (auto n : _multiSContext->_devicePriorities) {
exeDevices.push_back(n.deviceName);
}
return decltype(ov::available_devices)::value_type {exeDevices};
} else {
IE_THROW() << "Unsupported ExecutableNetwork metric key: " << name;
}