@@ -117,8 +117,6 @@ std::string ParseDeviceType(std::shared_ptr<OVCore> ov_core, const ProviderOptio
117
117
luid_list = split (luid_str, ' ,' );
118
118
}
119
119
120
- bool all_devices_found = true ;
121
-
122
120
for (auto device : devices_to_check) {
123
121
bool device_found = false ;
124
122
// Check deprecated device format (CPU_FP32, GPU.0_FP16, etc.) and remove the suffix in place
@@ -137,6 +135,9 @@ std::string ParseDeviceType(std::shared_ptr<OVCore> ov_core, const ProviderOptio
137
135
// Here we need to find the full device name (with .idx, but without _precision)
138
136
if (std::find (std::begin (available_devices), std::end (available_devices), device) != std::end (available_devices))
139
137
device_found = true ;
138
+ if (!device_found) {
139
+ ORT_THROW (" [ERROR] [OpenVINO] Device " , device, " is not available" );
140
+ }
140
141
if (device_prefix != " CPU" && luid_list.size () > 0 ) {
141
142
for (const auto & dev : available_devices) {
142
143
ov::device::LUID ov_luid = OVCore::Get ()->core .get_property (dev, ov::device::luid);
@@ -149,7 +150,6 @@ std::string ParseDeviceType(std::shared_ptr<OVCore> ov_core, const ProviderOptio
149
150
ORT_THROW (msg);
150
151
}
151
152
}
152
- all_devices_found = all_devices_found && device_found;
153
153
}
154
154
if (luid_list.size () > 0 ) {
155
155
std::string ov_luid_devices;
@@ -180,16 +180,9 @@ std::string ParseDeviceType(std::shared_ptr<OVCore> ov_core, const ProviderOptio
180
180
selected_device = std::move (ov_luid_devices);
181
181
}
182
182
}
183
- // If invalid device is chosen error is thrown
184
- if (!all_devices_found) {
185
- ORT_THROW (
186
- " [ERROR] [OpenVINO] You have selected wrong configuration value for the key 'device_type'. "
187
- " Select from 'CPU', 'GPU', 'NPU', 'GPU.x' where x = 0,1,2 and so on or from"
188
- " HETERO/MULTI/AUTO/BATCH options available. \n " );
189
- } else {
190
- LOGS_DEFAULT (INFO) << " [OpenVINO-EP] Choosing Device: " << selected_device;
191
- return selected_device;
192
- }
183
+
184
+ LOGS_DEFAULT (INFO) << " [OpenVINO-EP] Choosing Device: " << selected_device;
185
+ return selected_device;
193
186
}
194
187
195
188
void ParseProviderOptions ([[maybe_unused]] ProviderInfo& result, [[maybe_unused]] const ProviderOptions& config_options) {}
0 commit comments