Fix type mismatch when ORT_ENABLE_STREAM is off (#14324)

### Description
<!-- Describe your changes. -->
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
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->
Fix build error on Windows due to mismatched type.
This commit is contained in:
Scott McKay 2023-01-18 13:45:00 +10:00 committed by GitHub
parent f6d0598b4d
commit dab900dfa0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View file

@ -4,6 +4,7 @@
#include "core/framework/allocation_planner.h"
#include <list>
#include <algorithm>
#include <deque>
#include <sstream>
#include <ctime>
#include <iomanip>
@ -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<size_t>(graph_viewer_.MaxNodeIndex()) + 1);
for (auto node_index : graph_viewer_.GetNodesInTopologicalOrder()) {

View file

@ -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