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
8#include <google/protobuf/stubs/common.h>
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/descriptor.h>
13#include <google/protobuf/generated_message_reflection.h>
14#include <google/protobuf/reflection_ops.h>
15#include <google/protobuf/wire_format.h>
16// @@protoc_insertion_point(includes)
17#include <google/protobuf/port_def.inc>
18namespace tensorflow {
19class AllocationDescriptionDefaultTypeInternal {
20 public:
21 ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<AllocationDescription> _instance;
22} _AllocationDescription_default_instance_;
23} // namespace tensorflow
24static void InitDefaultsscc_info_AllocationDescription_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto() {
25 GOOGLE_PROTOBUF_VERIFY_VERSION;
26
27 {
28 void* ptr = &::tensorflow::_AllocationDescription_default_instance_;
29 new (ptr) ::tensorflow::AllocationDescription();
30 ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
31 }
32 ::tensorflow::AllocationDescription::InitAsDefaultInstance();
33}
34
35::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_AllocationDescription_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto =
36 {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_AllocationDescription_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto}, {}};
37
38static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto[1];
39static constexpr ::PROTOBUF_NAMESPACE_ID::EnumDescriptor const** file_level_enum_descriptors_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto = nullptr;
40static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto = nullptr;
41
42const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
43 ~0u, // no _has_bits_
44 PROTOBUF_FIELD_OFFSET(::tensorflow::AllocationDescription, _internal_metadata_),
45 ~0u, // no _extensions_
46 ~0u, // no _oneof_case_
47 ~0u, // no _weak_field_map_
48 PROTOBUF_FIELD_OFFSET(::tensorflow::AllocationDescription, requested_bytes_),
49 PROTOBUF_FIELD_OFFSET(::tensorflow::AllocationDescription, allocated_bytes_),
50 PROTOBUF_FIELD_OFFSET(::tensorflow::AllocationDescription, allocator_name_),
51 PROTOBUF_FIELD_OFFSET(::tensorflow::AllocationDescription, allocation_id_),
52 PROTOBUF_FIELD_OFFSET(::tensorflow::AllocationDescription, has_single_reference_),
53 PROTOBUF_FIELD_OFFSET(::tensorflow::AllocationDescription, ptr_),
54};
55static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
56 { 0, -1, sizeof(::tensorflow::AllocationDescription)},
57};
58
59static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = {
60 reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::tensorflow::_AllocationDescription_default_instance_),
61};
62
63const char descriptor_table_protodef_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
64 "\n6tensorflow/core/framework/allocation_d"
65 "escription.proto\022\ntensorflow\"\243\001\n\025Allocat"
66 "ionDescription\022\027\n\017requested_bytes\030\001 \001(\003\022"
67 "\027\n\017allocated_bytes\030\002 \001(\003\022\026\n\016allocator_na"
68 "me\030\003 \001(\t\022\025\n\rallocation_id\030\004 \001(\003\022\034\n\024has_s"
69 "ingle_reference\030\005 \001(\010\022\013\n\003ptr\030\006 \001(\004B\233\001\n\030o"
70 "rg.tensorflow.frameworkB\033AllocationDescr"
71 "iptionProtosP\001Z]github.com/tensorflow/te"
72 "nsorflow/tensorflow/go/core/framework/al"
73 "location_description_go_proto\370\001\001b\006proto3"
74 ;
75static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto_deps[1] = {
76};
77static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto_sccs[1] = {
78 &scc_info_AllocationDescription_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto.base,
79};
80static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto_once;
81static bool descriptor_table_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto_initialized = false;
82const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto = {
83 &descriptor_table_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto_initialized, descriptor_table_protodef_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto, "tensorflow/core/framework/allocation_description.proto", 400,
84 &descriptor_table_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto_once, descriptor_table_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto_sccs, descriptor_table_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto_deps, 1, 0,
85 schemas, file_default_instances, TableStruct_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto::offsets,
86 file_level_metadata_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto, 1, file_level_enum_descriptors_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto, file_level_service_descriptors_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto,
87};
88
89// Force running AddDescriptors() at dynamic initialization time.
90static bool dynamic_init_dummy_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto = ( ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptors(&descriptor_table_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto), true);
91namespace tensorflow {
92
93// ===================================================================
94
95void AllocationDescription::InitAsDefaultInstance() {
96}
97class AllocationDescription::_Internal {
98 public:
99};
100
101AllocationDescription::AllocationDescription()
102 : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
103 SharedCtor();
104 // @@protoc_insertion_point(constructor:tensorflow.AllocationDescription)
105}
106AllocationDescription::AllocationDescription(::PROTOBUF_NAMESPACE_ID::Arena* arena)
107 : ::PROTOBUF_NAMESPACE_ID::Message(),
108 _internal_metadata_(arena) {
109 SharedCtor();
110 RegisterArenaDtor(arena);
111 // @@protoc_insertion_point(arena_constructor:tensorflow.AllocationDescription)
112}
113AllocationDescription::AllocationDescription(const AllocationDescription& from)
114 : ::PROTOBUF_NAMESPACE_ID::Message(),
115 _internal_metadata_(nullptr) {
116 _internal_metadata_.MergeFrom(from._internal_metadata_);
117 allocator_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
118 if (!from.allocator_name().empty()) {
119 allocator_name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.allocator_name(),
120 GetArenaNoVirtual());
121 }
122 ::memcpy(&requested_bytes_, &from.requested_bytes_,
123 static_cast<size_t>(reinterpret_cast<char*>(&has_single_reference_) -
124 reinterpret_cast<char*>(&requested_bytes_)) + sizeof(has_single_reference_));
125 // @@protoc_insertion_point(copy_constructor:tensorflow.AllocationDescription)
126}
127
128void AllocationDescription::SharedCtor() {
129 ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_AllocationDescription_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto.base);
130 allocator_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
131 ::memset(&requested_bytes_, 0, static_cast<size_t>(
132 reinterpret_cast<char*>(&has_single_reference_) -
133 reinterpret_cast<char*>(&requested_bytes_)) + sizeof(has_single_reference_));
134}
135
136AllocationDescription::~AllocationDescription() {
137 // @@protoc_insertion_point(destructor:tensorflow.AllocationDescription)
138 SharedDtor();
139}
140
141void AllocationDescription::SharedDtor() {
142 GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr);
143 allocator_name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
144}
145
146void AllocationDescription::ArenaDtor(void* object) {
147 AllocationDescription* _this = reinterpret_cast< AllocationDescription* >(object);
148 (void)_this;
149}
150void AllocationDescription::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
151}
152void AllocationDescription::SetCachedSize(int size) const {
153 _cached_size_.Set(size);
154}
155const AllocationDescription& AllocationDescription::default_instance() {
156 ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_AllocationDescription_tensorflow_2fcore_2fframework_2fallocation_5fdescription_2eproto.base);
157 return *internal_default_instance();
158}
159
160
161void AllocationDescription::Clear() {
162// @@protoc_insertion_point(message_clear_start:tensorflow.AllocationDescription)
163 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
164 // Prevent compiler warnings about cached_has_bits being unused
165 (void) cached_has_bits;
166
167 allocator_name_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
168 ::memset(&requested_bytes_, 0, static_cast<size_t>(
169 reinterpret_cast<char*>(&has_single_reference_) -
170 reinterpret_cast<char*>(&requested_bytes_)) + sizeof(has_single_reference_));
171 _internal_metadata_.Clear();
172}
173
174#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
175const char* AllocationDescription::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
176#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
177 ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena;
178 while (!ctx->Done(&ptr)) {
179 ::PROTOBUF_NAMESPACE_ID::uint32 tag;
180 ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
181 CHK_(ptr);
182 switch (tag >> 3) {
183 // int64 requested_bytes = 1;
184 case 1:
185 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
186 requested_bytes_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
187 CHK_(ptr);
188 } else goto handle_unusual;
189 continue;
190 // int64 allocated_bytes = 2;
191 case 2:
192 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
193 allocated_bytes_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
194 CHK_(ptr);
195 } else goto handle_unusual;
196 continue;
197 // string allocator_name = 3;
198 case 3:
199 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) {
200 ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_allocator_name(), ptr, ctx, "tensorflow.AllocationDescription.allocator_name");
201 CHK_(ptr);
202 } else goto handle_unusual;
203 continue;
204 // int64 allocation_id = 4;
205 case 4:
206 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) {
207 allocation_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
208 CHK_(ptr);
209 } else goto handle_unusual;
210 continue;
211 // bool has_single_reference = 5;
212 case 5:
213 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) {
214 has_single_reference_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
215 CHK_(ptr);
216 } else goto handle_unusual;
217 continue;
218 // uint64 ptr = 6;
219 case 6:
220 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 48)) {
221 ptr_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
222 CHK_(ptr);
223 } else goto handle_unusual;
224 continue;
225 default: {
226 handle_unusual:
227 if ((tag & 7) == 4 || tag == 0) {
228 ctx->SetLastTag(tag);
229 goto success;
230 }
231 ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
232 CHK_(ptr != nullptr);
233 continue;
234 }
235 } // switch
236 } // while
237success:
238 return ptr;
239failure:
240 ptr = nullptr;
241 goto success;
242#undef CHK_
243}
244#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
245bool AllocationDescription::MergePartialFromCodedStream(
246 ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) {
247#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure
248 ::PROTOBUF_NAMESPACE_ID::uint32 tag;
249 // @@protoc_insertion_point(parse_start:tensorflow.AllocationDescription)
250 for (;;) {
251 ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
252 tag = p.first;
253 if (!p.second) goto handle_unusual;
254 switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) {
255 // int64 requested_bytes = 1;
256 case 1: {
257 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (8 & 0xFF)) {
258
259 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
260 ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>(
261 input, &requested_bytes_)));
262 } else {
263 goto handle_unusual;
264 }
265 break;
266 }
267
268 // int64 allocated_bytes = 2;
269 case 2: {
270 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (16 & 0xFF)) {
271
272 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
273 ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>(
274 input, &allocated_bytes_)));
275 } else {
276 goto handle_unusual;
277 }
278 break;
279 }
280
281 // string allocator_name = 3;
282 case 3: {
283 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (26 & 0xFF)) {
284 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
285 input, this->mutable_allocator_name()));
286 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
287 this->allocator_name().data(), static_cast<int>(this->allocator_name().length()),
288 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE,
289 "tensorflow.AllocationDescription.allocator_name"));
290 } else {
291 goto handle_unusual;
292 }
293 break;
294 }
295
296 // int64 allocation_id = 4;
297 case 4: {
298 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (32 & 0xFF)) {
299
300 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
301 ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>(
302 input, &allocation_id_)));
303 } else {
304 goto handle_unusual;
305 }
306 break;
307 }
308
309 // bool has_single_reference = 5;
310 case 5: {
311 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (40 & 0xFF)) {
312
313 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
314 bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
315 input, &has_single_reference_)));
316 } else {
317 goto handle_unusual;
318 }
319 break;
320 }
321
322 // uint64 ptr = 6;
323 case 6: {
324 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (48 & 0xFF)) {
325
326 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
327 ::PROTOBUF_NAMESPACE_ID::uint64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_UINT64>(
328 input, &ptr_)));
329 } else {
330 goto handle_unusual;
331 }
332 break;
333 }
334
335 default: {
336 handle_unusual:
337 if (tag == 0) {
338 goto success;
339 }
340 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField(
341 input, tag, _internal_metadata_.mutable_unknown_fields()));
342 break;
343 }
344 }
345 }
346success:
347 // @@protoc_insertion_point(parse_success:tensorflow.AllocationDescription)
348 return true;
349failure:
350 // @@protoc_insertion_point(parse_failure:tensorflow.AllocationDescription)
351 return false;
352#undef DO_
353}
354#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
355
356void AllocationDescription::SerializeWithCachedSizes(
357 ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const {
358 // @@protoc_insertion_point(serialize_start:tensorflow.AllocationDescription)
359 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
360 (void) cached_has_bits;
361
362 // int64 requested_bytes = 1;
363 if (this->requested_bytes() != 0) {
364 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(1, this->requested_bytes(), output);
365 }
366
367 // int64 allocated_bytes = 2;
368 if (this->allocated_bytes() != 0) {
369 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(2, this->allocated_bytes(), output);
370 }
371
372 // string allocator_name = 3;
373 if (this->allocator_name().size() > 0) {
374 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
375 this->allocator_name().data(), static_cast<int>(this->allocator_name().length()),
376 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
377 "tensorflow.AllocationDescription.allocator_name");
378 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased(
379 3, this->allocator_name(), output);
380 }
381
382 // int64 allocation_id = 4;
383 if (this->allocation_id() != 0) {
384 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(4, this->allocation_id(), output);
385 }
386
387 // bool has_single_reference = 5;
388 if (this->has_single_reference() != 0) {
389 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(5, this->has_single_reference(), output);
390 }
391
392 // uint64 ptr = 6;
393 if (this->ptr() != 0) {
394 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64(6, this->ptr(), output);
395 }
396
397 if (_internal_metadata_.have_unknown_fields()) {
398 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields(
399 _internal_metadata_.unknown_fields(), output);
400 }
401 // @@protoc_insertion_point(serialize_end:tensorflow.AllocationDescription)
402}
403
404::PROTOBUF_NAMESPACE_ID::uint8* AllocationDescription::InternalSerializeWithCachedSizesToArray(
405 ::PROTOBUF_NAMESPACE_ID::uint8* target) const {
406 // @@protoc_insertion_point(serialize_to_array_start:tensorflow.AllocationDescription)
407 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
408 (void) cached_has_bits;
409
410 // int64 requested_bytes = 1;
411 if (this->requested_bytes() != 0) {
412 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(1, this->requested_bytes(), target);
413 }
414
415 // int64 allocated_bytes = 2;
416 if (this->allocated_bytes() != 0) {
417 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(2, this->allocated_bytes(), target);
418 }
419
420 // string allocator_name = 3;
421 if (this->allocator_name().size() > 0) {
422 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
423 this->allocator_name().data(), static_cast<int>(this->allocator_name().length()),
424 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
425 "tensorflow.AllocationDescription.allocator_name");
426 target =
427 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray(
428 3, this->allocator_name(), target);
429 }
430
431 // int64 allocation_id = 4;
432 if (this->allocation_id() != 0) {
433 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(4, this->allocation_id(), target);
434 }
435
436 // bool has_single_reference = 5;
437 if (this->has_single_reference() != 0) {
438 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(5, this->has_single_reference(), target);
439 }
440
441 // uint64 ptr = 6;
442 if (this->ptr() != 0) {
443 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(6, this->ptr(), target);
444 }
445
446 if (_internal_metadata_.have_unknown_fields()) {
447 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray(
448 _internal_metadata_.unknown_fields(), target);
449 }
450 // @@protoc_insertion_point(serialize_to_array_end:tensorflow.AllocationDescription)
451 return target;
452}
453
454size_t AllocationDescription::ByteSizeLong() const {
455// @@protoc_insertion_point(message_byte_size_start:tensorflow.AllocationDescription)
456 size_t total_size = 0;
457
458 if (_internal_metadata_.have_unknown_fields()) {
459 total_size +=
460 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize(
461 _internal_metadata_.unknown_fields());
462 }
463 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
464 // Prevent compiler warnings about cached_has_bits being unused
465 (void) cached_has_bits;
466
467 // string allocator_name = 3;
468 if (this->allocator_name().size() > 0) {
469 total_size += 1 +
470 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
471 this->allocator_name());
472 }
473
474 // int64 requested_bytes = 1;
475 if (this->requested_bytes() != 0) {
476 total_size += 1 +
477 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size(
478 this->requested_bytes());
479 }
480
481 // int64 allocated_bytes = 2;
482 if (this->allocated_bytes() != 0) {
483 total_size += 1 +
484 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size(
485 this->allocated_bytes());
486 }
487
488 // int64 allocation_id = 4;
489 if (this->allocation_id() != 0) {
490 total_size += 1 +
491 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size(
492 this->allocation_id());
493 }
494
495 // uint64 ptr = 6;
496 if (this->ptr() != 0) {
497 total_size += 1 +
498 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size(
499 this->ptr());
500 }
501
502 // bool has_single_reference = 5;
503 if (this->has_single_reference() != 0) {
504 total_size += 1 + 1;
505 }
506
507 int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
508 SetCachedSize(cached_size);
509 return total_size;
510}
511
512void AllocationDescription::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
513// @@protoc_insertion_point(generalized_merge_from_start:tensorflow.AllocationDescription)
514 GOOGLE_DCHECK_NE(&from, this);
515 const AllocationDescription* source =
516 ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<AllocationDescription>(
517 &from);
518 if (source == nullptr) {
519 // @@protoc_insertion_point(generalized_merge_from_cast_fail:tensorflow.AllocationDescription)
520 ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
521 } else {
522 // @@protoc_insertion_point(generalized_merge_from_cast_success:tensorflow.AllocationDescription)
523 MergeFrom(*source);
524 }
525}
526
527void AllocationDescription::MergeFrom(const AllocationDescription& from) {
528// @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.AllocationDescription)
529 GOOGLE_DCHECK_NE(&from, this);
530 _internal_metadata_.MergeFrom(from._internal_metadata_);
531 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
532 (void) cached_has_bits;
533
534 if (from.allocator_name().size() > 0) {
535 set_allocator_name(from.allocator_name());
536 }
537 if (from.requested_bytes() != 0) {
538 set_requested_bytes(from.requested_bytes());
539 }
540 if (from.allocated_bytes() != 0) {
541 set_allocated_bytes(from.allocated_bytes());
542 }
543 if (from.allocation_id() != 0) {
544 set_allocation_id(from.allocation_id());
545 }
546 if (from.ptr() != 0) {
547 set_ptr(from.ptr());
548 }
549 if (from.has_single_reference() != 0) {
550 set_has_single_reference(from.has_single_reference());
551 }
552}
553
554void AllocationDescription::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
555// @@protoc_insertion_point(generalized_copy_from_start:tensorflow.AllocationDescription)
556 if (&from == this) return;
557 Clear();
558 MergeFrom(from);
559}
560
561void AllocationDescription::CopyFrom(const AllocationDescription& from) {
562// @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.AllocationDescription)
563 if (&from == this) return;
564 Clear();
565 MergeFrom(from);
566}
567
568bool AllocationDescription::IsInitialized() const {
569 return true;
570}
571
572void AllocationDescription::InternalSwap(AllocationDescription* other) {
573 using std::swap;
574 _internal_metadata_.Swap(&other->_internal_metadata_);
575 allocator_name_.Swap(&other->allocator_name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
576 GetArenaNoVirtual());
577 swap(requested_bytes_, other->requested_bytes_);
578 swap(allocated_bytes_, other->allocated_bytes_);
579 swap(allocation_id_, other->allocation_id_);
580 swap(ptr_, other->ptr_);
581 swap(has_single_reference_, other->has_single_reference_);
582}
583
584::PROTOBUF_NAMESPACE_ID::Metadata AllocationDescription::GetMetadata() const {
585 return GetMetadataStatic();
586}
587
588
589// @@protoc_insertion_point(namespace_scope)
590} // namespace tensorflow
591PROTOBUF_NAMESPACE_OPEN
592template<> PROTOBUF_NOINLINE ::tensorflow::AllocationDescription* Arena::CreateMaybeMessage< ::tensorflow::AllocationDescription >(Arena* arena) {
593 return Arena::CreateMessageInternal< ::tensorflow::AllocationDescription >(arena);
594}
595PROTOBUF_NAMESPACE_CLOSE
596
597// @@protoc_insertion_point(global_scope)
598#include <google/protobuf/port_undef.inc>
599