From 01145511b10c4c152480f59f8648982d4fd2aaac Mon Sep 17 00:00:00 2001 From: Javier Martinez Date: Fri, 7 Feb 2025 23:01:28 -0800 Subject: [PATCH] Fix for C4267 warning (#23610) ### Description A recent [commit](https://github.com/microsoft/onnxruntime/commit/1fce51b3b25b369f5e0486cf3223e5caa53e44bd) is causing an OVEP warning in [openvino_provider_factory.cc](https://github.com/microsoft/onnxruntime/blob/main/onnxruntime/core/providers/openvino/openvino_provider_factory.cc#L151). This PR fixes the warning. ### Motivation and Context Minor fix --- .../core/providers/openvino/openvino_provider_factory.cc | 2 +- onnxruntime/core/providers/openvino/ov_interface.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/onnxruntime/core/providers/openvino/openvino_provider_factory.cc b/onnxruntime/core/providers/openvino/openvino_provider_factory.cc index 1c2d857b62..2cf962c829 100644 --- a/onnxruntime/core/providers/openvino/openvino_provider_factory.cc +++ b/onnxruntime/core/providers/openvino/openvino_provider_factory.cc @@ -148,7 +148,7 @@ std::string ParsePrecision(const ProviderOptions& provider_options, std::string& << "Update the 'device_type' to specified types 'CPU', 'GPU', 'GPU.0', " << "'GPU.1', 'NPU' or from" << " HETERO/MULTI/AUTO options and set 'precision' separately. \n"; - int delimit = device_type.find("_"); + auto delimit = device_type.find("_"); device_type = device_type.substr(0, delimit); return device_type.substr(delimit + 1); } diff --git a/onnxruntime/core/providers/openvino/ov_interface.cc b/onnxruntime/core/providers/openvino/ov_interface.cc index 4c656bceff..d8d0dbfec8 100644 --- a/onnxruntime/core/providers/openvino/ov_interface.cc +++ b/onnxruntime/core/providers/openvino/ov_interface.cc @@ -233,7 +233,7 @@ void OVInferRequest::SetTensor(const std::string& name, OVTensorPtr& blob) { } uint32_t OVInferRequest::GetNumInputs() { - return ovInfReq.get_compiled_model().inputs().size(); + return static_cast(ovInfReq.get_compiled_model().inputs().size()); } void OVInferRequest::StartAsync() {