Skip to content

Commit ab94d32

Browse files
committed
Fix lint issues
1 parent 03f1951 commit ab94d32

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

onnxruntime/core/providers/openvino/backends/basic_backend.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ void BasicBackend::PopulateConfigValue(ov::AnyMap& device_config) {
225225
}
226226
}
227227
auto find_device_type_mode = [&](const std::string& device_type) -> std::string {
228-
std::string device_mode="";
228+
std::string device_mode = "";
229229
auto delimiter_pos = device_type.find(':');
230230
if (delimiter_pos != std::string::npos) {
231231
std::stringstream str_stream(device_type.substr(0, delimiter_pos));
@@ -285,7 +285,7 @@ void BasicBackend::PopulateConfigValue(ov::AnyMap& device_config) {
285285
auto device_mode = find_device_type_mode(session_context_.device_type);
286286
// Parse individual devices (e.g., "AUTO:CPU,GPU" -> ["CPU", "GPU"])
287287
auto individual_devices = parse_individual_devices(session_context_.device_type);
288-
if(!device_mode.empty()) individual_devices.emplace_back(device_mode);
288+
if (!device_mode.empty()) individual_devices.emplace_back(device_mode);
289289

290290
// Set properties only for individual devices (e.g., "CPU", "GPU")
291291
for (const std::string& device : individual_devices) {

onnxruntime/core/providers/openvino/backends/basic_backend.h

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <mutex>
1414
#include <map>
1515
#include <functional>
16+
#include <unordered_set>
1617

1718
#include "core/session/onnxruntime_cxx_api.h"
1819
#include "core/providers/openvino/contexts.h"

onnxruntime/core/providers/openvino/openvino_provider_factory.cc

+3-4
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
namespace onnxruntime {
1616
namespace openvino_ep {
1717
void ParseConfigOptions(ProviderInfo& pi) {
18-
if(pi.config_options==NULL)
18+
if (pi.config_options == NULL)
1919
return;
2020

2121
pi.so_disable_cpu_ep_fallback = pi.config_options->GetConfigOrDefault(kOrtSessionOptionsDisableCPUEPFallback, "0") == "1";
@@ -29,7 +29,6 @@ void ParseConfigOptions(ProviderInfo& pi) {
2929
map["NPU_COMPILATION_MODE_PARAMS"] = "enable-wd-blockarg-input=true compute-layers-with-higher-precision=Sqrt,Power,ReduceSum";
3030
pi.load_config["NPU"] = std::move(map);
3131
}
32-
3332
}
3433

3534
void* ParseUint64(const ProviderOptions& provider_options, std::string option_name) {
@@ -204,7 +203,7 @@ struct OpenVINO_Provider : Provider {
204203
const ProviderOptions* provider_options_ptr = reinterpret_cast<ProviderOptions*>(pointers_array[0]);
205204
const ConfigOptions* config_options = reinterpret_cast<ConfigOptions*>(pointers_array[1]);
206205

207-
if(provider_options_ptr == NULL) {
206+
if (provider_options_ptr == NULL) {
208207
LOGS_DEFAULT(ERROR) << "[OpenVINO EP] Passed NULL ProviderOptions to CreateExecutionProviderFactory()";
209208
return nullptr;
210209
}
@@ -256,7 +255,7 @@ struct OpenVINO_Provider : Provider {
256255

257256
for (auto& [key, value] : json_config.items()) {
258257
ov::AnyMap inner_map;
259-
std::unordered_set<std::string> valid_ov_devices = {"CPU", "GPU", "NPU", "AUTO", "HETERO", "MULTI"};
258+
std::set<std::string> valid_ov_devices = {"CPU", "GPU", "NPU", "AUTO", "HETERO", "MULTI"};
260259
// Ensure the key is one of "CPU", "GPU", or "NPU"
261260
if (valid_ov_devices.find(key) == valid_ov_devices.end()) {
262261
LOGS_DEFAULT(WARNING) << "Unsupported device key: " << key << ". Skipping entry.\n";

onnxruntime/core/providers/openvino/openvino_provider_factory_creator.h

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#pragma once
55

66
#include <memory>
7+
#include <set>
78

89
#include "core/providers/providers.h"
910
#include "core/framework/provider_options.h"

0 commit comments

Comments
 (0)