TT-MLIR
binary_generated.h
Go to the documentation of this file.
1 // automatically generated by the FlatBuffers compiler, do not modify
2 
3 
4 #ifndef FLATBUFFERS_GENERATED_BINARY_TT_TARGET_TTNN_H_
5 #define FLATBUFFERS_GENERATED_BINARY_TT_TARGET_TTNN_H_
6 
7 #include "flatbuffers/flatbuffers.h"
8 
9 // Ensure the included flatbuffers.h is the same version as when this file was
10 // generated, otherwise it may not be compatible.
11 static_assert(FLATBUFFERS_VERSION_MAJOR == 24 &&
12  FLATBUFFERS_VERSION_MINOR == 3 &&
13  FLATBUFFERS_VERSION_REVISION == 25,
14  "Non-compatible flatbuffers version included");
15 
16 #include "types_generated.h"
17 #include "version_generated.h"
18 #include "program_generated.h"
19 
20 // For access to the binary schema that produced this file.
21 #include "binary_bfbs_generated.h"
22 
23 namespace tt {
24 namespace target {
25 namespace ttnn {
26 
27 struct TTNNBinary;
28 struct TTNNBinaryBuilder;
29 
30 struct TTNNBinary FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
33  struct Traits;
34  enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
38  VT_PROGRAMS = 10
39  };
40  const tt::target::Version *version() const {
41  return GetStruct<const tt::target::Version *>(VT_VERSION);
42  }
43  const ::flatbuffers::String *ttmlir_git_hash() const {
44  return GetPointer<const ::flatbuffers::String *>(VT_TTMLIR_GIT_HASH);
45  }
46  const tt::target::SystemDesc *system_desc() const {
47  return GetPointer<const tt::target::SystemDesc *>(VT_SYSTEM_DESC);
48  }
49  const ::flatbuffers::Vector<::flatbuffers::Offset<tt::target::ttnn::Program>> *programs() const {
50  return GetPointer<const ::flatbuffers::Vector<::flatbuffers::Offset<tt::target::ttnn::Program>> *>(VT_PROGRAMS);
51  }
52  bool Verify(::flatbuffers::Verifier &verifier) const {
53  return VerifyTableStart(verifier) &&
54  VerifyField<tt::target::Version>(verifier, VT_VERSION, 4) &&
55  VerifyOffset(verifier, VT_TTMLIR_GIT_HASH) &&
56  verifier.VerifyString(ttmlir_git_hash()) &&
57  VerifyOffset(verifier, VT_SYSTEM_DESC) &&
58  verifier.VerifyTable(system_desc()) &&
59  VerifyOffset(verifier, VT_PROGRAMS) &&
60  verifier.VerifyVector(programs()) &&
61  verifier.VerifyVectorOfTables(programs()) &&
62  verifier.EndTable();
63  }
64 };
65 
67  typedef TTNNBinary Table;
68  ::flatbuffers::FlatBufferBuilder &fbb_;
69  ::flatbuffers::uoffset_t start_;
70  void add_version(const tt::target::Version *version) {
71  fbb_.AddStruct(TTNNBinary::VT_VERSION, version);
72  }
73  void add_ttmlir_git_hash(::flatbuffers::Offset<::flatbuffers::String> ttmlir_git_hash) {
74  fbb_.AddOffset(TTNNBinary::VT_TTMLIR_GIT_HASH, ttmlir_git_hash);
75  }
76  void add_system_desc(::flatbuffers::Offset<tt::target::SystemDesc> system_desc) {
77  fbb_.AddOffset(TTNNBinary::VT_SYSTEM_DESC, system_desc);
78  }
79  void add_programs(::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset<tt::target::ttnn::Program>>> programs) {
80  fbb_.AddOffset(TTNNBinary::VT_PROGRAMS, programs);
81  }
82  explicit TTNNBinaryBuilder(::flatbuffers::FlatBufferBuilder &_fbb)
83  : fbb_(_fbb) {
84  start_ = fbb_.StartTable();
85  }
86  ::flatbuffers::Offset<TTNNBinary> Finish() {
87  const auto end = fbb_.EndTable(start_);
88  auto o = ::flatbuffers::Offset<TTNNBinary>(end);
89  return o;
90  }
91 };
92 
93 inline ::flatbuffers::Offset<TTNNBinary> CreateTTNNBinary(
94  ::flatbuffers::FlatBufferBuilder &_fbb,
95  const tt::target::Version *version = nullptr,
96  ::flatbuffers::Offset<::flatbuffers::String> ttmlir_git_hash = 0,
97  ::flatbuffers::Offset<tt::target::SystemDesc> system_desc = 0,
98  ::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset<tt::target::ttnn::Program>>> programs = 0) {
99  TTNNBinaryBuilder builder_(_fbb);
100  builder_.add_programs(programs);
101  builder_.add_system_desc(system_desc);
102  builder_.add_ttmlir_git_hash(ttmlir_git_hash);
103  builder_.add_version(version);
104  return builder_.Finish();
105 }
106 
108  using type = TTNNBinary;
109  static auto constexpr Create = CreateTTNNBinary;
110 };
111 
112 inline ::flatbuffers::Offset<TTNNBinary> CreateTTNNBinaryDirect(
113  ::flatbuffers::FlatBufferBuilder &_fbb,
114  const tt::target::Version *version = nullptr,
115  const char *ttmlir_git_hash = nullptr,
116  ::flatbuffers::Offset<tt::target::SystemDesc> system_desc = 0,
117  const std::vector<::flatbuffers::Offset<tt::target::ttnn::Program>> *programs = nullptr) {
118  auto ttmlir_git_hash__ = ttmlir_git_hash ? _fbb.CreateString(ttmlir_git_hash) : 0;
119  auto programs__ = programs ? _fbb.CreateVector<::flatbuffers::Offset<tt::target::ttnn::Program>>(*programs) : 0;
121  _fbb,
122  version,
123  ttmlir_git_hash__,
124  system_desc,
125  programs__);
126 }
127 
128 inline const tt::target::ttnn::TTNNBinary *GetTTNNBinary(const void *buf) {
129  return ::flatbuffers::GetRoot<tt::target::ttnn::TTNNBinary>(buf);
130 }
131 
132 inline const tt::target::ttnn::TTNNBinary *GetSizePrefixedTTNNBinary(const void *buf) {
133  return ::flatbuffers::GetSizePrefixedRoot<tt::target::ttnn::TTNNBinary>(buf);
134 }
135 
136 inline const char *TTNNBinaryIdentifier() {
137  return "TTNN";
138 }
139 
140 inline bool TTNNBinaryBufferHasIdentifier(const void *buf) {
141  return ::flatbuffers::BufferHasIdentifier(
142  buf, TTNNBinaryIdentifier());
143 }
144 
145 inline bool SizePrefixedTTNNBinaryBufferHasIdentifier(const void *buf) {
146  return ::flatbuffers::BufferHasIdentifier(
147  buf, TTNNBinaryIdentifier(), true);
148 }
149 
151  ::flatbuffers::Verifier &verifier) {
152  return verifier.VerifyBuffer<tt::target::ttnn::TTNNBinary>(TTNNBinaryIdentifier());
153 }
154 
156  ::flatbuffers::Verifier &verifier) {
157  return verifier.VerifySizePrefixedBuffer<tt::target::ttnn::TTNNBinary>(TTNNBinaryIdentifier());
158 }
159 
160 inline const char *TTNNBinaryExtension() {
161  return "ttnn";
162 }
163 
165  ::flatbuffers::FlatBufferBuilder &fbb,
166  ::flatbuffers::Offset<tt::target::ttnn::TTNNBinary> root) {
167  fbb.Finish(root, TTNNBinaryIdentifier());
168 }
169 
171  ::flatbuffers::FlatBufferBuilder &fbb,
172  ::flatbuffers::Offset<tt::target::ttnn::TTNNBinary> root) {
173  fbb.FinishSizePrefixed(root, TTNNBinaryIdentifier());
174 }
175 
176 } // namespace ttnn
177 } // namespace target
178 } // namespace tt
179 
180 #endif // FLATBUFFERS_GENERATED_BINARY_TT_TARGET_TTNN_H_
VT_SYSTEM_DESC
Definition: binary_generated.h:249
VT_VERSION
Definition: binary_generated.h:247
VT_TTMLIR_GIT_HASH
Definition: binary_generated.h:248
bool VerifyTTNNBinaryBuffer(::flatbuffers::Verifier &verifier)
Definition: binary_generated.h:150
void FinishTTNNBinaryBuffer(::flatbuffers::FlatBufferBuilder &fbb, ::flatbuffers::Offset< tt::target::ttnn::TTNNBinary > root)
Definition: binary_generated.h:164
const char * TTNNBinaryIdentifier()
Definition: binary_generated.h:136
inline ::flatbuffers::Offset< TTNNBinary > CreateTTNNBinaryDirect(::flatbuffers::FlatBufferBuilder &_fbb, const tt::target::Version *version=nullptr, const char *ttmlir_git_hash=nullptr, ::flatbuffers::Offset< tt::target::SystemDesc > system_desc=0, const std::vector<::flatbuffers::Offset< tt::target::ttnn::Program >> *programs=nullptr)
Definition: binary_generated.h:112
bool TTNNBinaryBufferHasIdentifier(const void *buf)
Definition: binary_generated.h:140
void FinishSizePrefixedTTNNBinaryBuffer(::flatbuffers::FlatBufferBuilder &fbb, ::flatbuffers::Offset< tt::target::ttnn::TTNNBinary > root)
Definition: binary_generated.h:170
const tt::target::ttnn::TTNNBinary * GetSizePrefixedTTNNBinary(const void *buf)
Definition: binary_generated.h:132
inline ::flatbuffers::Offset< TTNNBinary > CreateTTNNBinary(::flatbuffers::FlatBufferBuilder &_fbb, const tt::target::Version *version=nullptr, ::flatbuffers::Offset<::flatbuffers::String > ttmlir_git_hash=0, ::flatbuffers::Offset< tt::target::SystemDesc > system_desc=0, ::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset< tt::target::ttnn::Program >>> programs=0)
Definition: binary_generated.h:93
const char * TTNNBinaryExtension()
Definition: binary_generated.h:160
bool SizePrefixedTTNNBinaryBufferHasIdentifier(const void *buf)
Definition: binary_generated.h:145
const tt::target::ttnn::TTNNBinary * GetTTNNBinary(const void *buf)
Definition: binary_generated.h:128
bool VerifySizePrefixedTTNNBinaryBuffer(::flatbuffers::Verifier &verifier)
Definition: binary_generated.h:155
Definition: debug_info_generated.h:18
Definition: binary_generated.h:30
const ::flatbuffers::Vector<::flatbuffers::Offset< tt::target::ttnn::Program > > * programs() const
Definition: binary_generated.h:49
const tt::target::Version * version() const
Definition: binary_generated.h:40
const tt::target::SystemDesc * system_desc() const
Definition: binary_generated.h:46
tt::target::ttnn::TTNNBinaryBinarySchema BinarySchema
Definition: binary_generated.h:32
bool Verify(::flatbuffers::Verifier &verifier) const
Definition: binary_generated.h:52
const ::flatbuffers::String * ttmlir_git_hash() const
Definition: binary_generated.h:43
TTNNBinaryBuilder Builder
Definition: binary_generated.h:31
Definition: binary_bfbs_generated.h:13
Definition: binary_generated.h:66
::flatbuffers::uoffset_t start_
Definition: binary_generated.h:69
void add_ttmlir_git_hash(::flatbuffers::Offset<::flatbuffers::String > ttmlir_git_hash)
Definition: binary_generated.h:73
void add_programs(::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset< tt::target::ttnn::Program >>> programs)
Definition: binary_generated.h:79
void add_system_desc(::flatbuffers::Offset< tt::target::SystemDesc > system_desc)
Definition: binary_generated.h:76
::flatbuffers::Offset< TTNNBinary > Finish()
Definition: binary_generated.h:86
TTNNBinary Table
Definition: binary_generated.h:67
TTNNBinaryBuilder(::flatbuffers::FlatBufferBuilder &_fbb)
Definition: binary_generated.h:82
::flatbuffers::FlatBufferBuilder & fbb_
Definition: binary_generated.h:68
void add_version(const tt::target::Version *version)
Definition: binary_generated.h:70
Definition: binary_generated.h:107
TTNNBinary type
Definition: binary_generated.h:108
static constexpr auto Create
Definition: binary_generated.h:109