From 765e3e8ef4897f00efd7f63b7d8098064c26656a Mon Sep 17 00:00:00 2001 From: "River.Li" Date: Mon, 11 Mar 2024 10:21:11 +0800 Subject: [PATCH] Move device name validation into meta plugin --- src/inference/src/dev/core_impl.cpp | 10 ---------- src/inference/tests/unit/core.cpp | 5 ----- 2 files changed, 15 deletions(-) diff --git a/src/inference/src/dev/core_impl.cpp b/src/inference/src/dev/core_impl.cpp index 9d1db03eab865e..68f8e9a750adeb 100644 --- a/src/inference/src/dev/core_impl.cpp +++ b/src/inference/src/dev/core_impl.cpp @@ -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; diff --git a/src/inference/tests/unit/core.cpp b/src/inference/tests/unit/core.cpp index 59d72c3c534c6c..f635d88bab1bf1 100644 --- a/src/inference/tests/unit/core.cpp +++ b/src/inference/tests/unit/core.cpp @@ -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 {