1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: tensorflow/core/framework/allocation_description.proto
3
4 #include "tensorflow/core/framework/allocation_description.pb.h"
5
6 #include <algorithm>
7 #include <cstdint>
8
9 #include <google/protobuf/io/coded_stream.h>
10 #include <google/protobuf/extension_set.h>
11 #include <google/protobuf/wire_format_lite.h>
12 #include <google/protobuf/io/zero_copy_stream_impl_lite.h>
13 // @@protoc_insertion_point(includes)
14 #include <google/protobuf/port_def.inc>
15
16 PROTOBUF_PRAGMA_INIT_SEG
17
18 namespace _pb = ::PROTOBUF_NAMESPACE_ID;
19 namespace _pbi = _pb::internal;
20
21 namespace tensorflow {
AllocationDescription(::_pbi::ConstantInitialized)22 PROTOBUF_CONSTEXPR AllocationDescription::AllocationDescription(
23 ::_pbi::ConstantInitialized): _impl_{
24 /*decltype(_impl_.allocator_name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
25 , /*decltype(_impl_.requested_bytes_)*/::int64_t{0}
26 , /*decltype(_impl_.allocated_bytes_)*/::int64_t{0}
27 , /*decltype(_impl_.allocation_id_)*/::int64_t{0}
28 , /*decltype(_impl_.ptr_)*/::uint64_t{0u}
29 , /*decltype(_impl_.has_single_reference_)*/false
30 , /*decltype(_impl_._cached_size_)*/{}} {}
31 struct AllocationDescriptionDefaultTypeInternal {
AllocationDescriptionDefaultTypeInternaltensorflow::AllocationDescriptionDefaultTypeInternal32 PROTOBUF_CONSTEXPR AllocationDescriptionDefaultTypeInternal()
33 : _instance(::_pbi::ConstantInitialized{}) {}
~AllocationDescriptionDefaultTypeInternaltensorflow::AllocationDescriptionDefaultTypeInternal34 ~AllocationDescriptionDefaultTypeInternal() {}
35 union { // NOLINT(misc-non-private-member-variables-in-classes)
36 AllocationDescription _instance;
37 };
38 };
39 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 AllocationDescriptionDefaultTypeInternal _AllocationDescription_default_instance_;
40 } // namespace tensorflow
41 namespace tensorflow {
42
43 // ===================================================================
44
45 class AllocationDescription::_Internal {
46 public:
47 };
48
AllocationDescription(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)49 AllocationDescription::AllocationDescription(::PROTOBUF_NAMESPACE_ID::Arena* arena,
50 bool is_message_owned)
51 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
52 SharedCtor(arena, is_message_owned);
53 // @@protoc_insertion_point(arena_constructor:tensorflow.AllocationDescription)
54 }
AllocationDescription(const AllocationDescription & from)55 AllocationDescription::AllocationDescription(const AllocationDescription& from)
56 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
57 AllocationDescription* const _this = this; (void)_this;
58 new (&_impl_) Impl_{
59 decltype(_impl_.allocator_name_){}
60 , decltype(_impl_.requested_bytes_){}
61 , decltype(_impl_.allocated_bytes_){}
62 , decltype(_impl_.allocation_id_){}
63 , decltype(_impl_.ptr_){}
64 , decltype(_impl_.has_single_reference_){}
65 , /*decltype(_impl_._cached_size_)*/{}};
66
67 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
68 _impl_.allocator_name_.InitDefault();
69 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
70 _impl_.allocator_name_.Set("", GetArenaForAllocation());
71 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
72 if (!from._internal_allocator_name().empty()) {
73 _this->_impl_.allocator_name_.Set(from._internal_allocator_name(),
74 _this->GetArenaForAllocation());
75 }
76 ::memcpy(&_impl_.requested_bytes_, &from._impl_.requested_bytes_,
77 static_cast<size_t>(reinterpret_cast<char*>(&_impl_.has_single_reference_) -
78 reinterpret_cast<char*>(&_impl_.requested_bytes_)) + sizeof(_impl_.has_single_reference_));
79 // @@protoc_insertion_point(copy_constructor:tensorflow.AllocationDescription)
80 }
81
SharedCtor(::_pb::Arena * arena,bool is_message_owned)82 inline void AllocationDescription::SharedCtor(
83 ::_pb::Arena* arena, bool is_message_owned) {
84 (void)arena;
85 (void)is_message_owned;
86 new (&_impl_) Impl_{
87 decltype(_impl_.allocator_name_){}
88 , decltype(_impl_.requested_bytes_){::int64_t{0}}
89 , decltype(_impl_.allocated_bytes_){::int64_t{0}}
90 , decltype(_impl_.allocation_id_){::int64_t{0}}
91 , decltype(_impl_.ptr_){::uint64_t{0u}}
92 , decltype(_impl_.has_single_reference_){false}
93 , /*decltype(_impl_._cached_size_)*/{}
94 };
95 _impl_.allocator_name_.InitDefault();
96 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
97 _impl_.allocator_name_.Set("", GetArenaForAllocation());
98 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
99 }
100
~AllocationDescription()101 AllocationDescription::~AllocationDescription() {
102 // @@protoc_insertion_point(destructor:tensorflow.AllocationDescription)
103 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
104 (void)arena;
105 return;
106 }
107 SharedDtor();
108 }
109
SharedDtor()110 inline void AllocationDescription::SharedDtor() {
111 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
112 _impl_.allocator_name_.Destroy();
113 }
114
SetCachedSize(int size) const115 void AllocationDescription::SetCachedSize(int size) const {
116 _impl_._cached_size_.Set(size);
117 }
118
Clear()119 void AllocationDescription::Clear() {
120 // @@protoc_insertion_point(message_clear_start:tensorflow.AllocationDescription)
121 ::uint32_t cached_has_bits = 0;
122 // Prevent compiler warnings about cached_has_bits being unused
123 (void) cached_has_bits;
124
125 _impl_.allocator_name_.ClearToEmpty();
126 ::memset(&_impl_.requested_bytes_, 0, static_cast<size_t>(
127 reinterpret_cast<char*>(&_impl_.has_single_reference_) -
128 reinterpret_cast<char*>(&_impl_.requested_bytes_)) + sizeof(_impl_.has_single_reference_));
129 _internal_metadata_.Clear<std::string>();
130 }
131
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)132 const char* AllocationDescription::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
133 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
134 while (!ctx->Done(&ptr)) {
135 ::uint32_t tag;
136 ptr = ::_pbi::ReadTag(ptr, &tag);
137 switch (tag >> 3) {
138 // int64 requested_bytes = 1;
139 case 1:
140 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
141 _impl_.requested_bytes_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
142 CHK_(ptr);
143 } else {
144 goto handle_unusual;
145 }
146 continue;
147 // int64 allocated_bytes = 2;
148 case 2:
149 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 16)) {
150 _impl_.allocated_bytes_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
151 CHK_(ptr);
152 } else {
153 goto handle_unusual;
154 }
155 continue;
156 // string allocator_name = 3;
157 case 3:
158 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 26)) {
159 auto str = _internal_mutable_allocator_name();
160 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
161 CHK_(ptr);
162 CHK_(::_pbi::VerifyUTF8(str, nullptr));
163 } else {
164 goto handle_unusual;
165 }
166 continue;
167 // int64 allocation_id = 4;
168 case 4:
169 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 32)) {
170 _impl_.allocation_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
171 CHK_(ptr);
172 } else {
173 goto handle_unusual;
174 }
175 continue;
176 // bool has_single_reference = 5;
177 case 5:
178 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 40)) {
179 _impl_.has_single_reference_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
180 CHK_(ptr);
181 } else {
182 goto handle_unusual;
183 }
184 continue;
185 // uint64 ptr = 6;
186 case 6:
187 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 48)) {
188 _impl_.ptr_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
189 CHK_(ptr);
190 } else {
191 goto handle_unusual;
192 }
193 continue;
194 default:
195 goto handle_unusual;
196 } // switch
197 handle_unusual:
198 if ((tag == 0) || ((tag & 7) == 4)) {
199 CHK_(ptr);
200 ctx->SetLastTag(tag);
201 goto message_done;
202 }
203 ptr = UnknownFieldParse(
204 tag,
205 _internal_metadata_.mutable_unknown_fields<std::string>(),
206 ptr, ctx);
207 CHK_(ptr != nullptr);
208 } // while
209 message_done:
210 return ptr;
211 failure:
212 ptr = nullptr;
213 goto message_done;
214 #undef CHK_
215 }
216
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const217 ::uint8_t* AllocationDescription::_InternalSerialize(
218 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
219 // @@protoc_insertion_point(serialize_to_array_start:tensorflow.AllocationDescription)
220 ::uint32_t cached_has_bits = 0;
221 (void) cached_has_bits;
222
223 // int64 requested_bytes = 1;
224 if (this->_internal_requested_bytes() != 0) {
225 target = stream->EnsureSpace(target);
226 target = ::_pbi::WireFormatLite::WriteInt64ToArray(1, this->_internal_requested_bytes(), target);
227 }
228
229 // int64 allocated_bytes = 2;
230 if (this->_internal_allocated_bytes() != 0) {
231 target = stream->EnsureSpace(target);
232 target = ::_pbi::WireFormatLite::WriteInt64ToArray(2, this->_internal_allocated_bytes(), target);
233 }
234
235 // string allocator_name = 3;
236 if (!this->_internal_allocator_name().empty()) {
237 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
238 this->_internal_allocator_name().data(), static_cast<int>(this->_internal_allocator_name().length()),
239 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
240 "tensorflow.AllocationDescription.allocator_name");
241 target = stream->WriteStringMaybeAliased(
242 3, this->_internal_allocator_name(), target);
243 }
244
245 // int64 allocation_id = 4;
246 if (this->_internal_allocation_id() != 0) {
247 target = stream->EnsureSpace(target);
248 target = ::_pbi::WireFormatLite::WriteInt64ToArray(4, this->_internal_allocation_id(), target);
249 }
250
251 // bool has_single_reference = 5;
252 if (this->_internal_has_single_reference() != 0) {
253 target = stream->EnsureSpace(target);
254 target = ::_pbi::WireFormatLite::WriteBoolToArray(5, this->_internal_has_single_reference(), target);
255 }
256
257 // uint64 ptr = 6;
258 if (this->_internal_ptr() != 0) {
259 target = stream->EnsureSpace(target);
260 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(6, this->_internal_ptr(), target);
261 }
262
263 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
264 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
265 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
266 }
267 // @@protoc_insertion_point(serialize_to_array_end:tensorflow.AllocationDescription)
268 return target;
269 }
270
ByteSizeLong() const271 size_t AllocationDescription::ByteSizeLong() const {
272 // @@protoc_insertion_point(message_byte_size_start:tensorflow.AllocationDescription)
273 size_t total_size = 0;
274
275 ::uint32_t cached_has_bits = 0;
276 // Prevent compiler warnings about cached_has_bits being unused
277 (void) cached_has_bits;
278
279 // string allocator_name = 3;
280 if (!this->_internal_allocator_name().empty()) {
281 total_size += 1 +
282 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
283 this->_internal_allocator_name());
284 }
285
286 // int64 requested_bytes = 1;
287 if (this->_internal_requested_bytes() != 0) {
288 total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_requested_bytes());
289 }
290
291 // int64 allocated_bytes = 2;
292 if (this->_internal_allocated_bytes() != 0) {
293 total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_allocated_bytes());
294 }
295
296 // int64 allocation_id = 4;
297 if (this->_internal_allocation_id() != 0) {
298 total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_allocation_id());
299 }
300
301 // uint64 ptr = 6;
302 if (this->_internal_ptr() != 0) {
303 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_ptr());
304 }
305
306 // bool has_single_reference = 5;
307 if (this->_internal_has_single_reference() != 0) {
308 total_size += 1 + 1;
309 }
310
311 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
312 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
313 }
314 int cached_size = ::_pbi::ToCachedSize(total_size);
315 SetCachedSize(cached_size);
316 return total_size;
317 }
318
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)319 void AllocationDescription::CheckTypeAndMergeFrom(
320 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
321 MergeFrom(*::_pbi::DownCast<const AllocationDescription*>(
322 &from));
323 }
324
MergeFrom(const AllocationDescription & from)325 void AllocationDescription::MergeFrom(const AllocationDescription& from) {
326 AllocationDescription* const _this = this;
327 // @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.AllocationDescription)
328 GOOGLE_DCHECK_NE(&from, _this);
329 ::uint32_t cached_has_bits = 0;
330 (void) cached_has_bits;
331
332 if (!from._internal_allocator_name().empty()) {
333 _this->_internal_set_allocator_name(from._internal_allocator_name());
334 }
335 if (from._internal_requested_bytes() != 0) {
336 _this->_internal_set_requested_bytes(from._internal_requested_bytes());
337 }
338 if (from._internal_allocated_bytes() != 0) {
339 _this->_internal_set_allocated_bytes(from._internal_allocated_bytes());
340 }
341 if (from._internal_allocation_id() != 0) {
342 _this->_internal_set_allocation_id(from._internal_allocation_id());
343 }
344 if (from._internal_ptr() != 0) {
345 _this->_internal_set_ptr(from._internal_ptr());
346 }
347 if (from._internal_has_single_reference() != 0) {
348 _this->_internal_set_has_single_reference(from._internal_has_single_reference());
349 }
350 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
351 }
352
CopyFrom(const AllocationDescription & from)353 void AllocationDescription::CopyFrom(const AllocationDescription& from) {
354 // @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.AllocationDescription)
355 if (&from == this) return;
356 Clear();
357 MergeFrom(from);
358 }
359
IsInitialized() const360 bool AllocationDescription::IsInitialized() const {
361 return true;
362 }
363
InternalSwap(AllocationDescription * other)364 void AllocationDescription::InternalSwap(AllocationDescription* other) {
365 using std::swap;
366 auto* lhs_arena = GetArenaForAllocation();
367 auto* rhs_arena = other->GetArenaForAllocation();
368 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
369 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
370 &_impl_.allocator_name_, lhs_arena,
371 &other->_impl_.allocator_name_, rhs_arena
372 );
373 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
374 PROTOBUF_FIELD_OFFSET(AllocationDescription, _impl_.has_single_reference_)
375 + sizeof(AllocationDescription::_impl_.has_single_reference_) // NOLINT
376 - PROTOBUF_FIELD_OFFSET(AllocationDescription, _impl_.requested_bytes_)>(
377 reinterpret_cast<char*>(&_impl_.requested_bytes_),
378 reinterpret_cast<char*>(&other->_impl_.requested_bytes_));
379 }
380
GetTypeName() const381 std::string AllocationDescription::GetTypeName() const {
382 return "tensorflow.AllocationDescription";
383 }
384
385
386 // @@protoc_insertion_point(namespace_scope)
387 } // namespace tensorflow
388 PROTOBUF_NAMESPACE_OPEN
389 template<> PROTOBUF_NOINLINE ::tensorflow::AllocationDescription*
CreateMaybeMessage(Arena * arena)390 Arena::CreateMaybeMessage< ::tensorflow::AllocationDescription >(Arena* arena) {
391 return Arena::CreateMessageInternal< ::tensorflow::AllocationDescription >(arena);
392 }
393 PROTOBUF_NAMESPACE_CLOSE
394
395 // @@protoc_insertion_point(global_scope)
396 #include <google/protobuf/port_undef.inc>
397