Skip to content

Commit

Permalink
update logic of checking if the device in candidate list is meta plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
yangwang201911 committed Jan 8, 2025
1 parent 9a1e0e0 commit 43ab439
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/inference/src/dev/core_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ void stripDeviceName(std::string& device, const std::string& substr) {
}

bool is_virtual_device(const std::string& device_name) {
return (device_name.find("AUTO") != std::string::npos || device_name.find("MULTI") != std::string::npos ||
device_name.find("HETERO") != std::string::npos || device_name.find("BATCH") != std::string::npos);
return (device_name.find("AUTO") == 0 || device_name.find("MULTI") == 0 || device_name.find("HETERO") == 0 ||
device_name.find("BATCH") == 0);
};

/**
Expand Down
10 changes: 7 additions & 3 deletions src/plugins/auto/src/plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -403,10 +403,14 @@ std::shared_ptr<ov::ICompiledModel> Plugin::compile_model_impl(const std::string
std::unordered_map<std::string, ov::Any> multi_model_config;
std::vector<DeviceInformation> meta_devices;
auto priorities = load_config.get_property(ov::device::priorities);
if (priorities.empty() && !work_mode_auto)
if (priorities.empty() && !work_mode_auto)
OPENVINO_THROW("KEY_MULTI_DEVICE_PRIORITIES key is not set for ", get_device_name());
if (priorities.find("AUTO") != std::string::npos || priorities.find("MULTI") != std::string::npos) {
OPENVINO_THROW("The device candidate list should not include the meta plugin for ", get_device_name());
std::vector<std::string> candidate_devices = m_plugin_config.parse_priorities_devices(priorities);
for (const auto& device : candidate_devices) {
if (device.find("AUTO:") != std::string::npos || device == "AUTO" ||
device.find("MULTI:") != std::string::npos || device == "MULTI") {
OPENVINO_THROW("The device candidate list should not include the meta plugin for ", get_device_name());
}
}
// check the configure and check if need to set PerfCounters configure to device
// and set filter configure
Expand Down

0 comments on commit 43ab439

Please # to comment.