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 + namespace flatbuffers { -class FlatBufferBuilder; template 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 +#include namespace ONNX_NAMESPACE { class ValueInfoProto; } -namespace flatbuffers { -class FlatBufferBuilder; - -template -struct Offset; - -struct String; - -template -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>* fbs_op_set_ids, + const flatbuffers::Vector, uint32_t>* fbs_op_set_ids, std::unordered_map& 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 namespace flatbuffers { -class FlatBufferBuilder; template 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 + namespace flatbuffers { -class FlatBufferBuilder; template 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 namespace ONNX_NAMESPACE { class AttributeProto; @@ -19,7 +20,6 @@ class SparseTensorProto; } // namespace ONNX_NAMESPACE namespace flatbuffers { -class FlatBufferBuilder; template 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 + namespace flatbuffers { -class FlatBufferBuilder; template 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 namespace flatbuffers { -class FlatBufferBuilder; template 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 +#include + namespace flatbuffers { -class FlatBufferBuilder; template struct Offset; -template -class Vector; } // namespace flatbuffers namespace onnxruntime { -- 2.41.0