1 /* Copyright 2020 The TensorFlow Authors. All Rights Reserved.
2
3 Licensed under the Apache License, Version 2.0 (the "License");
4 you may not use this file except in compliance with the License.
5 You may obtain a copy of the License at
6
7 http://www.apache.org/licenses/LICENSE-2.0
8
9 Unless required by applicable law or agreed to in writing, software
10 distributed under the License is distributed on an "AS IS" BASIS,
11 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 See the License for the specific language governing permissions and
13 limitations under the License.
14 ==============================================================================*/
15 // automatically generated by the FlatBuffers compiler, do not modify
16
17
18 #ifndef FLATBUFFERS_GENERATED_SERIALIZATIONBASE_TFLITE_GPU_DATA_H_
19 #define FLATBUFFERS_GENERATED_SERIALIZATIONBASE_TFLITE_GPU_DATA_H_
20
21 #include "flatbuffers/flatbuffers.h"
22
23 namespace tflite {
24 namespace gpu {
25 namespace data {
26
27 struct Int4;
28 struct Int4Builder;
29
30 struct Int3;
31 struct Int3Builder;
32
33 struct Int2;
34 struct Int2Builder;
35
36 struct StateVariable;
37 struct StateVariableBuilder;
38
39 struct GPUObjectDescriptor;
40 struct GPUObjectDescriptorBuilder;
41
42 struct IntValue;
43 struct IntValueBuilder;
44
45 struct FloatValue;
46 struct FloatValueBuilder;
47
48 struct HalfValue;
49 struct HalfValueBuilder;
50
51 struct BufferDescriptor;
52 struct BufferDescriptorBuilder;
53
54 struct BHWDC;
55 struct BHWDCBuilder;
56
57 struct TensorDescriptor;
58 struct TensorDescriptorBuilder;
59
60 struct BufferDescriptorMapValue;
61 struct BufferDescriptorMapValueBuilder;
62
63 struct TensorDescriptorMapValue;
64 struct TensorDescriptorMapValueBuilder;
65
66 struct Arguments;
67 struct ArgumentsBuilder;
68
69 struct OperationDef;
70 struct OperationDefBuilder;
71
72 struct CompilerOption;
73 struct CompilerOptionBuilder;
74
75 struct GPUOperation;
76 struct GPUOperationBuilder;
77
78 enum class AccessType : int8_t {
79 READ = 0,
80 WRITE = 1,
81 READ_WRITE = 2,
82 MIN = READ,
83 MAX = READ_WRITE
84 };
85
EnumValuesAccessType()86 inline const AccessType (&EnumValuesAccessType())[3] {
87 static const AccessType values[] = {
88 AccessType::READ,
89 AccessType::WRITE,
90 AccessType::READ_WRITE
91 };
92 return values;
93 }
94
EnumNamesAccessType()95 inline const char * const *EnumNamesAccessType() {
96 static const char * const names[4] = {
97 "READ",
98 "WRITE",
99 "READ_WRITE",
100 nullptr
101 };
102 return names;
103 }
104
EnumNameAccessType(AccessType e)105 inline const char *EnumNameAccessType(AccessType e) {
106 if (flatbuffers::IsOutRange(e, AccessType::READ, AccessType::READ_WRITE)) return "";
107 const size_t index = static_cast<size_t>(e);
108 return EnumNamesAccessType()[index];
109 }
110
111 enum class DataType : int8_t {
112 UNKNOWN = 0,
113 FLOAT16 = 1,
114 FLOAT32 = 2,
115 FLOAT64 = 3,
116 UINT8 = 4,
117 INT8 = 5,
118 UINT16 = 6,
119 INT16 = 7,
120 UINT32 = 8,
121 INT32 = 9,
122 UINT64 = 10,
123 INT64 = 11,
124 BOOL = 12,
125 MIN = UNKNOWN,
126 MAX = BOOL
127 };
128
EnumValuesDataType()129 inline const DataType (&EnumValuesDataType())[13] {
130 static const DataType values[] = {
131 DataType::UNKNOWN,
132 DataType::FLOAT16,
133 DataType::FLOAT32,
134 DataType::FLOAT64,
135 DataType::UINT8,
136 DataType::INT8,
137 DataType::UINT16,
138 DataType::INT16,
139 DataType::UINT32,
140 DataType::INT32,
141 DataType::UINT64,
142 DataType::INT64,
143 DataType::BOOL
144 };
145 return values;
146 }
147
EnumNamesDataType()148 inline const char * const *EnumNamesDataType() {
149 static const char * const names[14] = {
150 "UNKNOWN",
151 "FLOAT16",
152 "FLOAT32",
153 "FLOAT64",
154 "UINT8",
155 "INT8",
156 "UINT16",
157 "INT16",
158 "UINT32",
159 "INT32",
160 "UINT64",
161 "INT64",
162 "BOOL",
163 nullptr
164 };
165 return names;
166 }
167
EnumNameDataType(DataType e)168 inline const char *EnumNameDataType(DataType e) {
169 if (flatbuffers::IsOutRange(e, DataType::UNKNOWN, DataType::BOOL)) return "";
170 const size_t index = static_cast<size_t>(e);
171 return EnumNamesDataType()[index];
172 }
173
174 enum class MemoryType : int8_t {
175 GLOBAL = 0,
176 CONSTANT = 1,
177 LOCAL = 2,
178 MIN = GLOBAL,
179 MAX = LOCAL
180 };
181
EnumValuesMemoryType()182 inline const MemoryType (&EnumValuesMemoryType())[3] {
183 static const MemoryType values[] = {
184 MemoryType::GLOBAL,
185 MemoryType::CONSTANT,
186 MemoryType::LOCAL
187 };
188 return values;
189 }
190
EnumNamesMemoryType()191 inline const char * const *EnumNamesMemoryType() {
192 static const char * const names[4] = {
193 "GLOBAL",
194 "CONSTANT",
195 "LOCAL",
196 nullptr
197 };
198 return names;
199 }
200
EnumNameMemoryType(MemoryType e)201 inline const char *EnumNameMemoryType(MemoryType e) {
202 if (flatbuffers::IsOutRange(e, MemoryType::GLOBAL, MemoryType::LOCAL)) return "";
203 const size_t index = static_cast<size_t>(e);
204 return EnumNamesMemoryType()[index];
205 }
206
207 enum class TensorStorageType : int8_t {
208 UNKNOWN = 0,
209 BUFFER = 1,
210 IMAGE_BUFFER = 2,
211 TEXTURE_2D = 3,
212 TEXTURE_3D = 4,
213 TEXTURE_ARRAY = 5,
214 SINGLE_TEXTURE_2D = 6,
215 MIN = UNKNOWN,
216 MAX = SINGLE_TEXTURE_2D
217 };
218
EnumValuesTensorStorageType()219 inline const TensorStorageType (&EnumValuesTensorStorageType())[7] {
220 static const TensorStorageType values[] = {
221 TensorStorageType::UNKNOWN,
222 TensorStorageType::BUFFER,
223 TensorStorageType::IMAGE_BUFFER,
224 TensorStorageType::TEXTURE_2D,
225 TensorStorageType::TEXTURE_3D,
226 TensorStorageType::TEXTURE_ARRAY,
227 TensorStorageType::SINGLE_TEXTURE_2D
228 };
229 return values;
230 }
231
EnumNamesTensorStorageType()232 inline const char * const *EnumNamesTensorStorageType() {
233 static const char * const names[8] = {
234 "UNKNOWN",
235 "BUFFER",
236 "IMAGE_BUFFER",
237 "TEXTURE_2D",
238 "TEXTURE_3D",
239 "TEXTURE_ARRAY",
240 "SINGLE_TEXTURE_2D",
241 nullptr
242 };
243 return names;
244 }
245
EnumNameTensorStorageType(TensorStorageType e)246 inline const char *EnumNameTensorStorageType(TensorStorageType e) {
247 if (flatbuffers::IsOutRange(e, TensorStorageType::UNKNOWN, TensorStorageType::SINGLE_TEXTURE_2D)) return "";
248 const size_t index = static_cast<size_t>(e);
249 return EnumNamesTensorStorageType()[index];
250 }
251
252 enum class Layout : int8_t {
253 UNKNOWN = 0,
254 HWC = 1,
255 BHWC = 2,
256 HWDC = 3,
257 BHWDC = 4,
258 LINEAR = 5,
259 HW = 6,
260 MIN = UNKNOWN,
261 MAX = HW
262 };
263
EnumValuesLayout()264 inline const Layout (&EnumValuesLayout())[7] {
265 static const Layout values[] = {
266 Layout::UNKNOWN, Layout::HWC, Layout::BHWC, Layout::HWDC,
267 Layout::BHWDC, Layout::LINEAR, Layout::HW};
268 return values;
269 }
270
EnumNamesLayout()271 inline const char * const *EnumNamesLayout() {
272 static const char *const names[8] = {"UNKNOWN", "HWC", "BHWC", "HWDC",
273 "BHWDC", "LINEAR", "HW", nullptr};
274 return names;
275 }
276
EnumNameLayout(Layout e)277 inline const char *EnumNameLayout(Layout e) {
278 if (flatbuffers::IsOutRange(e, Layout::UNKNOWN, Layout::HW)) return "";
279 const size_t index = static_cast<size_t>(e);
280 return EnumNamesLayout()[index];
281 }
282
283 enum class CalculationsPrecision : int8_t {
284 F32 = 0,
285 F32_F16 = 1,
286 F16 = 2,
287 MIN = F32,
288 MAX = F16
289 };
290
EnumValuesCalculationsPrecision()291 inline const CalculationsPrecision (&EnumValuesCalculationsPrecision())[3] {
292 static const CalculationsPrecision values[] = {
293 CalculationsPrecision::F32,
294 CalculationsPrecision::F32_F16,
295 CalculationsPrecision::F16
296 };
297 return values;
298 }
299
EnumNamesCalculationsPrecision()300 inline const char * const *EnumNamesCalculationsPrecision() {
301 static const char * const names[4] = {
302 "F32",
303 "F32_F16",
304 "F16",
305 nullptr
306 };
307 return names;
308 }
309
EnumNameCalculationsPrecision(CalculationsPrecision e)310 inline const char *EnumNameCalculationsPrecision(CalculationsPrecision e) {
311 if (flatbuffers::IsOutRange(e, CalculationsPrecision::F32, CalculationsPrecision::F16)) return "";
312 const size_t index = static_cast<size_t>(e);
313 return EnumNamesCalculationsPrecision()[index];
314 }
315
316 enum class TensorToGrid : int8_t {
317 CUSTOM = 0,
318 WB_TO_X_HD_TO_Y_S_TO_Z = 1,
319 WB_TO_X_HD_TO_Y_Z_IS_1 = 2,
320 WB_TO_X_H_TO_Y_D_TO_Z = 3,
321 B_TO_X_Y_IS_1_Z_IS_1 = 4,
322 MIN = CUSTOM,
323 MAX = B_TO_X_Y_IS_1_Z_IS_1
324 };
325
EnumValuesTensorToGrid()326 inline const TensorToGrid (&EnumValuesTensorToGrid())[5] {
327 static const TensorToGrid values[] = {
328 TensorToGrid::CUSTOM,
329 TensorToGrid::WB_TO_X_HD_TO_Y_S_TO_Z,
330 TensorToGrid::WB_TO_X_HD_TO_Y_Z_IS_1,
331 TensorToGrid::WB_TO_X_H_TO_Y_D_TO_Z,
332 TensorToGrid::B_TO_X_Y_IS_1_Z_IS_1
333 };
334 return values;
335 }
336
EnumNamesTensorToGrid()337 inline const char * const *EnumNamesTensorToGrid() {
338 static const char * const names[6] = {
339 "CUSTOM",
340 "WB_TO_X_HD_TO_Y_S_TO_Z",
341 "WB_TO_X_HD_TO_Y_Z_IS_1",
342 "WB_TO_X_H_TO_Y_D_TO_Z",
343 "B_TO_X_Y_IS_1_Z_IS_1",
344 nullptr
345 };
346 return names;
347 }
348
EnumNameTensorToGrid(TensorToGrid e)349 inline const char *EnumNameTensorToGrid(TensorToGrid e) {
350 if (flatbuffers::IsOutRange(e, TensorToGrid::CUSTOM, TensorToGrid::B_TO_X_Y_IS_1_Z_IS_1)) return "";
351 const size_t index = static_cast<size_t>(e);
352 return EnumNamesTensorToGrid()[index];
353 }
354
355 enum class CompilerOptions : int8_t {
356 ADRENO_FULL_SIMD_LINE = 0,
357 ADRENO_MORE_WAVES = 1,
358 CL_FAST_RELAXED_MATH = 2,
359 CL_OPT_DISABLE = 3,
360 CL_2_0 = 4,
361 CL_3_0 = 5,
362 MIN = ADRENO_FULL_SIMD_LINE,
363 MAX = CL_3_0
364 };
365
EnumValuesCompilerOptions()366 inline const CompilerOptions (&EnumValuesCompilerOptions())[6] {
367 static const CompilerOptions values[] = {
368 CompilerOptions::ADRENO_FULL_SIMD_LINE,
369 CompilerOptions::ADRENO_MORE_WAVES,
370 CompilerOptions::CL_FAST_RELAXED_MATH,
371 CompilerOptions::CL_OPT_DISABLE,
372 CompilerOptions::CL_2_0,
373 CompilerOptions::CL_3_0
374 };
375 return values;
376 }
377
EnumNamesCompilerOptions()378 inline const char * const *EnumNamesCompilerOptions() {
379 static const char * const names[7] = {
380 "ADRENO_FULL_SIMD_LINE",
381 "ADRENO_MORE_WAVES",
382 "CL_FAST_RELAXED_MATH",
383 "CL_OPT_DISABLE",
384 "CL_2_0",
385 "CL_3_0",
386 nullptr
387 };
388 return names;
389 }
390
EnumNameCompilerOptions(CompilerOptions e)391 inline const char *EnumNameCompilerOptions(CompilerOptions e) {
392 if (flatbuffers::IsOutRange(e, CompilerOptions::ADRENO_FULL_SIMD_LINE, CompilerOptions::CL_3_0)) return "";
393 const size_t index = static_cast<size_t>(e);
394 return EnumNamesCompilerOptions()[index];
395 }
396
397 struct Int4 FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
398 typedef Int4Builder Builder;
399 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
400 VT_X = 4,
401 VT_Y = 6,
402 VT_Z = 8,
403 VT_W = 10
404 };
xFLATBUFFERS_FINAL_CLASS405 int32_t x() const {
406 return GetField<int32_t>(VT_X, 0);
407 }
yFLATBUFFERS_FINAL_CLASS408 int32_t y() const {
409 return GetField<int32_t>(VT_Y, 0);
410 }
zFLATBUFFERS_FINAL_CLASS411 int32_t z() const {
412 return GetField<int32_t>(VT_Z, 0);
413 }
wFLATBUFFERS_FINAL_CLASS414 int32_t w() const {
415 return GetField<int32_t>(VT_W, 0);
416 }
VerifyFLATBUFFERS_FINAL_CLASS417 bool Verify(flatbuffers::Verifier &verifier) const {
418 return VerifyTableStart(verifier) &&
419 VerifyField<int32_t>(verifier, VT_X, 4) &&
420 VerifyField<int32_t>(verifier, VT_Y, 4) &&
421 VerifyField<int32_t>(verifier, VT_Z, 4) &&
422 VerifyField<int32_t>(verifier, VT_W, 4) &&
423 verifier.EndTable();
424 }
425 };
426
427 struct Int4Builder {
428 typedef Int4 Table;
429 flatbuffers::FlatBufferBuilder &fbb_;
430 flatbuffers::uoffset_t start_;
add_xInt4Builder431 void add_x(int32_t x) {
432 fbb_.AddElement<int32_t>(Int4::VT_X, x, 0);
433 }
add_yInt4Builder434 void add_y(int32_t y) {
435 fbb_.AddElement<int32_t>(Int4::VT_Y, y, 0);
436 }
add_zInt4Builder437 void add_z(int32_t z) {
438 fbb_.AddElement<int32_t>(Int4::VT_Z, z, 0);
439 }
add_wInt4Builder440 void add_w(int32_t w) {
441 fbb_.AddElement<int32_t>(Int4::VT_W, w, 0);
442 }
Int4BuilderInt4Builder443 explicit Int4Builder(flatbuffers::FlatBufferBuilder &_fbb)
444 : fbb_(_fbb) {
445 start_ = fbb_.StartTable();
446 }
FinishInt4Builder447 flatbuffers::Offset<Int4> Finish() {
448 const auto end = fbb_.EndTable(start_);
449 auto o = flatbuffers::Offset<Int4>(end);
450 return o;
451 }
452 };
453
454 inline flatbuffers::Offset<Int4> CreateInt4(
455 flatbuffers::FlatBufferBuilder &_fbb,
456 int32_t x = 0,
457 int32_t y = 0,
458 int32_t z = 0,
459 int32_t w = 0) {
460 Int4Builder builder_(_fbb);
461 builder_.add_w(w);
462 builder_.add_z(z);
463 builder_.add_y(y);
464 builder_.add_x(x);
465 return builder_.Finish();
466 }
467
468 struct Int3 FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
469 typedef Int3Builder Builder;
470 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
471 VT_X = 4,
472 VT_Y = 6,
473 VT_Z = 8
474 };
xFLATBUFFERS_FINAL_CLASS475 int32_t x() const {
476 return GetField<int32_t>(VT_X, 0);
477 }
yFLATBUFFERS_FINAL_CLASS478 int32_t y() const {
479 return GetField<int32_t>(VT_Y, 0);
480 }
zFLATBUFFERS_FINAL_CLASS481 int32_t z() const {
482 return GetField<int32_t>(VT_Z, 0);
483 }
VerifyFLATBUFFERS_FINAL_CLASS484 bool Verify(flatbuffers::Verifier &verifier) const {
485 return VerifyTableStart(verifier) &&
486 VerifyField<int32_t>(verifier, VT_X, 4) &&
487 VerifyField<int32_t>(verifier, VT_Y, 4) &&
488 VerifyField<int32_t>(verifier, VT_Z, 4) &&
489 verifier.EndTable();
490 }
491 };
492
493 struct Int3Builder {
494 typedef Int3 Table;
495 flatbuffers::FlatBufferBuilder &fbb_;
496 flatbuffers::uoffset_t start_;
add_xInt3Builder497 void add_x(int32_t x) {
498 fbb_.AddElement<int32_t>(Int3::VT_X, x, 0);
499 }
add_yInt3Builder500 void add_y(int32_t y) {
501 fbb_.AddElement<int32_t>(Int3::VT_Y, y, 0);
502 }
add_zInt3Builder503 void add_z(int32_t z) {
504 fbb_.AddElement<int32_t>(Int3::VT_Z, z, 0);
505 }
Int3BuilderInt3Builder506 explicit Int3Builder(flatbuffers::FlatBufferBuilder &_fbb)
507 : fbb_(_fbb) {
508 start_ = fbb_.StartTable();
509 }
FinishInt3Builder510 flatbuffers::Offset<Int3> Finish() {
511 const auto end = fbb_.EndTable(start_);
512 auto o = flatbuffers::Offset<Int3>(end);
513 return o;
514 }
515 };
516
517 inline flatbuffers::Offset<Int3> CreateInt3(
518 flatbuffers::FlatBufferBuilder &_fbb,
519 int32_t x = 0,
520 int32_t y = 0,
521 int32_t z = 0) {
522 Int3Builder builder_(_fbb);
523 builder_.add_z(z);
524 builder_.add_y(y);
525 builder_.add_x(x);
526 return builder_.Finish();
527 }
528
529 struct Int2 FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
530 typedef Int2Builder Builder;
531 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
532 VT_X = 4,
533 VT_Y = 6
534 };
xFLATBUFFERS_FINAL_CLASS535 int32_t x() const {
536 return GetField<int32_t>(VT_X, 0);
537 }
yFLATBUFFERS_FINAL_CLASS538 int32_t y() const {
539 return GetField<int32_t>(VT_Y, 0);
540 }
VerifyFLATBUFFERS_FINAL_CLASS541 bool Verify(flatbuffers::Verifier &verifier) const {
542 return VerifyTableStart(verifier) &&
543 VerifyField<int32_t>(verifier, VT_X, 4) &&
544 VerifyField<int32_t>(verifier, VT_Y, 4) &&
545 verifier.EndTable();
546 }
547 };
548
549 struct Int2Builder {
550 typedef Int2 Table;
551 flatbuffers::FlatBufferBuilder &fbb_;
552 flatbuffers::uoffset_t start_;
add_xInt2Builder553 void add_x(int32_t x) {
554 fbb_.AddElement<int32_t>(Int2::VT_X, x, 0);
555 }
add_yInt2Builder556 void add_y(int32_t y) {
557 fbb_.AddElement<int32_t>(Int2::VT_Y, y, 0);
558 }
Int2BuilderInt2Builder559 explicit Int2Builder(flatbuffers::FlatBufferBuilder &_fbb)
560 : fbb_(_fbb) {
561 start_ = fbb_.StartTable();
562 }
FinishInt2Builder563 flatbuffers::Offset<Int2> Finish() {
564 const auto end = fbb_.EndTable(start_);
565 auto o = flatbuffers::Offset<Int2>(end);
566 return o;
567 }
568 };
569
570 inline flatbuffers::Offset<Int2> CreateInt2(
571 flatbuffers::FlatBufferBuilder &_fbb,
572 int32_t x = 0,
573 int32_t y = 0) {
574 Int2Builder builder_(_fbb);
575 builder_.add_y(y);
576 builder_.add_x(x);
577 return builder_.Finish();
578 }
579
580 struct StateVariable FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
581 typedef StateVariableBuilder Builder;
582 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
583 VT_KEY = 4,
584 VT_VALUE = 6
585 };
keyFLATBUFFERS_FINAL_CLASS586 const flatbuffers::String *key() const {
587 return GetPointer<const flatbuffers::String *>(VT_KEY);
588 }
valueFLATBUFFERS_FINAL_CLASS589 const flatbuffers::String *value() const {
590 return GetPointer<const flatbuffers::String *>(VT_VALUE);
591 }
VerifyFLATBUFFERS_FINAL_CLASS592 bool Verify(flatbuffers::Verifier &verifier) const {
593 return VerifyTableStart(verifier) &&
594 VerifyOffset(verifier, VT_KEY) &&
595 verifier.VerifyString(key()) &&
596 VerifyOffset(verifier, VT_VALUE) &&
597 verifier.VerifyString(value()) &&
598 verifier.EndTable();
599 }
600 };
601
602 struct StateVariableBuilder {
603 typedef StateVariable Table;
604 flatbuffers::FlatBufferBuilder &fbb_;
605 flatbuffers::uoffset_t start_;
add_keyStateVariableBuilder606 void add_key(flatbuffers::Offset<flatbuffers::String> key) {
607 fbb_.AddOffset(StateVariable::VT_KEY, key);
608 }
add_valueStateVariableBuilder609 void add_value(flatbuffers::Offset<flatbuffers::String> value) {
610 fbb_.AddOffset(StateVariable::VT_VALUE, value);
611 }
StateVariableBuilderStateVariableBuilder612 explicit StateVariableBuilder(flatbuffers::FlatBufferBuilder &_fbb)
613 : fbb_(_fbb) {
614 start_ = fbb_.StartTable();
615 }
FinishStateVariableBuilder616 flatbuffers::Offset<StateVariable> Finish() {
617 const auto end = fbb_.EndTable(start_);
618 auto o = flatbuffers::Offset<StateVariable>(end);
619 return o;
620 }
621 };
622
623 inline flatbuffers::Offset<StateVariable> CreateStateVariable(
624 flatbuffers::FlatBufferBuilder &_fbb,
625 flatbuffers::Offset<flatbuffers::String> key = 0,
626 flatbuffers::Offset<flatbuffers::String> value = 0) {
627 StateVariableBuilder builder_(_fbb);
628 builder_.add_value(value);
629 builder_.add_key(key);
630 return builder_.Finish();
631 }
632
633 inline flatbuffers::Offset<StateVariable> CreateStateVariableDirect(
634 flatbuffers::FlatBufferBuilder &_fbb,
635 const char *key = nullptr,
636 const char *value = nullptr) {
637 auto key__ = key ? _fbb.CreateString(key) : 0;
638 auto value__ = value ? _fbb.CreateString(value) : 0;
639 return tflite::gpu::data::CreateStateVariable(
640 _fbb,
641 key__,
642 value__);
643 }
644
645 struct GPUObjectDescriptor FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
646 typedef GPUObjectDescriptorBuilder Builder;
647 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
648 VT_STATE_VARS = 4,
649 VT_ACCESS_TYPE = 6
650 };
state_varsFLATBUFFERS_FINAL_CLASS651 const flatbuffers::Vector<flatbuffers::Offset<tflite::gpu::data::StateVariable>> *state_vars() const {
652 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<tflite::gpu::data::StateVariable>> *>(VT_STATE_VARS);
653 }
access_typeFLATBUFFERS_FINAL_CLASS654 tflite::gpu::data::AccessType access_type() const {
655 return static_cast<tflite::gpu::data::AccessType>(GetField<int8_t>(VT_ACCESS_TYPE, 0));
656 }
VerifyFLATBUFFERS_FINAL_CLASS657 bool Verify(flatbuffers::Verifier &verifier) const {
658 return VerifyTableStart(verifier) &&
659 VerifyOffset(verifier, VT_STATE_VARS) &&
660 verifier.VerifyVector(state_vars()) &&
661 verifier.VerifyVectorOfTables(state_vars()) &&
662 VerifyField<int8_t>(verifier, VT_ACCESS_TYPE, 1) &&
663 verifier.EndTable();
664 }
665 };
666
667 struct GPUObjectDescriptorBuilder {
668 typedef GPUObjectDescriptor Table;
669 flatbuffers::FlatBufferBuilder &fbb_;
670 flatbuffers::uoffset_t start_;
add_state_varsGPUObjectDescriptorBuilder671 void add_state_vars(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<tflite::gpu::data::StateVariable>>> state_vars) {
672 fbb_.AddOffset(GPUObjectDescriptor::VT_STATE_VARS, state_vars);
673 }
add_access_typeGPUObjectDescriptorBuilder674 void add_access_type(tflite::gpu::data::AccessType access_type) {
675 fbb_.AddElement<int8_t>(GPUObjectDescriptor::VT_ACCESS_TYPE, static_cast<int8_t>(access_type), 0);
676 }
GPUObjectDescriptorBuilderGPUObjectDescriptorBuilder677 explicit GPUObjectDescriptorBuilder(flatbuffers::FlatBufferBuilder &_fbb)
678 : fbb_(_fbb) {
679 start_ = fbb_.StartTable();
680 }
FinishGPUObjectDescriptorBuilder681 flatbuffers::Offset<GPUObjectDescriptor> Finish() {
682 const auto end = fbb_.EndTable(start_);
683 auto o = flatbuffers::Offset<GPUObjectDescriptor>(end);
684 return o;
685 }
686 };
687
688 inline flatbuffers::Offset<GPUObjectDescriptor> CreateGPUObjectDescriptor(
689 flatbuffers::FlatBufferBuilder &_fbb,
690 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<tflite::gpu::data::StateVariable>>> state_vars = 0,
691 tflite::gpu::data::AccessType access_type = tflite::gpu::data::AccessType::READ) {
692 GPUObjectDescriptorBuilder builder_(_fbb);
693 builder_.add_state_vars(state_vars);
694 builder_.add_access_type(access_type);
695 return builder_.Finish();
696 }
697
698 inline flatbuffers::Offset<GPUObjectDescriptor> CreateGPUObjectDescriptorDirect(
699 flatbuffers::FlatBufferBuilder &_fbb,
700 const std::vector<flatbuffers::Offset<tflite::gpu::data::StateVariable>> *state_vars = nullptr,
701 tflite::gpu::data::AccessType access_type = tflite::gpu::data::AccessType::READ) {
702 auto state_vars__ = state_vars ? _fbb.CreateVector<flatbuffers::Offset<tflite::gpu::data::StateVariable>>(*state_vars) : 0;
703 return tflite::gpu::data::CreateGPUObjectDescriptor(
704 _fbb,
705 state_vars__,
706 access_type);
707 }
708
709 struct IntValue FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
710 typedef IntValueBuilder Builder;
711 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
712 VT_NAME = 4,
713 VT_VALUE = 6,
714 VT_ACTIVE = 8
715 };
nameFLATBUFFERS_FINAL_CLASS716 const flatbuffers::String *name() const {
717 return GetPointer<const flatbuffers::String *>(VT_NAME);
718 }
valueFLATBUFFERS_FINAL_CLASS719 int32_t value() const {
720 return GetField<int32_t>(VT_VALUE, 0);
721 }
activeFLATBUFFERS_FINAL_CLASS722 bool active() const {
723 return GetField<uint8_t>(VT_ACTIVE, 0) != 0;
724 }
VerifyFLATBUFFERS_FINAL_CLASS725 bool Verify(flatbuffers::Verifier &verifier) const {
726 return VerifyTableStart(verifier) &&
727 VerifyOffset(verifier, VT_NAME) &&
728 verifier.VerifyString(name()) &&
729 VerifyField<int32_t>(verifier, VT_VALUE, 4) &&
730 VerifyField<uint8_t>(verifier, VT_ACTIVE, 1) &&
731 verifier.EndTable();
732 }
733 };
734
735 struct IntValueBuilder {
736 typedef IntValue Table;
737 flatbuffers::FlatBufferBuilder &fbb_;
738 flatbuffers::uoffset_t start_;
add_nameIntValueBuilder739 void add_name(flatbuffers::Offset<flatbuffers::String> name) {
740 fbb_.AddOffset(IntValue::VT_NAME, name);
741 }
add_valueIntValueBuilder742 void add_value(int32_t value) {
743 fbb_.AddElement<int32_t>(IntValue::VT_VALUE, value, 0);
744 }
add_activeIntValueBuilder745 void add_active(bool active) {
746 fbb_.AddElement<uint8_t>(IntValue::VT_ACTIVE, static_cast<uint8_t>(active), 0);
747 }
IntValueBuilderIntValueBuilder748 explicit IntValueBuilder(flatbuffers::FlatBufferBuilder &_fbb)
749 : fbb_(_fbb) {
750 start_ = fbb_.StartTable();
751 }
FinishIntValueBuilder752 flatbuffers::Offset<IntValue> Finish() {
753 const auto end = fbb_.EndTable(start_);
754 auto o = flatbuffers::Offset<IntValue>(end);
755 return o;
756 }
757 };
758
759 inline flatbuffers::Offset<IntValue> CreateIntValue(
760 flatbuffers::FlatBufferBuilder &_fbb,
761 flatbuffers::Offset<flatbuffers::String> name = 0,
762 int32_t value = 0,
763 bool active = false) {
764 IntValueBuilder builder_(_fbb);
765 builder_.add_value(value);
766 builder_.add_name(name);
767 builder_.add_active(active);
768 return builder_.Finish();
769 }
770
771 inline flatbuffers::Offset<IntValue> CreateIntValueDirect(
772 flatbuffers::FlatBufferBuilder &_fbb,
773 const char *name = nullptr,
774 int32_t value = 0,
775 bool active = false) {
776 auto name__ = name ? _fbb.CreateString(name) : 0;
777 return tflite::gpu::data::CreateIntValue(
778 _fbb,
779 name__,
780 value,
781 active);
782 }
783
784 struct FloatValue FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
785 typedef FloatValueBuilder Builder;
786 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
787 VT_NAME = 4,
788 VT_VALUE = 6,
789 VT_ACTIVE = 8
790 };
nameFLATBUFFERS_FINAL_CLASS791 const flatbuffers::String *name() const {
792 return GetPointer<const flatbuffers::String *>(VT_NAME);
793 }
valueFLATBUFFERS_FINAL_CLASS794 float value() const {
795 return GetField<float>(VT_VALUE, 0.0f);
796 }
activeFLATBUFFERS_FINAL_CLASS797 bool active() const {
798 return GetField<uint8_t>(VT_ACTIVE, 0) != 0;
799 }
VerifyFLATBUFFERS_FINAL_CLASS800 bool Verify(flatbuffers::Verifier &verifier) const {
801 return VerifyTableStart(verifier) &&
802 VerifyOffset(verifier, VT_NAME) &&
803 verifier.VerifyString(name()) &&
804 VerifyField<float>(verifier, VT_VALUE, 4) &&
805 VerifyField<uint8_t>(verifier, VT_ACTIVE, 1) &&
806 verifier.EndTable();
807 }
808 };
809
810 struct FloatValueBuilder {
811 typedef FloatValue Table;
812 flatbuffers::FlatBufferBuilder &fbb_;
813 flatbuffers::uoffset_t start_;
add_nameFloatValueBuilder814 void add_name(flatbuffers::Offset<flatbuffers::String> name) {
815 fbb_.AddOffset(FloatValue::VT_NAME, name);
816 }
add_valueFloatValueBuilder817 void add_value(float value) {
818 fbb_.AddElement<float>(FloatValue::VT_VALUE, value, 0.0f);
819 }
add_activeFloatValueBuilder820 void add_active(bool active) {
821 fbb_.AddElement<uint8_t>(FloatValue::VT_ACTIVE, static_cast<uint8_t>(active), 0);
822 }
FloatValueBuilderFloatValueBuilder823 explicit FloatValueBuilder(flatbuffers::FlatBufferBuilder &_fbb)
824 : fbb_(_fbb) {
825 start_ = fbb_.StartTable();
826 }
FinishFloatValueBuilder827 flatbuffers::Offset<FloatValue> Finish() {
828 const auto end = fbb_.EndTable(start_);
829 auto o = flatbuffers::Offset<FloatValue>(end);
830 return o;
831 }
832 };
833
834 inline flatbuffers::Offset<FloatValue> CreateFloatValue(
835 flatbuffers::FlatBufferBuilder &_fbb,
836 flatbuffers::Offset<flatbuffers::String> name = 0,
837 float value = 0.0f,
838 bool active = false) {
839 FloatValueBuilder builder_(_fbb);
840 builder_.add_value(value);
841 builder_.add_name(name);
842 builder_.add_active(active);
843 return builder_.Finish();
844 }
845
846 inline flatbuffers::Offset<FloatValue> CreateFloatValueDirect(
847 flatbuffers::FlatBufferBuilder &_fbb,
848 const char *name = nullptr,
849 float value = 0.0f,
850 bool active = false) {
851 auto name__ = name ? _fbb.CreateString(name) : 0;
852 return tflite::gpu::data::CreateFloatValue(
853 _fbb,
854 name__,
855 value,
856 active);
857 }
858
859 struct HalfValue FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
860 typedef HalfValueBuilder Builder;
861 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
862 VT_NAME = 4,
863 VT_VALUE = 6,
864 VT_ACTIVE = 8
865 };
nameFLATBUFFERS_FINAL_CLASS866 const flatbuffers::String *name() const {
867 return GetPointer<const flatbuffers::String *>(VT_NAME);
868 }
valueFLATBUFFERS_FINAL_CLASS869 float value() const {
870 return GetField<float>(VT_VALUE, 0.0f);
871 }
activeFLATBUFFERS_FINAL_CLASS872 bool active() const {
873 return GetField<uint8_t>(VT_ACTIVE, 0) != 0;
874 }
VerifyFLATBUFFERS_FINAL_CLASS875 bool Verify(flatbuffers::Verifier &verifier) const {
876 return VerifyTableStart(verifier) &&
877 VerifyOffset(verifier, VT_NAME) &&
878 verifier.VerifyString(name()) &&
879 VerifyField<float>(verifier, VT_VALUE, 4) &&
880 VerifyField<uint8_t>(verifier, VT_ACTIVE, 1) &&
881 verifier.EndTable();
882 }
883 };
884
885 struct HalfValueBuilder {
886 typedef HalfValue Table;
887 flatbuffers::FlatBufferBuilder &fbb_;
888 flatbuffers::uoffset_t start_;
add_nameHalfValueBuilder889 void add_name(flatbuffers::Offset<flatbuffers::String> name) {
890 fbb_.AddOffset(HalfValue::VT_NAME, name);
891 }
add_valueHalfValueBuilder892 void add_value(float value) {
893 fbb_.AddElement<float>(HalfValue::VT_VALUE, value, 0.0f);
894 }
add_activeHalfValueBuilder895 void add_active(bool active) {
896 fbb_.AddElement<uint8_t>(HalfValue::VT_ACTIVE, static_cast<uint8_t>(active), 0);
897 }
HalfValueBuilderHalfValueBuilder898 explicit HalfValueBuilder(flatbuffers::FlatBufferBuilder &_fbb)
899 : fbb_(_fbb) {
900 start_ = fbb_.StartTable();
901 }
FinishHalfValueBuilder902 flatbuffers::Offset<HalfValue> Finish() {
903 const auto end = fbb_.EndTable(start_);
904 auto o = flatbuffers::Offset<HalfValue>(end);
905 return o;
906 }
907 };
908
909 inline flatbuffers::Offset<HalfValue> CreateHalfValue(
910 flatbuffers::FlatBufferBuilder &_fbb,
911 flatbuffers::Offset<flatbuffers::String> name = 0,
912 float value = 0.0f,
913 bool active = false) {
914 HalfValueBuilder builder_(_fbb);
915 builder_.add_value(value);
916 builder_.add_name(name);
917 builder_.add_active(active);
918 return builder_.Finish();
919 }
920
921 inline flatbuffers::Offset<HalfValue> CreateHalfValueDirect(
922 flatbuffers::FlatBufferBuilder &_fbb,
923 const char *name = nullptr,
924 float value = 0.0f,
925 bool active = false) {
926 auto name__ = name ? _fbb.CreateString(name) : 0;
927 return tflite::gpu::data::CreateHalfValue(
928 _fbb,
929 name__,
930 value,
931 active);
932 }
933
934 struct BufferDescriptor FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
935 typedef BufferDescriptorBuilder Builder;
936 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
937 VT_BASE_OBJ = 4,
938 VT_ELEMENT_TYPE = 6,
939 VT_ELEMENT_SIZE = 8,
940 VT_MEMORY_TYPE = 10,
941 VT_ATTRIBUTES = 12,
942 VT_SIZE = 14,
943 VT_DATA = 16
944 };
base_objFLATBUFFERS_FINAL_CLASS945 const tflite::gpu::data::GPUObjectDescriptor *base_obj() const {
946 return GetPointer<const tflite::gpu::data::GPUObjectDescriptor *>(VT_BASE_OBJ);
947 }
element_typeFLATBUFFERS_FINAL_CLASS948 tflite::gpu::data::DataType element_type() const {
949 return static_cast<tflite::gpu::data::DataType>(GetField<int8_t>(VT_ELEMENT_TYPE, 0));
950 }
element_sizeFLATBUFFERS_FINAL_CLASS951 int32_t element_size() const {
952 return GetField<int32_t>(VT_ELEMENT_SIZE, 0);
953 }
memory_typeFLATBUFFERS_FINAL_CLASS954 tflite::gpu::data::MemoryType memory_type() const {
955 return static_cast<tflite::gpu::data::MemoryType>(GetField<int8_t>(VT_MEMORY_TYPE, 0));
956 }
attributesFLATBUFFERS_FINAL_CLASS957 const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *attributes() const {
958 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *>(VT_ATTRIBUTES);
959 }
sizeFLATBUFFERS_FINAL_CLASS960 int32_t size() const {
961 return GetField<int32_t>(VT_SIZE, 0);
962 }
dataFLATBUFFERS_FINAL_CLASS963 const flatbuffers::Vector<uint8_t> *data() const {
964 return GetPointer<const flatbuffers::Vector<uint8_t> *>(VT_DATA);
965 }
VerifyFLATBUFFERS_FINAL_CLASS966 bool Verify(flatbuffers::Verifier &verifier) const {
967 return VerifyTableStart(verifier) &&
968 VerifyOffset(verifier, VT_BASE_OBJ) &&
969 verifier.VerifyTable(base_obj()) &&
970 VerifyField<int8_t>(verifier, VT_ELEMENT_TYPE, 1) &&
971 VerifyField<int32_t>(verifier, VT_ELEMENT_SIZE, 4) &&
972 VerifyField<int8_t>(verifier, VT_MEMORY_TYPE, 1) &&
973 VerifyOffset(verifier, VT_ATTRIBUTES) &&
974 verifier.VerifyVector(attributes()) &&
975 verifier.VerifyVectorOfStrings(attributes()) &&
976 VerifyField<int32_t>(verifier, VT_SIZE, 4) &&
977 VerifyOffset(verifier, VT_DATA) &&
978 verifier.VerifyVector(data()) &&
979 verifier.EndTable();
980 }
981 };
982
983 struct BufferDescriptorBuilder {
984 typedef BufferDescriptor Table;
985 flatbuffers::FlatBufferBuilder &fbb_;
986 flatbuffers::uoffset_t start_;
add_base_objBufferDescriptorBuilder987 void add_base_obj(flatbuffers::Offset<tflite::gpu::data::GPUObjectDescriptor> base_obj) {
988 fbb_.AddOffset(BufferDescriptor::VT_BASE_OBJ, base_obj);
989 }
add_element_typeBufferDescriptorBuilder990 void add_element_type(tflite::gpu::data::DataType element_type) {
991 fbb_.AddElement<int8_t>(BufferDescriptor::VT_ELEMENT_TYPE, static_cast<int8_t>(element_type), 0);
992 }
add_element_sizeBufferDescriptorBuilder993 void add_element_size(int32_t element_size) {
994 fbb_.AddElement<int32_t>(BufferDescriptor::VT_ELEMENT_SIZE, element_size, 0);
995 }
add_memory_typeBufferDescriptorBuilder996 void add_memory_type(tflite::gpu::data::MemoryType memory_type) {
997 fbb_.AddElement<int8_t>(BufferDescriptor::VT_MEMORY_TYPE, static_cast<int8_t>(memory_type), 0);
998 }
add_attributesBufferDescriptorBuilder999 void add_attributes(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> attributes) {
1000 fbb_.AddOffset(BufferDescriptor::VT_ATTRIBUTES, attributes);
1001 }
add_sizeBufferDescriptorBuilder1002 void add_size(int32_t size) {
1003 fbb_.AddElement<int32_t>(BufferDescriptor::VT_SIZE, size, 0);
1004 }
add_dataBufferDescriptorBuilder1005 void add_data(flatbuffers::Offset<flatbuffers::Vector<uint8_t>> data) {
1006 fbb_.AddOffset(BufferDescriptor::VT_DATA, data);
1007 }
BufferDescriptorBuilderBufferDescriptorBuilder1008 explicit BufferDescriptorBuilder(flatbuffers::FlatBufferBuilder &_fbb)
1009 : fbb_(_fbb) {
1010 start_ = fbb_.StartTable();
1011 }
FinishBufferDescriptorBuilder1012 flatbuffers::Offset<BufferDescriptor> Finish() {
1013 const auto end = fbb_.EndTable(start_);
1014 auto o = flatbuffers::Offset<BufferDescriptor>(end);
1015 return o;
1016 }
1017 };
1018
1019 inline flatbuffers::Offset<BufferDescriptor> CreateBufferDescriptor(
1020 flatbuffers::FlatBufferBuilder &_fbb,
1021 flatbuffers::Offset<tflite::gpu::data::GPUObjectDescriptor> base_obj = 0,
1022 tflite::gpu::data::DataType element_type = tflite::gpu::data::DataType::UNKNOWN,
1023 int32_t element_size = 0,
1024 tflite::gpu::data::MemoryType memory_type = tflite::gpu::data::MemoryType::GLOBAL,
1025 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> attributes = 0,
1026 int32_t size = 0,
1027 flatbuffers::Offset<flatbuffers::Vector<uint8_t>> data = 0) {
1028 BufferDescriptorBuilder builder_(_fbb);
1029 builder_.add_data(data);
1030 builder_.add_size(size);
1031 builder_.add_attributes(attributes);
1032 builder_.add_element_size(element_size);
1033 builder_.add_base_obj(base_obj);
1034 builder_.add_memory_type(memory_type);
1035 builder_.add_element_type(element_type);
1036 return builder_.Finish();
1037 }
1038
1039 inline flatbuffers::Offset<BufferDescriptor> CreateBufferDescriptorDirect(
1040 flatbuffers::FlatBufferBuilder &_fbb,
1041 flatbuffers::Offset<tflite::gpu::data::GPUObjectDescriptor> base_obj = 0,
1042 tflite::gpu::data::DataType element_type = tflite::gpu::data::DataType::UNKNOWN,
1043 int32_t element_size = 0,
1044 tflite::gpu::data::MemoryType memory_type = tflite::gpu::data::MemoryType::GLOBAL,
1045 const std::vector<flatbuffers::Offset<flatbuffers::String>> *attributes = nullptr,
1046 int32_t size = 0,
1047 const std::vector<uint8_t> *data = nullptr) {
1048 auto attributes__ = attributes ? _fbb.CreateVector<flatbuffers::Offset<flatbuffers::String>>(*attributes) : 0;
1049 auto data__ = data ? _fbb.CreateVector<uint8_t>(*data) : 0;
1050 return tflite::gpu::data::CreateBufferDescriptor(
1051 _fbb,
1052 base_obj,
1053 element_type,
1054 element_size,
1055 memory_type,
1056 attributes__,
1057 size,
1058 data__);
1059 }
1060
1061 struct BHWDC FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
1062 typedef BHWDCBuilder Builder;
1063 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
1064 VT_B = 4,
1065 VT_H = 6,
1066 VT_W = 8,
1067 VT_D = 10,
1068 VT_C = 12
1069 };
bFLATBUFFERS_FINAL_CLASS1070 int32_t b() const {
1071 return GetField<int32_t>(VT_B, 0);
1072 }
hFLATBUFFERS_FINAL_CLASS1073 int32_t h() const {
1074 return GetField<int32_t>(VT_H, 0);
1075 }
wFLATBUFFERS_FINAL_CLASS1076 int32_t w() const {
1077 return GetField<int32_t>(VT_W, 0);
1078 }
dFLATBUFFERS_FINAL_CLASS1079 int32_t d() const {
1080 return GetField<int32_t>(VT_D, 0);
1081 }
cFLATBUFFERS_FINAL_CLASS1082 int32_t c() const {
1083 return GetField<int32_t>(VT_C, 0);
1084 }
VerifyFLATBUFFERS_FINAL_CLASS1085 bool Verify(flatbuffers::Verifier &verifier) const {
1086 return VerifyTableStart(verifier) &&
1087 VerifyField<int32_t>(verifier, VT_B, 4) &&
1088 VerifyField<int32_t>(verifier, VT_H, 4) &&
1089 VerifyField<int32_t>(verifier, VT_W, 4) &&
1090 VerifyField<int32_t>(verifier, VT_D, 4) &&
1091 VerifyField<int32_t>(verifier, VT_C, 4) &&
1092 verifier.EndTable();
1093 }
1094 };
1095
1096 struct BHWDCBuilder {
1097 typedef BHWDC Table;
1098 flatbuffers::FlatBufferBuilder &fbb_;
1099 flatbuffers::uoffset_t start_;
add_bBHWDCBuilder1100 void add_b(int32_t b) {
1101 fbb_.AddElement<int32_t>(BHWDC::VT_B, b, 0);
1102 }
add_hBHWDCBuilder1103 void add_h(int32_t h) {
1104 fbb_.AddElement<int32_t>(BHWDC::VT_H, h, 0);
1105 }
add_wBHWDCBuilder1106 void add_w(int32_t w) {
1107 fbb_.AddElement<int32_t>(BHWDC::VT_W, w, 0);
1108 }
add_dBHWDCBuilder1109 void add_d(int32_t d) {
1110 fbb_.AddElement<int32_t>(BHWDC::VT_D, d, 0);
1111 }
add_cBHWDCBuilder1112 void add_c(int32_t c) {
1113 fbb_.AddElement<int32_t>(BHWDC::VT_C, c, 0);
1114 }
BHWDCBuilderBHWDCBuilder1115 explicit BHWDCBuilder(flatbuffers::FlatBufferBuilder &_fbb)
1116 : fbb_(_fbb) {
1117 start_ = fbb_.StartTable();
1118 }
FinishBHWDCBuilder1119 flatbuffers::Offset<BHWDC> Finish() {
1120 const auto end = fbb_.EndTable(start_);
1121 auto o = flatbuffers::Offset<BHWDC>(end);
1122 return o;
1123 }
1124 };
1125
1126 inline flatbuffers::Offset<BHWDC> CreateBHWDC(
1127 flatbuffers::FlatBufferBuilder &_fbb,
1128 int32_t b = 0,
1129 int32_t h = 0,
1130 int32_t w = 0,
1131 int32_t d = 0,
1132 int32_t c = 0) {
1133 BHWDCBuilder builder_(_fbb);
1134 builder_.add_c(c);
1135 builder_.add_d(d);
1136 builder_.add_w(w);
1137 builder_.add_h(h);
1138 builder_.add_b(b);
1139 return builder_.Finish();
1140 }
1141
1142 struct TensorDescriptor FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
1143 typedef TensorDescriptorBuilder Builder;
1144 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
1145 VT_BASE_OBJ = 4,
1146 VT_DATA_TYPE = 6,
1147 VT_STORAGE_TYPE = 8,
1148 VT_LAYOUT = 10,
1149 VT_SHAPE = 12,
1150 VT_DATA = 14,
1151 VT_USE_BUFFER_FOR_WRITE_ONLY_2D_TEXTURE = 16,
1152 VT_USE_BUFFER_FOR_WRITE_ONLY_IMAGE_BUFFER = 18
1153 };
base_objFLATBUFFERS_FINAL_CLASS1154 const tflite::gpu::data::GPUObjectDescriptor *base_obj() const {
1155 return GetPointer<const tflite::gpu::data::GPUObjectDescriptor *>(VT_BASE_OBJ);
1156 }
data_typeFLATBUFFERS_FINAL_CLASS1157 tflite::gpu::data::DataType data_type() const {
1158 return static_cast<tflite::gpu::data::DataType>(GetField<int8_t>(VT_DATA_TYPE, 0));
1159 }
storage_typeFLATBUFFERS_FINAL_CLASS1160 tflite::gpu::data::TensorStorageType storage_type() const {
1161 return static_cast<tflite::gpu::data::TensorStorageType>(GetField<int8_t>(VT_STORAGE_TYPE, 0));
1162 }
layoutFLATBUFFERS_FINAL_CLASS1163 tflite::gpu::data::Layout layout() const {
1164 return static_cast<tflite::gpu::data::Layout>(GetField<int8_t>(VT_LAYOUT, 0));
1165 }
shapeFLATBUFFERS_FINAL_CLASS1166 const tflite::gpu::data::BHWDC *shape() const {
1167 return GetPointer<const tflite::gpu::data::BHWDC *>(VT_SHAPE);
1168 }
dataFLATBUFFERS_FINAL_CLASS1169 const flatbuffers::Vector<uint8_t> *data() const {
1170 return GetPointer<const flatbuffers::Vector<uint8_t> *>(VT_DATA);
1171 }
use_buffer_for_write_only_2d_textureFLATBUFFERS_FINAL_CLASS1172 bool use_buffer_for_write_only_2d_texture() const {
1173 return GetField<uint8_t>(VT_USE_BUFFER_FOR_WRITE_ONLY_2D_TEXTURE, 0) != 0;
1174 }
use_buffer_for_write_only_image_bufferFLATBUFFERS_FINAL_CLASS1175 bool use_buffer_for_write_only_image_buffer() const {
1176 return GetField<uint8_t>(VT_USE_BUFFER_FOR_WRITE_ONLY_IMAGE_BUFFER, 0) != 0;
1177 }
VerifyFLATBUFFERS_FINAL_CLASS1178 bool Verify(flatbuffers::Verifier &verifier) const {
1179 return VerifyTableStart(verifier) &&
1180 VerifyOffset(verifier, VT_BASE_OBJ) &&
1181 verifier.VerifyTable(base_obj()) &&
1182 VerifyField<int8_t>(verifier, VT_DATA_TYPE, 1) &&
1183 VerifyField<int8_t>(verifier, VT_STORAGE_TYPE, 1) &&
1184 VerifyField<int8_t>(verifier, VT_LAYOUT, 1) &&
1185 VerifyOffset(verifier, VT_SHAPE) &&
1186 verifier.VerifyTable(shape()) &&
1187 VerifyOffset(verifier, VT_DATA) &&
1188 verifier.VerifyVector(data()) &&
1189 VerifyField<uint8_t>(verifier, VT_USE_BUFFER_FOR_WRITE_ONLY_2D_TEXTURE, 1) &&
1190 VerifyField<uint8_t>(verifier, VT_USE_BUFFER_FOR_WRITE_ONLY_IMAGE_BUFFER, 1) &&
1191 verifier.EndTable();
1192 }
1193 };
1194
1195 struct TensorDescriptorBuilder {
1196 typedef TensorDescriptor Table;
1197 flatbuffers::FlatBufferBuilder &fbb_;
1198 flatbuffers::uoffset_t start_;
add_base_objTensorDescriptorBuilder1199 void add_base_obj(flatbuffers::Offset<tflite::gpu::data::GPUObjectDescriptor> base_obj) {
1200 fbb_.AddOffset(TensorDescriptor::VT_BASE_OBJ, base_obj);
1201 }
add_data_typeTensorDescriptorBuilder1202 void add_data_type(tflite::gpu::data::DataType data_type) {
1203 fbb_.AddElement<int8_t>(TensorDescriptor::VT_DATA_TYPE, static_cast<int8_t>(data_type), 0);
1204 }
add_storage_typeTensorDescriptorBuilder1205 void add_storage_type(tflite::gpu::data::TensorStorageType storage_type) {
1206 fbb_.AddElement<int8_t>(TensorDescriptor::VT_STORAGE_TYPE, static_cast<int8_t>(storage_type), 0);
1207 }
add_layoutTensorDescriptorBuilder1208 void add_layout(tflite::gpu::data::Layout layout) {
1209 fbb_.AddElement<int8_t>(TensorDescriptor::VT_LAYOUT, static_cast<int8_t>(layout), 0);
1210 }
add_shapeTensorDescriptorBuilder1211 void add_shape(flatbuffers::Offset<tflite::gpu::data::BHWDC> shape) {
1212 fbb_.AddOffset(TensorDescriptor::VT_SHAPE, shape);
1213 }
add_dataTensorDescriptorBuilder1214 void add_data(flatbuffers::Offset<flatbuffers::Vector<uint8_t>> data) {
1215 fbb_.AddOffset(TensorDescriptor::VT_DATA, data);
1216 }
add_use_buffer_for_write_only_2d_textureTensorDescriptorBuilder1217 void add_use_buffer_for_write_only_2d_texture(bool use_buffer_for_write_only_2d_texture) {
1218 fbb_.AddElement<uint8_t>(TensorDescriptor::VT_USE_BUFFER_FOR_WRITE_ONLY_2D_TEXTURE, static_cast<uint8_t>(use_buffer_for_write_only_2d_texture), 0);
1219 }
add_use_buffer_for_write_only_image_bufferTensorDescriptorBuilder1220 void add_use_buffer_for_write_only_image_buffer(bool use_buffer_for_write_only_image_buffer) {
1221 fbb_.AddElement<uint8_t>(TensorDescriptor::VT_USE_BUFFER_FOR_WRITE_ONLY_IMAGE_BUFFER, static_cast<uint8_t>(use_buffer_for_write_only_image_buffer), 0);
1222 }
TensorDescriptorBuilderTensorDescriptorBuilder1223 explicit TensorDescriptorBuilder(flatbuffers::FlatBufferBuilder &_fbb)
1224 : fbb_(_fbb) {
1225 start_ = fbb_.StartTable();
1226 }
FinishTensorDescriptorBuilder1227 flatbuffers::Offset<TensorDescriptor> Finish() {
1228 const auto end = fbb_.EndTable(start_);
1229 auto o = flatbuffers::Offset<TensorDescriptor>(end);
1230 return o;
1231 }
1232 };
1233
1234 inline flatbuffers::Offset<TensorDescriptor> CreateTensorDescriptor(
1235 flatbuffers::FlatBufferBuilder &_fbb,
1236 flatbuffers::Offset<tflite::gpu::data::GPUObjectDescriptor> base_obj = 0,
1237 tflite::gpu::data::DataType data_type = tflite::gpu::data::DataType::UNKNOWN,
1238 tflite::gpu::data::TensorStorageType storage_type = tflite::gpu::data::TensorStorageType::UNKNOWN,
1239 tflite::gpu::data::Layout layout = tflite::gpu::data::Layout::UNKNOWN,
1240 flatbuffers::Offset<tflite::gpu::data::BHWDC> shape = 0,
1241 flatbuffers::Offset<flatbuffers::Vector<uint8_t>> data = 0,
1242 bool use_buffer_for_write_only_2d_texture = false,
1243 bool use_buffer_for_write_only_image_buffer = false) {
1244 TensorDescriptorBuilder builder_(_fbb);
1245 builder_.add_data(data);
1246 builder_.add_shape(shape);
1247 builder_.add_base_obj(base_obj);
1248 builder_.add_use_buffer_for_write_only_image_buffer(use_buffer_for_write_only_image_buffer);
1249 builder_.add_use_buffer_for_write_only_2d_texture(use_buffer_for_write_only_2d_texture);
1250 builder_.add_layout(layout);
1251 builder_.add_storage_type(storage_type);
1252 builder_.add_data_type(data_type);
1253 return builder_.Finish();
1254 }
1255
1256 inline flatbuffers::Offset<TensorDescriptor> CreateTensorDescriptorDirect(
1257 flatbuffers::FlatBufferBuilder &_fbb,
1258 flatbuffers::Offset<tflite::gpu::data::GPUObjectDescriptor> base_obj = 0,
1259 tflite::gpu::data::DataType data_type = tflite::gpu::data::DataType::UNKNOWN,
1260 tflite::gpu::data::TensorStorageType storage_type = tflite::gpu::data::TensorStorageType::UNKNOWN,
1261 tflite::gpu::data::Layout layout = tflite::gpu::data::Layout::UNKNOWN,
1262 flatbuffers::Offset<tflite::gpu::data::BHWDC> shape = 0,
1263 const std::vector<uint8_t> *data = nullptr,
1264 bool use_buffer_for_write_only_2d_texture = false,
1265 bool use_buffer_for_write_only_image_buffer = false) {
1266 auto data__ = data ? _fbb.CreateVector<uint8_t>(*data) : 0;
1267 return tflite::gpu::data::CreateTensorDescriptor(
1268 _fbb,
1269 base_obj,
1270 data_type,
1271 storage_type,
1272 layout,
1273 shape,
1274 data__,
1275 use_buffer_for_write_only_2d_texture,
1276 use_buffer_for_write_only_image_buffer);
1277 }
1278
1279 struct BufferDescriptorMapValue FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
1280 typedef BufferDescriptorMapValueBuilder Builder;
1281 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
1282 VT_KEY = 4,
1283 VT_VALUE = 6
1284 };
keyFLATBUFFERS_FINAL_CLASS1285 const flatbuffers::String *key() const {
1286 return GetPointer<const flatbuffers::String *>(VT_KEY);
1287 }
valueFLATBUFFERS_FINAL_CLASS1288 const tflite::gpu::data::BufferDescriptor *value() const {
1289 return GetPointer<const tflite::gpu::data::BufferDescriptor *>(VT_VALUE);
1290 }
VerifyFLATBUFFERS_FINAL_CLASS1291 bool Verify(flatbuffers::Verifier &verifier) const {
1292 return VerifyTableStart(verifier) &&
1293 VerifyOffset(verifier, VT_KEY) &&
1294 verifier.VerifyString(key()) &&
1295 VerifyOffset(verifier, VT_VALUE) &&
1296 verifier.VerifyTable(value()) &&
1297 verifier.EndTable();
1298 }
1299 };
1300
1301 struct BufferDescriptorMapValueBuilder {
1302 typedef BufferDescriptorMapValue Table;
1303 flatbuffers::FlatBufferBuilder &fbb_;
1304 flatbuffers::uoffset_t start_;
add_keyBufferDescriptorMapValueBuilder1305 void add_key(flatbuffers::Offset<flatbuffers::String> key) {
1306 fbb_.AddOffset(BufferDescriptorMapValue::VT_KEY, key);
1307 }
add_valueBufferDescriptorMapValueBuilder1308 void add_value(flatbuffers::Offset<tflite::gpu::data::BufferDescriptor> value) {
1309 fbb_.AddOffset(BufferDescriptorMapValue::VT_VALUE, value);
1310 }
BufferDescriptorMapValueBuilderBufferDescriptorMapValueBuilder1311 explicit BufferDescriptorMapValueBuilder(flatbuffers::FlatBufferBuilder &_fbb)
1312 : fbb_(_fbb) {
1313 start_ = fbb_.StartTable();
1314 }
FinishBufferDescriptorMapValueBuilder1315 flatbuffers::Offset<BufferDescriptorMapValue> Finish() {
1316 const auto end = fbb_.EndTable(start_);
1317 auto o = flatbuffers::Offset<BufferDescriptorMapValue>(end);
1318 return o;
1319 }
1320 };
1321
1322 inline flatbuffers::Offset<BufferDescriptorMapValue> CreateBufferDescriptorMapValue(
1323 flatbuffers::FlatBufferBuilder &_fbb,
1324 flatbuffers::Offset<flatbuffers::String> key = 0,
1325 flatbuffers::Offset<tflite::gpu::data::BufferDescriptor> value = 0) {
1326 BufferDescriptorMapValueBuilder builder_(_fbb);
1327 builder_.add_value(value);
1328 builder_.add_key(key);
1329 return builder_.Finish();
1330 }
1331
1332 inline flatbuffers::Offset<BufferDescriptorMapValue> CreateBufferDescriptorMapValueDirect(
1333 flatbuffers::FlatBufferBuilder &_fbb,
1334 const char *key = nullptr,
1335 flatbuffers::Offset<tflite::gpu::data::BufferDescriptor> value = 0) {
1336 auto key__ = key ? _fbb.CreateString(key) : 0;
1337 return tflite::gpu::data::CreateBufferDescriptorMapValue(
1338 _fbb,
1339 key__,
1340 value);
1341 }
1342
1343 struct TensorDescriptorMapValue FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
1344 typedef TensorDescriptorMapValueBuilder Builder;
1345 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
1346 VT_KEY = 4,
1347 VT_VALUE = 6
1348 };
keyFLATBUFFERS_FINAL_CLASS1349 const flatbuffers::String *key() const {
1350 return GetPointer<const flatbuffers::String *>(VT_KEY);
1351 }
valueFLATBUFFERS_FINAL_CLASS1352 const tflite::gpu::data::TensorDescriptor *value() const {
1353 return GetPointer<const tflite::gpu::data::TensorDescriptor *>(VT_VALUE);
1354 }
VerifyFLATBUFFERS_FINAL_CLASS1355 bool Verify(flatbuffers::Verifier &verifier) const {
1356 return VerifyTableStart(verifier) &&
1357 VerifyOffset(verifier, VT_KEY) &&
1358 verifier.VerifyString(key()) &&
1359 VerifyOffset(verifier, VT_VALUE) &&
1360 verifier.VerifyTable(value()) &&
1361 verifier.EndTable();
1362 }
1363 };
1364
1365 struct TensorDescriptorMapValueBuilder {
1366 typedef TensorDescriptorMapValue Table;
1367 flatbuffers::FlatBufferBuilder &fbb_;
1368 flatbuffers::uoffset_t start_;
add_keyTensorDescriptorMapValueBuilder1369 void add_key(flatbuffers::Offset<flatbuffers::String> key) {
1370 fbb_.AddOffset(TensorDescriptorMapValue::VT_KEY, key);
1371 }
add_valueTensorDescriptorMapValueBuilder1372 void add_value(flatbuffers::Offset<tflite::gpu::data::TensorDescriptor> value) {
1373 fbb_.AddOffset(TensorDescriptorMapValue::VT_VALUE, value);
1374 }
TensorDescriptorMapValueBuilderTensorDescriptorMapValueBuilder1375 explicit TensorDescriptorMapValueBuilder(flatbuffers::FlatBufferBuilder &_fbb)
1376 : fbb_(_fbb) {
1377 start_ = fbb_.StartTable();
1378 }
FinishTensorDescriptorMapValueBuilder1379 flatbuffers::Offset<TensorDescriptorMapValue> Finish() {
1380 const auto end = fbb_.EndTable(start_);
1381 auto o = flatbuffers::Offset<TensorDescriptorMapValue>(end);
1382 return o;
1383 }
1384 };
1385
1386 inline flatbuffers::Offset<TensorDescriptorMapValue> CreateTensorDescriptorMapValue(
1387 flatbuffers::FlatBufferBuilder &_fbb,
1388 flatbuffers::Offset<flatbuffers::String> key = 0,
1389 flatbuffers::Offset<tflite::gpu::data::TensorDescriptor> value = 0) {
1390 TensorDescriptorMapValueBuilder builder_(_fbb);
1391 builder_.add_value(value);
1392 builder_.add_key(key);
1393 return builder_.Finish();
1394 }
1395
1396 inline flatbuffers::Offset<TensorDescriptorMapValue> CreateTensorDescriptorMapValueDirect(
1397 flatbuffers::FlatBufferBuilder &_fbb,
1398 const char *key = nullptr,
1399 flatbuffers::Offset<tflite::gpu::data::TensorDescriptor> value = 0) {
1400 auto key__ = key ? _fbb.CreateString(key) : 0;
1401 return tflite::gpu::data::CreateTensorDescriptorMapValue(
1402 _fbb,
1403 key__,
1404 value);
1405 }
1406
1407 struct Arguments FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
1408 typedef ArgumentsBuilder Builder;
1409 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
1410 VT_INT_VALUES = 4,
1411 VT_FLOAT_VALUES = 6,
1412 VT_HALF_VALUES = 8,
1413 VT_BUFFER_REFS = 10,
1414 VT_TENSOR_REFS = 12,
1415 VT_BUFFER_OBJECTS = 14,
1416 VT_TENSOR_OBJECTS = 16
1417 };
int_valuesFLATBUFFERS_FINAL_CLASS1418 const flatbuffers::Vector<flatbuffers::Offset<tflite::gpu::data::IntValue>> *int_values() const {
1419 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<tflite::gpu::data::IntValue>> *>(VT_INT_VALUES);
1420 }
float_valuesFLATBUFFERS_FINAL_CLASS1421 const flatbuffers::Vector<flatbuffers::Offset<tflite::gpu::data::FloatValue>> *float_values() const {
1422 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<tflite::gpu::data::FloatValue>> *>(VT_FLOAT_VALUES);
1423 }
half_valuesFLATBUFFERS_FINAL_CLASS1424 const flatbuffers::Vector<flatbuffers::Offset<tflite::gpu::data::HalfValue>> *half_values() const {
1425 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<tflite::gpu::data::HalfValue>> *>(VT_HALF_VALUES);
1426 }
buffer_refsFLATBUFFERS_FINAL_CLASS1427 const flatbuffers::Vector<flatbuffers::Offset<tflite::gpu::data::BufferDescriptorMapValue>> *buffer_refs() const {
1428 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<tflite::gpu::data::BufferDescriptorMapValue>> *>(VT_BUFFER_REFS);
1429 }
tensor_refsFLATBUFFERS_FINAL_CLASS1430 const flatbuffers::Vector<flatbuffers::Offset<tflite::gpu::data::TensorDescriptorMapValue>> *tensor_refs() const {
1431 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<tflite::gpu::data::TensorDescriptorMapValue>> *>(VT_TENSOR_REFS);
1432 }
buffer_objectsFLATBUFFERS_FINAL_CLASS1433 const flatbuffers::Vector<flatbuffers::Offset<tflite::gpu::data::BufferDescriptorMapValue>> *buffer_objects() const {
1434 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<tflite::gpu::data::BufferDescriptorMapValue>> *>(VT_BUFFER_OBJECTS);
1435 }
tensor_objectsFLATBUFFERS_FINAL_CLASS1436 const flatbuffers::Vector<flatbuffers::Offset<tflite::gpu::data::TensorDescriptorMapValue>> *tensor_objects() const {
1437 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<tflite::gpu::data::TensorDescriptorMapValue>> *>(VT_TENSOR_OBJECTS);
1438 }
VerifyFLATBUFFERS_FINAL_CLASS1439 bool Verify(flatbuffers::Verifier &verifier) const {
1440 return VerifyTableStart(verifier) &&
1441 VerifyOffset(verifier, VT_INT_VALUES) &&
1442 verifier.VerifyVector(int_values()) &&
1443 verifier.VerifyVectorOfTables(int_values()) &&
1444 VerifyOffset(verifier, VT_FLOAT_VALUES) &&
1445 verifier.VerifyVector(float_values()) &&
1446 verifier.VerifyVectorOfTables(float_values()) &&
1447 VerifyOffset(verifier, VT_HALF_VALUES) &&
1448 verifier.VerifyVector(half_values()) &&
1449 verifier.VerifyVectorOfTables(half_values()) &&
1450 VerifyOffset(verifier, VT_BUFFER_REFS) &&
1451 verifier.VerifyVector(buffer_refs()) &&
1452 verifier.VerifyVectorOfTables(buffer_refs()) &&
1453 VerifyOffset(verifier, VT_TENSOR_REFS) &&
1454 verifier.VerifyVector(tensor_refs()) &&
1455 verifier.VerifyVectorOfTables(tensor_refs()) &&
1456 VerifyOffset(verifier, VT_BUFFER_OBJECTS) &&
1457 verifier.VerifyVector(buffer_objects()) &&
1458 verifier.VerifyVectorOfTables(buffer_objects()) &&
1459 VerifyOffset(verifier, VT_TENSOR_OBJECTS) &&
1460 verifier.VerifyVector(tensor_objects()) &&
1461 verifier.VerifyVectorOfTables(tensor_objects()) &&
1462 verifier.EndTable();
1463 }
1464 };
1465
1466 struct ArgumentsBuilder {
1467 typedef Arguments Table;
1468 flatbuffers::FlatBufferBuilder &fbb_;
1469 flatbuffers::uoffset_t start_;
add_int_valuesArgumentsBuilder1470 void add_int_values(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<tflite::gpu::data::IntValue>>> int_values) {
1471 fbb_.AddOffset(Arguments::VT_INT_VALUES, int_values);
1472 }
add_float_valuesArgumentsBuilder1473 void add_float_values(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<tflite::gpu::data::FloatValue>>> float_values) {
1474 fbb_.AddOffset(Arguments::VT_FLOAT_VALUES, float_values);
1475 }
add_half_valuesArgumentsBuilder1476 void add_half_values(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<tflite::gpu::data::HalfValue>>> half_values) {
1477 fbb_.AddOffset(Arguments::VT_HALF_VALUES, half_values);
1478 }
add_buffer_refsArgumentsBuilder1479 void add_buffer_refs(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<tflite::gpu::data::BufferDescriptorMapValue>>> buffer_refs) {
1480 fbb_.AddOffset(Arguments::VT_BUFFER_REFS, buffer_refs);
1481 }
add_tensor_refsArgumentsBuilder1482 void add_tensor_refs(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<tflite::gpu::data::TensorDescriptorMapValue>>> tensor_refs) {
1483 fbb_.AddOffset(Arguments::VT_TENSOR_REFS, tensor_refs);
1484 }
add_buffer_objectsArgumentsBuilder1485 void add_buffer_objects(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<tflite::gpu::data::BufferDescriptorMapValue>>> buffer_objects) {
1486 fbb_.AddOffset(Arguments::VT_BUFFER_OBJECTS, buffer_objects);
1487 }
add_tensor_objectsArgumentsBuilder1488 void add_tensor_objects(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<tflite::gpu::data::TensorDescriptorMapValue>>> tensor_objects) {
1489 fbb_.AddOffset(Arguments::VT_TENSOR_OBJECTS, tensor_objects);
1490 }
ArgumentsBuilderArgumentsBuilder1491 explicit ArgumentsBuilder(flatbuffers::FlatBufferBuilder &_fbb)
1492 : fbb_(_fbb) {
1493 start_ = fbb_.StartTable();
1494 }
FinishArgumentsBuilder1495 flatbuffers::Offset<Arguments> Finish() {
1496 const auto end = fbb_.EndTable(start_);
1497 auto o = flatbuffers::Offset<Arguments>(end);
1498 return o;
1499 }
1500 };
1501
1502 inline flatbuffers::Offset<Arguments> CreateArguments(
1503 flatbuffers::FlatBufferBuilder &_fbb,
1504 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<tflite::gpu::data::IntValue>>> int_values = 0,
1505 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<tflite::gpu::data::FloatValue>>> float_values = 0,
1506 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<tflite::gpu::data::HalfValue>>> half_values = 0,
1507 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<tflite::gpu::data::BufferDescriptorMapValue>>> buffer_refs = 0,
1508 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<tflite::gpu::data::TensorDescriptorMapValue>>> tensor_refs = 0,
1509 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<tflite::gpu::data::BufferDescriptorMapValue>>> buffer_objects = 0,
1510 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<tflite::gpu::data::TensorDescriptorMapValue>>> tensor_objects = 0) {
1511 ArgumentsBuilder builder_(_fbb);
1512 builder_.add_tensor_objects(tensor_objects);
1513 builder_.add_buffer_objects(buffer_objects);
1514 builder_.add_tensor_refs(tensor_refs);
1515 builder_.add_buffer_refs(buffer_refs);
1516 builder_.add_half_values(half_values);
1517 builder_.add_float_values(float_values);
1518 builder_.add_int_values(int_values);
1519 return builder_.Finish();
1520 }
1521
1522 inline flatbuffers::Offset<Arguments> CreateArgumentsDirect(
1523 flatbuffers::FlatBufferBuilder &_fbb,
1524 const std::vector<flatbuffers::Offset<tflite::gpu::data::IntValue>> *int_values = nullptr,
1525 const std::vector<flatbuffers::Offset<tflite::gpu::data::FloatValue>> *float_values = nullptr,
1526 const std::vector<flatbuffers::Offset<tflite::gpu::data::HalfValue>> *half_values = nullptr,
1527 const std::vector<flatbuffers::Offset<tflite::gpu::data::BufferDescriptorMapValue>> *buffer_refs = nullptr,
1528 const std::vector<flatbuffers::Offset<tflite::gpu::data::TensorDescriptorMapValue>> *tensor_refs = nullptr,
1529 const std::vector<flatbuffers::Offset<tflite::gpu::data::BufferDescriptorMapValue>> *buffer_objects = nullptr,
1530 const std::vector<flatbuffers::Offset<tflite::gpu::data::TensorDescriptorMapValue>> *tensor_objects = nullptr) {
1531 auto int_values__ = int_values ? _fbb.CreateVector<flatbuffers::Offset<tflite::gpu::data::IntValue>>(*int_values) : 0;
1532 auto float_values__ = float_values ? _fbb.CreateVector<flatbuffers::Offset<tflite::gpu::data::FloatValue>>(*float_values) : 0;
1533 auto half_values__ = half_values ? _fbb.CreateVector<flatbuffers::Offset<tflite::gpu::data::HalfValue>>(*half_values) : 0;
1534 auto buffer_refs__ = buffer_refs ? _fbb.CreateVector<flatbuffers::Offset<tflite::gpu::data::BufferDescriptorMapValue>>(*buffer_refs) : 0;
1535 auto tensor_refs__ = tensor_refs ? _fbb.CreateVector<flatbuffers::Offset<tflite::gpu::data::TensorDescriptorMapValue>>(*tensor_refs) : 0;
1536 auto buffer_objects__ = buffer_objects ? _fbb.CreateVector<flatbuffers::Offset<tflite::gpu::data::BufferDescriptorMapValue>>(*buffer_objects) : 0;
1537 auto tensor_objects__ = tensor_objects ? _fbb.CreateVector<flatbuffers::Offset<tflite::gpu::data::TensorDescriptorMapValue>>(*tensor_objects) : 0;
1538 return tflite::gpu::data::CreateArguments(
1539 _fbb,
1540 int_values__,
1541 float_values__,
1542 half_values__,
1543 buffer_refs__,
1544 tensor_refs__,
1545 buffer_objects__,
1546 tensor_objects__);
1547 }
1548
1549 struct OperationDef FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
1550 typedef OperationDefBuilder Builder;
1551 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
1552 VT_PRECISION = 4,
1553 VT_SRC_TENSORS = 6,
1554 VT_DST_TENSORS = 8
1555 };
precisionFLATBUFFERS_FINAL_CLASS1556 tflite::gpu::data::CalculationsPrecision precision() const {
1557 return static_cast<tflite::gpu::data::CalculationsPrecision>(GetField<int8_t>(VT_PRECISION, 0));
1558 }
src_tensorsFLATBUFFERS_FINAL_CLASS1559 const flatbuffers::Vector<flatbuffers::Offset<tflite::gpu::data::TensorDescriptor>> *src_tensors() const {
1560 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<tflite::gpu::data::TensorDescriptor>> *>(VT_SRC_TENSORS);
1561 }
dst_tensorsFLATBUFFERS_FINAL_CLASS1562 const flatbuffers::Vector<flatbuffers::Offset<tflite::gpu::data::TensorDescriptor>> *dst_tensors() const {
1563 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<tflite::gpu::data::TensorDescriptor>> *>(VT_DST_TENSORS);
1564 }
VerifyFLATBUFFERS_FINAL_CLASS1565 bool Verify(flatbuffers::Verifier &verifier) const {
1566 return VerifyTableStart(verifier) &&
1567 VerifyField<int8_t>(verifier, VT_PRECISION, 1) &&
1568 VerifyOffset(verifier, VT_SRC_TENSORS) &&
1569 verifier.VerifyVector(src_tensors()) &&
1570 verifier.VerifyVectorOfTables(src_tensors()) &&
1571 VerifyOffset(verifier, VT_DST_TENSORS) &&
1572 verifier.VerifyVector(dst_tensors()) &&
1573 verifier.VerifyVectorOfTables(dst_tensors()) &&
1574 verifier.EndTable();
1575 }
1576 };
1577
1578 struct OperationDefBuilder {
1579 typedef OperationDef Table;
1580 flatbuffers::FlatBufferBuilder &fbb_;
1581 flatbuffers::uoffset_t start_;
add_precisionOperationDefBuilder1582 void add_precision(tflite::gpu::data::CalculationsPrecision precision) {
1583 fbb_.AddElement<int8_t>(OperationDef::VT_PRECISION, static_cast<int8_t>(precision), 0);
1584 }
add_src_tensorsOperationDefBuilder1585 void add_src_tensors(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<tflite::gpu::data::TensorDescriptor>>> src_tensors) {
1586 fbb_.AddOffset(OperationDef::VT_SRC_TENSORS, src_tensors);
1587 }
add_dst_tensorsOperationDefBuilder1588 void add_dst_tensors(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<tflite::gpu::data::TensorDescriptor>>> dst_tensors) {
1589 fbb_.AddOffset(OperationDef::VT_DST_TENSORS, dst_tensors);
1590 }
OperationDefBuilderOperationDefBuilder1591 explicit OperationDefBuilder(flatbuffers::FlatBufferBuilder &_fbb)
1592 : fbb_(_fbb) {
1593 start_ = fbb_.StartTable();
1594 }
FinishOperationDefBuilder1595 flatbuffers::Offset<OperationDef> Finish() {
1596 const auto end = fbb_.EndTable(start_);
1597 auto o = flatbuffers::Offset<OperationDef>(end);
1598 return o;
1599 }
1600 };
1601
1602 inline flatbuffers::Offset<OperationDef> CreateOperationDef(
1603 flatbuffers::FlatBufferBuilder &_fbb,
1604 tflite::gpu::data::CalculationsPrecision precision = tflite::gpu::data::CalculationsPrecision::F32,
1605 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<tflite::gpu::data::TensorDescriptor>>> src_tensors = 0,
1606 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<tflite::gpu::data::TensorDescriptor>>> dst_tensors = 0) {
1607 OperationDefBuilder builder_(_fbb);
1608 builder_.add_dst_tensors(dst_tensors);
1609 builder_.add_src_tensors(src_tensors);
1610 builder_.add_precision(precision);
1611 return builder_.Finish();
1612 }
1613
1614 inline flatbuffers::Offset<OperationDef> CreateOperationDefDirect(
1615 flatbuffers::FlatBufferBuilder &_fbb,
1616 tflite::gpu::data::CalculationsPrecision precision = tflite::gpu::data::CalculationsPrecision::F32,
1617 const std::vector<flatbuffers::Offset<tflite::gpu::data::TensorDescriptor>> *src_tensors = nullptr,
1618 const std::vector<flatbuffers::Offset<tflite::gpu::data::TensorDescriptor>> *dst_tensors = nullptr) {
1619 auto src_tensors__ = src_tensors ? _fbb.CreateVector<flatbuffers::Offset<tflite::gpu::data::TensorDescriptor>>(*src_tensors) : 0;
1620 auto dst_tensors__ = dst_tensors ? _fbb.CreateVector<flatbuffers::Offset<tflite::gpu::data::TensorDescriptor>>(*dst_tensors) : 0;
1621 return tflite::gpu::data::CreateOperationDef(
1622 _fbb,
1623 precision,
1624 src_tensors__,
1625 dst_tensors__);
1626 }
1627
1628 struct CompilerOption FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
1629 typedef CompilerOptionBuilder Builder;
1630 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
1631 VT_OPTION = 4
1632 };
optionFLATBUFFERS_FINAL_CLASS1633 tflite::gpu::data::CompilerOptions option() const {
1634 return static_cast<tflite::gpu::data::CompilerOptions>(GetField<int8_t>(VT_OPTION, 0));
1635 }
VerifyFLATBUFFERS_FINAL_CLASS1636 bool Verify(flatbuffers::Verifier &verifier) const {
1637 return VerifyTableStart(verifier) &&
1638 VerifyField<int8_t>(verifier, VT_OPTION, 1) &&
1639 verifier.EndTable();
1640 }
1641 };
1642
1643 struct CompilerOptionBuilder {
1644 typedef CompilerOption Table;
1645 flatbuffers::FlatBufferBuilder &fbb_;
1646 flatbuffers::uoffset_t start_;
add_optionCompilerOptionBuilder1647 void add_option(tflite::gpu::data::CompilerOptions option) {
1648 fbb_.AddElement<int8_t>(CompilerOption::VT_OPTION, static_cast<int8_t>(option), 0);
1649 }
CompilerOptionBuilderCompilerOptionBuilder1650 explicit CompilerOptionBuilder(flatbuffers::FlatBufferBuilder &_fbb)
1651 : fbb_(_fbb) {
1652 start_ = fbb_.StartTable();
1653 }
FinishCompilerOptionBuilder1654 flatbuffers::Offset<CompilerOption> Finish() {
1655 const auto end = fbb_.EndTable(start_);
1656 auto o = flatbuffers::Offset<CompilerOption>(end);
1657 return o;
1658 }
1659 };
1660
1661 inline flatbuffers::Offset<CompilerOption> CreateCompilerOption(
1662 flatbuffers::FlatBufferBuilder &_fbb,
1663 tflite::gpu::data::CompilerOptions option = tflite::gpu::data::CompilerOptions::ADRENO_FULL_SIMD_LINE) {
1664 CompilerOptionBuilder builder_(_fbb);
1665 builder_.add_option(option);
1666 return builder_.Finish();
1667 }
1668
1669 struct GPUOperation FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
1670 typedef GPUOperationBuilder Builder;
1671 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
1672 VT_ARGUMENTS = 4,
1673 VT_CODE = 6,
1674 VT_WORK_GROUP_SIZE = 8,
1675 VT_COMPILER_OPTIONS = 10,
1676 VT_TENSOR_TO_GRID = 12,
1677 VT_FLOPS = 14,
1678 VT_DEFINITION = 16,
1679 VT_GRID_DIMENSION = 18,
1680 VT_WORK_GROUP_LAUNCH_ORDER = 20,
1681 VT_GRID_SIZE = 22,
1682 VT_SRC_TENSORS_NAMES = 24,
1683 VT_DST_TENSORS_NAMES = 26,
1684 VT_WORK_GROUPS_COUNT = 28
1685 };
argumentsFLATBUFFERS_FINAL_CLASS1686 const tflite::gpu::data::Arguments *arguments() const {
1687 return GetPointer<const tflite::gpu::data::Arguments *>(VT_ARGUMENTS);
1688 }
codeFLATBUFFERS_FINAL_CLASS1689 const flatbuffers::String *code() const {
1690 return GetPointer<const flatbuffers::String *>(VT_CODE);
1691 }
work_group_sizeFLATBUFFERS_FINAL_CLASS1692 const tflite::gpu::data::Int3 *work_group_size() const {
1693 return GetPointer<const tflite::gpu::data::Int3 *>(VT_WORK_GROUP_SIZE);
1694 }
compiler_optionsFLATBUFFERS_FINAL_CLASS1695 const flatbuffers::Vector<flatbuffers::Offset<tflite::gpu::data::CompilerOption>> *compiler_options() const {
1696 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<tflite::gpu::data::CompilerOption>> *>(VT_COMPILER_OPTIONS);
1697 }
tensor_to_gridFLATBUFFERS_FINAL_CLASS1698 tflite::gpu::data::TensorToGrid tensor_to_grid() const {
1699 return static_cast<tflite::gpu::data::TensorToGrid>(GetField<int8_t>(VT_TENSOR_TO_GRID, 0));
1700 }
flopsFLATBUFFERS_FINAL_CLASS1701 uint64_t flops() const {
1702 return GetField<uint64_t>(VT_FLOPS, 0);
1703 }
definitionFLATBUFFERS_FINAL_CLASS1704 const tflite::gpu::data::OperationDef *definition() const {
1705 return GetPointer<const tflite::gpu::data::OperationDef *>(VT_DEFINITION);
1706 }
grid_dimensionFLATBUFFERS_FINAL_CLASS1707 int32_t grid_dimension() const {
1708 return GetField<int32_t>(VT_GRID_DIMENSION, 0);
1709 }
work_group_launch_orderFLATBUFFERS_FINAL_CLASS1710 const tflite::gpu::data::Int3 *work_group_launch_order() const {
1711 return GetPointer<const tflite::gpu::data::Int3 *>(VT_WORK_GROUP_LAUNCH_ORDER);
1712 }
grid_sizeFLATBUFFERS_FINAL_CLASS1713 const tflite::gpu::data::Int3 *grid_size() const {
1714 return GetPointer<const tflite::gpu::data::Int3 *>(VT_GRID_SIZE);
1715 }
src_tensors_namesFLATBUFFERS_FINAL_CLASS1716 const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *src_tensors_names() const {
1717 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *>(VT_SRC_TENSORS_NAMES);
1718 }
dst_tensors_namesFLATBUFFERS_FINAL_CLASS1719 const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *dst_tensors_names() const {
1720 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *>(VT_DST_TENSORS_NAMES);
1721 }
work_groups_countFLATBUFFERS_FINAL_CLASS1722 const tflite::gpu::data::Int3 *work_groups_count() const {
1723 return GetPointer<const tflite::gpu::data::Int3 *>(VT_WORK_GROUPS_COUNT);
1724 }
VerifyFLATBUFFERS_FINAL_CLASS1725 bool Verify(flatbuffers::Verifier &verifier) const {
1726 return VerifyTableStart(verifier) &&
1727 VerifyOffset(verifier, VT_ARGUMENTS) &&
1728 verifier.VerifyTable(arguments()) &&
1729 VerifyOffset(verifier, VT_CODE) &&
1730 verifier.VerifyString(code()) &&
1731 VerifyOffset(verifier, VT_WORK_GROUP_SIZE) &&
1732 verifier.VerifyTable(work_group_size()) &&
1733 VerifyOffset(verifier, VT_COMPILER_OPTIONS) &&
1734 verifier.VerifyVector(compiler_options()) &&
1735 verifier.VerifyVectorOfTables(compiler_options()) &&
1736 VerifyField<int8_t>(verifier, VT_TENSOR_TO_GRID, 1) &&
1737 VerifyField<uint64_t>(verifier, VT_FLOPS, 8) &&
1738 VerifyOffset(verifier, VT_DEFINITION) &&
1739 verifier.VerifyTable(definition()) &&
1740 VerifyField<int32_t>(verifier, VT_GRID_DIMENSION, 4) &&
1741 VerifyOffset(verifier, VT_WORK_GROUP_LAUNCH_ORDER) &&
1742 verifier.VerifyTable(work_group_launch_order()) &&
1743 VerifyOffset(verifier, VT_GRID_SIZE) &&
1744 verifier.VerifyTable(grid_size()) &&
1745 VerifyOffset(verifier, VT_SRC_TENSORS_NAMES) &&
1746 verifier.VerifyVector(src_tensors_names()) &&
1747 verifier.VerifyVectorOfStrings(src_tensors_names()) &&
1748 VerifyOffset(verifier, VT_DST_TENSORS_NAMES) &&
1749 verifier.VerifyVector(dst_tensors_names()) &&
1750 verifier.VerifyVectorOfStrings(dst_tensors_names()) &&
1751 VerifyOffset(verifier, VT_WORK_GROUPS_COUNT) &&
1752 verifier.VerifyTable(work_groups_count()) &&
1753 verifier.EndTable();
1754 }
1755 };
1756
1757 struct GPUOperationBuilder {
1758 typedef GPUOperation Table;
1759 flatbuffers::FlatBufferBuilder &fbb_;
1760 flatbuffers::uoffset_t start_;
add_argumentsGPUOperationBuilder1761 void add_arguments(flatbuffers::Offset<tflite::gpu::data::Arguments> arguments) {
1762 fbb_.AddOffset(GPUOperation::VT_ARGUMENTS, arguments);
1763 }
add_codeGPUOperationBuilder1764 void add_code(flatbuffers::Offset<flatbuffers::String> code) {
1765 fbb_.AddOffset(GPUOperation::VT_CODE, code);
1766 }
add_work_group_sizeGPUOperationBuilder1767 void add_work_group_size(flatbuffers::Offset<tflite::gpu::data::Int3> work_group_size) {
1768 fbb_.AddOffset(GPUOperation::VT_WORK_GROUP_SIZE, work_group_size);
1769 }
add_compiler_optionsGPUOperationBuilder1770 void add_compiler_options(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<tflite::gpu::data::CompilerOption>>> compiler_options) {
1771 fbb_.AddOffset(GPUOperation::VT_COMPILER_OPTIONS, compiler_options);
1772 }
add_tensor_to_gridGPUOperationBuilder1773 void add_tensor_to_grid(tflite::gpu::data::TensorToGrid tensor_to_grid) {
1774 fbb_.AddElement<int8_t>(GPUOperation::VT_TENSOR_TO_GRID, static_cast<int8_t>(tensor_to_grid), 0);
1775 }
add_flopsGPUOperationBuilder1776 void add_flops(uint64_t flops) {
1777 fbb_.AddElement<uint64_t>(GPUOperation::VT_FLOPS, flops, 0);
1778 }
add_definitionGPUOperationBuilder1779 void add_definition(flatbuffers::Offset<tflite::gpu::data::OperationDef> definition) {
1780 fbb_.AddOffset(GPUOperation::VT_DEFINITION, definition);
1781 }
add_grid_dimensionGPUOperationBuilder1782 void add_grid_dimension(int32_t grid_dimension) {
1783 fbb_.AddElement<int32_t>(GPUOperation::VT_GRID_DIMENSION, grid_dimension, 0);
1784 }
add_work_group_launch_orderGPUOperationBuilder1785 void add_work_group_launch_order(flatbuffers::Offset<tflite::gpu::data::Int3> work_group_launch_order) {
1786 fbb_.AddOffset(GPUOperation::VT_WORK_GROUP_LAUNCH_ORDER, work_group_launch_order);
1787 }
add_grid_sizeGPUOperationBuilder1788 void add_grid_size(flatbuffers::Offset<tflite::gpu::data::Int3> grid_size) {
1789 fbb_.AddOffset(GPUOperation::VT_GRID_SIZE, grid_size);
1790 }
add_src_tensors_namesGPUOperationBuilder1791 void add_src_tensors_names(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> src_tensors_names) {
1792 fbb_.AddOffset(GPUOperation::VT_SRC_TENSORS_NAMES, src_tensors_names);
1793 }
add_dst_tensors_namesGPUOperationBuilder1794 void add_dst_tensors_names(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> dst_tensors_names) {
1795 fbb_.AddOffset(GPUOperation::VT_DST_TENSORS_NAMES, dst_tensors_names);
1796 }
add_work_groups_countGPUOperationBuilder1797 void add_work_groups_count(flatbuffers::Offset<tflite::gpu::data::Int3> work_groups_count) {
1798 fbb_.AddOffset(GPUOperation::VT_WORK_GROUPS_COUNT, work_groups_count);
1799 }
GPUOperationBuilderGPUOperationBuilder1800 explicit GPUOperationBuilder(flatbuffers::FlatBufferBuilder &_fbb)
1801 : fbb_(_fbb) {
1802 start_ = fbb_.StartTable();
1803 }
FinishGPUOperationBuilder1804 flatbuffers::Offset<GPUOperation> Finish() {
1805 const auto end = fbb_.EndTable(start_);
1806 auto o = flatbuffers::Offset<GPUOperation>(end);
1807 return o;
1808 }
1809 };
1810
1811 inline flatbuffers::Offset<GPUOperation> CreateGPUOperation(
1812 flatbuffers::FlatBufferBuilder &_fbb,
1813 flatbuffers::Offset<tflite::gpu::data::Arguments> arguments = 0,
1814 flatbuffers::Offset<flatbuffers::String> code = 0,
1815 flatbuffers::Offset<tflite::gpu::data::Int3> work_group_size = 0,
1816 flatbuffers::Offset<flatbuffers::Vector<
1817 flatbuffers::Offset<tflite::gpu::data::CompilerOption>>>
1818 compiler_options = 0,
1819 tflite::gpu::data::TensorToGrid tensor_to_grid =
1820 tflite::gpu::data::TensorToGrid::CUSTOM,
1821 uint64_t flops = 0,
1822 flatbuffers::Offset<tflite::gpu::data::OperationDef> definition = 0,
1823 int32_t grid_dimension = 0,
1824 flatbuffers::Offset<tflite::gpu::data::Int3> work_group_launch_order = 0,
1825 flatbuffers::Offset<tflite::gpu::data::Int3> grid_size = 0,
1826 flatbuffers::Offset<
1827 flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>>
1828 src_tensors_names = 0,
1829 flatbuffers::Offset<
1830 flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>>
1831 dst_tensors_names = 0,
1832 flatbuffers::Offset<tflite::gpu::data::Int3> work_groups_count = 0) {
1833 GPUOperationBuilder builder_(_fbb);
1834 builder_.add_flops(flops);
1835 builder_.add_work_groups_count(work_groups_count);
1836 builder_.add_dst_tensors_names(dst_tensors_names);
1837 builder_.add_src_tensors_names(src_tensors_names);
1838 builder_.add_grid_size(grid_size);
1839 builder_.add_work_group_launch_order(work_group_launch_order);
1840 builder_.add_grid_dimension(grid_dimension);
1841 builder_.add_definition(definition);
1842 builder_.add_compiler_options(compiler_options);
1843 builder_.add_work_group_size(work_group_size);
1844 builder_.add_code(code);
1845 builder_.add_arguments(arguments);
1846 builder_.add_tensor_to_grid(tensor_to_grid);
1847 return builder_.Finish();
1848 }
1849
1850 inline flatbuffers::Offset<GPUOperation> CreateGPUOperationDirect(
1851 flatbuffers::FlatBufferBuilder &_fbb,
1852 flatbuffers::Offset<tflite::gpu::data::Arguments> arguments = 0,
1853 const char *code = nullptr,
1854 flatbuffers::Offset<tflite::gpu::data::Int3> work_group_size = 0,
1855 const std::vector<flatbuffers::Offset<tflite::gpu::data::CompilerOption>>
1856 *compiler_options = nullptr,
1857 tflite::gpu::data::TensorToGrid tensor_to_grid =
1858 tflite::gpu::data::TensorToGrid::CUSTOM,
1859 uint64_t flops = 0,
1860 flatbuffers::Offset<tflite::gpu::data::OperationDef> definition = 0,
1861 int32_t grid_dimension = 0,
1862 flatbuffers::Offset<tflite::gpu::data::Int3> work_group_launch_order = 0,
1863 flatbuffers::Offset<tflite::gpu::data::Int3> grid_size = 0,
1864 const std::vector<flatbuffers::Offset<flatbuffers::String>>
1865 *src_tensors_names = nullptr,
1866 const std::vector<flatbuffers::Offset<flatbuffers::String>>
1867 *dst_tensors_names = nullptr,
1868 flatbuffers::Offset<tflite::gpu::data::Int3> work_groups_count = 0) {
1869 auto code__ = code ? _fbb.CreateString(code) : 0;
1870 auto compiler_options__ = compiler_options ? _fbb.CreateVector<flatbuffers::Offset<tflite::gpu::data::CompilerOption>>(*compiler_options) : 0;
1871 auto src_tensors_names__ = src_tensors_names ? _fbb.CreateVector<flatbuffers::Offset<flatbuffers::String>>(*src_tensors_names) : 0;
1872 auto dst_tensors_names__ = dst_tensors_names ? _fbb.CreateVector<flatbuffers::Offset<flatbuffers::String>>(*dst_tensors_names) : 0;
1873 return tflite::gpu::data::CreateGPUOperation(
1874 _fbb, arguments, code__, work_group_size, compiler_options__,
1875 tensor_to_grid, flops, definition, grid_dimension,
1876 work_group_launch_order, grid_size, src_tensors_names__,
1877 dst_tensors_names__, work_groups_count);
1878 }
1879
1880 } // namespace data
1881 } // namespace gpu
1882 } // namespace tflite
1883
1884 #endif // FLATBUFFERS_GENERATED_SERIALIZATIONBASE_TFLITE_GPU_DATA_H_
1885