mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-21 19:18:55 +00:00
### Description This change upgrade emsdk to 3.1.44. Because backend is upgraded to LLVM 16, so need to fix a lot of build failures caused by "-Wshorten-64-to-32". most of the build failures comes from generated `onnx.pb.h`, and this can be fixed by including "core/graph/onnx_protobuf.h", which detects and ignore shorten-64-to-32 warnings.
54 lines
1.4 KiB
C++
54 lines
1.4 KiB
C++
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
// Licensed under the MIT License.
|
|
|
|
#pragma once
|
|
|
|
#include "core/graph/op_identifier.h"
|
|
|
|
#include "core/common/status.h"
|
|
#include "core/graph/graph.h"
|
|
#include "core/graph/onnx_protobuf.h"
|
|
|
|
namespace flatbuffers {
|
|
class FlatBufferBuilder;
|
|
|
|
template <typename T>
|
|
struct Offset;
|
|
|
|
struct String;
|
|
} // namespace flatbuffers
|
|
|
|
namespace onnxruntime {
|
|
|
|
namespace fbs::utils {
|
|
|
|
#if !defined(ORT_MINIMAL_BUILD)
|
|
|
|
Status SaveOpIdentifierOrtFormat(flatbuffers::FlatBufferBuilder& builder,
|
|
const onnxruntime::OpIdentifier& op_id,
|
|
flatbuffers::Offset<flatbuffers::String>& fbs_op_id_str);
|
|
|
|
#endif // !defined(ORT_MINIMAL_BUILD)
|
|
|
|
Status LoadOpIdentifierOrtFormat(const flatbuffers::String& fbs_op_id_str,
|
|
onnxruntime::OpIdentifier& op_id);
|
|
|
|
} // namespace fbs::utils
|
|
|
|
namespace utils {
|
|
|
|
inline onnxruntime::OpIdentifier MakeOpId(const Node& node) {
|
|
return onnxruntime::OpIdentifier{node.Domain(), node.OpType(), node.SinceVersion()};
|
|
}
|
|
|
|
#if !defined(ORT_MINIMAL_BUILD)
|
|
|
|
inline onnxruntime::OpIdentifier MakeOpId(const ONNX_NAMESPACE::OpSchema& op_schema) {
|
|
return onnxruntime::OpIdentifier{op_schema.domain(), op_schema.Name(), op_schema.SinceVersion()};
|
|
}
|
|
|
|
#endif // !defined(ORT_MINIMAL_BUILD)
|
|
|
|
} // namespace utils
|
|
|
|
} // namespace onnxruntime
|