@@ -138,7 +138,7 @@ std::string ParseDeviceType(std::shared_ptr<OVCore> ov_core, const ProviderOptio
138
138
if (std::find (std::begin (available_devices), std::end (available_devices), device) != std::end (available_devices))
139
139
device_found = true ;
140
140
if (device_prefix != " CPU" && luid_list.size () > 0 ) {
141
- for (auto dev : available_devices) {
141
+ for (const auto & dev : available_devices) {
142
142
ov::device::LUID ov_luid = OVCore::Get ()->core .get_property (dev, ov::device::luid);
143
143
std::stringstream ov_luid_str;
144
144
ov_luid_str << ov_luid;
@@ -153,7 +153,7 @@ std::string ParseDeviceType(std::shared_ptr<OVCore> ov_core, const ProviderOptio
153
153
}
154
154
if (luid_list.size () > 0 ) {
155
155
std::string ov_luid_devices;
156
- for (auto luid_str : luid_list) {
156
+ for (const auto & luid_str : luid_list) {
157
157
if (ov_luid_map.contains (luid_str)) {
158
158
std::string ov_dev = ov_luid_map.at (luid_str);
159
159
std::string ov_dev_strip = split (ov_dev, ' .' )[0 ];
@@ -170,14 +170,14 @@ std::string ParseDeviceType(std::shared_ptr<OVCore> ov_core, const ProviderOptio
170
170
}
171
171
if (!device_mode.empty ()) {
172
172
selected_device = device_mode + " :" + ov_luid_devices;
173
- for (auto dev_str : devices_to_check) {
174
- auto default_dev = split (dev_str, ' .' )[0 ];
173
+ for (const auto & dev_str : devices_to_check) {
174
+ const auto default_dev = split (dev_str, ' .' )[0 ];
175
175
176
176
if (ov_luid_devices.find (default_dev) == std::string::npos)
177
177
selected_device = selected_device + " ," + dev_str;
178
178
}
179
179
} else {
180
- selected_device = ov_luid_devices;
180
+ selected_device = std::move ( ov_luid_devices) ;
181
181
}
182
182
}
183
183
// If invalid device is chosen error is thrown
@@ -215,7 +215,7 @@ static void ParseProviderInfo(const ProviderOptions& provider_options,
215
215
// Minor optimization: we'll hold an OVCore reference to ensure we don't create a new core between ParseDeviceType and
216
216
// (potential) SharedContext creation.
217
217
auto ov_core = OVCore::Get ();
218
- pi .device_type = ParseDeviceType (ov_core, provider_options);
218
+ pi .device_type = ParseDeviceType (std::move ( ov_core) , provider_options);
219
219
220
220
if (provider_options.contains (" device_id" )) {
221
221
std::string dev_id = provider_options.at (" device_id" ).data ();
@@ -355,7 +355,7 @@ static void ParseProviderInfo(const ProviderOptions& provider_options,
355
355
356
356
struct OpenVINOProviderFactory : IExecutionProviderFactory {
357
357
OpenVINOProviderFactory (ProviderInfo provider_info, std::shared_ptr<SharedContext> shared_context)
358
- : provider_info_(std::move(provider_info)), shared_context_(shared_context) {}
358
+ : provider_info_(std::move(provider_info)), shared_context_(std::move( shared_context) ) {}
359
359
360
360
~OpenVINOProviderFactory () override {}
361
361
0 commit comments