1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
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
|