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
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>
18extern PROTOBUF_INTERNAL_EXPORT_tensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_DeviceLocality_tensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto;
19extern PROTOBUF_INTERNAL_EXPORT_tensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_InterconnectLink_tensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto;
20extern PROTOBUF_INTERNAL_EXPORT_tensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_LocalLinks_tensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto;
21namespace tensorflow {
22class InterconnectLinkDefaultTypeInternal {
23 public:
24 ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<InterconnectLink> _instance;
25} _InterconnectLink_default_instance_;
26class LocalLinksDefaultTypeInternal {
27 public:
28 ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<LocalLinks> _instance;
29} _LocalLinks_default_instance_;
30class DeviceLocalityDefaultTypeInternal {
31 public:
32 ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<DeviceLocality> _instance;
33} _DeviceLocality_default_instance_;
34class DeviceAttributesDefaultTypeInternal {
35 public:
36 ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<DeviceAttributes> _instance;
37} _DeviceAttributes_default_instance_;
38} // namespace tensorflow
39static void InitDefaultsscc_info_DeviceAttributes_tensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto() {
40 GOOGLE_PROTOBUF_VERIFY_VERSION;
41
42 {
43 void* ptr = &::tensorflow::_DeviceAttributes_default_instance_;
44 new (ptr) ::tensorflow::DeviceAttributes();
45 ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
46 }
47 ::tensorflow::DeviceAttributes::InitAsDefaultInstance();
48}
49
50::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_DeviceAttributes_tensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto =
51 {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsscc_info_DeviceAttributes_tensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto}, {
52 &scc_info_DeviceLocality_tensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto.base,}};
53
54static void InitDefaultsscc_info_DeviceLocality_tensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto() {
55 GOOGLE_PROTOBUF_VERIFY_VERSION;
56
57 {
58 void* ptr = &::tensorflow::_DeviceLocality_default_instance_;
59 new (ptr) ::tensorflow::DeviceLocality();
60 ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
61 }
62 ::tensorflow::DeviceLocality::InitAsDefaultInstance();
63}
64
65::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_DeviceLocality_tensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto =
66 {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsscc_info_DeviceLocality_tensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto}, {
67 &scc_info_LocalLinks_tensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto.base,}};
68
69static void InitDefaultsscc_info_InterconnectLink_tensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto() {
70 GOOGLE_PROTOBUF_VERIFY_VERSION;
71
72 {
73 void* ptr = &::tensorflow::_InterconnectLink_default_instance_;
74 new (ptr) ::tensorflow::InterconnectLink();
75 ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
76 }
77 ::tensorflow::InterconnectLink::InitAsDefaultInstance();
78}
79
80::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_InterconnectLink_tensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto =
81 {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_InterconnectLink_tensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto}, {}};
82
83static void InitDefaultsscc_info_LocalLinks_tensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto() {
84 GOOGLE_PROTOBUF_VERIFY_VERSION;
85
86 {
87 void* ptr = &::tensorflow::_LocalLinks_default_instance_;
88 new (ptr) ::tensorflow::LocalLinks();
89 ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
90 }
91 ::tensorflow::LocalLinks::InitAsDefaultInstance();
92}
93
94::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_LocalLinks_tensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto =
95 {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsscc_info_LocalLinks_tensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto}, {
96 &scc_info_InterconnectLink_tensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto.base,}};
97
98static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_tensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto[4];
99static constexpr ::PROTOBUF_NAMESPACE_ID::EnumDescriptor const** file_level_enum_descriptors_tensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto = nullptr;
100static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_tensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto = nullptr;
101
102const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_tensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
103 ~0u, // no _has_bits_
104 PROTOBUF_FIELD_OFFSET(::tensorflow::InterconnectLink, _internal_metadata_),
105 ~0u, // no _extensions_
106 ~0u, // no _oneof_case_
107 ~0u, // no _weak_field_map_
108 PROTOBUF_FIELD_OFFSET(::tensorflow::InterconnectLink, device_id_),
109 PROTOBUF_FIELD_OFFSET(::tensorflow::InterconnectLink, type_),
110 PROTOBUF_FIELD_OFFSET(::tensorflow::InterconnectLink, strength_),
111 ~0u, // no _has_bits_
112 PROTOBUF_FIELD_OFFSET(::tensorflow::LocalLinks, _internal_metadata_),
113 ~0u, // no _extensions_
114 ~0u, // no _oneof_case_
115 ~0u, // no _weak_field_map_
116 PROTOBUF_FIELD_OFFSET(::tensorflow::LocalLinks, link_),
117 ~0u, // no _has_bits_
118 PROTOBUF_FIELD_OFFSET(::tensorflow::DeviceLocality, _internal_metadata_),
119 ~0u, // no _extensions_
120 ~0u, // no _oneof_case_
121 ~0u, // no _weak_field_map_
122 PROTOBUF_FIELD_OFFSET(::tensorflow::DeviceLocality, bus_id_),
123 PROTOBUF_FIELD_OFFSET(::tensorflow::DeviceLocality, numa_node_),
124 PROTOBUF_FIELD_OFFSET(::tensorflow::DeviceLocality, links_),
125 ~0u, // no _has_bits_
126 PROTOBUF_FIELD_OFFSET(::tensorflow::DeviceAttributes, _internal_metadata_),
127 ~0u, // no _extensions_
128 ~0u, // no _oneof_case_
129 ~0u, // no _weak_field_map_
130 PROTOBUF_FIELD_OFFSET(::tensorflow::DeviceAttributes, name_),
131 PROTOBUF_FIELD_OFFSET(::tensorflow::DeviceAttributes, device_type_),
132 PROTOBUF_FIELD_OFFSET(::tensorflow::DeviceAttributes, memory_limit_),
133 PROTOBUF_FIELD_OFFSET(::tensorflow::DeviceAttributes, locality_),
134 PROTOBUF_FIELD_OFFSET(::tensorflow::DeviceAttributes, incarnation_),
135 PROTOBUF_FIELD_OFFSET(::tensorflow::DeviceAttributes, physical_device_desc_),
136 PROTOBUF_FIELD_OFFSET(::tensorflow::DeviceAttributes, xla_global_id_),
137};
138static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
139 { 0, -1, sizeof(::tensorflow::InterconnectLink)},
140 { 8, -1, sizeof(::tensorflow::LocalLinks)},
141 { 14, -1, sizeof(::tensorflow::DeviceLocality)},
142 { 22, -1, sizeof(::tensorflow::DeviceAttributes)},
143};
144
145static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = {
146 reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::tensorflow::_InterconnectLink_default_instance_),
147 reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::tensorflow::_LocalLinks_default_instance_),
148 reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::tensorflow::_DeviceLocality_default_instance_),
149 reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::tensorflow::_DeviceAttributes_default_instance_),
150};
151
152const char descriptor_table_protodef_tensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
153 "\n1tensorflow/core/framework/device_attri"
154 "butes.proto\022\ntensorflow\"E\n\020InterconnectL"
155 "ink\022\021\n\tdevice_id\030\001 \001(\005\022\014\n\004type\030\002 \001(\t\022\020\n\010"
156 "strength\030\003 \001(\005\"8\n\nLocalLinks\022*\n\004link\030\001 \003"
157 "(\0132\034.tensorflow.InterconnectLink\"Z\n\016Devi"
158 "ceLocality\022\016\n\006bus_id\030\001 \001(\005\022\021\n\tnuma_node\030"
159 "\002 \001(\005\022%\n\005links\030\003 \001(\0132\026.tensorflow.LocalL"
160 "inks\"\303\001\n\020DeviceAttributes\022\014\n\004name\030\001 \001(\t\022"
161 "\023\n\013device_type\030\002 \001(\t\022\024\n\014memory_limit\030\004 \001"
162 "(\003\022,\n\010locality\030\005 \001(\0132\032.tensorflow.Device"
163 "Locality\022\023\n\013incarnation\030\006 \001(\006\022\034\n\024physica"
164 "l_device_desc\030\007 \001(\t\022\025\n\rxla_global_id\030\010 \001"
165 "(\003B\221\001\n\030org.tensorflow.frameworkB\026DeviceA"
166 "ttributesProtosP\001ZXgithub.com/tensorflow"
167 "/tensorflow/tensorflow/go/core/framework"
168 "/device_attributes_go_proto\370\001\001b\006proto3"
169 ;
170static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_tensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto_deps[1] = {
171};
172static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_tensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto_sccs[4] = {
173 &scc_info_DeviceAttributes_tensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto.base,
174 &scc_info_DeviceLocality_tensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto.base,
175 &scc_info_InterconnectLink_tensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto.base,
176 &scc_info_LocalLinks_tensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto.base,
177};
178static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_tensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto_once;
179static bool descriptor_table_tensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto_initialized = false;
180const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_tensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto = {
181 &descriptor_table_tensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto_initialized, descriptor_table_protodef_tensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto, "tensorflow/core/framework/device_attributes.proto", 638,
182 &descriptor_table_tensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto_once, descriptor_table_tensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto_sccs, descriptor_table_tensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto_deps, 4, 0,
183 schemas, file_default_instances, TableStruct_tensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto::offsets,
184 file_level_metadata_tensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto, 4, file_level_enum_descriptors_tensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto, file_level_service_descriptors_tensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto,
185};
186
187// Force running AddDescriptors() at dynamic initialization time.
188static bool dynamic_init_dummy_tensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto = ( ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptors(&descriptor_table_tensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto), true);
189namespace tensorflow {
190
191// ===================================================================
192
193void InterconnectLink::InitAsDefaultInstance() {
194}
195class InterconnectLink::_Internal {
196 public:
197};
198
199InterconnectLink::InterconnectLink()
200 : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
201 SharedCtor();
202 // @@protoc_insertion_point(constructor:tensorflow.InterconnectLink)
203}
204InterconnectLink::InterconnectLink(::PROTOBUF_NAMESPACE_ID::Arena* arena)
205 : ::PROTOBUF_NAMESPACE_ID::Message(),
206 _internal_metadata_(arena) {
207 SharedCtor();
208 RegisterArenaDtor(arena);
209 // @@protoc_insertion_point(arena_constructor:tensorflow.InterconnectLink)
210}
211InterconnectLink::InterconnectLink(const InterconnectLink& from)
212 : ::PROTOBUF_NAMESPACE_ID::Message(),
213 _internal_metadata_(nullptr) {
214 _internal_metadata_.MergeFrom(from._internal_metadata_);
215 type_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
216 if (!from.type().empty()) {
217 type_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.type(),
218 GetArenaNoVirtual());
219 }
220 ::memcpy(&device_id_, &from.device_id_,
221 static_cast<size_t>(reinterpret_cast<char*>(&strength_) -
222 reinterpret_cast<char*>(&device_id_)) + sizeof(strength_));
223 // @@protoc_insertion_point(copy_constructor:tensorflow.InterconnectLink)
224}
225
226void InterconnectLink::SharedCtor() {
227 ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_InterconnectLink_tensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto.base);
228 type_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
229 ::memset(&device_id_, 0, static_cast<size_t>(
230 reinterpret_cast<char*>(&strength_) -
231 reinterpret_cast<char*>(&device_id_)) + sizeof(strength_));
232}
233
234InterconnectLink::~InterconnectLink() {
235 // @@protoc_insertion_point(destructor:tensorflow.InterconnectLink)
236 SharedDtor();
237}
238
239void InterconnectLink::SharedDtor() {
240 GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr);
241 type_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
242}
243
244void InterconnectLink::ArenaDtor(void* object) {
245 InterconnectLink* _this = reinterpret_cast< InterconnectLink* >(object);
246 (void)_this;
247}
248void InterconnectLink::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
249}
250void InterconnectLink::SetCachedSize(int size) const {
251 _cached_size_.Set(size);
252}
253const InterconnectLink& InterconnectLink::default_instance() {
254 ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_InterconnectLink_tensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto.base);
255 return *internal_default_instance();
256}
257
258
259void InterconnectLink::Clear() {
260// @@protoc_insertion_point(message_clear_start:tensorflow.InterconnectLink)
261 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
262 // Prevent compiler warnings about cached_has_bits being unused
263 (void) cached_has_bits;
264
265 type_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
266 ::memset(&device_id_, 0, static_cast<size_t>(
267 reinterpret_cast<char*>(&strength_) -
268 reinterpret_cast<char*>(&device_id_)) + sizeof(strength_));
269 _internal_metadata_.Clear();
270}
271
272#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
273const char* InterconnectLink::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
274#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
275 ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena;
276 while (!ctx->Done(&ptr)) {
277 ::PROTOBUF_NAMESPACE_ID::uint32 tag;
278 ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
279 CHK_(ptr);
280 switch (tag >> 3) {
281 // int32 device_id = 1;
282 case 1:
283 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
284 device_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
285 CHK_(ptr);
286 } else goto handle_unusual;
287 continue;
288 // string type = 2;
289 case 2:
290 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
291 ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_type(), ptr, ctx, "tensorflow.InterconnectLink.type");
292 CHK_(ptr);
293 } else goto handle_unusual;
294 continue;
295 // int32 strength = 3;
296 case 3:
297 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) {
298 strength_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
299 CHK_(ptr);
300 } else goto handle_unusual;
301 continue;
302 default: {
303 handle_unusual:
304 if ((tag & 7) == 4 || tag == 0) {
305 ctx->SetLastTag(tag);
306 goto success;
307 }
308 ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
309 CHK_(ptr != nullptr);
310 continue;
311 }
312 } // switch
313 } // while
314success:
315 return ptr;
316failure:
317 ptr = nullptr;
318 goto success;
319#undef CHK_
320}
321#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
322bool InterconnectLink::MergePartialFromCodedStream(
323 ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) {
324#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure
325 ::PROTOBUF_NAMESPACE_ID::uint32 tag;
326 // @@protoc_insertion_point(parse_start:tensorflow.InterconnectLink)
327 for (;;) {
328 ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
329 tag = p.first;
330 if (!p.second) goto handle_unusual;
331 switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) {
332 // int32 device_id = 1;
333 case 1: {
334 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (8 & 0xFF)) {
335
336 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
337 ::PROTOBUF_NAMESPACE_ID::int32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT32>(
338 input, &device_id_)));
339 } else {
340 goto handle_unusual;
341 }
342 break;
343 }
344
345 // string type = 2;
346 case 2: {
347 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) {
348 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
349 input, this->mutable_type()));
350 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
351 this->type().data(), static_cast<int>(this->type().length()),
352 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE,
353 "tensorflow.InterconnectLink.type"));
354 } else {
355 goto handle_unusual;
356 }
357 break;
358 }
359
360 // int32 strength = 3;
361 case 3: {
362 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (24 & 0xFF)) {
363
364 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
365 ::PROTOBUF_NAMESPACE_ID::int32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT32>(
366 input, &strength_)));
367 } else {
368 goto handle_unusual;
369 }
370 break;
371 }
372
373 default: {
374 handle_unusual:
375 if (tag == 0) {
376 goto success;
377 }
378 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField(
379 input, tag, _internal_metadata_.mutable_unknown_fields()));
380 break;
381 }
382 }
383 }
384success:
385 // @@protoc_insertion_point(parse_success:tensorflow.InterconnectLink)
386 return true;
387failure:
388 // @@protoc_insertion_point(parse_failure:tensorflow.InterconnectLink)
389 return false;
390#undef DO_
391}
392#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
393
394void InterconnectLink::SerializeWithCachedSizes(
395 ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const {
396 // @@protoc_insertion_point(serialize_start:tensorflow.InterconnectLink)
397 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
398 (void) cached_has_bits;
399
400 // int32 device_id = 1;
401 if (this->device_id() != 0) {
402 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32(1, this->device_id(), output);
403 }
404
405 // string type = 2;
406 if (this->type().size() > 0) {
407 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
408 this->type().data(), static_cast<int>(this->type().length()),
409 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
410 "tensorflow.InterconnectLink.type");
411 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased(
412 2, this->type(), output);
413 }
414
415 // int32 strength = 3;
416 if (this->strength() != 0) {
417 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32(3, this->strength(), output);
418 }
419
420 if (_internal_metadata_.have_unknown_fields()) {
421 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields(
422 _internal_metadata_.unknown_fields(), output);
423 }
424 // @@protoc_insertion_point(serialize_end:tensorflow.InterconnectLink)
425}
426
427::PROTOBUF_NAMESPACE_ID::uint8* InterconnectLink::InternalSerializeWithCachedSizesToArray(
428 ::PROTOBUF_NAMESPACE_ID::uint8* target) const {
429 // @@protoc_insertion_point(serialize_to_array_start:tensorflow.InterconnectLink)
430 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
431 (void) cached_has_bits;
432
433 // int32 device_id = 1;
434 if (this->device_id() != 0) {
435 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(1, this->device_id(), target);
436 }
437
438 // string type = 2;
439 if (this->type().size() > 0) {
440 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
441 this->type().data(), static_cast<int>(this->type().length()),
442 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
443 "tensorflow.InterconnectLink.type");
444 target =
445 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray(
446 2, this->type(), target);
447 }
448
449 // int32 strength = 3;
450 if (this->strength() != 0) {
451 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(3, this->strength(), target);
452 }
453
454 if (_internal_metadata_.have_unknown_fields()) {
455 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray(
456 _internal_metadata_.unknown_fields(), target);
457 }
458 // @@protoc_insertion_point(serialize_to_array_end:tensorflow.InterconnectLink)
459 return target;
460}
461
462size_t InterconnectLink::ByteSizeLong() const {
463// @@protoc_insertion_point(message_byte_size_start:tensorflow.InterconnectLink)
464 size_t total_size = 0;
465
466 if (_internal_metadata_.have_unknown_fields()) {
467 total_size +=
468 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize(
469 _internal_metadata_.unknown_fields());
470 }
471 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
472 // Prevent compiler warnings about cached_has_bits being unused
473 (void) cached_has_bits;
474
475 // string type = 2;
476 if (this->type().size() > 0) {
477 total_size += 1 +
478 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
479 this->type());
480 }
481
482 // int32 device_id = 1;
483 if (this->device_id() != 0) {
484 total_size += 1 +
485 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
486 this->device_id());
487 }
488
489 // int32 strength = 3;
490 if (this->strength() != 0) {
491 total_size += 1 +
492 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
493 this->strength());
494 }
495
496 int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
497 SetCachedSize(cached_size);
498 return total_size;
499}
500
501void InterconnectLink::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
502// @@protoc_insertion_point(generalized_merge_from_start:tensorflow.InterconnectLink)
503 GOOGLE_DCHECK_NE(&from, this);
504 const InterconnectLink* source =
505 ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<InterconnectLink>(
506 &from);
507 if (source == nullptr) {
508 // @@protoc_insertion_point(generalized_merge_from_cast_fail:tensorflow.InterconnectLink)
509 ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
510 } else {
511 // @@protoc_insertion_point(generalized_merge_from_cast_success:tensorflow.InterconnectLink)
512 MergeFrom(*source);
513 }
514}
515
516void InterconnectLink::MergeFrom(const InterconnectLink& from) {
517// @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.InterconnectLink)
518 GOOGLE_DCHECK_NE(&from, this);
519 _internal_metadata_.MergeFrom(from._internal_metadata_);
520 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
521 (void) cached_has_bits;
522
523 if (from.type().size() > 0) {
524 set_type(from.type());
525 }
526 if (from.device_id() != 0) {
527 set_device_id(from.device_id());
528 }
529 if (from.strength() != 0) {
530 set_strength(from.strength());
531 }
532}
533
534void InterconnectLink::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
535// @@protoc_insertion_point(generalized_copy_from_start:tensorflow.InterconnectLink)
536 if (&from == this) return;
537 Clear();
538 MergeFrom(from);
539}
540
541void InterconnectLink::CopyFrom(const InterconnectLink& from) {
542// @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.InterconnectLink)
543 if (&from == this) return;
544 Clear();
545 MergeFrom(from);
546}
547
548bool InterconnectLink::IsInitialized() const {
549 return true;
550}
551
552void InterconnectLink::InternalSwap(InterconnectLink* other) {
553 using std::swap;
554 _internal_metadata_.Swap(&other->_internal_metadata_);
555 type_.Swap(&other->type_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
556 GetArenaNoVirtual());
557 swap(device_id_, other->device_id_);
558 swap(strength_, other->strength_);
559}
560
561::PROTOBUF_NAMESPACE_ID::Metadata InterconnectLink::GetMetadata() const {
562 return GetMetadataStatic();
563}
564
565
566// ===================================================================
567
568void LocalLinks::InitAsDefaultInstance() {
569}
570class LocalLinks::_Internal {
571 public:
572};
573
574LocalLinks::LocalLinks()
575 : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
576 SharedCtor();
577 // @@protoc_insertion_point(constructor:tensorflow.LocalLinks)
578}
579LocalLinks::LocalLinks(::PROTOBUF_NAMESPACE_ID::Arena* arena)
580 : ::PROTOBUF_NAMESPACE_ID::Message(),
581 _internal_metadata_(arena),
582 link_(arena) {
583 SharedCtor();
584 RegisterArenaDtor(arena);
585 // @@protoc_insertion_point(arena_constructor:tensorflow.LocalLinks)
586}
587LocalLinks::LocalLinks(const LocalLinks& from)
588 : ::PROTOBUF_NAMESPACE_ID::Message(),
589 _internal_metadata_(nullptr),
590 link_(from.link_) {
591 _internal_metadata_.MergeFrom(from._internal_metadata_);
592 // @@protoc_insertion_point(copy_constructor:tensorflow.LocalLinks)
593}
594
595void LocalLinks::SharedCtor() {
596 ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_LocalLinks_tensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto.base);
597}
598
599LocalLinks::~LocalLinks() {
600 // @@protoc_insertion_point(destructor:tensorflow.LocalLinks)
601 SharedDtor();
602}
603
604void LocalLinks::SharedDtor() {
605 GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr);
606}
607
608void LocalLinks::ArenaDtor(void* object) {
609 LocalLinks* _this = reinterpret_cast< LocalLinks* >(object);
610 (void)_this;
611}
612void LocalLinks::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
613}
614void LocalLinks::SetCachedSize(int size) const {
615 _cached_size_.Set(size);
616}
617const LocalLinks& LocalLinks::default_instance() {
618 ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_LocalLinks_tensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto.base);
619 return *internal_default_instance();
620}
621
622
623void LocalLinks::Clear() {
624// @@protoc_insertion_point(message_clear_start:tensorflow.LocalLinks)
625 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
626 // Prevent compiler warnings about cached_has_bits being unused
627 (void) cached_has_bits;
628
629 link_.Clear();
630 _internal_metadata_.Clear();
631}
632
633#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
634const char* LocalLinks::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
635#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
636 ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena;
637 while (!ctx->Done(&ptr)) {
638 ::PROTOBUF_NAMESPACE_ID::uint32 tag;
639 ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
640 CHK_(ptr);
641 switch (tag >> 3) {
642 // repeated .tensorflow.InterconnectLink link = 1;
643 case 1:
644 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
645 ptr -= 1;
646 do {
647 ptr += 1;
648 ptr = ctx->ParseMessage(add_link(), ptr);
649 CHK_(ptr);
650 if (!ctx->DataAvailable(ptr)) break;
651 } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 10);
652 } else goto handle_unusual;
653 continue;
654 default: {
655 handle_unusual:
656 if ((tag & 7) == 4 || tag == 0) {
657 ctx->SetLastTag(tag);
658 goto success;
659 }
660 ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
661 CHK_(ptr != nullptr);
662 continue;
663 }
664 } // switch
665 } // while
666success:
667 return ptr;
668failure:
669 ptr = nullptr;
670 goto success;
671#undef CHK_
672}
673#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
674bool LocalLinks::MergePartialFromCodedStream(
675 ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) {
676#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure
677 ::PROTOBUF_NAMESPACE_ID::uint32 tag;
678 // @@protoc_insertion_point(parse_start:tensorflow.LocalLinks)
679 for (;;) {
680 ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
681 tag = p.first;
682 if (!p.second) goto handle_unusual;
683 switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) {
684 // repeated .tensorflow.InterconnectLink link = 1;
685 case 1: {
686 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) {
687 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
688 input, add_link()));
689 } else {
690 goto handle_unusual;
691 }
692 break;
693 }
694
695 default: {
696 handle_unusual:
697 if (tag == 0) {
698 goto success;
699 }
700 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField(
701 input, tag, _internal_metadata_.mutable_unknown_fields()));
702 break;
703 }
704 }
705 }
706success:
707 // @@protoc_insertion_point(parse_success:tensorflow.LocalLinks)
708 return true;
709failure:
710 // @@protoc_insertion_point(parse_failure:tensorflow.LocalLinks)
711 return false;
712#undef DO_
713}
714#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
715
716void LocalLinks::SerializeWithCachedSizes(
717 ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const {
718 // @@protoc_insertion_point(serialize_start:tensorflow.LocalLinks)
719 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
720 (void) cached_has_bits;
721
722 // repeated .tensorflow.InterconnectLink link = 1;
723 for (unsigned int i = 0,
724 n = static_cast<unsigned int>(this->link_size()); i < n; i++) {
725 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
726 1,
727 this->link(static_cast<int>(i)),
728 output);
729 }
730
731 if (_internal_metadata_.have_unknown_fields()) {
732 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields(
733 _internal_metadata_.unknown_fields(), output);
734 }
735 // @@protoc_insertion_point(serialize_end:tensorflow.LocalLinks)
736}
737
738::PROTOBUF_NAMESPACE_ID::uint8* LocalLinks::InternalSerializeWithCachedSizesToArray(
739 ::PROTOBUF_NAMESPACE_ID::uint8* target) const {
740 // @@protoc_insertion_point(serialize_to_array_start:tensorflow.LocalLinks)
741 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
742 (void) cached_has_bits;
743
744 // repeated .tensorflow.InterconnectLink link = 1;
745 for (unsigned int i = 0,
746 n = static_cast<unsigned int>(this->link_size()); i < n; i++) {
747 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
748 InternalWriteMessageToArray(
749 1, this->link(static_cast<int>(i)), target);
750 }
751
752 if (_internal_metadata_.have_unknown_fields()) {
753 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray(
754 _internal_metadata_.unknown_fields(), target);
755 }
756 // @@protoc_insertion_point(serialize_to_array_end:tensorflow.LocalLinks)
757 return target;
758}
759
760size_t LocalLinks::ByteSizeLong() const {
761// @@protoc_insertion_point(message_byte_size_start:tensorflow.LocalLinks)
762 size_t total_size = 0;
763
764 if (_internal_metadata_.have_unknown_fields()) {
765 total_size +=
766 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize(
767 _internal_metadata_.unknown_fields());
768 }
769 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
770 // Prevent compiler warnings about cached_has_bits being unused
771 (void) cached_has_bits;
772
773 // repeated .tensorflow.InterconnectLink link = 1;
774 {
775 unsigned int count = static_cast<unsigned int>(this->link_size());
776 total_size += 1UL * count;
777 for (unsigned int i = 0; i < count; i++) {
778 total_size +=
779 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
780 this->link(static_cast<int>(i)));
781 }
782 }
783
784 int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
785 SetCachedSize(cached_size);
786 return total_size;
787}
788
789void LocalLinks::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
790// @@protoc_insertion_point(generalized_merge_from_start:tensorflow.LocalLinks)
791 GOOGLE_DCHECK_NE(&from, this);
792 const LocalLinks* source =
793 ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<LocalLinks>(
794 &from);
795 if (source == nullptr) {
796 // @@protoc_insertion_point(generalized_merge_from_cast_fail:tensorflow.LocalLinks)
797 ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
798 } else {
799 // @@protoc_insertion_point(generalized_merge_from_cast_success:tensorflow.LocalLinks)
800 MergeFrom(*source);
801 }
802}
803
804void LocalLinks::MergeFrom(const LocalLinks& from) {
805// @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.LocalLinks)
806 GOOGLE_DCHECK_NE(&from, this);
807 _internal_metadata_.MergeFrom(from._internal_metadata_);
808 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
809 (void) cached_has_bits;
810
811 link_.MergeFrom(from.link_);
812}
813
814void LocalLinks::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
815// @@protoc_insertion_point(generalized_copy_from_start:tensorflow.LocalLinks)
816 if (&from == this) return;
817 Clear();
818 MergeFrom(from);
819}
820
821void LocalLinks::CopyFrom(const LocalLinks& from) {
822// @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.LocalLinks)
823 if (&from == this) return;
824 Clear();
825 MergeFrom(from);
826}
827
828bool LocalLinks::IsInitialized() const {
829 return true;
830}
831
832void LocalLinks::InternalSwap(LocalLinks* other) {
833 using std::swap;
834 _internal_metadata_.Swap(&other->_internal_metadata_);
835 CastToBase(&link_)->InternalSwap(CastToBase(&other->link_));
836}
837
838::PROTOBUF_NAMESPACE_ID::Metadata LocalLinks::GetMetadata() const {
839 return GetMetadataStatic();
840}
841
842
843// ===================================================================
844
845void DeviceLocality::InitAsDefaultInstance() {
846 ::tensorflow::_DeviceLocality_default_instance_._instance.get_mutable()->links_ = const_cast< ::tensorflow::LocalLinks*>(
847 ::tensorflow::LocalLinks::internal_default_instance());
848}
849class DeviceLocality::_Internal {
850 public:
851 static const ::tensorflow::LocalLinks& links(const DeviceLocality* msg);
852};
853
854const ::tensorflow::LocalLinks&
855DeviceLocality::_Internal::links(const DeviceLocality* msg) {
856 return *msg->links_;
857}
858void DeviceLocality::unsafe_arena_set_allocated_links(
859 ::tensorflow::LocalLinks* links) {
860 if (GetArenaNoVirtual() == nullptr) {
861 delete links_;
862 }
863 links_ = links;
864 if (links) {
865
866 } else {
867
868 }
869 // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.DeviceLocality.links)
870}
871DeviceLocality::DeviceLocality()
872 : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
873 SharedCtor();
874 // @@protoc_insertion_point(constructor:tensorflow.DeviceLocality)
875}
876DeviceLocality::DeviceLocality(::PROTOBUF_NAMESPACE_ID::Arena* arena)
877 : ::PROTOBUF_NAMESPACE_ID::Message(),
878 _internal_metadata_(arena) {
879 SharedCtor();
880 RegisterArenaDtor(arena);
881 // @@protoc_insertion_point(arena_constructor:tensorflow.DeviceLocality)
882}
883DeviceLocality::DeviceLocality(const DeviceLocality& from)
884 : ::PROTOBUF_NAMESPACE_ID::Message(),
885 _internal_metadata_(nullptr) {
886 _internal_metadata_.MergeFrom(from._internal_metadata_);
887 if (from.has_links()) {
888 links_ = new ::tensorflow::LocalLinks(*from.links_);
889 } else {
890 links_ = nullptr;
891 }
892 ::memcpy(&bus_id_, &from.bus_id_,
893 static_cast<size_t>(reinterpret_cast<char*>(&numa_node_) -
894 reinterpret_cast<char*>(&bus_id_)) + sizeof(numa_node_));
895 // @@protoc_insertion_point(copy_constructor:tensorflow.DeviceLocality)
896}
897
898void DeviceLocality::SharedCtor() {
899 ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_DeviceLocality_tensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto.base);
900 ::memset(&links_, 0, static_cast<size_t>(
901 reinterpret_cast<char*>(&numa_node_) -
902 reinterpret_cast<char*>(&links_)) + sizeof(numa_node_));
903}
904
905DeviceLocality::~DeviceLocality() {
906 // @@protoc_insertion_point(destructor:tensorflow.DeviceLocality)
907 SharedDtor();
908}
909
910void DeviceLocality::SharedDtor() {
911 GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr);
912 if (this != internal_default_instance()) delete links_;
913}
914
915void DeviceLocality::ArenaDtor(void* object) {
916 DeviceLocality* _this = reinterpret_cast< DeviceLocality* >(object);
917 (void)_this;
918}
919void DeviceLocality::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
920}
921void DeviceLocality::SetCachedSize(int size) const {
922 _cached_size_.Set(size);
923}
924const DeviceLocality& DeviceLocality::default_instance() {
925 ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_DeviceLocality_tensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto.base);
926 return *internal_default_instance();
927}
928
929
930void DeviceLocality::Clear() {
931// @@protoc_insertion_point(message_clear_start:tensorflow.DeviceLocality)
932 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
933 // Prevent compiler warnings about cached_has_bits being unused
934 (void) cached_has_bits;
935
936 if (GetArenaNoVirtual() == nullptr && links_ != nullptr) {
937 delete links_;
938 }
939 links_ = nullptr;
940 ::memset(&bus_id_, 0, static_cast<size_t>(
941 reinterpret_cast<char*>(&numa_node_) -
942 reinterpret_cast<char*>(&bus_id_)) + sizeof(numa_node_));
943 _internal_metadata_.Clear();
944}
945
946#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
947const char* DeviceLocality::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
948#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
949 ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena;
950 while (!ctx->Done(&ptr)) {
951 ::PROTOBUF_NAMESPACE_ID::uint32 tag;
952 ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
953 CHK_(ptr);
954 switch (tag >> 3) {
955 // int32 bus_id = 1;
956 case 1:
957 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
958 bus_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
959 CHK_(ptr);
960 } else goto handle_unusual;
961 continue;
962 // int32 numa_node = 2;
963 case 2:
964 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
965 numa_node_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
966 CHK_(ptr);
967 } else goto handle_unusual;
968 continue;
969 // .tensorflow.LocalLinks links = 3;
970 case 3:
971 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) {
972 ptr = ctx->ParseMessage(mutable_links(), ptr);
973 CHK_(ptr);
974 } else goto handle_unusual;
975 continue;
976 default: {
977 handle_unusual:
978 if ((tag & 7) == 4 || tag == 0) {
979 ctx->SetLastTag(tag);
980 goto success;
981 }
982 ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
983 CHK_(ptr != nullptr);
984 continue;
985 }
986 } // switch
987 } // while
988success:
989 return ptr;
990failure:
991 ptr = nullptr;
992 goto success;
993#undef CHK_
994}
995#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
996bool DeviceLocality::MergePartialFromCodedStream(
997 ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) {
998#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure
999 ::PROTOBUF_NAMESPACE_ID::uint32 tag;
1000 // @@protoc_insertion_point(parse_start:tensorflow.DeviceLocality)
1001 for (;;) {
1002 ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
1003 tag = p.first;
1004 if (!p.second) goto handle_unusual;
1005 switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) {
1006 // int32 bus_id = 1;
1007 case 1: {
1008 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (8 & 0xFF)) {
1009
1010 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
1011 ::PROTOBUF_NAMESPACE_ID::int32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT32>(
1012 input, &bus_id_)));
1013 } else {
1014 goto handle_unusual;
1015 }
1016 break;
1017 }
1018
1019 // int32 numa_node = 2;
1020 case 2: {
1021 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (16 & 0xFF)) {
1022
1023 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
1024 ::PROTOBUF_NAMESPACE_ID::int32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT32>(
1025 input, &numa_node_)));
1026 } else {
1027 goto handle_unusual;
1028 }
1029 break;
1030 }
1031
1032 // .tensorflow.LocalLinks links = 3;
1033 case 3: {
1034 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (26 & 0xFF)) {
1035 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
1036 input, mutable_links()));
1037 } else {
1038 goto handle_unusual;
1039 }
1040 break;
1041 }
1042
1043 default: {
1044 handle_unusual:
1045 if (tag == 0) {
1046 goto success;
1047 }
1048 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField(
1049 input, tag, _internal_metadata_.mutable_unknown_fields()));
1050 break;
1051 }
1052 }
1053 }
1054success:
1055 // @@protoc_insertion_point(parse_success:tensorflow.DeviceLocality)
1056 return true;
1057failure:
1058 // @@protoc_insertion_point(parse_failure:tensorflow.DeviceLocality)
1059 return false;
1060#undef DO_
1061}
1062#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
1063
1064void DeviceLocality::SerializeWithCachedSizes(
1065 ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const {
1066 // @@protoc_insertion_point(serialize_start:tensorflow.DeviceLocality)
1067 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
1068 (void) cached_has_bits;
1069
1070 // int32 bus_id = 1;
1071 if (this->bus_id() != 0) {
1072 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32(1, this->bus_id(), output);
1073 }
1074
1075 // int32 numa_node = 2;
1076 if (this->numa_node() != 0) {
1077 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32(2, this->numa_node(), output);
1078 }
1079
1080 // .tensorflow.LocalLinks links = 3;
1081 if (this->has_links()) {
1082 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
1083 3, _Internal::links(this), output);
1084 }
1085
1086 if (_internal_metadata_.have_unknown_fields()) {
1087 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields(
1088 _internal_metadata_.unknown_fields(), output);
1089 }
1090 // @@protoc_insertion_point(serialize_end:tensorflow.DeviceLocality)
1091}
1092
1093::PROTOBUF_NAMESPACE_ID::uint8* DeviceLocality::InternalSerializeWithCachedSizesToArray(
1094 ::PROTOBUF_NAMESPACE_ID::uint8* target) const {
1095 // @@protoc_insertion_point(serialize_to_array_start:tensorflow.DeviceLocality)
1096 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
1097 (void) cached_has_bits;
1098
1099 // int32 bus_id = 1;
1100 if (this->bus_id() != 0) {
1101 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(1, this->bus_id(), target);
1102 }
1103
1104 // int32 numa_node = 2;
1105 if (this->numa_node() != 0) {
1106 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->numa_node(), target);
1107 }
1108
1109 // .tensorflow.LocalLinks links = 3;
1110 if (this->has_links()) {
1111 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
1112 InternalWriteMessageToArray(
1113 3, _Internal::links(this), target);
1114 }
1115
1116 if (_internal_metadata_.have_unknown_fields()) {
1117 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray(
1118 _internal_metadata_.unknown_fields(), target);
1119 }
1120 // @@protoc_insertion_point(serialize_to_array_end:tensorflow.DeviceLocality)
1121 return target;
1122}
1123
1124size_t DeviceLocality::ByteSizeLong() const {
1125// @@protoc_insertion_point(message_byte_size_start:tensorflow.DeviceLocality)
1126 size_t total_size = 0;
1127
1128 if (_internal_metadata_.have_unknown_fields()) {
1129 total_size +=
1130 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize(
1131 _internal_metadata_.unknown_fields());
1132 }
1133 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
1134 // Prevent compiler warnings about cached_has_bits being unused
1135 (void) cached_has_bits;
1136
1137 // .tensorflow.LocalLinks links = 3;
1138 if (this->has_links()) {
1139 total_size += 1 +
1140 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
1141 *links_);
1142 }
1143
1144 // int32 bus_id = 1;
1145 if (this->bus_id() != 0) {
1146 total_size += 1 +
1147 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
1148 this->bus_id());
1149 }
1150
1151 // int32 numa_node = 2;
1152 if (this->numa_node() != 0) {
1153 total_size += 1 +
1154 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
1155 this->numa_node());
1156 }
1157
1158 int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
1159 SetCachedSize(cached_size);
1160 return total_size;
1161}
1162
1163void DeviceLocality::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
1164// @@protoc_insertion_point(generalized_merge_from_start:tensorflow.DeviceLocality)
1165 GOOGLE_DCHECK_NE(&from, this);
1166 const DeviceLocality* source =
1167 ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<DeviceLocality>(
1168 &from);
1169 if (source == nullptr) {
1170 // @@protoc_insertion_point(generalized_merge_from_cast_fail:tensorflow.DeviceLocality)
1171 ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
1172 } else {
1173 // @@protoc_insertion_point(generalized_merge_from_cast_success:tensorflow.DeviceLocality)
1174 MergeFrom(*source);
1175 }
1176}
1177
1178void DeviceLocality::MergeFrom(const DeviceLocality& from) {
1179// @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.DeviceLocality)
1180 GOOGLE_DCHECK_NE(&from, this);
1181 _internal_metadata_.MergeFrom(from._internal_metadata_);
1182 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
1183 (void) cached_has_bits;
1184
1185 if (from.has_links()) {
1186 mutable_links()->::tensorflow::LocalLinks::MergeFrom(from.links());
1187 }
1188 if (from.bus_id() != 0) {
1189 set_bus_id(from.bus_id());
1190 }
1191 if (from.numa_node() != 0) {
1192 set_numa_node(from.numa_node());
1193 }
1194}
1195
1196void DeviceLocality::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
1197// @@protoc_insertion_point(generalized_copy_from_start:tensorflow.DeviceLocality)
1198 if (&from == this) return;
1199 Clear();
1200 MergeFrom(from);
1201}
1202
1203void DeviceLocality::CopyFrom(const DeviceLocality& from) {
1204// @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.DeviceLocality)
1205 if (&from == this) return;
1206 Clear();
1207 MergeFrom(from);
1208}
1209
1210bool DeviceLocality::IsInitialized() const {
1211 return true;
1212}
1213
1214void DeviceLocality::InternalSwap(DeviceLocality* other) {
1215 using std::swap;
1216 _internal_metadata_.Swap(&other->_internal_metadata_);
1217 swap(links_, other->links_);
1218 swap(bus_id_, other->bus_id_);
1219 swap(numa_node_, other->numa_node_);
1220}
1221
1222::PROTOBUF_NAMESPACE_ID::Metadata DeviceLocality::GetMetadata() const {
1223 return GetMetadataStatic();
1224}
1225
1226
1227// ===================================================================
1228
1229void DeviceAttributes::InitAsDefaultInstance() {
1230 ::tensorflow::_DeviceAttributes_default_instance_._instance.get_mutable()->locality_ = const_cast< ::tensorflow::DeviceLocality*>(
1231 ::tensorflow::DeviceLocality::internal_default_instance());
1232}
1233class DeviceAttributes::_Internal {
1234 public:
1235 static const ::tensorflow::DeviceLocality& locality(const DeviceAttributes* msg);
1236};
1237
1238const ::tensorflow::DeviceLocality&
1239DeviceAttributes::_Internal::locality(const DeviceAttributes* msg) {
1240 return *msg->locality_;
1241}
1242void DeviceAttributes::unsafe_arena_set_allocated_locality(
1243 ::tensorflow::DeviceLocality* locality) {
1244 if (GetArenaNoVirtual() == nullptr) {
1245 delete locality_;
1246 }
1247 locality_ = locality;
1248 if (locality) {
1249
1250 } else {
1251
1252 }
1253 // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.DeviceAttributes.locality)
1254}
1255DeviceAttributes::DeviceAttributes()
1256 : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
1257 SharedCtor();
1258 // @@protoc_insertion_point(constructor:tensorflow.DeviceAttributes)
1259}
1260DeviceAttributes::DeviceAttributes(::PROTOBUF_NAMESPACE_ID::Arena* arena)
1261 : ::PROTOBUF_NAMESPACE_ID::Message(),
1262 _internal_metadata_(arena) {
1263 SharedCtor();
1264 RegisterArenaDtor(arena);
1265 // @@protoc_insertion_point(arena_constructor:tensorflow.DeviceAttributes)
1266}
1267DeviceAttributes::DeviceAttributes(const DeviceAttributes& from)
1268 : ::PROTOBUF_NAMESPACE_ID::Message(),
1269 _internal_metadata_(nullptr) {
1270 _internal_metadata_.MergeFrom(from._internal_metadata_);
1271 name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
1272 if (!from.name().empty()) {
1273 name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name(),
1274 GetArenaNoVirtual());
1275 }
1276 device_type_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
1277 if (!from.device_type().empty()) {
1278 device_type_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.device_type(),
1279 GetArenaNoVirtual());
1280 }
1281 physical_device_desc_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
1282 if (!from.physical_device_desc().empty()) {
1283 physical_device_desc_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.physical_device_desc(),
1284 GetArenaNoVirtual());
1285 }
1286 if (from.has_locality()) {
1287 locality_ = new ::tensorflow::DeviceLocality(*from.locality_);
1288 } else {
1289 locality_ = nullptr;
1290 }
1291 ::memcpy(&memory_limit_, &from.memory_limit_,
1292 static_cast<size_t>(reinterpret_cast<char*>(&xla_global_id_) -
1293 reinterpret_cast<char*>(&memory_limit_)) + sizeof(xla_global_id_));
1294 // @@protoc_insertion_point(copy_constructor:tensorflow.DeviceAttributes)
1295}
1296
1297void DeviceAttributes::SharedCtor() {
1298 ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_DeviceAttributes_tensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto.base);
1299 name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
1300 device_type_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
1301 physical_device_desc_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
1302 ::memset(&locality_, 0, static_cast<size_t>(
1303 reinterpret_cast<char*>(&xla_global_id_) -
1304 reinterpret_cast<char*>(&locality_)) + sizeof(xla_global_id_));
1305}
1306
1307DeviceAttributes::~DeviceAttributes() {
1308 // @@protoc_insertion_point(destructor:tensorflow.DeviceAttributes)
1309 SharedDtor();
1310}
1311
1312void DeviceAttributes::SharedDtor() {
1313 GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr);
1314 name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
1315 device_type_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
1316 physical_device_desc_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
1317 if (this != internal_default_instance()) delete locality_;
1318}
1319
1320void DeviceAttributes::ArenaDtor(void* object) {
1321 DeviceAttributes* _this = reinterpret_cast< DeviceAttributes* >(object);
1322 (void)_this;
1323}
1324void DeviceAttributes::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
1325}
1326void DeviceAttributes::SetCachedSize(int size) const {
1327 _cached_size_.Set(size);
1328}
1329const DeviceAttributes& DeviceAttributes::default_instance() {
1330 ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_DeviceAttributes_tensorflow_2fcore_2fframework_2fdevice_5fattributes_2eproto.base);
1331 return *internal_default_instance();
1332}
1333
1334
1335void DeviceAttributes::Clear() {
1336// @@protoc_insertion_point(message_clear_start:tensorflow.DeviceAttributes)
1337 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
1338 // Prevent compiler warnings about cached_has_bits being unused
1339 (void) cached_has_bits;
1340
1341 name_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
1342 device_type_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
1343 physical_device_desc_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
1344 if (GetArenaNoVirtual() == nullptr && locality_ != nullptr) {
1345 delete locality_;
1346 }
1347 locality_ = nullptr;
1348 ::memset(&memory_limit_, 0, static_cast<size_t>(
1349 reinterpret_cast<char*>(&xla_global_id_) -
1350 reinterpret_cast<char*>(&memory_limit_)) + sizeof(xla_global_id_));
1351 _internal_metadata_.Clear();
1352}
1353
1354#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
1355const char* DeviceAttributes::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
1356#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
1357 ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena;
1358 while (!ctx->Done(&ptr)) {
1359 ::PROTOBUF_NAMESPACE_ID::uint32 tag;
1360 ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
1361 CHK_(ptr);
1362 switch (tag >> 3) {
1363 // string name = 1;
1364 case 1:
1365 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
1366 ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_name(), ptr, ctx, "tensorflow.DeviceAttributes.name");
1367 CHK_(ptr);
1368 } else goto handle_unusual;
1369 continue;
1370 // string device_type = 2;
1371 case 2:
1372 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
1373 ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_device_type(), ptr, ctx, "tensorflow.DeviceAttributes.device_type");
1374 CHK_(ptr);
1375 } else goto handle_unusual;
1376 continue;
1377 // int64 memory_limit = 4;
1378 case 4:
1379 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) {
1380 memory_limit_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
1381 CHK_(ptr);
1382 } else goto handle_unusual;
1383 continue;
1384 // .tensorflow.DeviceLocality locality = 5;
1385 case 5:
1386 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) {
1387 ptr = ctx->ParseMessage(mutable_locality(), ptr);
1388 CHK_(ptr);
1389 } else goto handle_unusual;
1390 continue;
1391 // fixed64 incarnation = 6;
1392 case 6:
1393 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 49)) {
1394 incarnation_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint64>(ptr);
1395 ptr += sizeof(::PROTOBUF_NAMESPACE_ID::uint64);
1396 } else goto handle_unusual;
1397 continue;
1398 // string physical_device_desc = 7;
1399 case 7:
1400 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 58)) {
1401 ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_physical_device_desc(), ptr, ctx, "tensorflow.DeviceAttributes.physical_device_desc");
1402 CHK_(ptr);
1403 } else goto handle_unusual;
1404 continue;
1405 // int64 xla_global_id = 8;
1406 case 8:
1407 if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 64)) {
1408 xla_global_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
1409 CHK_(ptr);
1410 } else goto handle_unusual;
1411 continue;
1412 default: {
1413 handle_unusual:
1414 if ((tag & 7) == 4 || tag == 0) {
1415 ctx->SetLastTag(tag);
1416 goto success;
1417 }
1418 ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
1419 CHK_(ptr != nullptr);
1420 continue;
1421 }
1422 } // switch
1423 } // while
1424success:
1425 return ptr;
1426failure:
1427 ptr = nullptr;
1428 goto success;
1429#undef CHK_
1430}
1431#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
1432bool DeviceAttributes::MergePartialFromCodedStream(
1433 ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) {
1434#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure
1435 ::PROTOBUF_NAMESPACE_ID::uint32 tag;
1436 // @@protoc_insertion_point(parse_start:tensorflow.DeviceAttributes)
1437 for (;;) {
1438 ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
1439 tag = p.first;
1440 if (!p.second) goto handle_unusual;
1441 switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) {
1442 // string name = 1;
1443 case 1: {
1444 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) {
1445 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
1446 input, this->mutable_name()));
1447 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
1448 this->name().data(), static_cast<int>(this->name().length()),
1449 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE,
1450 "tensorflow.DeviceAttributes.name"));
1451 } else {
1452 goto handle_unusual;
1453 }
1454 break;
1455 }
1456
1457 // string device_type = 2;
1458 case 2: {
1459 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) {
1460 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
1461 input, this->mutable_device_type()));
1462 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
1463 this->device_type().data(), static_cast<int>(this->device_type().length()),
1464 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE,
1465 "tensorflow.DeviceAttributes.device_type"));
1466 } else {
1467 goto handle_unusual;
1468 }
1469 break;
1470 }
1471
1472 // int64 memory_limit = 4;
1473 case 4: {
1474 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (32 & 0xFF)) {
1475
1476 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
1477 ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>(
1478 input, &memory_limit_)));
1479 } else {
1480 goto handle_unusual;
1481 }
1482 break;
1483 }
1484
1485 // .tensorflow.DeviceLocality locality = 5;
1486 case 5: {
1487 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (42 & 0xFF)) {
1488 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
1489 input, mutable_locality()));
1490 } else {
1491 goto handle_unusual;
1492 }
1493 break;
1494 }
1495
1496 // fixed64 incarnation = 6;
1497 case 6: {
1498 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (49 & 0xFF)) {
1499
1500 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
1501 ::PROTOBUF_NAMESPACE_ID::uint64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_FIXED64>(
1502 input, &incarnation_)));
1503 } else {
1504 goto handle_unusual;
1505 }
1506 break;
1507 }
1508
1509 // string physical_device_desc = 7;
1510 case 7: {
1511 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (58 & 0xFF)) {
1512 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
1513 input, this->mutable_physical_device_desc()));
1514 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
1515 this->physical_device_desc().data(), static_cast<int>(this->physical_device_desc().length()),
1516 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE,
1517 "tensorflow.DeviceAttributes.physical_device_desc"));
1518 } else {
1519 goto handle_unusual;
1520 }
1521 break;
1522 }
1523
1524 // int64 xla_global_id = 8;
1525 case 8: {
1526 if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (64 & 0xFF)) {
1527
1528 DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
1529 ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>(
1530 input, &xla_global_id_)));
1531 } else {
1532 goto handle_unusual;
1533 }
1534 break;
1535 }
1536
1537 default: {
1538 handle_unusual:
1539 if (tag == 0) {
1540 goto success;
1541 }
1542 DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField(
1543 input, tag, _internal_metadata_.mutable_unknown_fields()));
1544 break;
1545 }
1546 }
1547 }
1548success:
1549 // @@protoc_insertion_point(parse_success:tensorflow.DeviceAttributes)
1550 return true;
1551failure:
1552 // @@protoc_insertion_point(parse_failure:tensorflow.DeviceAttributes)
1553 return false;
1554#undef DO_
1555}
1556#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
1557
1558void DeviceAttributes::SerializeWithCachedSizes(
1559 ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const {
1560 // @@protoc_insertion_point(serialize_start:tensorflow.DeviceAttributes)
1561 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
1562 (void) cached_has_bits;
1563
1564 // string name = 1;
1565 if (this->name().size() > 0) {
1566 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
1567 this->name().data(), static_cast<int>(this->name().length()),
1568 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
1569 "tensorflow.DeviceAttributes.name");
1570 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased(
1571 1, this->name(), output);
1572 }
1573
1574 // string device_type = 2;
1575 if (this->device_type().size() > 0) {
1576 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
1577 this->device_type().data(), static_cast<int>(this->device_type().length()),
1578 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
1579 "tensorflow.DeviceAttributes.device_type");
1580 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased(
1581 2, this->device_type(), output);
1582 }
1583
1584 // int64 memory_limit = 4;
1585 if (this->memory_limit() != 0) {
1586 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(4, this->memory_limit(), output);
1587 }
1588
1589 // .tensorflow.DeviceLocality locality = 5;
1590 if (this->has_locality()) {
1591 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
1592 5, _Internal::locality(this), output);
1593 }
1594
1595 // fixed64 incarnation = 6;
1596 if (this->incarnation() != 0) {
1597 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFixed64(6, this->incarnation(), output);
1598 }
1599
1600 // string physical_device_desc = 7;
1601 if (this->physical_device_desc().size() > 0) {
1602 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
1603 this->physical_device_desc().data(), static_cast<int>(this->physical_device_desc().length()),
1604 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
1605 "tensorflow.DeviceAttributes.physical_device_desc");
1606 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased(
1607 7, this->physical_device_desc(), output);
1608 }
1609
1610 // int64 xla_global_id = 8;
1611 if (this->xla_global_id() != 0) {
1612 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(8, this->xla_global_id(), output);
1613 }
1614
1615 if (_internal_metadata_.have_unknown_fields()) {
1616 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields(
1617 _internal_metadata_.unknown_fields(), output);
1618 }
1619 // @@protoc_insertion_point(serialize_end:tensorflow.DeviceAttributes)
1620}
1621
1622::PROTOBUF_NAMESPACE_ID::uint8* DeviceAttributes::InternalSerializeWithCachedSizesToArray(
1623 ::PROTOBUF_NAMESPACE_ID::uint8* target) const {
1624 // @@protoc_insertion_point(serialize_to_array_start:tensorflow.DeviceAttributes)
1625 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
1626 (void) cached_has_bits;
1627
1628 // string name = 1;
1629 if (this->name().size() > 0) {
1630 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
1631 this->name().data(), static_cast<int>(this->name().length()),
1632 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
1633 "tensorflow.DeviceAttributes.name");
1634 target =
1635 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray(
1636 1, this->name(), target);
1637 }
1638
1639 // string device_type = 2;
1640 if (this->device_type().size() > 0) {
1641 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
1642 this->device_type().data(), static_cast<int>(this->device_type().length()),
1643 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
1644 "tensorflow.DeviceAttributes.device_type");
1645 target =
1646 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray(
1647 2, this->device_type(), target);
1648 }
1649
1650 // int64 memory_limit = 4;
1651 if (this->memory_limit() != 0) {
1652 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(4, this->memory_limit(), target);
1653 }
1654
1655 // .tensorflow.DeviceLocality locality = 5;
1656 if (this->has_locality()) {
1657 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
1658 InternalWriteMessageToArray(
1659 5, _Internal::locality(this), target);
1660 }
1661
1662 // fixed64 incarnation = 6;
1663 if (this->incarnation() != 0) {
1664 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFixed64ToArray(6, this->incarnation(), target);
1665 }
1666
1667 // string physical_device_desc = 7;
1668 if (this->physical_device_desc().size() > 0) {
1669 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
1670 this->physical_device_desc().data(), static_cast<int>(this->physical_device_desc().length()),
1671 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
1672 "tensorflow.DeviceAttributes.physical_device_desc");
1673 target =
1674 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray(
1675 7, this->physical_device_desc(), target);
1676 }
1677
1678 // int64 xla_global_id = 8;
1679 if (this->xla_global_id() != 0) {
1680 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(8, this->xla_global_id(), target);
1681 }
1682
1683 if (_internal_metadata_.have_unknown_fields()) {
1684 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray(
1685 _internal_metadata_.unknown_fields(), target);
1686 }
1687 // @@protoc_insertion_point(serialize_to_array_end:tensorflow.DeviceAttributes)
1688 return target;
1689}
1690
1691size_t DeviceAttributes::ByteSizeLong() const {
1692// @@protoc_insertion_point(message_byte_size_start:tensorflow.DeviceAttributes)
1693 size_t total_size = 0;
1694
1695 if (_internal_metadata_.have_unknown_fields()) {
1696 total_size +=
1697 ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize(
1698 _internal_metadata_.unknown_fields());
1699 }
1700 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
1701 // Prevent compiler warnings about cached_has_bits being unused
1702 (void) cached_has_bits;
1703
1704 // string name = 1;
1705 if (this->name().size() > 0) {
1706 total_size += 1 +
1707 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
1708 this->name());
1709 }
1710
1711 // string device_type = 2;
1712 if (this->device_type().size() > 0) {
1713 total_size += 1 +
1714 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
1715 this->device_type());
1716 }
1717
1718 // string physical_device_desc = 7;
1719 if (this->physical_device_desc().size() > 0) {
1720 total_size += 1 +
1721 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
1722 this->physical_device_desc());
1723 }
1724
1725 // .tensorflow.DeviceLocality locality = 5;
1726 if (this->has_locality()) {
1727 total_size += 1 +
1728 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
1729 *locality_);
1730 }
1731
1732 // int64 memory_limit = 4;
1733 if (this->memory_limit() != 0) {
1734 total_size += 1 +
1735 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size(
1736 this->memory_limit());
1737 }
1738
1739 // fixed64 incarnation = 6;
1740 if (this->incarnation() != 0) {
1741 total_size += 1 + 8;
1742 }
1743
1744 // int64 xla_global_id = 8;
1745 if (this->xla_global_id() != 0) {
1746 total_size += 1 +
1747 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size(
1748 this->xla_global_id());
1749 }
1750
1751 int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
1752 SetCachedSize(cached_size);
1753 return total_size;
1754}
1755
1756void DeviceAttributes::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
1757// @@protoc_insertion_point(generalized_merge_from_start:tensorflow.DeviceAttributes)
1758 GOOGLE_DCHECK_NE(&from, this);
1759 const DeviceAttributes* source =
1760 ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<DeviceAttributes>(
1761 &from);
1762 if (source == nullptr) {
1763 // @@protoc_insertion_point(generalized_merge_from_cast_fail:tensorflow.DeviceAttributes)
1764 ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
1765 } else {
1766 // @@protoc_insertion_point(generalized_merge_from_cast_success:tensorflow.DeviceAttributes)
1767 MergeFrom(*source);
1768 }
1769}
1770
1771void DeviceAttributes::MergeFrom(const DeviceAttributes& from) {
1772// @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.DeviceAttributes)
1773 GOOGLE_DCHECK_NE(&from, this);
1774 _internal_metadata_.MergeFrom(from._internal_metadata_);
1775 ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
1776 (void) cached_has_bits;
1777
1778 if (from.name().size() > 0) {
1779 set_name(from.name());
1780 }
1781 if (from.device_type().size() > 0) {
1782 set_device_type(from.device_type());
1783 }
1784 if (from.physical_device_desc().size() > 0) {
1785 set_physical_device_desc(from.physical_device_desc());
1786 }
1787 if (from.has_locality()) {
1788 mutable_locality()->::tensorflow::DeviceLocality::MergeFrom(from.locality());
1789 }
1790 if (from.memory_limit() != 0) {
1791 set_memory_limit(from.memory_limit());
1792 }
1793 if (from.incarnation() != 0) {
1794 set_incarnation(from.incarnation());
1795 }
1796 if (from.xla_global_id() != 0) {
1797 set_xla_global_id(from.xla_global_id());
1798 }
1799}
1800
1801void DeviceAttributes::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
1802// @@protoc_insertion_point(generalized_copy_from_start:tensorflow.DeviceAttributes)
1803 if (&from == this) return;
1804 Clear();
1805 MergeFrom(from);
1806}
1807
1808void DeviceAttributes::CopyFrom(const DeviceAttributes& from) {
1809// @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.DeviceAttributes)
1810 if (&from == this) return;
1811 Clear();
1812 MergeFrom(from);
1813}
1814
1815bool DeviceAttributes::IsInitialized() const {
1816 return true;
1817}
1818
1819void DeviceAttributes::InternalSwap(DeviceAttributes* other) {
1820 using std::swap;
1821 _internal_metadata_.Swap(&other->_internal_metadata_);
1822 name_.Swap(&other->name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
1823 GetArenaNoVirtual());
1824 device_type_.Swap(&other->device_type_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
1825 GetArenaNoVirtual());
1826 physical_device_desc_.Swap(&other->physical_device_desc_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
1827 GetArenaNoVirtual());
1828 swap(locality_, other->locality_);
1829 swap(memory_limit_, other->memory_limit_);
1830 swap(incarnation_, other->incarnation_);
1831 swap(xla_global_id_, other->xla_global_id_);
1832}
1833
1834::PROTOBUF_NAMESPACE_ID::Metadata DeviceAttributes::GetMetadata() const {
1835 return GetMetadataStatic();
1836}
1837
1838
1839// @@protoc_insertion_point(namespace_scope)
1840} // namespace tensorflow
1841PROTOBUF_NAMESPACE_OPEN
1842template<> PROTOBUF_NOINLINE ::tensorflow::InterconnectLink* Arena::CreateMaybeMessage< ::tensorflow::InterconnectLink >(Arena* arena) {
1843 return Arena::CreateMessageInternal< ::tensorflow::InterconnectLink >(arena);
1844}
1845template<> PROTOBUF_NOINLINE ::tensorflow::LocalLinks* Arena::CreateMaybeMessage< ::tensorflow::LocalLinks >(Arena* arena) {
1846 return Arena::CreateMessageInternal< ::tensorflow::LocalLinks >(arena);
1847}
1848template<> PROTOBUF_NOINLINE ::tensorflow::DeviceLocality* Arena::CreateMaybeMessage< ::tensorflow::DeviceLocality >(Arena* arena) {
1849 return Arena::CreateMessageInternal< ::tensorflow::DeviceLocality >(arena);
1850}
1851template<> PROTOBUF_NOINLINE ::tensorflow::DeviceAttributes* Arena::CreateMaybeMessage< ::tensorflow::DeviceAttributes >(Arena* arena) {
1852 return Arena::CreateMessageInternal< ::tensorflow::DeviceAttributes >(arena);
1853}
1854PROTOBUF_NAMESPACE_CLOSE
1855
1856// @@protoc_insertion_point(global_scope)
1857#include <google/protobuf/port_undef.inc>
1858