Skip to content

Commit

Permalink
Move device name validation into meta plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
riverlijunjie committed Mar 11, 2024
1 parent 78aa44a commit 765e3e8
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 15 deletions.
10 changes: 0 additions & 10 deletions src/inference/src/dev/core_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,16 +234,6 @@ bool ov::is_config_applicable(const std::string& user_device_name, const std::st
ov::Parsed ov::parseDeviceNameIntoConfig(const std::string& deviceName,
const AnyMap& config,
const bool keep_core_property) {
// check to the validity of device name
auto bracket_pos = deviceName.find(")");
while (bracket_pos != std::string::npos) {
if (bracket_pos < deviceName.length() - 1 &&
(deviceName[bracket_pos + 1] != ',' || bracket_pos + 1 == deviceName.length() - 1)) {
OPENVINO_THROW("Device with \"", deviceName, "\" name is illegal in the OpenVINO Runtime");
}
bracket_pos = deviceName.find(")", bracket_pos + 1);
}

auto updated_config = config;
auto updated_device_name = deviceName;

Expand Down
5 changes: 0 additions & 5 deletions src/inference/tests/unit/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -382,11 +382,6 @@ TEST(CoreTests_parse_device_config, get_device_config) {
"HETERO",
ov::AnyMap{ov::device::priorities("MULTI,DEVICE"),
ov::device::properties(ov::AnyMap{{"MULTI", ov::AnyMap{ov::device::priorities("DEVICE")}}})});

// invalid device name with characters after parenthesis except comma
EXPECT_THROW(ov::parseDeviceNameIntoConfig("DEVICE(0)ov", ov::AnyMap{}), ov::Exception);
EXPECT_THROW(ov::parseDeviceNameIntoConfig("MULTI:DEVICE(0)ov,DEVICE(1)", ov::AnyMap{}), ov::Exception);
EXPECT_THROW(ov::parseDeviceNameIntoConfig("MULTI:DEVICE(0),DEVICE(1),", ov::AnyMap{}), ov::Exception);
}

class ApplyAutoBatchThreading : public testing::Test {
Expand Down

0 comments on commit 765e3e8

Please sign in to comment.