diff options
author | CoprDistGit <infra@openeuler.org> | 2024-02-01 06:22:39 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2024-02-01 06:22:39 +0000 |
commit | 2e6205e7c427a3e0f79b954360d5309981308ecd (patch) | |
tree | c8cd1f1a3e7eee644a8a26f04d8c88012338c096 /0001-fix-forward-decl-flatbuffers.patch | |
parent | 163fafecf77c42a8ad9cd11cc33d9cd5cb89d71c (diff) |
automatic import of onnxruntime
Diffstat (limited to '0001-fix-forward-decl-flatbuffers.patch')
-rw-r--r-- | 0001-fix-forward-decl-flatbuffers.patch | 172 |
1 files changed, 172 insertions, 0 deletions
diff --git a/0001-fix-forward-decl-flatbuffers.patch b/0001-fix-forward-decl-flatbuffers.patch new file mode 100644 index 0000000..c80ccc6 --- /dev/null +++ b/0001-fix-forward-decl-flatbuffers.patch @@ -0,0 +1,172 @@ +From 9354134facbe2ab00546b45552bca62e2975c12c Mon Sep 17 00:00:00 2001 +From: binsz <274620705z@gmail.com> +Date: Wed, 31 Jan 2024 00:13:56 +0800 +Subject: [PATCH] fix forward decl flatbuffers + +--- + include/onnxruntime/core/graph/graph.h | 3 ++- + onnxruntime/core/flatbuffers/flatbuffers_utils.h | 15 +++------------ + .../core/framework/kernel_type_str_resolver.h | 2 +- + onnxruntime/core/framework/session_state.h | 3 ++- + onnxruntime/core/graph/graph_flatbuffers_utils.h | 2 +- + onnxruntime/core/graph/model.h | 3 ++- + onnxruntime/core/graph/op_identifier_utils.h | 2 +- + .../graph/runtime_optimization_record_container.h | 6 +++--- + 8 files changed, 15 insertions(+), 21 deletions(-) + +diff --git a/include/onnxruntime/core/graph/graph.h b/include/onnxruntime/core/graph/graph.h +index 81015b2..9ae5b13 100644 +--- a/include/onnxruntime/core/graph/graph.h ++++ b/include/onnxruntime/core/graph/graph.h +@@ -43,8 +43,9 @@ + #include "core/graph/node_arg.h" + #include "core/graph/ort_format_load_options.h" + ++#include <flatbuffers/flatbuffer_builder.h> ++ + namespace flatbuffers { +-class FlatBufferBuilder; + template <typename T> + struct Offset; + } // namespace flatbuffers +diff --git a/onnxruntime/core/flatbuffers/flatbuffers_utils.h b/onnxruntime/core/flatbuffers/flatbuffers_utils.h +index 4e7db4d..e4e100c 100644 +--- a/onnxruntime/core/flatbuffers/flatbuffers_utils.h ++++ b/onnxruntime/core/flatbuffers/flatbuffers_utils.h +@@ -8,22 +8,13 @@ + #include "core/common/common.h" + #include "core/common/path_string.h" + #include "core/common/status.h" ++#include <flatbuffers/vector.h> ++#include <flatbuffers/flatbuffer_builder.h> + + namespace ONNX_NAMESPACE { + class ValueInfoProto; + } + +-namespace flatbuffers { +-class FlatBufferBuilder; +- +-template <typename T> +-struct Offset; +- +-struct String; +- +-template <typename T> +-class Vector; +-} // namespace flatbuffers + + namespace onnxruntime { + +@@ -57,7 +48,7 @@ onnxruntime::common::Status LoadValueInfoOrtFormat( + const fbs::ValueInfo& fbs_value_info, ONNX_NAMESPACE::ValueInfoProto& value_info_proto); + + onnxruntime::common::Status LoadOpsetImportOrtFormat( +- const flatbuffers::Vector<flatbuffers::Offset<fbs::OperatorSetId>>* fbs_op_set_ids, ++ const flatbuffers::Vector<flatbuffers::Offset<fbs::OperatorSetId>, uint32_t>* fbs_op_set_ids, + std::unordered_map<std::string, int>& domain_to_version); + + // check if filename ends in .ort +diff --git a/onnxruntime/core/framework/kernel_type_str_resolver.h b/onnxruntime/core/framework/kernel_type_str_resolver.h +index 75fc2fa..e029e5c 100644 +--- a/onnxruntime/core/framework/kernel_type_str_resolver.h ++++ b/onnxruntime/core/framework/kernel_type_str_resolver.h +@@ -17,9 +17,9 @@ + #include "core/graph/op_identifier.h" + #include "core/graph/graph.h" + #include "core/platform/ort_mutex.h" ++#include <flatbuffers/flatbuffer_builder.h> + + namespace flatbuffers { +-class FlatBufferBuilder; + template <typename T> + struct Offset; + } // namespace flatbuffers +diff --git a/onnxruntime/core/framework/session_state.h b/onnxruntime/core/framework/session_state.h +index d546f26..5741a78 100644 +--- a/onnxruntime/core/framework/session_state.h ++++ b/onnxruntime/core/framework/session_state.h +@@ -43,8 +43,9 @@ + #include "core/framework/program_region.h" + #endif + ++#include <flatbuffers/flatbuffer_builder.h> ++ + namespace flatbuffers { +-class FlatBufferBuilder; + template <typename T> + struct Offset; + } // namespace flatbuffers +diff --git a/onnxruntime/core/graph/graph_flatbuffers_utils.h b/onnxruntime/core/graph/graph_flatbuffers_utils.h +index f4899ff..08b9345 100644 +--- a/onnxruntime/core/graph/graph_flatbuffers_utils.h ++++ b/onnxruntime/core/graph/graph_flatbuffers_utils.h +@@ -8,6 +8,7 @@ + #include "core/common/status.h" + #include "core/graph/ort_format_load_options.h" + #include "core/framework/tensor.h" ++#include <flatbuffers/flatbuffer_builder.h> + + namespace ONNX_NAMESPACE { + class AttributeProto; +@@ -19,7 +20,6 @@ class SparseTensorProto; + } // namespace ONNX_NAMESPACE + + namespace flatbuffers { +-class FlatBufferBuilder; + template <typename T> + struct Offset; + } // namespace flatbuffers +diff --git a/onnxruntime/core/graph/model.h b/onnxruntime/core/graph/model.h +index 5337211..cb03cf9 100644 +--- a/onnxruntime/core/graph/model.h ++++ b/onnxruntime/core/graph/model.h +@@ -15,8 +15,9 @@ + #include "core/graph/function_template.h" + #endif + ++#include <flatbuffers/flatbuffer_builder.h> ++ + namespace flatbuffers { +-class FlatBufferBuilder; + template <typename T> + struct Offset; + } // namespace flatbuffers +diff --git a/onnxruntime/core/graph/op_identifier_utils.h b/onnxruntime/core/graph/op_identifier_utils.h +index 265364a..be54a8c 100644 +--- a/onnxruntime/core/graph/op_identifier_utils.h ++++ b/onnxruntime/core/graph/op_identifier_utils.h +@@ -8,9 +8,9 @@ + #include "core/common/status.h" + #include "core/graph/graph.h" + #include "core/graph/onnx_protobuf.h" ++#include <flatbuffers/flatbuffer_builder.h> + + namespace flatbuffers { +-class FlatBufferBuilder; + + template <typename T> + struct Offset; +diff --git a/onnxruntime/core/graph/runtime_optimization_record_container.h b/onnxruntime/core/graph/runtime_optimization_record_container.h +index 5db784f..7fecf4a 100644 +--- a/onnxruntime/core/graph/runtime_optimization_record_container.h ++++ b/onnxruntime/core/graph/runtime_optimization_record_container.h +@@ -12,12 +12,12 @@ + #include "core/common/common.h" + #include "core/graph/runtime_optimization_record.h" + ++#include <flatbuffers/flatbuffer_builder.h> ++#include <flatbuffers/vector.h> ++ + namespace flatbuffers { +-class FlatBufferBuilder; + template <typename T> + struct Offset; +-template <typename T> +-class Vector; + } // namespace flatbuffers + + namespace onnxruntime { +-- +2.41.0 + |