Skip to content

Commit 167f2ad

Browse files
[OVEP] Fix cov issues (#796)
1 parent e019aa1 commit 167f2ad

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

onnxruntime/core/providers/openvino/openvino_provider_factory.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ std::string ParseDeviceType(std::shared_ptr<OVCore> ov_core, const ProviderOptio
171171
if (!device_mode.empty()) {
172172
selected_device = device_mode + ":" + ov_luid_devices;
173173
for (const auto& dev_str : devices_to_check) {
174-
const auto default_dev = split(dev_str, '.')[0];
174+
const std::string default_dev = split(dev_str, '.')[0];
175175

176176
if (ov_luid_devices.find(default_dev) == std::string::npos)
177177
selected_device = selected_device + "," + dev_str;
@@ -532,7 +532,7 @@ struct OpenVINO_Provider : Provider {
532532
std::string ov_device_string;
533533
if (is_meta_device_factory) {
534534
// Build up a meta device string based on the devices that are passed in. E.g. AUTO:NPU,GPU.0,CPU
535-
ov_device_string = ov_meta_device_type;
535+
ov_device_string = std::move(ov_meta_device_type);
536536
ov_device_string += ":";
537537
}
538538

@@ -545,7 +545,7 @@ struct OpenVINO_Provider : Provider {
545545
prepend_comma = true;
546546
}
547547

548-
provider_options["device_type"] = ov_device_string;
548+
provider_options["device_type"] = std::move(ov_device_string);
549549

550550
// Parse provider info with the device type
551551
ProviderInfo pi;

onnxruntime/core/providers/openvino/ov_factory.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ OrtStatus* OpenVINOEpPluginFactory::GetSupportedDevices(const OrtHardwareDevice*
105105
std::string ov_device_name;
106106
auto get_gpu_device_id = [&](const std::string& ov_device) {
107107
try {
108-
auto device_id_str = ov_core_->get_property(ov_device, "GPU_DEVICE_ID").as<std::string>();
108+
const std::string device_id_str = ov_core_->get_property(ov_device, "GPU_DEVICE_ID").as<std::string>();
109109
return static_cast<uint32_t>(std::stoul(device_id_str, nullptr, 0));
110110
} catch (ov::Exception&) {
111111
return 0u; // If we can't get the GPU_DEVICE_ID info, we won't have a device ID.

onnxruntime/core/providers/openvino/ov_interface.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ class OVInferRequest {
136136
cached_binding.tensor_ptr.reset();
137137
auto ov_tensor = std::make_shared<ov::Tensor>(type, shape, const_cast<void*>(ort_ptr));
138138
ovInfReq.set_tensor(name, *ov_tensor);
139-
cached_binding = {ov_tensor, ort_ptr};
139+
cached_binding = {std::move(ov_tensor), ort_ptr};
140140
}
141141
}
142142

0 commit comments

Comments
 (0)