From 272aab4afa92fedca5b537c78667d344a57b2325 Mon Sep 17 00:00:00 2001 From: BoarQing Date: Fri, 5 May 2023 05:42:19 +0800 Subject: [PATCH] Fix issues on Windows for Vitis AI (#15810) ### Description Fix two errors that is only encountered on windows ### Motivation and Context For onnxruntime::VitisAIProviderFactoryCreator::Create, it would cause the compile error. For if (it == provider_options_map.end()), it would cause an error but execute as normal Co-authored-by: Zhang --- onnxruntime/python/onnxruntime_pybind_schema.cc | 2 +- onnxruntime/python/onnxruntime_pybind_state.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/onnxruntime/python/onnxruntime_pybind_schema.cc b/onnxruntime/python/onnxruntime_pybind_schema.cc index e325d3a2a6..61d4feb182 100644 --- a/onnxruntime/python/onnxruntime_pybind_schema.cc +++ b/onnxruntime/python/onnxruntime_pybind_schema.cc @@ -50,7 +50,7 @@ void addGlobalSchemaFunctions(pybind11::module& m) { onnxruntime::MIGraphXProviderFactoryCreator::Create(0), #endif #ifdef USE_VITISAI - onnxruntime::VitisAIProviderFactoryCreator::Create(), + onnxruntime::VitisAIProviderFactoryCreator::Create(ProviderOptions{}), #endif #ifdef USE_ACL onnxruntime::ACLProviderFactoryCreator::Create(0), diff --git a/onnxruntime/python/onnxruntime_pybind_state.cc b/onnxruntime/python/onnxruntime_pybind_state.cc index 6f9e277f6a..cf709e508d 100644 --- a/onnxruntime/python/onnxruntime_pybind_state.cc +++ b/onnxruntime/python/onnxruntime_pybind_state.cc @@ -762,7 +762,7 @@ std::unique_ptr CreateExecutionProviderInstance( } else if (type == kVitisAIExecutionProvider) { #if USE_VITISAI const auto it = provider_options_map.find(type); - if (it != provider_options_map.end()) { + if (it == provider_options_map.end()) { LOGS_DEFAULT(FATAL) << "cannot find provider options for VitisAIExecutionProvider"; } const auto& vitis_option_map = it->second;