1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: tensorflow/core/framework/device_attributes.proto
3
4 #include "tensorflow/core/framework/device_attributes.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 {
InterconnectLink(::_pbi::ConstantInitialized)22 PROTOBUF_CONSTEXPR InterconnectLink::InterconnectLink(
23 ::_pbi::ConstantInitialized): _impl_{
24 /*decltype(_impl_.type_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
25 , /*decltype(_impl_.device_id_)*/0
26 , /*decltype(_impl_.strength_)*/0
27 , /*decltype(_impl_._cached_size_)*/{}} {}
28 struct InterconnectLinkDefaultTypeInternal {
InterconnectLinkDefaultTypeInternaltensorflow::InterconnectLinkDefaultTypeInternal29 PROTOBUF_CONSTEXPR InterconnectLinkDefaultTypeInternal()
30 : _instance(::_pbi::ConstantInitialized{}) {}
~InterconnectLinkDefaultTypeInternaltensorflow::InterconnectLinkDefaultTypeInternal31 ~InterconnectLinkDefaultTypeInternal() {}
32 union { // NOLINT(misc-non-private-member-variables-in-classes)
33 InterconnectLink _instance;
34 };
35 };
36 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 InterconnectLinkDefaultTypeInternal _InterconnectLink_default_instance_;
LocalLinks(::_pbi::ConstantInitialized)37 PROTOBUF_CONSTEXPR LocalLinks::LocalLinks(
38 ::_pbi::ConstantInitialized): _impl_{
39 /*decltype(_impl_.link_)*/{}
40 , /*decltype(_impl_._cached_size_)*/{}} {}
41 struct LocalLinksDefaultTypeInternal {
LocalLinksDefaultTypeInternaltensorflow::LocalLinksDefaultTypeInternal42 PROTOBUF_CONSTEXPR LocalLinksDefaultTypeInternal()
43 : _instance(::_pbi::ConstantInitialized{}) {}
~LocalLinksDefaultTypeInternaltensorflow::LocalLinksDefaultTypeInternal44 ~LocalLinksDefaultTypeInternal() {}
45 union { // NOLINT(misc-non-private-member-variables-in-classes)
46 LocalLinks _instance;
47 };
48 };
49 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 LocalLinksDefaultTypeInternal _LocalLinks_default_instance_;
DeviceLocality(::_pbi::ConstantInitialized)50 PROTOBUF_CONSTEXPR DeviceLocality::DeviceLocality(
51 ::_pbi::ConstantInitialized): _impl_{
52 /*decltype(_impl_.links_)*/nullptr
53 , /*decltype(_impl_.bus_id_)*/0
54 , /*decltype(_impl_.numa_node_)*/0
55 , /*decltype(_impl_._cached_size_)*/{}} {}
56 struct DeviceLocalityDefaultTypeInternal {
DeviceLocalityDefaultTypeInternaltensorflow::DeviceLocalityDefaultTypeInternal57 PROTOBUF_CONSTEXPR DeviceLocalityDefaultTypeInternal()
58 : _instance(::_pbi::ConstantInitialized{}) {}
~DeviceLocalityDefaultTypeInternaltensorflow::DeviceLocalityDefaultTypeInternal59 ~DeviceLocalityDefaultTypeInternal() {}
60 union { // NOLINT(misc-non-private-member-variables-in-classes)
61 DeviceLocality _instance;
62 };
63 };
64 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 DeviceLocalityDefaultTypeInternal _DeviceLocality_default_instance_;
DeviceAttributes(::_pbi::ConstantInitialized)65 PROTOBUF_CONSTEXPR DeviceAttributes::DeviceAttributes(
66 ::_pbi::ConstantInitialized): _impl_{
67 /*decltype(_impl_.name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
68 , /*decltype(_impl_.device_type_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
69 , /*decltype(_impl_.physical_device_desc_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
70 , /*decltype(_impl_.locality_)*/nullptr
71 , /*decltype(_impl_.memory_limit_)*/::int64_t{0}
72 , /*decltype(_impl_.incarnation_)*/::uint64_t{0u}
73 , /*decltype(_impl_.xla_global_id_)*/::int64_t{0}
74 , /*decltype(_impl_._cached_size_)*/{}} {}
75 struct DeviceAttributesDefaultTypeInternal {
DeviceAttributesDefaultTypeInternaltensorflow::DeviceAttributesDefaultTypeInternal76 PROTOBUF_CONSTEXPR DeviceAttributesDefaultTypeInternal()
77 : _instance(::_pbi::ConstantInitialized{}) {}
~DeviceAttributesDefaultTypeInternaltensorflow::DeviceAttributesDefaultTypeInternal78 ~DeviceAttributesDefaultTypeInternal() {}
79 union { // NOLINT(misc-non-private-member-variables-in-classes)
80 DeviceAttributes _instance;
81 };
82 };
83 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 DeviceAttributesDefaultTypeInternal _DeviceAttributes_default_instance_;
84 } // namespace tensorflow
85 namespace tensorflow {
86
87 // ===================================================================
88
89 class InterconnectLink::_Internal {
90 public:
91 };
92
InterconnectLink(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)93 InterconnectLink::InterconnectLink(::PROTOBUF_NAMESPACE_ID::Arena* arena,
94 bool is_message_owned)
95 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
96 SharedCtor(arena, is_message_owned);
97 // @@protoc_insertion_point(arena_constructor:tensorflow.InterconnectLink)
98 }
InterconnectLink(const InterconnectLink & from)99 InterconnectLink::InterconnectLink(const InterconnectLink& from)
100 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
101 InterconnectLink* const _this = this; (void)_this;
102 new (&_impl_) Impl_{
103 decltype(_impl_.type_){}
104 , decltype(_impl_.device_id_){}
105 , decltype(_impl_.strength_){}
106 , /*decltype(_impl_._cached_size_)*/{}};
107
108 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
109 _impl_.type_.InitDefault();
110 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
111 _impl_.type_.Set("", GetArenaForAllocation());
112 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
113 if (!from._internal_type().empty()) {
114 _this->_impl_.type_.Set(from._internal_type(),
115 _this->GetArenaForAllocation());
116 }
117 ::memcpy(&_impl_.device_id_, &from._impl_.device_id_,
118 static_cast<size_t>(reinterpret_cast<char*>(&_impl_.strength_) -
119 reinterpret_cast<char*>(&_impl_.device_id_)) + sizeof(_impl_.strength_));
120 // @@protoc_insertion_point(copy_constructor:tensorflow.InterconnectLink)
121 }
122
SharedCtor(::_pb::Arena * arena,bool is_message_owned)123 inline void InterconnectLink::SharedCtor(
124 ::_pb::Arena* arena, bool is_message_owned) {
125 (void)arena;
126 (void)is_message_owned;
127 new (&_impl_) Impl_{
128 decltype(_impl_.type_){}
129 , decltype(_impl_.device_id_){0}
130 , decltype(_impl_.strength_){0}
131 , /*decltype(_impl_._cached_size_)*/{}
132 };
133 _impl_.type_.InitDefault();
134 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
135 _impl_.type_.Set("", GetArenaForAllocation());
136 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
137 }
138
~InterconnectLink()139 InterconnectLink::~InterconnectLink() {
140 // @@protoc_insertion_point(destructor:tensorflow.InterconnectLink)
141 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
142 (void)arena;
143 return;
144 }
145 SharedDtor();
146 }
147
SharedDtor()148 inline void InterconnectLink::SharedDtor() {
149 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
150 _impl_.type_.Destroy();
151 }
152
SetCachedSize(int size) const153 void InterconnectLink::SetCachedSize(int size) const {
154 _impl_._cached_size_.Set(size);
155 }
156
Clear()157 void InterconnectLink::Clear() {
158 // @@protoc_insertion_point(message_clear_start:tensorflow.InterconnectLink)
159 ::uint32_t cached_has_bits = 0;
160 // Prevent compiler warnings about cached_has_bits being unused
161 (void) cached_has_bits;
162
163 _impl_.type_.ClearToEmpty();
164 ::memset(&_impl_.device_id_, 0, static_cast<size_t>(
165 reinterpret_cast<char*>(&_impl_.strength_) -
166 reinterpret_cast<char*>(&_impl_.device_id_)) + sizeof(_impl_.strength_));
167 _internal_metadata_.Clear<std::string>();
168 }
169
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)170 const char* InterconnectLink::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
171 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
172 while (!ctx->Done(&ptr)) {
173 ::uint32_t tag;
174 ptr = ::_pbi::ReadTag(ptr, &tag);
175 switch (tag >> 3) {
176 // int32 device_id = 1;
177 case 1:
178 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
179 _impl_.device_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
180 CHK_(ptr);
181 } else {
182 goto handle_unusual;
183 }
184 continue;
185 // string type = 2;
186 case 2:
187 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
188 auto str = _internal_mutable_type();
189 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
190 CHK_(ptr);
191 CHK_(::_pbi::VerifyUTF8(str, nullptr));
192 } else {
193 goto handle_unusual;
194 }
195 continue;
196 // int32 strength = 3;
197 case 3:
198 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 24)) {
199 _impl_.strength_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
200 CHK_(ptr);
201 } else {
202 goto handle_unusual;
203 }
204 continue;
205 default:
206 goto handle_unusual;
207 } // switch
208 handle_unusual:
209 if ((tag == 0) || ((tag & 7) == 4)) {
210 CHK_(ptr);
211 ctx->SetLastTag(tag);
212 goto message_done;
213 }
214 ptr = UnknownFieldParse(
215 tag,
216 _internal_metadata_.mutable_unknown_fields<std::string>(),
217 ptr, ctx);
218 CHK_(ptr != nullptr);
219 } // while
220 message_done:
221 return ptr;
222 failure:
223 ptr = nullptr;
224 goto message_done;
225 #undef CHK_
226 }
227
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const228 ::uint8_t* InterconnectLink::_InternalSerialize(
229 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
230 // @@protoc_insertion_point(serialize_to_array_start:tensorflow.InterconnectLink)
231 ::uint32_t cached_has_bits = 0;
232 (void) cached_has_bits;
233
234 // int32 device_id = 1;
235 if (this->_internal_device_id() != 0) {
236 target = stream->EnsureSpace(target);
237 target = ::_pbi::WireFormatLite::WriteInt32ToArray(1, this->_internal_device_id(), target);
238 }
239
240 // string type = 2;
241 if (!this->_internal_type().empty()) {
242 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
243 this->_internal_type().data(), static_cast<int>(this->_internal_type().length()),
244 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
245 "tensorflow.InterconnectLink.type");
246 target = stream->WriteStringMaybeAliased(
247 2, this->_internal_type(), target);
248 }
249
250 // int32 strength = 3;
251 if (this->_internal_strength() != 0) {
252 target = stream->EnsureSpace(target);
253 target = ::_pbi::WireFormatLite::WriteInt32ToArray(3, this->_internal_strength(), target);
254 }
255
256 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
257 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
258 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
259 }
260 // @@protoc_insertion_point(serialize_to_array_end:tensorflow.InterconnectLink)
261 return target;
262 }
263
ByteSizeLong() const264 size_t InterconnectLink::ByteSizeLong() const {
265 // @@protoc_insertion_point(message_byte_size_start:tensorflow.InterconnectLink)
266 size_t total_size = 0;
267
268 ::uint32_t cached_has_bits = 0;
269 // Prevent compiler warnings about cached_has_bits being unused
270 (void) cached_has_bits;
271
272 // string type = 2;
273 if (!this->_internal_type().empty()) {
274 total_size += 1 +
275 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
276 this->_internal_type());
277 }
278
279 // int32 device_id = 1;
280 if (this->_internal_device_id() != 0) {
281 total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_device_id());
282 }
283
284 // int32 strength = 3;
285 if (this->_internal_strength() != 0) {
286 total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_strength());
287 }
288
289 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
290 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
291 }
292 int cached_size = ::_pbi::ToCachedSize(total_size);
293 SetCachedSize(cached_size);
294 return total_size;
295 }
296
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)297 void InterconnectLink::CheckTypeAndMergeFrom(
298 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
299 MergeFrom(*::_pbi::DownCast<const InterconnectLink*>(
300 &from));
301 }
302
MergeFrom(const InterconnectLink & from)303 void InterconnectLink::MergeFrom(const InterconnectLink& from) {
304 InterconnectLink* const _this = this;
305 // @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.InterconnectLink)
306 GOOGLE_DCHECK_NE(&from, _this);
307 ::uint32_t cached_has_bits = 0;
308 (void) cached_has_bits;
309
310 if (!from._internal_type().empty()) {
311 _this->_internal_set_type(from._internal_type());
312 }
313 if (from._internal_device_id() != 0) {
314 _this->_internal_set_device_id(from._internal_device_id());
315 }
316 if (from._internal_strength() != 0) {
317 _this->_internal_set_strength(from._internal_strength());
318 }
319 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
320 }
321
CopyFrom(const InterconnectLink & from)322 void InterconnectLink::CopyFrom(const InterconnectLink& from) {
323 // @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.InterconnectLink)
324 if (&from == this) return;
325 Clear();
326 MergeFrom(from);
327 }
328
IsInitialized() const329 bool InterconnectLink::IsInitialized() const {
330 return true;
331 }
332
InternalSwap(InterconnectLink * other)333 void InterconnectLink::InternalSwap(InterconnectLink* other) {
334 using std::swap;
335 auto* lhs_arena = GetArenaForAllocation();
336 auto* rhs_arena = other->GetArenaForAllocation();
337 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
338 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
339 &_impl_.type_, lhs_arena,
340 &other->_impl_.type_, rhs_arena
341 );
342 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
343 PROTOBUF_FIELD_OFFSET(InterconnectLink, _impl_.strength_)
344 + sizeof(InterconnectLink::_impl_.strength_) // NOLINT
345 - PROTOBUF_FIELD_OFFSET(InterconnectLink, _impl_.device_id_)>(
346 reinterpret_cast<char*>(&_impl_.device_id_),
347 reinterpret_cast<char*>(&other->_impl_.device_id_));
348 }
349
GetTypeName() const350 std::string InterconnectLink::GetTypeName() const {
351 return "tensorflow.InterconnectLink";
352 }
353
354
355 // ===================================================================
356
357 class LocalLinks::_Internal {
358 public:
359 };
360
LocalLinks(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)361 LocalLinks::LocalLinks(::PROTOBUF_NAMESPACE_ID::Arena* arena,
362 bool is_message_owned)
363 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
364 SharedCtor(arena, is_message_owned);
365 // @@protoc_insertion_point(arena_constructor:tensorflow.LocalLinks)
366 }
LocalLinks(const LocalLinks & from)367 LocalLinks::LocalLinks(const LocalLinks& from)
368 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
369 LocalLinks* const _this = this; (void)_this;
370 new (&_impl_) Impl_{
371 decltype(_impl_.link_){from._impl_.link_}
372 , /*decltype(_impl_._cached_size_)*/{}};
373
374 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
375 // @@protoc_insertion_point(copy_constructor:tensorflow.LocalLinks)
376 }
377
SharedCtor(::_pb::Arena * arena,bool is_message_owned)378 inline void LocalLinks::SharedCtor(
379 ::_pb::Arena* arena, bool is_message_owned) {
380 (void)arena;
381 (void)is_message_owned;
382 new (&_impl_) Impl_{
383 decltype(_impl_.link_){arena}
384 , /*decltype(_impl_._cached_size_)*/{}
385 };
386 }
387
~LocalLinks()388 LocalLinks::~LocalLinks() {
389 // @@protoc_insertion_point(destructor:tensorflow.LocalLinks)
390 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
391 (void)arena;
392 return;
393 }
394 SharedDtor();
395 }
396
SharedDtor()397 inline void LocalLinks::SharedDtor() {
398 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
399 _impl_.link_.~RepeatedPtrField();
400 }
401
SetCachedSize(int size) const402 void LocalLinks::SetCachedSize(int size) const {
403 _impl_._cached_size_.Set(size);
404 }
405
Clear()406 void LocalLinks::Clear() {
407 // @@protoc_insertion_point(message_clear_start:tensorflow.LocalLinks)
408 ::uint32_t cached_has_bits = 0;
409 // Prevent compiler warnings about cached_has_bits being unused
410 (void) cached_has_bits;
411
412 _impl_.link_.Clear();
413 _internal_metadata_.Clear<std::string>();
414 }
415
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)416 const char* LocalLinks::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
417 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
418 while (!ctx->Done(&ptr)) {
419 ::uint32_t tag;
420 ptr = ::_pbi::ReadTag(ptr, &tag);
421 switch (tag >> 3) {
422 // repeated .tensorflow.InterconnectLink link = 1;
423 case 1:
424 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
425 ptr -= 1;
426 do {
427 ptr += 1;
428 ptr = ctx->ParseMessage(_internal_add_link(), ptr);
429 CHK_(ptr);
430 if (!ctx->DataAvailable(ptr)) break;
431 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr));
432 } else {
433 goto handle_unusual;
434 }
435 continue;
436 default:
437 goto handle_unusual;
438 } // switch
439 handle_unusual:
440 if ((tag == 0) || ((tag & 7) == 4)) {
441 CHK_(ptr);
442 ctx->SetLastTag(tag);
443 goto message_done;
444 }
445 ptr = UnknownFieldParse(
446 tag,
447 _internal_metadata_.mutable_unknown_fields<std::string>(),
448 ptr, ctx);
449 CHK_(ptr != nullptr);
450 } // while
451 message_done:
452 return ptr;
453 failure:
454 ptr = nullptr;
455 goto message_done;
456 #undef CHK_
457 }
458
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const459 ::uint8_t* LocalLinks::_InternalSerialize(
460 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
461 // @@protoc_insertion_point(serialize_to_array_start:tensorflow.LocalLinks)
462 ::uint32_t cached_has_bits = 0;
463 (void) cached_has_bits;
464
465 // repeated .tensorflow.InterconnectLink link = 1;
466 for (unsigned i = 0,
467 n = static_cast<unsigned>(this->_internal_link_size()); i < n; i++) {
468 const auto& repfield = this->_internal_link(i);
469 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
470 InternalWriteMessage(1, repfield, repfield.GetCachedSize(), target, stream);
471 }
472
473 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
474 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
475 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
476 }
477 // @@protoc_insertion_point(serialize_to_array_end:tensorflow.LocalLinks)
478 return target;
479 }
480
ByteSizeLong() const481 size_t LocalLinks::ByteSizeLong() const {
482 // @@protoc_insertion_point(message_byte_size_start:tensorflow.LocalLinks)
483 size_t total_size = 0;
484
485 ::uint32_t cached_has_bits = 0;
486 // Prevent compiler warnings about cached_has_bits being unused
487 (void) cached_has_bits;
488
489 // repeated .tensorflow.InterconnectLink link = 1;
490 total_size += 1UL * this->_internal_link_size();
491 for (const auto& msg : this->_impl_.link_) {
492 total_size +=
493 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
494 }
495
496 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
497 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
498 }
499 int cached_size = ::_pbi::ToCachedSize(total_size);
500 SetCachedSize(cached_size);
501 return total_size;
502 }
503
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)504 void LocalLinks::CheckTypeAndMergeFrom(
505 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
506 MergeFrom(*::_pbi::DownCast<const LocalLinks*>(
507 &from));
508 }
509
MergeFrom(const LocalLinks & from)510 void LocalLinks::MergeFrom(const LocalLinks& from) {
511 LocalLinks* const _this = this;
512 // @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.LocalLinks)
513 GOOGLE_DCHECK_NE(&from, _this);
514 ::uint32_t cached_has_bits = 0;
515 (void) cached_has_bits;
516
517 _this->_impl_.link_.MergeFrom(from._impl_.link_);
518 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
519 }
520
CopyFrom(const LocalLinks & from)521 void LocalLinks::CopyFrom(const LocalLinks& from) {
522 // @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.LocalLinks)
523 if (&from == this) return;
524 Clear();
525 MergeFrom(from);
526 }
527
IsInitialized() const528 bool LocalLinks::IsInitialized() const {
529 return true;
530 }
531
InternalSwap(LocalLinks * other)532 void LocalLinks::InternalSwap(LocalLinks* other) {
533 using std::swap;
534 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
535 _impl_.link_.InternalSwap(&other->_impl_.link_);
536 }
537
GetTypeName() const538 std::string LocalLinks::GetTypeName() const {
539 return "tensorflow.LocalLinks";
540 }
541
542
543 // ===================================================================
544
545 class DeviceLocality::_Internal {
546 public:
547 static const ::tensorflow::LocalLinks& links(const DeviceLocality* msg);
548 };
549
550 const ::tensorflow::LocalLinks&
links(const DeviceLocality * msg)551 DeviceLocality::_Internal::links(const DeviceLocality* msg) {
552 return *msg->_impl_.links_;
553 }
DeviceLocality(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)554 DeviceLocality::DeviceLocality(::PROTOBUF_NAMESPACE_ID::Arena* arena,
555 bool is_message_owned)
556 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
557 SharedCtor(arena, is_message_owned);
558 // @@protoc_insertion_point(arena_constructor:tensorflow.DeviceLocality)
559 }
DeviceLocality(const DeviceLocality & from)560 DeviceLocality::DeviceLocality(const DeviceLocality& from)
561 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
562 DeviceLocality* const _this = this; (void)_this;
563 new (&_impl_) Impl_{
564 decltype(_impl_.links_){nullptr}
565 , decltype(_impl_.bus_id_){}
566 , decltype(_impl_.numa_node_){}
567 , /*decltype(_impl_._cached_size_)*/{}};
568
569 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
570 if (from._internal_has_links()) {
571 _this->_impl_.links_ = new ::tensorflow::LocalLinks(*from._impl_.links_);
572 }
573 ::memcpy(&_impl_.bus_id_, &from._impl_.bus_id_,
574 static_cast<size_t>(reinterpret_cast<char*>(&_impl_.numa_node_) -
575 reinterpret_cast<char*>(&_impl_.bus_id_)) + sizeof(_impl_.numa_node_));
576 // @@protoc_insertion_point(copy_constructor:tensorflow.DeviceLocality)
577 }
578
SharedCtor(::_pb::Arena * arena,bool is_message_owned)579 inline void DeviceLocality::SharedCtor(
580 ::_pb::Arena* arena, bool is_message_owned) {
581 (void)arena;
582 (void)is_message_owned;
583 new (&_impl_) Impl_{
584 decltype(_impl_.links_){nullptr}
585 , decltype(_impl_.bus_id_){0}
586 , decltype(_impl_.numa_node_){0}
587 , /*decltype(_impl_._cached_size_)*/{}
588 };
589 }
590
~DeviceLocality()591 DeviceLocality::~DeviceLocality() {
592 // @@protoc_insertion_point(destructor:tensorflow.DeviceLocality)
593 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
594 (void)arena;
595 return;
596 }
597 SharedDtor();
598 }
599
SharedDtor()600 inline void DeviceLocality::SharedDtor() {
601 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
602 if (this != internal_default_instance()) delete _impl_.links_;
603 }
604
SetCachedSize(int size) const605 void DeviceLocality::SetCachedSize(int size) const {
606 _impl_._cached_size_.Set(size);
607 }
608
Clear()609 void DeviceLocality::Clear() {
610 // @@protoc_insertion_point(message_clear_start:tensorflow.DeviceLocality)
611 ::uint32_t cached_has_bits = 0;
612 // Prevent compiler warnings about cached_has_bits being unused
613 (void) cached_has_bits;
614
615 if (GetArenaForAllocation() == nullptr && _impl_.links_ != nullptr) {
616 delete _impl_.links_;
617 }
618 _impl_.links_ = nullptr;
619 ::memset(&_impl_.bus_id_, 0, static_cast<size_t>(
620 reinterpret_cast<char*>(&_impl_.numa_node_) -
621 reinterpret_cast<char*>(&_impl_.bus_id_)) + sizeof(_impl_.numa_node_));
622 _internal_metadata_.Clear<std::string>();
623 }
624
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)625 const char* DeviceLocality::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
626 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
627 while (!ctx->Done(&ptr)) {
628 ::uint32_t tag;
629 ptr = ::_pbi::ReadTag(ptr, &tag);
630 switch (tag >> 3) {
631 // int32 bus_id = 1;
632 case 1:
633 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
634 _impl_.bus_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
635 CHK_(ptr);
636 } else {
637 goto handle_unusual;
638 }
639 continue;
640 // int32 numa_node = 2;
641 case 2:
642 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 16)) {
643 _impl_.numa_node_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
644 CHK_(ptr);
645 } else {
646 goto handle_unusual;
647 }
648 continue;
649 // .tensorflow.LocalLinks links = 3;
650 case 3:
651 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 26)) {
652 ptr = ctx->ParseMessage(_internal_mutable_links(), ptr);
653 CHK_(ptr);
654 } else {
655 goto handle_unusual;
656 }
657 continue;
658 default:
659 goto handle_unusual;
660 } // switch
661 handle_unusual:
662 if ((tag == 0) || ((tag & 7) == 4)) {
663 CHK_(ptr);
664 ctx->SetLastTag(tag);
665 goto message_done;
666 }
667 ptr = UnknownFieldParse(
668 tag,
669 _internal_metadata_.mutable_unknown_fields<std::string>(),
670 ptr, ctx);
671 CHK_(ptr != nullptr);
672 } // while
673 message_done:
674 return ptr;
675 failure:
676 ptr = nullptr;
677 goto message_done;
678 #undef CHK_
679 }
680
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const681 ::uint8_t* DeviceLocality::_InternalSerialize(
682 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
683 // @@protoc_insertion_point(serialize_to_array_start:tensorflow.DeviceLocality)
684 ::uint32_t cached_has_bits = 0;
685 (void) cached_has_bits;
686
687 // int32 bus_id = 1;
688 if (this->_internal_bus_id() != 0) {
689 target = stream->EnsureSpace(target);
690 target = ::_pbi::WireFormatLite::WriteInt32ToArray(1, this->_internal_bus_id(), target);
691 }
692
693 // int32 numa_node = 2;
694 if (this->_internal_numa_node() != 0) {
695 target = stream->EnsureSpace(target);
696 target = ::_pbi::WireFormatLite::WriteInt32ToArray(2, this->_internal_numa_node(), target);
697 }
698
699 // .tensorflow.LocalLinks links = 3;
700 if (this->_internal_has_links()) {
701 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
702 InternalWriteMessage(3, _Internal::links(this),
703 _Internal::links(this).GetCachedSize(), target, stream);
704 }
705
706 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
707 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
708 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
709 }
710 // @@protoc_insertion_point(serialize_to_array_end:tensorflow.DeviceLocality)
711 return target;
712 }
713
ByteSizeLong() const714 size_t DeviceLocality::ByteSizeLong() const {
715 // @@protoc_insertion_point(message_byte_size_start:tensorflow.DeviceLocality)
716 size_t total_size = 0;
717
718 ::uint32_t cached_has_bits = 0;
719 // Prevent compiler warnings about cached_has_bits being unused
720 (void) cached_has_bits;
721
722 // .tensorflow.LocalLinks links = 3;
723 if (this->_internal_has_links()) {
724 total_size += 1 +
725 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
726 *_impl_.links_);
727 }
728
729 // int32 bus_id = 1;
730 if (this->_internal_bus_id() != 0) {
731 total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_bus_id());
732 }
733
734 // int32 numa_node = 2;
735 if (this->_internal_numa_node() != 0) {
736 total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_numa_node());
737 }
738
739 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
740 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
741 }
742 int cached_size = ::_pbi::ToCachedSize(total_size);
743 SetCachedSize(cached_size);
744 return total_size;
745 }
746
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)747 void DeviceLocality::CheckTypeAndMergeFrom(
748 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
749 MergeFrom(*::_pbi::DownCast<const DeviceLocality*>(
750 &from));
751 }
752
MergeFrom(const DeviceLocality & from)753 void DeviceLocality::MergeFrom(const DeviceLocality& from) {
754 DeviceLocality* const _this = this;
755 // @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.DeviceLocality)
756 GOOGLE_DCHECK_NE(&from, _this);
757 ::uint32_t cached_has_bits = 0;
758 (void) cached_has_bits;
759
760 if (from._internal_has_links()) {
761 _this->_internal_mutable_links()->::tensorflow::LocalLinks::MergeFrom(
762 from._internal_links());
763 }
764 if (from._internal_bus_id() != 0) {
765 _this->_internal_set_bus_id(from._internal_bus_id());
766 }
767 if (from._internal_numa_node() != 0) {
768 _this->_internal_set_numa_node(from._internal_numa_node());
769 }
770 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
771 }
772
CopyFrom(const DeviceLocality & from)773 void DeviceLocality::CopyFrom(const DeviceLocality& from) {
774 // @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.DeviceLocality)
775 if (&from == this) return;
776 Clear();
777 MergeFrom(from);
778 }
779
IsInitialized() const780 bool DeviceLocality::IsInitialized() const {
781 return true;
782 }
783
InternalSwap(DeviceLocality * other)784 void DeviceLocality::InternalSwap(DeviceLocality* other) {
785 using std::swap;
786 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
787 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
788 PROTOBUF_FIELD_OFFSET(DeviceLocality, _impl_.numa_node_)
789 + sizeof(DeviceLocality::_impl_.numa_node_) // NOLINT
790 - PROTOBUF_FIELD_OFFSET(DeviceLocality, _impl_.links_)>(
791 reinterpret_cast<char*>(&_impl_.links_),
792 reinterpret_cast<char*>(&other->_impl_.links_));
793 }
794
GetTypeName() const795 std::string DeviceLocality::GetTypeName() const {
796 return "tensorflow.DeviceLocality";
797 }
798
799
800 // ===================================================================
801
802 class DeviceAttributes::_Internal {
803 public:
804 static const ::tensorflow::DeviceLocality& locality(const DeviceAttributes* msg);
805 };
806
807 const ::tensorflow::DeviceLocality&
locality(const DeviceAttributes * msg)808 DeviceAttributes::_Internal::locality(const DeviceAttributes* msg) {
809 return *msg->_impl_.locality_;
810 }
DeviceAttributes(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)811 DeviceAttributes::DeviceAttributes(::PROTOBUF_NAMESPACE_ID::Arena* arena,
812 bool is_message_owned)
813 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
814 SharedCtor(arena, is_message_owned);
815 // @@protoc_insertion_point(arena_constructor:tensorflow.DeviceAttributes)
816 }
DeviceAttributes(const DeviceAttributes & from)817 DeviceAttributes::DeviceAttributes(const DeviceAttributes& from)
818 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
819 DeviceAttributes* const _this = this; (void)_this;
820 new (&_impl_) Impl_{
821 decltype(_impl_.name_){}
822 , decltype(_impl_.device_type_){}
823 , decltype(_impl_.physical_device_desc_){}
824 , decltype(_impl_.locality_){nullptr}
825 , decltype(_impl_.memory_limit_){}
826 , decltype(_impl_.incarnation_){}
827 , decltype(_impl_.xla_global_id_){}
828 , /*decltype(_impl_._cached_size_)*/{}};
829
830 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
831 _impl_.name_.InitDefault();
832 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
833 _impl_.name_.Set("", GetArenaForAllocation());
834 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
835 if (!from._internal_name().empty()) {
836 _this->_impl_.name_.Set(from._internal_name(),
837 _this->GetArenaForAllocation());
838 }
839 _impl_.device_type_.InitDefault();
840 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
841 _impl_.device_type_.Set("", GetArenaForAllocation());
842 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
843 if (!from._internal_device_type().empty()) {
844 _this->_impl_.device_type_.Set(from._internal_device_type(),
845 _this->GetArenaForAllocation());
846 }
847 _impl_.physical_device_desc_.InitDefault();
848 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
849 _impl_.physical_device_desc_.Set("", GetArenaForAllocation());
850 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
851 if (!from._internal_physical_device_desc().empty()) {
852 _this->_impl_.physical_device_desc_.Set(from._internal_physical_device_desc(),
853 _this->GetArenaForAllocation());
854 }
855 if (from._internal_has_locality()) {
856 _this->_impl_.locality_ = new ::tensorflow::DeviceLocality(*from._impl_.locality_);
857 }
858 ::memcpy(&_impl_.memory_limit_, &from._impl_.memory_limit_,
859 static_cast<size_t>(reinterpret_cast<char*>(&_impl_.xla_global_id_) -
860 reinterpret_cast<char*>(&_impl_.memory_limit_)) + sizeof(_impl_.xla_global_id_));
861 // @@protoc_insertion_point(copy_constructor:tensorflow.DeviceAttributes)
862 }
863
SharedCtor(::_pb::Arena * arena,bool is_message_owned)864 inline void DeviceAttributes::SharedCtor(
865 ::_pb::Arena* arena, bool is_message_owned) {
866 (void)arena;
867 (void)is_message_owned;
868 new (&_impl_) Impl_{
869 decltype(_impl_.name_){}
870 , decltype(_impl_.device_type_){}
871 , decltype(_impl_.physical_device_desc_){}
872 , decltype(_impl_.locality_){nullptr}
873 , decltype(_impl_.memory_limit_){::int64_t{0}}
874 , decltype(_impl_.incarnation_){::uint64_t{0u}}
875 , decltype(_impl_.xla_global_id_){::int64_t{0}}
876 , /*decltype(_impl_._cached_size_)*/{}
877 };
878 _impl_.name_.InitDefault();
879 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
880 _impl_.name_.Set("", GetArenaForAllocation());
881 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
882 _impl_.device_type_.InitDefault();
883 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
884 _impl_.device_type_.Set("", GetArenaForAllocation());
885 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
886 _impl_.physical_device_desc_.InitDefault();
887 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
888 _impl_.physical_device_desc_.Set("", GetArenaForAllocation());
889 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
890 }
891
~DeviceAttributes()892 DeviceAttributes::~DeviceAttributes() {
893 // @@protoc_insertion_point(destructor:tensorflow.DeviceAttributes)
894 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
895 (void)arena;
896 return;
897 }
898 SharedDtor();
899 }
900
SharedDtor()901 inline void DeviceAttributes::SharedDtor() {
902 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
903 _impl_.name_.Destroy();
904 _impl_.device_type_.Destroy();
905 _impl_.physical_device_desc_.Destroy();
906 if (this != internal_default_instance()) delete _impl_.locality_;
907 }
908
SetCachedSize(int size) const909 void DeviceAttributes::SetCachedSize(int size) const {
910 _impl_._cached_size_.Set(size);
911 }
912
Clear()913 void DeviceAttributes::Clear() {
914 // @@protoc_insertion_point(message_clear_start:tensorflow.DeviceAttributes)
915 ::uint32_t cached_has_bits = 0;
916 // Prevent compiler warnings about cached_has_bits being unused
917 (void) cached_has_bits;
918
919 _impl_.name_.ClearToEmpty();
920 _impl_.device_type_.ClearToEmpty();
921 _impl_.physical_device_desc_.ClearToEmpty();
922 if (GetArenaForAllocation() == nullptr && _impl_.locality_ != nullptr) {
923 delete _impl_.locality_;
924 }
925 _impl_.locality_ = nullptr;
926 ::memset(&_impl_.memory_limit_, 0, static_cast<size_t>(
927 reinterpret_cast<char*>(&_impl_.xla_global_id_) -
928 reinterpret_cast<char*>(&_impl_.memory_limit_)) + sizeof(_impl_.xla_global_id_));
929 _internal_metadata_.Clear<std::string>();
930 }
931
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)932 const char* DeviceAttributes::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
933 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
934 while (!ctx->Done(&ptr)) {
935 ::uint32_t tag;
936 ptr = ::_pbi::ReadTag(ptr, &tag);
937 switch (tag >> 3) {
938 // string name = 1;
939 case 1:
940 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
941 auto str = _internal_mutable_name();
942 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
943 CHK_(ptr);
944 CHK_(::_pbi::VerifyUTF8(str, nullptr));
945 } else {
946 goto handle_unusual;
947 }
948 continue;
949 // string device_type = 2;
950 case 2:
951 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
952 auto str = _internal_mutable_device_type();
953 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
954 CHK_(ptr);
955 CHK_(::_pbi::VerifyUTF8(str, nullptr));
956 } else {
957 goto handle_unusual;
958 }
959 continue;
960 // int64 memory_limit = 4;
961 case 4:
962 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 32)) {
963 _impl_.memory_limit_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
964 CHK_(ptr);
965 } else {
966 goto handle_unusual;
967 }
968 continue;
969 // .tensorflow.DeviceLocality locality = 5;
970 case 5:
971 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 42)) {
972 ptr = ctx->ParseMessage(_internal_mutable_locality(), ptr);
973 CHK_(ptr);
974 } else {
975 goto handle_unusual;
976 }
977 continue;
978 // fixed64 incarnation = 6;
979 case 6:
980 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 49)) {
981 _impl_.incarnation_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::uint64_t>(ptr);
982 ptr += sizeof(::uint64_t);
983 } else {
984 goto handle_unusual;
985 }
986 continue;
987 // string physical_device_desc = 7;
988 case 7:
989 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 58)) {
990 auto str = _internal_mutable_physical_device_desc();
991 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
992 CHK_(ptr);
993 CHK_(::_pbi::VerifyUTF8(str, nullptr));
994 } else {
995 goto handle_unusual;
996 }
997 continue;
998 // int64 xla_global_id = 8;
999 case 8:
1000 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 64)) {
1001 _impl_.xla_global_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
1002 CHK_(ptr);
1003 } else {
1004 goto handle_unusual;
1005 }
1006 continue;
1007 default:
1008 goto handle_unusual;
1009 } // switch
1010 handle_unusual:
1011 if ((tag == 0) || ((tag & 7) == 4)) {
1012 CHK_(ptr);
1013 ctx->SetLastTag(tag);
1014 goto message_done;
1015 }
1016 ptr = UnknownFieldParse(
1017 tag,
1018 _internal_metadata_.mutable_unknown_fields<std::string>(),
1019 ptr, ctx);
1020 CHK_(ptr != nullptr);
1021 } // while
1022 message_done:
1023 return ptr;
1024 failure:
1025 ptr = nullptr;
1026 goto message_done;
1027 #undef CHK_
1028 }
1029
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const1030 ::uint8_t* DeviceAttributes::_InternalSerialize(
1031 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
1032 // @@protoc_insertion_point(serialize_to_array_start:tensorflow.DeviceAttributes)
1033 ::uint32_t cached_has_bits = 0;
1034 (void) cached_has_bits;
1035
1036 // string name = 1;
1037 if (!this->_internal_name().empty()) {
1038 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
1039 this->_internal_name().data(), static_cast<int>(this->_internal_name().length()),
1040 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
1041 "tensorflow.DeviceAttributes.name");
1042 target = stream->WriteStringMaybeAliased(
1043 1, this->_internal_name(), target);
1044 }
1045
1046 // string device_type = 2;
1047 if (!this->_internal_device_type().empty()) {
1048 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
1049 this->_internal_device_type().data(), static_cast<int>(this->_internal_device_type().length()),
1050 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
1051 "tensorflow.DeviceAttributes.device_type");
1052 target = stream->WriteStringMaybeAliased(
1053 2, this->_internal_device_type(), target);
1054 }
1055
1056 // int64 memory_limit = 4;
1057 if (this->_internal_memory_limit() != 0) {
1058 target = stream->EnsureSpace(target);
1059 target = ::_pbi::WireFormatLite::WriteInt64ToArray(4, this->_internal_memory_limit(), target);
1060 }
1061
1062 // .tensorflow.DeviceLocality locality = 5;
1063 if (this->_internal_has_locality()) {
1064 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
1065 InternalWriteMessage(5, _Internal::locality(this),
1066 _Internal::locality(this).GetCachedSize(), target, stream);
1067 }
1068
1069 // fixed64 incarnation = 6;
1070 if (this->_internal_incarnation() != 0) {
1071 target = stream->EnsureSpace(target);
1072 target = ::_pbi::WireFormatLite::WriteFixed64ToArray(6, this->_internal_incarnation(), target);
1073 }
1074
1075 // string physical_device_desc = 7;
1076 if (!this->_internal_physical_device_desc().empty()) {
1077 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
1078 this->_internal_physical_device_desc().data(), static_cast<int>(this->_internal_physical_device_desc().length()),
1079 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
1080 "tensorflow.DeviceAttributes.physical_device_desc");
1081 target = stream->WriteStringMaybeAliased(
1082 7, this->_internal_physical_device_desc(), target);
1083 }
1084
1085 // int64 xla_global_id = 8;
1086 if (this->_internal_xla_global_id() != 0) {
1087 target = stream->EnsureSpace(target);
1088 target = ::_pbi::WireFormatLite::WriteInt64ToArray(8, this->_internal_xla_global_id(), target);
1089 }
1090
1091 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
1092 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
1093 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
1094 }
1095 // @@protoc_insertion_point(serialize_to_array_end:tensorflow.DeviceAttributes)
1096 return target;
1097 }
1098
ByteSizeLong() const1099 size_t DeviceAttributes::ByteSizeLong() const {
1100 // @@protoc_insertion_point(message_byte_size_start:tensorflow.DeviceAttributes)
1101 size_t total_size = 0;
1102
1103 ::uint32_t cached_has_bits = 0;
1104 // Prevent compiler warnings about cached_has_bits being unused
1105 (void) cached_has_bits;
1106
1107 // string name = 1;
1108 if (!this->_internal_name().empty()) {
1109 total_size += 1 +
1110 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
1111 this->_internal_name());
1112 }
1113
1114 // string device_type = 2;
1115 if (!this->_internal_device_type().empty()) {
1116 total_size += 1 +
1117 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
1118 this->_internal_device_type());
1119 }
1120
1121 // string physical_device_desc = 7;
1122 if (!this->_internal_physical_device_desc().empty()) {
1123 total_size += 1 +
1124 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
1125 this->_internal_physical_device_desc());
1126 }
1127
1128 // .tensorflow.DeviceLocality locality = 5;
1129 if (this->_internal_has_locality()) {
1130 total_size += 1 +
1131 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
1132 *_impl_.locality_);
1133 }
1134
1135 // int64 memory_limit = 4;
1136 if (this->_internal_memory_limit() != 0) {
1137 total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_memory_limit());
1138 }
1139
1140 // fixed64 incarnation = 6;
1141 if (this->_internal_incarnation() != 0) {
1142 total_size += 1 + 8;
1143 }
1144
1145 // int64 xla_global_id = 8;
1146 if (this->_internal_xla_global_id() != 0) {
1147 total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_xla_global_id());
1148 }
1149
1150 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
1151 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
1152 }
1153 int cached_size = ::_pbi::ToCachedSize(total_size);
1154 SetCachedSize(cached_size);
1155 return total_size;
1156 }
1157
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)1158 void DeviceAttributes::CheckTypeAndMergeFrom(
1159 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
1160 MergeFrom(*::_pbi::DownCast<const DeviceAttributes*>(
1161 &from));
1162 }
1163
MergeFrom(const DeviceAttributes & from)1164 void DeviceAttributes::MergeFrom(const DeviceAttributes& from) {
1165 DeviceAttributes* const _this = this;
1166 // @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.DeviceAttributes)
1167 GOOGLE_DCHECK_NE(&from, _this);
1168 ::uint32_t cached_has_bits = 0;
1169 (void) cached_has_bits;
1170
1171 if (!from._internal_name().empty()) {
1172 _this->_internal_set_name(from._internal_name());
1173 }
1174 if (!from._internal_device_type().empty()) {
1175 _this->_internal_set_device_type(from._internal_device_type());
1176 }
1177 if (!from._internal_physical_device_desc().empty()) {
1178 _this->_internal_set_physical_device_desc(from._internal_physical_device_desc());
1179 }
1180 if (from._internal_has_locality()) {
1181 _this->_internal_mutable_locality()->::tensorflow::DeviceLocality::MergeFrom(
1182 from._internal_locality());
1183 }
1184 if (from._internal_memory_limit() != 0) {
1185 _this->_internal_set_memory_limit(from._internal_memory_limit());
1186 }
1187 if (from._internal_incarnation() != 0) {
1188 _this->_internal_set_incarnation(from._internal_incarnation());
1189 }
1190 if (from._internal_xla_global_id() != 0) {
1191 _this->_internal_set_xla_global_id(from._internal_xla_global_id());
1192 }
1193 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
1194 }
1195
CopyFrom(const DeviceAttributes & from)1196 void DeviceAttributes::CopyFrom(const DeviceAttributes& from) {
1197 // @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.DeviceAttributes)
1198 if (&from == this) return;
1199 Clear();
1200 MergeFrom(from);
1201 }
1202
IsInitialized() const1203 bool DeviceAttributes::IsInitialized() const {
1204 return true;
1205 }
1206
InternalSwap(DeviceAttributes * other)1207 void DeviceAttributes::InternalSwap(DeviceAttributes* other) {
1208 using std::swap;
1209 auto* lhs_arena = GetArenaForAllocation();
1210 auto* rhs_arena = other->GetArenaForAllocation();
1211 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
1212 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
1213 &_impl_.name_, lhs_arena,
1214 &other->_impl_.name_, rhs_arena
1215 );
1216 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
1217 &_impl_.device_type_, lhs_arena,
1218 &other->_impl_.device_type_, rhs_arena
1219 );
1220 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
1221 &_impl_.physical_device_desc_, lhs_arena,
1222 &other->_impl_.physical_device_desc_, rhs_arena
1223 );
1224 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
1225 PROTOBUF_FIELD_OFFSET(DeviceAttributes, _impl_.xla_global_id_)
1226 + sizeof(DeviceAttributes::_impl_.xla_global_id_) // NOLINT
1227 - PROTOBUF_FIELD_OFFSET(DeviceAttributes, _impl_.locality_)>(
1228 reinterpret_cast<char*>(&_impl_.locality_),
1229 reinterpret_cast<char*>(&other->_impl_.locality_));
1230 }
1231
GetTypeName() const1232 std::string DeviceAttributes::GetTypeName() const {
1233 return "tensorflow.DeviceAttributes";
1234 }
1235
1236
1237 // @@protoc_insertion_point(namespace_scope)
1238 } // namespace tensorflow
1239 PROTOBUF_NAMESPACE_OPEN
1240 template<> PROTOBUF_NOINLINE ::tensorflow::InterconnectLink*
CreateMaybeMessage(Arena * arena)1241 Arena::CreateMaybeMessage< ::tensorflow::InterconnectLink >(Arena* arena) {
1242 return Arena::CreateMessageInternal< ::tensorflow::InterconnectLink >(arena);
1243 }
1244 template<> PROTOBUF_NOINLINE ::tensorflow::LocalLinks*
CreateMaybeMessage(Arena * arena)1245 Arena::CreateMaybeMessage< ::tensorflow::LocalLinks >(Arena* arena) {
1246 return Arena::CreateMessageInternal< ::tensorflow::LocalLinks >(arena);
1247 }
1248 template<> PROTOBUF_NOINLINE ::tensorflow::DeviceLocality*
CreateMaybeMessage(Arena * arena)1249 Arena::CreateMaybeMessage< ::tensorflow::DeviceLocality >(Arena* arena) {
1250 return Arena::CreateMessageInternal< ::tensorflow::DeviceLocality >(arena);
1251 }
1252 template<> PROTOBUF_NOINLINE ::tensorflow::DeviceAttributes*
CreateMaybeMessage(Arena * arena)1253 Arena::CreateMaybeMessage< ::tensorflow::DeviceAttributes >(Arena* arena) {
1254 return Arena::CreateMessageInternal< ::tensorflow::DeviceAttributes >(arena);
1255 }
1256 PROTOBUF_NAMESPACE_CLOSE
1257
1258 // @@protoc_insertion_point(global_scope)
1259 #include <google/protobuf/port_undef.inc>
1260