Matthew Sloyan | 80fbcd5 | 2021-01-07 13:28:47 +0000 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2020 Arm Ltd and Contributors. All rights reserved. |
| 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | |
| 6 | // automatically generated by the FlatBuffers compiler, do not modify |
| 7 | |
| 8 | #ifndef FLATBUFFERS_GENERATED_CLCONTEXTSCHEMA_ARMNN_H_ |
| 9 | #define FLATBUFFERS_GENERATED_CLCONTEXTSCHEMA_ARMNN_H_ |
| 10 | |
| 11 | #include "flatbuffers/flatbuffers.h" |
| 12 | |
| 13 | namespace armnn { |
| 14 | |
| 15 | struct ClContext; |
| 16 | struct ClContextBuilder; |
| 17 | |
| 18 | struct Program; |
| 19 | struct ProgramBuilder; |
| 20 | |
| 21 | struct ClContext FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 22 | typedef ClContextBuilder Builder; |
| 23 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 24 | VT_PROGRAMS = 4 |
| 25 | }; |
| 26 | const flatbuffers::Vector<flatbuffers::Offset<armnn::Program>> *programs() const { |
| 27 | return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<armnn::Program>> *>(VT_PROGRAMS); |
| 28 | } |
| 29 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 30 | return VerifyTableStart(verifier) && |
| 31 | VerifyOffset(verifier, VT_PROGRAMS) && |
| 32 | verifier.VerifyVector(programs()) && |
| 33 | verifier.VerifyVectorOfTables(programs()) && |
| 34 | verifier.EndTable(); |
| 35 | } |
| 36 | }; |
| 37 | |
| 38 | struct ClContextBuilder { |
| 39 | typedef ClContext Table; |
| 40 | flatbuffers::FlatBufferBuilder &fbb_; |
| 41 | flatbuffers::uoffset_t start_; |
| 42 | void add_programs(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<armnn::Program>>> programs) { |
| 43 | fbb_.AddOffset(ClContext::VT_PROGRAMS, programs); |
| 44 | } |
| 45 | explicit ClContextBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 46 | : fbb_(_fbb) { |
| 47 | start_ = fbb_.StartTable(); |
| 48 | } |
| 49 | ClContextBuilder &operator=(const ClContextBuilder &); |
| 50 | flatbuffers::Offset<ClContext> Finish() { |
| 51 | const auto end = fbb_.EndTable(start_); |
| 52 | auto o = flatbuffers::Offset<ClContext>(end); |
| 53 | return o; |
| 54 | } |
| 55 | }; |
| 56 | |
| 57 | inline flatbuffers::Offset<ClContext> CreateClContext( |
| 58 | flatbuffers::FlatBufferBuilder &_fbb, |
| 59 | flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<armnn::Program>>> programs = 0) { |
| 60 | ClContextBuilder builder_(_fbb); |
| 61 | builder_.add_programs(programs); |
| 62 | return builder_.Finish(); |
| 63 | } |
| 64 | |
| 65 | inline flatbuffers::Offset<ClContext> CreateClContextDirect( |
| 66 | flatbuffers::FlatBufferBuilder &_fbb, |
| 67 | const std::vector<flatbuffers::Offset<armnn::Program>> *programs = nullptr) { |
| 68 | auto programs__ = programs ? _fbb.CreateVector<flatbuffers::Offset<armnn::Program>>(*programs) : 0; |
| 69 | return armnn::CreateClContext( |
| 70 | _fbb, |
| 71 | programs__); |
| 72 | } |
| 73 | |
| 74 | struct Program FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
| 75 | typedef ProgramBuilder Builder; |
| 76 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 77 | VT_NAME = 4, |
| 78 | VT_BINARY = 6 |
| 79 | }; |
| 80 | const flatbuffers::String *name() const { |
| 81 | return GetPointer<const flatbuffers::String *>(VT_NAME); |
| 82 | } |
| 83 | const flatbuffers::Vector<uint8_t> *binary() const { |
| 84 | return GetPointer<const flatbuffers::Vector<uint8_t> *>(VT_BINARY); |
| 85 | } |
| 86 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 87 | return VerifyTableStart(verifier) && |
| 88 | VerifyOffset(verifier, VT_NAME) && |
| 89 | verifier.VerifyString(name()) && |
| 90 | VerifyOffset(verifier, VT_BINARY) && |
| 91 | verifier.VerifyVector(binary()) && |
| 92 | verifier.EndTable(); |
| 93 | } |
| 94 | }; |
| 95 | |
| 96 | struct ProgramBuilder { |
| 97 | typedef Program Table; |
| 98 | flatbuffers::FlatBufferBuilder &fbb_; |
| 99 | flatbuffers::uoffset_t start_; |
| 100 | void add_name(flatbuffers::Offset<flatbuffers::String> name) { |
| 101 | fbb_.AddOffset(Program::VT_NAME, name); |
| 102 | } |
| 103 | void add_binary(flatbuffers::Offset<flatbuffers::Vector<uint8_t>> binary) { |
| 104 | fbb_.AddOffset(Program::VT_BINARY, binary); |
| 105 | } |
| 106 | explicit ProgramBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 107 | : fbb_(_fbb) { |
| 108 | start_ = fbb_.StartTable(); |
| 109 | } |
| 110 | ProgramBuilder &operator=(const ProgramBuilder &); |
| 111 | flatbuffers::Offset<Program> Finish() { |
| 112 | const auto end = fbb_.EndTable(start_); |
| 113 | auto o = flatbuffers::Offset<Program>(end); |
| 114 | return o; |
| 115 | } |
| 116 | }; |
| 117 | |
| 118 | inline flatbuffers::Offset<Program> CreateProgram( |
| 119 | flatbuffers::FlatBufferBuilder &_fbb, |
| 120 | flatbuffers::Offset<flatbuffers::String> name = 0, |
| 121 | flatbuffers::Offset<flatbuffers::Vector<uint8_t>> binary = 0) { |
| 122 | ProgramBuilder builder_(_fbb); |
| 123 | builder_.add_binary(binary); |
| 124 | builder_.add_name(name); |
| 125 | return builder_.Finish(); |
| 126 | } |
| 127 | |
| 128 | inline flatbuffers::Offset<Program> CreateProgramDirect( |
| 129 | flatbuffers::FlatBufferBuilder &_fbb, |
| 130 | const char *name = nullptr, |
| 131 | const std::vector<uint8_t> *binary = nullptr) { |
| 132 | auto name__ = name ? _fbb.CreateString(name) : 0; |
| 133 | auto binary__ = binary ? _fbb.CreateVector<uint8_t>(*binary) : 0; |
| 134 | return armnn::CreateProgram( |
| 135 | _fbb, |
| 136 | name__, |
| 137 | binary__); |
| 138 | } |
| 139 | |
| 140 | inline const armnn::ClContext *GetClContext(const void *buf) { |
| 141 | return flatbuffers::GetRoot<armnn::ClContext>(buf); |
| 142 | } |
| 143 | |
| 144 | inline const armnn::ClContext *GetSizePrefixedClContext(const void *buf) { |
| 145 | return flatbuffers::GetSizePrefixedRoot<armnn::ClContext>(buf); |
| 146 | } |
| 147 | |
| 148 | inline const char *ClContextIdentifier() { |
| 149 | return "ARMN"; |
| 150 | } |
| 151 | |
| 152 | inline bool ClContextBufferHasIdentifier(const void *buf) { |
| 153 | return flatbuffers::BufferHasIdentifier( |
| 154 | buf, ClContextIdentifier()); |
| 155 | } |
| 156 | |
| 157 | inline bool VerifyClContextBuffer( |
| 158 | flatbuffers::Verifier &verifier) { |
| 159 | return verifier.VerifyBuffer<armnn::ClContext>(ClContextIdentifier()); |
| 160 | } |
| 161 | |
| 162 | inline bool VerifySizePrefixedClContextBuffer( |
| 163 | flatbuffers::Verifier &verifier) { |
| 164 | return verifier.VerifySizePrefixedBuffer<armnn::ClContext>(ClContextIdentifier()); |
| 165 | } |
| 166 | |
| 167 | inline const char *ClContextExtension() { |
| 168 | return "armnn"; |
| 169 | } |
| 170 | |
| 171 | inline void FinishClContextBuffer( |
| 172 | flatbuffers::FlatBufferBuilder &fbb, |
| 173 | flatbuffers::Offset<armnn::ClContext> root) { |
| 174 | fbb.Finish(root, ClContextIdentifier()); |
| 175 | } |
| 176 | |
| 177 | inline void FinishSizePrefixedClContextBuffer( |
| 178 | flatbuffers::FlatBufferBuilder &fbb, |
| 179 | flatbuffers::Offset<armnn::ClContext> root) { |
| 180 | fbb.FinishSizePrefixed(root, ClContextIdentifier()); |
| 181 | } |
| 182 | |
| 183 | } // namespace armnn |
| 184 | |
| 185 | #endif // FLATBUFFERS_GENERATED_CLCONTEXTSCHEMA_ARMNN_H_ |