[vitisai] Fix build failure introduced by #20920 (#21247)

### Description

Fix build failure introduced by #20920
This commit is contained in:
zz002 2024-07-08 20:44:30 +08:00 committed by GitHub
parent 83e0c6b96e
commit 4a7eaff1d9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -123,11 +123,11 @@ static std::string config_to_json_str(const onnxruntime::ProviderOptions& config
vaip_core::DllSafe<std::vector<std::unique_ptr<vaip_core::ExecutionProvider>>> compile_onnx_model(
const onnxruntime::GraphViewer& graph_viewer, const logging::Logger& logger, const ProviderOptions& options) {
#ifndef _WIN32
auto model_path = graph_viewer.ModelPath().ToPathString();
auto model_path = graph_viewer.ModelPath().string();
#else
using convert_t = std::codecvt_utf8<wchar_t>;
std::wstring_convert<convert_t, wchar_t> strconverter;
auto model_path = strconverter.to_bytes(graph_viewer.ModelPath().ToPathString());
auto model_path = strconverter.to_bytes(graph_viewer.ModelPath().string());
#endif
if (s_library_vitisaiep.compile_onnx_model_with_options) {
return vaip_core::DllSafe(s_library_vitisaiep.compile_onnx_model_with_options(model_path, graph_viewer.GetGraph(), options));
@ -218,7 +218,7 @@ vaip_core::OrtApiForVaip* create_org_api_hook() {
auto& logger = logging::LoggingManager::DefaultLogger();
auto& model = const_cast<onnxruntime::Model&>(const_model);
auto model_proto = model.ToProto();
auto file_path = model.MainGraph().ModelPath().ToPathString();
auto file_path = model.MainGraph().ModelPath().string();
auto local_registries = IOnnxRuntimeOpSchemaRegistryList{model.MainGraph().GetSchemaRegistry()};
auto ret = Model::Create(std::move(*model_proto), file_path, &local_registries, logger);
auto status = ret->MainGraph().Resolve();