From dab900dfa0f90b74c7580c9cb31b67064ca77b16 Mon Sep 17 00:00:00 2001 From: Scott McKay Date: Wed, 18 Jan 2023 13:45:00 +1000 Subject: [PATCH] Fix type mismatch when ORT_ENABLE_STREAM is off (#14324) ### Description PartitionIntoStreams was incorrectly using std::string instead of PathString for the config file argument when ORT_ENABLE_STREAM was not defined. Also Incorporate changes from #14291 to fix build and test issues. ### Motivation and Context Fix build error on Windows due to mismatched type. --- onnxruntime/core/framework/allocation_planner.cc | 3 ++- onnxruntime/test/shared_lib/test_io_types.cc | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/onnxruntime/core/framework/allocation_planner.cc b/onnxruntime/core/framework/allocation_planner.cc index 1d1ed277b5..0f0d6a3611 100644 --- a/onnxruntime/core/framework/allocation_planner.cc +++ b/onnxruntime/core/framework/allocation_planner.cc @@ -4,6 +4,7 @@ #include "core/framework/allocation_planner.h" #include #include +#include #include #include #include @@ -1720,7 +1721,7 @@ class PlannerImpl { #ifndef ORT_ENABLE_STREAM void PartitionIntoStreams(const logging::Logger& /*logger*/, const ExecutionProviders& /*execution_providers*/, - const std::string& /*partition_config_file*/) { + const PathString& /*partition_config_file*/) { stream_nodes_.push_back({}); node_stream_map_.resize(SafeInt(graph_viewer_.MaxNodeIndex()) + 1); for (auto node_index : graph_viewer_.GetNodesInTopologicalOrder()) { diff --git a/onnxruntime/test/shared_lib/test_io_types.cc b/onnxruntime/test/shared_lib/test_io_types.cc index 2266f4572c..86d09e1340 100644 --- a/onnxruntime/test/shared_lib/test_io_types.cc +++ b/onnxruntime/test/shared_lib/test_io_types.cc @@ -31,6 +31,8 @@ static void TestModelInfo(const Ort::Session& session, bool is_input, const std: ASSERT_EQ(real_dims, dims); } +#if !defined(ORT_MINIMAL_BUILD) +// onnx format models are not supported in a minimal build TEST(CApiTest, input_output_type_info) { constexpr const ORTCHAR_T* model_uri = ORT_TSTR("../models/opset8/test_squeezenet/model.onnx"); Ort::SessionOptions session_options; @@ -38,3 +40,4 @@ TEST(CApiTest, input_output_type_info) { TestModelInfo(session, true, {1, 3, 224, 224}); TestModelInfo(session, false, {1, 1000, 1, 1}); } +#endif