Skip to content

Commit

Permalink
Fix build break from removing custom ORT onnx protobuf (microsoft#4904)
Browse files Browse the repository at this point in the history
Exclude parsing of json config in model (also excludes json parsing library)
  • Loading branch information
skottmckay authored Aug 25, 2020
1 parent 71d8846 commit 14c6910
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
2 changes: 2 additions & 0 deletions include/onnxruntime/core/graph/onnx_protobuf.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ class OpSchema {};
#endif

#include "onnx/onnx_pb.h"
#include "onnx/onnx-operators_pb.h"

#ifdef __GNUC__
#pragma GCC diagnostic pop
#else
Expand Down
4 changes: 2 additions & 2 deletions onnxruntime/core/framework/execution_provider.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ IExecutionProvider::GetCapability(const onnxruntime::GraphViewer& graph,
}
}
}

return result;
#else
ORT_UNUSED_PARAMETER(graph);
ORT_UNUSED_PARAMETER(kernel_registries);
ORT_NOT_IMPLEMENTED("IExecutionProvider::GetCapability is not supported in this build.");
#endif

return result;
}

common::Status IExecutionProvider::Sync() const { return Status::OK(); };
Expand Down
6 changes: 5 additions & 1 deletion onnxruntime/core/session/inference_session_utils.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

#if !defined(ORT_MINIMAL_BUILD)

#include "core/session/inference_session_utils.h"

namespace onnxruntime {
Expand Down Expand Up @@ -36,7 +38,7 @@ static Status SetInterOpNumThreads(SessionOptions& session_options,
}

LOGS(logger, INFO) << "Setting inter_op_num_threads to " << value;
session_options.inter_op_param.thread_pool_size= value;
session_options.inter_op_param.thread_pool_size = value;
return Status::OK();
}

Expand Down Expand Up @@ -220,3 +222,5 @@ Status InferenceSessionUtils::ParseRunOptionsFromModelProto(RunOptions& /*run_op
}

} // namespace onnxruntime

#endif // !defined(ORT_MINIMAL_BUILD)
10 changes: 10 additions & 0 deletions onnxruntime/core/session/inference_session_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,18 @@
// Licensed under the MIT License.

#pragma once

// Currently everything here is unused in a minimal build.
// Leaving the file included in case there are other InferenceSession utils needed in a minimal build, as this would
// be the best place to add them.

#if !defined(ORT_MINIMAL_BUILD)

#include "core/graph/onnx_protobuf.h"
#include "core/session/inference_session.h"
#include "core/framework/session_options.h"
#include "core/common/common.h"

#ifdef _WIN32
#pragma warning(push)
#pragma warning(disable : 28020)
Expand Down Expand Up @@ -53,3 +61,5 @@ class InferenceSessionUtils {
};

} // namespace onnxruntime

#endif // !defined(ORT_MINIMAL_BUILD)

0 comments on commit 14c6910

Please sign in to comment.