@@ -78,7 +78,7 @@ std::string ParseDeviceType(std::shared_ptr<OVCore> ov_core, const ProviderOptio
78
78
if (supported_device_modes.contains (device_mode)) {
79
79
const auto & devices = selected_device.substr (delimit + 1 );
80
80
devices_to_check = split (devices, ' ,' );
81
- ORT_ENFORCE (devices_to_check.size () > 0 , " Modes should have devices listed based on priority" );
81
+ ORT_ENFORCE (devices_to_check.size () > 0 , " Mode AUTO/HETERO/MULTI should have devices listed based on priority" );
82
82
} else {
83
83
ORT_THROW (" [ERROR] [OpenVINO] Invalid device_type is selected. Supported modes are AUTO/HETERO/MULTI" );
84
84
}
@@ -155,16 +155,24 @@ std::string ParseDeviceType(std::shared_ptr<OVCore> ov_core, const ProviderOptio
155
155
std::string ov_luid_devices;
156
156
for (auto luid_str : luid_list) {
157
157
if (ov_luid_map.contains (luid_str)) {
158
- if (!ov_luid_devices.empty ()) ov_luid_devices = ov_luid_devices + " ," ;
159
- ov_luid_devices = ov_luid_devices + ov_luid_map.at (luid_str);
158
+ std::string ov_dev = ov_luid_map.at (luid_str);
159
+ std::string ov_dev_strip = split (ov_dev, ' .' )[0 ];
160
+ if (std::find (std::begin (devices_to_check), std::end (devices_to_check), ov_dev) != std::end (devices_to_check) ||
161
+ std::find (std::begin (devices_to_check), std::end (devices_to_check), ov_dev_strip) != std::end (devices_to_check)) {
162
+ if (!ov_luid_devices.empty ()) ov_luid_devices = ov_luid_devices + " ," ;
163
+ ov_luid_devices = ov_luid_devices + ov_dev;
164
+ } else {
165
+ ORT_THROW (" LUID : " , ov_dev, " does not match with device_type : " , selected_device);
166
+ }
160
167
} else {
161
- ORT_THROW (" Invalid device_luid is set " );
168
+ ORT_THROW (provider_options. at ( " device_luid" ), " does not exist for the selected device_type : " , selected_device );
162
169
}
163
170
}
164
171
if (!device_mode.empty ()) {
165
172
selected_device = device_mode + " :" + ov_luid_devices;
166
173
for (auto dev_str : devices_to_check) {
167
174
auto default_dev = split (dev_str, ' .' )[0 ];
175
+
168
176
if (ov_luid_devices.find (default_dev) == std::string::npos)
169
177
selected_device = selected_device + " ," + dev_str;
170
178
}
@@ -173,13 +181,15 @@ std::string ParseDeviceType(std::shared_ptr<OVCore> ov_core, const ProviderOptio
173
181
}
174
182
}
175
183
// If invalid device is chosen error is thrown
176
- if (!all_devices_found)
184
+ if (!all_devices_found) {
177
185
ORT_THROW (
178
186
" [ERROR] [OpenVINO] You have selected wrong configuration value for the key 'device_type'. "
179
187
" Select from 'CPU', 'GPU', 'NPU', 'GPU.x' where x = 0,1,2 and so on or from"
180
188
" HETERO/MULTI/AUTO/BATCH options available. \n " );
181
- else
189
+ } else {
190
+ LOGS_DEFAULT (INFO) << " [OpenVINO-EP] Choosing Device: " << selected_device;
182
191
return selected_device;
192
+ }
183
193
}
184
194
185
195
void ParseProviderOptions ([[maybe_unused]] ProviderInfo& result, [[maybe_unused]] const ProviderOptions& config_options) {}
0 commit comments