Skip to content

Commit 43ab439

Browse files
update logic of checking if the device in candidate list is meta plugin
1 parent 9a1e0e0 commit 43ab439

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/inference/src/dev/core_impl.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ void stripDeviceName(std::string& device, const std::string& substr) {
6565
}
6666

6767
bool is_virtual_device(const std::string& device_name) {
68-
return (device_name.find("AUTO") != std::string::npos || device_name.find("MULTI") != std::string::npos ||
69-
device_name.find("HETERO") != std::string::npos || device_name.find("BATCH") != std::string::npos);
68+
return (device_name.find("AUTO") == 0 || device_name.find("MULTI") == 0 || device_name.find("HETERO") == 0 ||
69+
device_name.find("BATCH") == 0);
7070
};
7171

7272
/**

src/plugins/auto/src/plugin.cpp

+7-3
Original file line numberDiff line numberDiff line change
@@ -403,10 +403,14 @@ std::shared_ptr<ov::ICompiledModel> Plugin::compile_model_impl(const std::string
403403
std::unordered_map<std::string, ov::Any> multi_model_config;
404404
std::vector<DeviceInformation> meta_devices;
405405
auto priorities = load_config.get_property(ov::device::priorities);
406-
if (priorities.empty() && !work_mode_auto)
406+
if (priorities.empty() && !work_mode_auto)
407407
OPENVINO_THROW("KEY_MULTI_DEVICE_PRIORITIES key is not set for ", get_device_name());
408-
if (priorities.find("AUTO") != std::string::npos || priorities.find("MULTI") != std::string::npos) {
409-
OPENVINO_THROW("The device candidate list should not include the meta plugin for ", get_device_name());
408+
std::vector<std::string> candidate_devices = m_plugin_config.parse_priorities_devices(priorities);
409+
for (const auto& device : candidate_devices) {
410+
if (device.find("AUTO:") != std::string::npos || device == "AUTO" ||
411+
device.find("MULTI:") != std::string::npos || device == "MULTI") {
412+
OPENVINO_THROW("The device candidate list should not include the meta plugin for ", get_device_name());
413+
}
410414
}
411415
// check the configure and check if need to set PerfCounters configure to device
412416
// and set filter configure

0 commit comments

Comments
 (0)