Skip to content

Commit

Permalink
Bug fix in legacy API mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
preetha-intel authored and MaajidKhan committed Feb 10, 2024
1 parent 6c821ff commit b04fec7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ BasicBackend::BasicBackend(const ONNX_NAMESPACE::ModelProto& model_proto,
LOGS_DEFAULT(INFO) << log_tag << "Loaded model to the plugin";
}
#else
if (!subgraph_context_.has_dynamic_input_shape && dev_prec != "CPU_FP16"){
if (!subgraph_context_.has_dynamic_input_shape && dev_prec != "CPU_FP16") {
exe_network_ = global_context_.ie_core.LoadNetwork(global_context_.onnx_model_path_name,
hw_target,
device_config,
Expand Down
18 changes: 10 additions & 8 deletions onnxruntime/core/session/provider_bridge_ort.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1682,7 +1682,11 @@ ProviderOptions OrtOpenVINOProviderOptionsToOrtOpenVINOProviderOptionsV2(const O
if (legacy_ov_options->device_type != nullptr)
ov_options_converted_map["device_type"] = legacy_ov_options->device_type;

ov_options_converted_map["enable_npu_fast_compile"] = legacy_ov_options->enable_npu_fast_compile;
if (legacy_ov_options->enable_npu_fast_compile) {
ov_options_converted_map["enable_npu_fast_compile"] = "false";
} else {
ov_options_converted_map["enable_npu_fast_compile"] = "true";
}

if (legacy_ov_options->device_id != nullptr)
ov_options_converted_map["device_id"] = legacy_ov_options->device_id;
Expand All @@ -1701,14 +1705,12 @@ ProviderOptions OrtOpenVINOProviderOptionsToOrtOpenVINOProviderOptionsV2(const O

ov_options_converted_map["enable_opencl_throttling"] = legacy_ov_options->enable_opencl_throttling;

if (legacy_ov_options->enable_dynamic_shapes != '\0') {
std::string enable_dynamic_shapes = reinterpret_cast<const char*>(legacy_ov_options->enable_dynamic_shapes);
if (enable_dynamic_shapes == "true" || enable_dynamic_shapes == "True") {
ov_options_converted_map["disable_dynamic_shapes"] = "false";
} else if (enable_dynamic_shapes == "false" || enable_dynamic_shapes == "False") {
ov_options_converted_map["disable_dynamic_shapes"] = "true";
}
if (legacy_ov_options->enable_dynamic_shapes) {
ov_options_converted_map["disable_dynamic_shapes"] = "false";
} else {
ov_options_converted_map["disable_dynamic_shapes"] = "true";
}

// Add new provider option below
ov_options_converted_map["num_streams"] = "1";
return ov_options_converted_map;
Expand Down

0 comments on commit b04fec7

Please sign in to comment.