Skip to content

Commit 3c47cf2

Browse files
authored
Merge pull request #319 from intel/customerA
Fix for when device_type is empty
2 parents b916082 + 6dadd2b commit 3c47cf2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

onnxruntime/core/providers/openvino/openvino_provider_factory.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ struct OpenVINO_Provider : Provider {
6464

6565
std::shared_ptr<IExecutionProviderFactory> CreateExecutionProviderFactory(const void* void_params) override {
6666
auto& params = *reinterpret_cast<const OrtOpenVINOProviderOptions*>(void_params);
67-
if (params.device_type != nullptr) { // check for device_type correctness only if provided, skip checks otherwise
67+
if (params.device_type != nullptr && !((std::string)params.device_type).empty()) { // check for device_type correctness only if provided, skip checks otherwise
6868
std::string device_type = params.device_type;
6969
std::set<std::string> ov_supported_device_types = {"CPU_FP32", "CPU_FP16", "GPU_FP32",
7070
"GPU.0_FP32", "GPU.1_FP32", "GPU_FP16",
@@ -73,8 +73,9 @@ struct OpenVINO_Provider : Provider {
7373

7474
if (!((ov_supported_device_types.find(device_type) != ov_supported_device_types.end()) ||
7575
(device_type.find("HETERO:") == 0) || (device_type.find("MULTI:") == 0) || (device_type.find("AUTO:") == 0))) {
76-
LOGS_DEFAULT(ERROR) << "[ERROR] [OpenVINO] You have selcted wrong configuration value for the key 'device_type'.\n "
77-
"Select from 'CPU_FP32', 'CPU_FP16', 'GPU_FP32', 'GPU.0_FP32', 'GPU.1_FP32', 'GPU_FP16', "
76+
LOGS_DEFAULT(ERROR) << "[ERROR] [OpenVINO] You have selcted wrong configuration value for the key 'device_type'. Provided:"
77+
<< device_type << "\n "
78+
<< "Select from 'CPU_FP32', 'CPU_FP16', 'GPU_FP32', 'GPU.0_FP32', 'GPU.1_FP32', 'GPU_FP16', "
7879
"'GPU.0_FP16', 'GPU.1_FP16', 'NPU_FP16', 'NPU_U8' or from"
7980
" HETERO/MULTI/AUTO options available. \n";
8081
}

0 commit comments

Comments
 (0)