Skip to content

Commit 6be82a2

Browse files
committed
Address review comments
1 parent 1197737 commit 6be82a2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

onnxruntime/core/providers/openvino/backends/basic_backend.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,9 @@ void BasicBackend::PopulateConfigValue(ov::AnyMap& device_config) {
282282
session_context_.device_type.find("HETERO") == 0 ||
283283
session_context_.device_type.find("MULTI") == 0) {
284284
//// Parse to get the device mode (e.g., "AUTO:CPU,GPU" -> "AUTO")
285+
std::unordered_set<std::string> supported_mode = {"AUTO", "HETERO", "MULTI"};
285286
auto device_mode = find_device_type_mode(session_context_.device_type);
287+
ORT_ENFORCE(supported_mode.find(device_mode)!=supported_mode.end(), " Invalid device mode is passed : " , session_context_.device_type);
286288
// Parse individual devices (e.g., "AUTO:CPU,GPU" -> ["CPU", "GPU"])
287289
auto individual_devices = parse_individual_devices(session_context_.device_type);
288290
if (!device_mode.empty()) individual_devices.emplace_back(device_mode);
@@ -297,8 +299,6 @@ void BasicBackend::PopulateConfigValue(ov::AnyMap& device_config) {
297299
}
298300
}
299301
} else {
300-
std::unordered_set<std::string> valid_ov_devices = {"CPU", "GPU", "NPU", "AUTO", "HETERO", "MULTI"};
301-
302302
if (target_config.count(session_context_.device_type)) {
303303
auto supported_properties = OVCore::Get()->core.get_property(session_context_.device_type,
304304
ov::supported_properties);

0 commit comments

Comments
 (0)