1 // Generated by the protocol buffer compiler.  DO NOT EDIT!
2 // source: tensorflow/core/protobuf/device_properties.proto
3 
4 #include "tensorflow/core/protobuf/device_properties.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 {
DeviceProperties_EnvironmentEntry_DoNotUse(::_pbi::ConstantInitialized)22 PROTOBUF_CONSTEXPR DeviceProperties_EnvironmentEntry_DoNotUse::DeviceProperties_EnvironmentEntry_DoNotUse(
23     ::_pbi::ConstantInitialized) {}
24 struct DeviceProperties_EnvironmentEntry_DoNotUseDefaultTypeInternal {
DeviceProperties_EnvironmentEntry_DoNotUseDefaultTypeInternaltensorflow::DeviceProperties_EnvironmentEntry_DoNotUseDefaultTypeInternal25   PROTOBUF_CONSTEXPR DeviceProperties_EnvironmentEntry_DoNotUseDefaultTypeInternal()
26       : _instance(::_pbi::ConstantInitialized{}) {}
~DeviceProperties_EnvironmentEntry_DoNotUseDefaultTypeInternaltensorflow::DeviceProperties_EnvironmentEntry_DoNotUseDefaultTypeInternal27   ~DeviceProperties_EnvironmentEntry_DoNotUseDefaultTypeInternal() {}
28   union {  // NOLINT(misc-non-private-member-variables-in-classes)
29     DeviceProperties_EnvironmentEntry_DoNotUse _instance;
30   };
31 };
32 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 DeviceProperties_EnvironmentEntry_DoNotUseDefaultTypeInternal _DeviceProperties_EnvironmentEntry_DoNotUse_default_instance_;
DeviceProperties(::_pbi::ConstantInitialized)33 PROTOBUF_CONSTEXPR DeviceProperties::DeviceProperties(
34     ::_pbi::ConstantInitialized): _impl_{
35     /*decltype(_impl_.environment_)*/{}
36   , /*decltype(_impl_.type_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
37   , /*decltype(_impl_.vendor_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
38   , /*decltype(_impl_.model_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
39   , /*decltype(_impl_.frequency_)*/::int64_t{0}
40   , /*decltype(_impl_.num_cores_)*/::int64_t{0}
41   , /*decltype(_impl_.num_registers_)*/::int64_t{0}
42   , /*decltype(_impl_.l1_cache_size_)*/::int64_t{0}
43   , /*decltype(_impl_.l2_cache_size_)*/::int64_t{0}
44   , /*decltype(_impl_.l3_cache_size_)*/::int64_t{0}
45   , /*decltype(_impl_.shared_memory_size_per_multiprocessor_)*/::int64_t{0}
46   , /*decltype(_impl_.memory_size_)*/::int64_t{0}
47   , /*decltype(_impl_.bandwidth_)*/::int64_t{0}
48   , /*decltype(_impl_._cached_size_)*/{}} {}
49 struct DevicePropertiesDefaultTypeInternal {
DevicePropertiesDefaultTypeInternaltensorflow::DevicePropertiesDefaultTypeInternal50   PROTOBUF_CONSTEXPR DevicePropertiesDefaultTypeInternal()
51       : _instance(::_pbi::ConstantInitialized{}) {}
~DevicePropertiesDefaultTypeInternaltensorflow::DevicePropertiesDefaultTypeInternal52   ~DevicePropertiesDefaultTypeInternal() {}
53   union {  // NOLINT(misc-non-private-member-variables-in-classes)
54     DeviceProperties _instance;
55   };
56 };
57 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 DevicePropertiesDefaultTypeInternal _DeviceProperties_default_instance_;
NamedDevice(::_pbi::ConstantInitialized)58 PROTOBUF_CONSTEXPR NamedDevice::NamedDevice(
59     ::_pbi::ConstantInitialized): _impl_{
60     /*decltype(_impl_.name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
61   , /*decltype(_impl_.properties_)*/nullptr
62   , /*decltype(_impl_._cached_size_)*/{}} {}
63 struct NamedDeviceDefaultTypeInternal {
NamedDeviceDefaultTypeInternaltensorflow::NamedDeviceDefaultTypeInternal64   PROTOBUF_CONSTEXPR NamedDeviceDefaultTypeInternal()
65       : _instance(::_pbi::ConstantInitialized{}) {}
~NamedDeviceDefaultTypeInternaltensorflow::NamedDeviceDefaultTypeInternal66   ~NamedDeviceDefaultTypeInternal() {}
67   union {  // NOLINT(misc-non-private-member-variables-in-classes)
68     NamedDevice _instance;
69   };
70 };
71 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 NamedDeviceDefaultTypeInternal _NamedDevice_default_instance_;
72 }  // namespace tensorflow
73 namespace tensorflow {
74 
75 // ===================================================================
76 
DeviceProperties_EnvironmentEntry_DoNotUse()77 DeviceProperties_EnvironmentEntry_DoNotUse::DeviceProperties_EnvironmentEntry_DoNotUse() {}
DeviceProperties_EnvironmentEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena * arena)78 DeviceProperties_EnvironmentEntry_DoNotUse::DeviceProperties_EnvironmentEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena* arena)
79     : SuperType(arena) {}
MergeFrom(const DeviceProperties_EnvironmentEntry_DoNotUse & other)80 void DeviceProperties_EnvironmentEntry_DoNotUse::MergeFrom(const DeviceProperties_EnvironmentEntry_DoNotUse& other) {
81   MergeFromInternal(other);
82 }
83 
84 // ===================================================================
85 
86 class DeviceProperties::_Internal {
87  public:
88 };
89 
DeviceProperties(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)90 DeviceProperties::DeviceProperties(::PROTOBUF_NAMESPACE_ID::Arena* arena,
91                          bool is_message_owned)
92   : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
93   SharedCtor(arena, is_message_owned);
94   // @@protoc_insertion_point(arena_constructor:tensorflow.DeviceProperties)
95 }
DeviceProperties(const DeviceProperties & from)96 DeviceProperties::DeviceProperties(const DeviceProperties& from)
97   : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
98   DeviceProperties* const _this = this; (void)_this;
99   new (&_impl_) Impl_{
100       /*decltype(_impl_.environment_)*/{}
101     , decltype(_impl_.type_){}
102     , decltype(_impl_.vendor_){}
103     , decltype(_impl_.model_){}
104     , decltype(_impl_.frequency_){}
105     , decltype(_impl_.num_cores_){}
106     , decltype(_impl_.num_registers_){}
107     , decltype(_impl_.l1_cache_size_){}
108     , decltype(_impl_.l2_cache_size_){}
109     , decltype(_impl_.l3_cache_size_){}
110     , decltype(_impl_.shared_memory_size_per_multiprocessor_){}
111     , decltype(_impl_.memory_size_){}
112     , decltype(_impl_.bandwidth_){}
113     , /*decltype(_impl_._cached_size_)*/{}};
114 
115   _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
116   _this->_impl_.environment_.MergeFrom(from._impl_.environment_);
117   _impl_.type_.InitDefault();
118   #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
119     _impl_.type_.Set("", GetArenaForAllocation());
120   #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
121   if (!from._internal_type().empty()) {
122     _this->_impl_.type_.Set(from._internal_type(),
123       _this->GetArenaForAllocation());
124   }
125   _impl_.vendor_.InitDefault();
126   #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
127     _impl_.vendor_.Set("", GetArenaForAllocation());
128   #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
129   if (!from._internal_vendor().empty()) {
130     _this->_impl_.vendor_.Set(from._internal_vendor(),
131       _this->GetArenaForAllocation());
132   }
133   _impl_.model_.InitDefault();
134   #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
135     _impl_.model_.Set("", GetArenaForAllocation());
136   #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
137   if (!from._internal_model().empty()) {
138     _this->_impl_.model_.Set(from._internal_model(),
139       _this->GetArenaForAllocation());
140   }
141   ::memcpy(&_impl_.frequency_, &from._impl_.frequency_,
142     static_cast<size_t>(reinterpret_cast<char*>(&_impl_.bandwidth_) -
143     reinterpret_cast<char*>(&_impl_.frequency_)) + sizeof(_impl_.bandwidth_));
144   // @@protoc_insertion_point(copy_constructor:tensorflow.DeviceProperties)
145 }
146 
SharedCtor(::_pb::Arena * arena,bool is_message_owned)147 inline void DeviceProperties::SharedCtor(
148     ::_pb::Arena* arena, bool is_message_owned) {
149   (void)arena;
150   (void)is_message_owned;
151   new (&_impl_) Impl_{
152       /*decltype(_impl_.environment_)*/{::_pbi::ArenaInitialized(), arena}
153     , decltype(_impl_.type_){}
154     , decltype(_impl_.vendor_){}
155     , decltype(_impl_.model_){}
156     , decltype(_impl_.frequency_){::int64_t{0}}
157     , decltype(_impl_.num_cores_){::int64_t{0}}
158     , decltype(_impl_.num_registers_){::int64_t{0}}
159     , decltype(_impl_.l1_cache_size_){::int64_t{0}}
160     , decltype(_impl_.l2_cache_size_){::int64_t{0}}
161     , decltype(_impl_.l3_cache_size_){::int64_t{0}}
162     , decltype(_impl_.shared_memory_size_per_multiprocessor_){::int64_t{0}}
163     , decltype(_impl_.memory_size_){::int64_t{0}}
164     , decltype(_impl_.bandwidth_){::int64_t{0}}
165     , /*decltype(_impl_._cached_size_)*/{}
166   };
167   _impl_.type_.InitDefault();
168   #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
169     _impl_.type_.Set("", GetArenaForAllocation());
170   #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
171   _impl_.vendor_.InitDefault();
172   #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
173     _impl_.vendor_.Set("", GetArenaForAllocation());
174   #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
175   _impl_.model_.InitDefault();
176   #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
177     _impl_.model_.Set("", GetArenaForAllocation());
178   #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
179 }
180 
~DeviceProperties()181 DeviceProperties::~DeviceProperties() {
182   // @@protoc_insertion_point(destructor:tensorflow.DeviceProperties)
183   if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
184   (void)arena;
185     return;
186   }
187   SharedDtor();
188 }
189 
SharedDtor()190 inline void DeviceProperties::SharedDtor() {
191   GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
192   _impl_.environment_.Destruct();
193   _impl_.environment_.~MapFieldLite();
194   _impl_.type_.Destroy();
195   _impl_.vendor_.Destroy();
196   _impl_.model_.Destroy();
197 }
198 
SetCachedSize(int size) const199 void DeviceProperties::SetCachedSize(int size) const {
200   _impl_._cached_size_.Set(size);
201 }
202 
Clear()203 void DeviceProperties::Clear() {
204 // @@protoc_insertion_point(message_clear_start:tensorflow.DeviceProperties)
205   ::uint32_t cached_has_bits = 0;
206   // Prevent compiler warnings about cached_has_bits being unused
207   (void) cached_has_bits;
208 
209   _impl_.environment_.Clear();
210   _impl_.type_.ClearToEmpty();
211   _impl_.vendor_.ClearToEmpty();
212   _impl_.model_.ClearToEmpty();
213   ::memset(&_impl_.frequency_, 0, static_cast<size_t>(
214       reinterpret_cast<char*>(&_impl_.bandwidth_) -
215       reinterpret_cast<char*>(&_impl_.frequency_)) + sizeof(_impl_.bandwidth_));
216   _internal_metadata_.Clear<std::string>();
217 }
218 
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)219 const char* DeviceProperties::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
220 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
221   while (!ctx->Done(&ptr)) {
222     ::uint32_t tag;
223     ptr = ::_pbi::ReadTag(ptr, &tag);
224     switch (tag >> 3) {
225       // string type = 1;
226       case 1:
227         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
228           auto str = _internal_mutable_type();
229           ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
230           CHK_(ptr);
231           CHK_(::_pbi::VerifyUTF8(str, nullptr));
232         } else {
233           goto handle_unusual;
234         }
235         continue;
236       // string vendor = 2;
237       case 2:
238         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
239           auto str = _internal_mutable_vendor();
240           ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
241           CHK_(ptr);
242           CHK_(::_pbi::VerifyUTF8(str, nullptr));
243         } else {
244           goto handle_unusual;
245         }
246         continue;
247       // string model = 3;
248       case 3:
249         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 26)) {
250           auto str = _internal_mutable_model();
251           ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
252           CHK_(ptr);
253           CHK_(::_pbi::VerifyUTF8(str, nullptr));
254         } else {
255           goto handle_unusual;
256         }
257         continue;
258       // int64 frequency = 4;
259       case 4:
260         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 32)) {
261           _impl_.frequency_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
262           CHK_(ptr);
263         } else {
264           goto handle_unusual;
265         }
266         continue;
267       // int64 num_cores = 5;
268       case 5:
269         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 40)) {
270           _impl_.num_cores_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
271           CHK_(ptr);
272         } else {
273           goto handle_unusual;
274         }
275         continue;
276       // map<string, string> environment = 6;
277       case 6:
278         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 50)) {
279           ptr -= 1;
280           do {
281             ptr += 1;
282             ptr = ctx->ParseMessage(&_impl_.environment_, ptr);
283             CHK_(ptr);
284             if (!ctx->DataAvailable(ptr)) break;
285           } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<50>(ptr));
286         } else {
287           goto handle_unusual;
288         }
289         continue;
290       // int64 num_registers = 7;
291       case 7:
292         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 56)) {
293           _impl_.num_registers_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
294           CHK_(ptr);
295         } else {
296           goto handle_unusual;
297         }
298         continue;
299       // int64 l1_cache_size = 8;
300       case 8:
301         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 64)) {
302           _impl_.l1_cache_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
303           CHK_(ptr);
304         } else {
305           goto handle_unusual;
306         }
307         continue;
308       // int64 l2_cache_size = 9;
309       case 9:
310         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 72)) {
311           _impl_.l2_cache_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
312           CHK_(ptr);
313         } else {
314           goto handle_unusual;
315         }
316         continue;
317       // int64 l3_cache_size = 10;
318       case 10:
319         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 80)) {
320           _impl_.l3_cache_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
321           CHK_(ptr);
322         } else {
323           goto handle_unusual;
324         }
325         continue;
326       // int64 shared_memory_size_per_multiprocessor = 11;
327       case 11:
328         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 88)) {
329           _impl_.shared_memory_size_per_multiprocessor_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
330           CHK_(ptr);
331         } else {
332           goto handle_unusual;
333         }
334         continue;
335       // int64 memory_size = 12;
336       case 12:
337         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 96)) {
338           _impl_.memory_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
339           CHK_(ptr);
340         } else {
341           goto handle_unusual;
342         }
343         continue;
344       // int64 bandwidth = 13;
345       case 13:
346         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 104)) {
347           _impl_.bandwidth_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
348           CHK_(ptr);
349         } else {
350           goto handle_unusual;
351         }
352         continue;
353       default:
354         goto handle_unusual;
355     }  // switch
356   handle_unusual:
357     if ((tag == 0) || ((tag & 7) == 4)) {
358       CHK_(ptr);
359       ctx->SetLastTag(tag);
360       goto message_done;
361     }
362     ptr = UnknownFieldParse(
363         tag,
364         _internal_metadata_.mutable_unknown_fields<std::string>(),
365         ptr, ctx);
366     CHK_(ptr != nullptr);
367   }  // while
368 message_done:
369   return ptr;
370 failure:
371   ptr = nullptr;
372   goto message_done;
373 #undef CHK_
374 }
375 
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const376 ::uint8_t* DeviceProperties::_InternalSerialize(
377     ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
378   // @@protoc_insertion_point(serialize_to_array_start:tensorflow.DeviceProperties)
379   ::uint32_t cached_has_bits = 0;
380   (void) cached_has_bits;
381 
382   // string type = 1;
383   if (!this->_internal_type().empty()) {
384     ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
385       this->_internal_type().data(), static_cast<int>(this->_internal_type().length()),
386       ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
387       "tensorflow.DeviceProperties.type");
388     target = stream->WriteStringMaybeAliased(
389         1, this->_internal_type(), target);
390   }
391 
392   // string vendor = 2;
393   if (!this->_internal_vendor().empty()) {
394     ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
395       this->_internal_vendor().data(), static_cast<int>(this->_internal_vendor().length()),
396       ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
397       "tensorflow.DeviceProperties.vendor");
398     target = stream->WriteStringMaybeAliased(
399         2, this->_internal_vendor(), target);
400   }
401 
402   // string model = 3;
403   if (!this->_internal_model().empty()) {
404     ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
405       this->_internal_model().data(), static_cast<int>(this->_internal_model().length()),
406       ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
407       "tensorflow.DeviceProperties.model");
408     target = stream->WriteStringMaybeAliased(
409         3, this->_internal_model(), target);
410   }
411 
412   // int64 frequency = 4;
413   if (this->_internal_frequency() != 0) {
414     target = stream->EnsureSpace(target);
415     target = ::_pbi::WireFormatLite::WriteInt64ToArray(4, this->_internal_frequency(), target);
416   }
417 
418   // int64 num_cores = 5;
419   if (this->_internal_num_cores() != 0) {
420     target = stream->EnsureSpace(target);
421     target = ::_pbi::WireFormatLite::WriteInt64ToArray(5, this->_internal_num_cores(), target);
422   }
423 
424   // map<string, string> environment = 6;
425   if (!this->_internal_environment().empty()) {
426     using MapType = ::_pb::Map<std::string, std::string>;
427     using WireHelper = DeviceProperties_EnvironmentEntry_DoNotUse::Funcs;
428     const auto& map_field = this->_internal_environment();
429     auto check_utf8 = [](const MapType::value_type& entry) {
430       (void)entry;
431       ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
432         entry.first.data(), static_cast<int>(entry.first.length()),
433         ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
434         "tensorflow.DeviceProperties.EnvironmentEntry.key");
435       ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
436         entry.second.data(), static_cast<int>(entry.second.length()),
437         ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
438         "tensorflow.DeviceProperties.EnvironmentEntry.value");
439     };
440 
441     if (stream->IsSerializationDeterministic() && map_field.size() > 1) {
442       for (const auto& entry : ::_pbi::MapSorterPtr<MapType>(map_field)) {
443         target = WireHelper::InternalSerialize(6, entry.first, entry.second, target, stream);
444         check_utf8(entry);
445       }
446     } else {
447       for (const auto& entry : map_field) {
448         target = WireHelper::InternalSerialize(6, entry.first, entry.second, target, stream);
449         check_utf8(entry);
450       }
451     }
452   }
453 
454   // int64 num_registers = 7;
455   if (this->_internal_num_registers() != 0) {
456     target = stream->EnsureSpace(target);
457     target = ::_pbi::WireFormatLite::WriteInt64ToArray(7, this->_internal_num_registers(), target);
458   }
459 
460   // int64 l1_cache_size = 8;
461   if (this->_internal_l1_cache_size() != 0) {
462     target = stream->EnsureSpace(target);
463     target = ::_pbi::WireFormatLite::WriteInt64ToArray(8, this->_internal_l1_cache_size(), target);
464   }
465 
466   // int64 l2_cache_size = 9;
467   if (this->_internal_l2_cache_size() != 0) {
468     target = stream->EnsureSpace(target);
469     target = ::_pbi::WireFormatLite::WriteInt64ToArray(9, this->_internal_l2_cache_size(), target);
470   }
471 
472   // int64 l3_cache_size = 10;
473   if (this->_internal_l3_cache_size() != 0) {
474     target = stream->EnsureSpace(target);
475     target = ::_pbi::WireFormatLite::WriteInt64ToArray(10, this->_internal_l3_cache_size(), target);
476   }
477 
478   // int64 shared_memory_size_per_multiprocessor = 11;
479   if (this->_internal_shared_memory_size_per_multiprocessor() != 0) {
480     target = stream->EnsureSpace(target);
481     target = ::_pbi::WireFormatLite::WriteInt64ToArray(11, this->_internal_shared_memory_size_per_multiprocessor(), target);
482   }
483 
484   // int64 memory_size = 12;
485   if (this->_internal_memory_size() != 0) {
486     target = stream->EnsureSpace(target);
487     target = ::_pbi::WireFormatLite::WriteInt64ToArray(12, this->_internal_memory_size(), target);
488   }
489 
490   // int64 bandwidth = 13;
491   if (this->_internal_bandwidth() != 0) {
492     target = stream->EnsureSpace(target);
493     target = ::_pbi::WireFormatLite::WriteInt64ToArray(13, this->_internal_bandwidth(), target);
494   }
495 
496   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
497     target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
498         static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
499   }
500   // @@protoc_insertion_point(serialize_to_array_end:tensorflow.DeviceProperties)
501   return target;
502 }
503 
ByteSizeLong() const504 size_t DeviceProperties::ByteSizeLong() const {
505 // @@protoc_insertion_point(message_byte_size_start:tensorflow.DeviceProperties)
506   size_t total_size = 0;
507 
508   ::uint32_t cached_has_bits = 0;
509   // Prevent compiler warnings about cached_has_bits being unused
510   (void) cached_has_bits;
511 
512   // map<string, string> environment = 6;
513   total_size += 1 *
514       ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_environment_size());
515   for (::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >::const_iterator
516       it = this->_internal_environment().begin();
517       it != this->_internal_environment().end(); ++it) {
518     total_size += DeviceProperties_EnvironmentEntry_DoNotUse::Funcs::ByteSizeLong(it->first, it->second);
519   }
520 
521   // string type = 1;
522   if (!this->_internal_type().empty()) {
523     total_size += 1 +
524       ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
525         this->_internal_type());
526   }
527 
528   // string vendor = 2;
529   if (!this->_internal_vendor().empty()) {
530     total_size += 1 +
531       ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
532         this->_internal_vendor());
533   }
534 
535   // string model = 3;
536   if (!this->_internal_model().empty()) {
537     total_size += 1 +
538       ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
539         this->_internal_model());
540   }
541 
542   // int64 frequency = 4;
543   if (this->_internal_frequency() != 0) {
544     total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_frequency());
545   }
546 
547   // int64 num_cores = 5;
548   if (this->_internal_num_cores() != 0) {
549     total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_num_cores());
550   }
551 
552   // int64 num_registers = 7;
553   if (this->_internal_num_registers() != 0) {
554     total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_num_registers());
555   }
556 
557   // int64 l1_cache_size = 8;
558   if (this->_internal_l1_cache_size() != 0) {
559     total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_l1_cache_size());
560   }
561 
562   // int64 l2_cache_size = 9;
563   if (this->_internal_l2_cache_size() != 0) {
564     total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_l2_cache_size());
565   }
566 
567   // int64 l3_cache_size = 10;
568   if (this->_internal_l3_cache_size() != 0) {
569     total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_l3_cache_size());
570   }
571 
572   // int64 shared_memory_size_per_multiprocessor = 11;
573   if (this->_internal_shared_memory_size_per_multiprocessor() != 0) {
574     total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_shared_memory_size_per_multiprocessor());
575   }
576 
577   // int64 memory_size = 12;
578   if (this->_internal_memory_size() != 0) {
579     total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_memory_size());
580   }
581 
582   // int64 bandwidth = 13;
583   if (this->_internal_bandwidth() != 0) {
584     total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_bandwidth());
585   }
586 
587   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
588     total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
589   }
590   int cached_size = ::_pbi::ToCachedSize(total_size);
591   SetCachedSize(cached_size);
592   return total_size;
593 }
594 
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)595 void DeviceProperties::CheckTypeAndMergeFrom(
596     const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
597   MergeFrom(*::_pbi::DownCast<const DeviceProperties*>(
598       &from));
599 }
600 
MergeFrom(const DeviceProperties & from)601 void DeviceProperties::MergeFrom(const DeviceProperties& from) {
602   DeviceProperties* const _this = this;
603   // @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.DeviceProperties)
604   GOOGLE_DCHECK_NE(&from, _this);
605   ::uint32_t cached_has_bits = 0;
606   (void) cached_has_bits;
607 
608   _this->_impl_.environment_.MergeFrom(from._impl_.environment_);
609   if (!from._internal_type().empty()) {
610     _this->_internal_set_type(from._internal_type());
611   }
612   if (!from._internal_vendor().empty()) {
613     _this->_internal_set_vendor(from._internal_vendor());
614   }
615   if (!from._internal_model().empty()) {
616     _this->_internal_set_model(from._internal_model());
617   }
618   if (from._internal_frequency() != 0) {
619     _this->_internal_set_frequency(from._internal_frequency());
620   }
621   if (from._internal_num_cores() != 0) {
622     _this->_internal_set_num_cores(from._internal_num_cores());
623   }
624   if (from._internal_num_registers() != 0) {
625     _this->_internal_set_num_registers(from._internal_num_registers());
626   }
627   if (from._internal_l1_cache_size() != 0) {
628     _this->_internal_set_l1_cache_size(from._internal_l1_cache_size());
629   }
630   if (from._internal_l2_cache_size() != 0) {
631     _this->_internal_set_l2_cache_size(from._internal_l2_cache_size());
632   }
633   if (from._internal_l3_cache_size() != 0) {
634     _this->_internal_set_l3_cache_size(from._internal_l3_cache_size());
635   }
636   if (from._internal_shared_memory_size_per_multiprocessor() != 0) {
637     _this->_internal_set_shared_memory_size_per_multiprocessor(from._internal_shared_memory_size_per_multiprocessor());
638   }
639   if (from._internal_memory_size() != 0) {
640     _this->_internal_set_memory_size(from._internal_memory_size());
641   }
642   if (from._internal_bandwidth() != 0) {
643     _this->_internal_set_bandwidth(from._internal_bandwidth());
644   }
645   _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
646 }
647 
CopyFrom(const DeviceProperties & from)648 void DeviceProperties::CopyFrom(const DeviceProperties& from) {
649 // @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.DeviceProperties)
650   if (&from == this) return;
651   Clear();
652   MergeFrom(from);
653 }
654 
IsInitialized() const655 bool DeviceProperties::IsInitialized() const {
656   return true;
657 }
658 
InternalSwap(DeviceProperties * other)659 void DeviceProperties::InternalSwap(DeviceProperties* other) {
660   using std::swap;
661   auto* lhs_arena = GetArenaForAllocation();
662   auto* rhs_arena = other->GetArenaForAllocation();
663   _internal_metadata_.InternalSwap(&other->_internal_metadata_);
664   _impl_.environment_.InternalSwap(&other->_impl_.environment_);
665   ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
666       &_impl_.type_, lhs_arena,
667       &other->_impl_.type_, rhs_arena
668   );
669   ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
670       &_impl_.vendor_, lhs_arena,
671       &other->_impl_.vendor_, rhs_arena
672   );
673   ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
674       &_impl_.model_, lhs_arena,
675       &other->_impl_.model_, rhs_arena
676   );
677   ::PROTOBUF_NAMESPACE_ID::internal::memswap<
678       PROTOBUF_FIELD_OFFSET(DeviceProperties, _impl_.bandwidth_)
679       + sizeof(DeviceProperties::_impl_.bandwidth_)  // NOLINT
680       - PROTOBUF_FIELD_OFFSET(DeviceProperties, _impl_.frequency_)>(
681           reinterpret_cast<char*>(&_impl_.frequency_),
682           reinterpret_cast<char*>(&other->_impl_.frequency_));
683 }
684 
GetTypeName() const685 std::string DeviceProperties::GetTypeName() const {
686   return "tensorflow.DeviceProperties";
687 }
688 
689 
690 // ===================================================================
691 
692 class NamedDevice::_Internal {
693  public:
694   static const ::tensorflow::DeviceProperties& properties(const NamedDevice* msg);
695 };
696 
697 const ::tensorflow::DeviceProperties&
properties(const NamedDevice * msg)698 NamedDevice::_Internal::properties(const NamedDevice* msg) {
699   return *msg->_impl_.properties_;
700 }
NamedDevice(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)701 NamedDevice::NamedDevice(::PROTOBUF_NAMESPACE_ID::Arena* arena,
702                          bool is_message_owned)
703   : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
704   SharedCtor(arena, is_message_owned);
705   // @@protoc_insertion_point(arena_constructor:tensorflow.NamedDevice)
706 }
NamedDevice(const NamedDevice & from)707 NamedDevice::NamedDevice(const NamedDevice& from)
708   : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
709   NamedDevice* const _this = this; (void)_this;
710   new (&_impl_) Impl_{
711       decltype(_impl_.name_){}
712     , decltype(_impl_.properties_){nullptr}
713     , /*decltype(_impl_._cached_size_)*/{}};
714 
715   _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
716   _impl_.name_.InitDefault();
717   #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
718     _impl_.name_.Set("", GetArenaForAllocation());
719   #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
720   if (!from._internal_name().empty()) {
721     _this->_impl_.name_.Set(from._internal_name(),
722       _this->GetArenaForAllocation());
723   }
724   if (from._internal_has_properties()) {
725     _this->_impl_.properties_ = new ::tensorflow::DeviceProperties(*from._impl_.properties_);
726   }
727   // @@protoc_insertion_point(copy_constructor:tensorflow.NamedDevice)
728 }
729 
SharedCtor(::_pb::Arena * arena,bool is_message_owned)730 inline void NamedDevice::SharedCtor(
731     ::_pb::Arena* arena, bool is_message_owned) {
732   (void)arena;
733   (void)is_message_owned;
734   new (&_impl_) Impl_{
735       decltype(_impl_.name_){}
736     , decltype(_impl_.properties_){nullptr}
737     , /*decltype(_impl_._cached_size_)*/{}
738   };
739   _impl_.name_.InitDefault();
740   #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
741     _impl_.name_.Set("", GetArenaForAllocation());
742   #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
743 }
744 
~NamedDevice()745 NamedDevice::~NamedDevice() {
746   // @@protoc_insertion_point(destructor:tensorflow.NamedDevice)
747   if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
748   (void)arena;
749     return;
750   }
751   SharedDtor();
752 }
753 
SharedDtor()754 inline void NamedDevice::SharedDtor() {
755   GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
756   _impl_.name_.Destroy();
757   if (this != internal_default_instance()) delete _impl_.properties_;
758 }
759 
SetCachedSize(int size) const760 void NamedDevice::SetCachedSize(int size) const {
761   _impl_._cached_size_.Set(size);
762 }
763 
Clear()764 void NamedDevice::Clear() {
765 // @@protoc_insertion_point(message_clear_start:tensorflow.NamedDevice)
766   ::uint32_t cached_has_bits = 0;
767   // Prevent compiler warnings about cached_has_bits being unused
768   (void) cached_has_bits;
769 
770   _impl_.name_.ClearToEmpty();
771   if (GetArenaForAllocation() == nullptr && _impl_.properties_ != nullptr) {
772     delete _impl_.properties_;
773   }
774   _impl_.properties_ = nullptr;
775   _internal_metadata_.Clear<std::string>();
776 }
777 
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)778 const char* NamedDevice::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
779 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
780   while (!ctx->Done(&ptr)) {
781     ::uint32_t tag;
782     ptr = ::_pbi::ReadTag(ptr, &tag);
783     switch (tag >> 3) {
784       // string name = 1;
785       case 1:
786         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
787           auto str = _internal_mutable_name();
788           ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
789           CHK_(ptr);
790           CHK_(::_pbi::VerifyUTF8(str, nullptr));
791         } else {
792           goto handle_unusual;
793         }
794         continue;
795       // .tensorflow.DeviceProperties properties = 2;
796       case 2:
797         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
798           ptr = ctx->ParseMessage(_internal_mutable_properties(), ptr);
799           CHK_(ptr);
800         } else {
801           goto handle_unusual;
802         }
803         continue;
804       default:
805         goto handle_unusual;
806     }  // switch
807   handle_unusual:
808     if ((tag == 0) || ((tag & 7) == 4)) {
809       CHK_(ptr);
810       ctx->SetLastTag(tag);
811       goto message_done;
812     }
813     ptr = UnknownFieldParse(
814         tag,
815         _internal_metadata_.mutable_unknown_fields<std::string>(),
816         ptr, ctx);
817     CHK_(ptr != nullptr);
818   }  // while
819 message_done:
820   return ptr;
821 failure:
822   ptr = nullptr;
823   goto message_done;
824 #undef CHK_
825 }
826 
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const827 ::uint8_t* NamedDevice::_InternalSerialize(
828     ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
829   // @@protoc_insertion_point(serialize_to_array_start:tensorflow.NamedDevice)
830   ::uint32_t cached_has_bits = 0;
831   (void) cached_has_bits;
832 
833   // string name = 1;
834   if (!this->_internal_name().empty()) {
835     ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
836       this->_internal_name().data(), static_cast<int>(this->_internal_name().length()),
837       ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
838       "tensorflow.NamedDevice.name");
839     target = stream->WriteStringMaybeAliased(
840         1, this->_internal_name(), target);
841   }
842 
843   // .tensorflow.DeviceProperties properties = 2;
844   if (this->_internal_has_properties()) {
845     target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
846       InternalWriteMessage(2, _Internal::properties(this),
847         _Internal::properties(this).GetCachedSize(), target, stream);
848   }
849 
850   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
851     target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
852         static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
853   }
854   // @@protoc_insertion_point(serialize_to_array_end:tensorflow.NamedDevice)
855   return target;
856 }
857 
ByteSizeLong() const858 size_t NamedDevice::ByteSizeLong() const {
859 // @@protoc_insertion_point(message_byte_size_start:tensorflow.NamedDevice)
860   size_t total_size = 0;
861 
862   ::uint32_t cached_has_bits = 0;
863   // Prevent compiler warnings about cached_has_bits being unused
864   (void) cached_has_bits;
865 
866   // string name = 1;
867   if (!this->_internal_name().empty()) {
868     total_size += 1 +
869       ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
870         this->_internal_name());
871   }
872 
873   // .tensorflow.DeviceProperties properties = 2;
874   if (this->_internal_has_properties()) {
875     total_size += 1 +
876       ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
877         *_impl_.properties_);
878   }
879 
880   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
881     total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
882   }
883   int cached_size = ::_pbi::ToCachedSize(total_size);
884   SetCachedSize(cached_size);
885   return total_size;
886 }
887 
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)888 void NamedDevice::CheckTypeAndMergeFrom(
889     const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
890   MergeFrom(*::_pbi::DownCast<const NamedDevice*>(
891       &from));
892 }
893 
MergeFrom(const NamedDevice & from)894 void NamedDevice::MergeFrom(const NamedDevice& from) {
895   NamedDevice* const _this = this;
896   // @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.NamedDevice)
897   GOOGLE_DCHECK_NE(&from, _this);
898   ::uint32_t cached_has_bits = 0;
899   (void) cached_has_bits;
900 
901   if (!from._internal_name().empty()) {
902     _this->_internal_set_name(from._internal_name());
903   }
904   if (from._internal_has_properties()) {
905     _this->_internal_mutable_properties()->::tensorflow::DeviceProperties::MergeFrom(
906         from._internal_properties());
907   }
908   _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
909 }
910 
CopyFrom(const NamedDevice & from)911 void NamedDevice::CopyFrom(const NamedDevice& from) {
912 // @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.NamedDevice)
913   if (&from == this) return;
914   Clear();
915   MergeFrom(from);
916 }
917 
IsInitialized() const918 bool NamedDevice::IsInitialized() const {
919   return true;
920 }
921 
InternalSwap(NamedDevice * other)922 void NamedDevice::InternalSwap(NamedDevice* other) {
923   using std::swap;
924   auto* lhs_arena = GetArenaForAllocation();
925   auto* rhs_arena = other->GetArenaForAllocation();
926   _internal_metadata_.InternalSwap(&other->_internal_metadata_);
927   ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
928       &_impl_.name_, lhs_arena,
929       &other->_impl_.name_, rhs_arena
930   );
931   swap(_impl_.properties_, other->_impl_.properties_);
932 }
933 
GetTypeName() const934 std::string NamedDevice::GetTypeName() const {
935   return "tensorflow.NamedDevice";
936 }
937 
938 
939 // @@protoc_insertion_point(namespace_scope)
940 }  // namespace tensorflow
941 PROTOBUF_NAMESPACE_OPEN
942 template<> PROTOBUF_NOINLINE ::tensorflow::DeviceProperties_EnvironmentEntry_DoNotUse*
CreateMaybeMessage(Arena * arena)943 Arena::CreateMaybeMessage< ::tensorflow::DeviceProperties_EnvironmentEntry_DoNotUse >(Arena* arena) {
944   return Arena::CreateMessageInternal< ::tensorflow::DeviceProperties_EnvironmentEntry_DoNotUse >(arena);
945 }
946 template<> PROTOBUF_NOINLINE ::tensorflow::DeviceProperties*
CreateMaybeMessage(Arena * arena)947 Arena::CreateMaybeMessage< ::tensorflow::DeviceProperties >(Arena* arena) {
948   return Arena::CreateMessageInternal< ::tensorflow::DeviceProperties >(arena);
949 }
950 template<> PROTOBUF_NOINLINE ::tensorflow::NamedDevice*
CreateMaybeMessage(Arena * arena)951 Arena::CreateMaybeMessage< ::tensorflow::NamedDevice >(Arena* arena) {
952   return Arena::CreateMessageInternal< ::tensorflow::NamedDevice >(arena);
953 }
954 PROTOBUF_NAMESPACE_CLOSE
955 
956 // @@protoc_insertion_point(global_scope)
957 #include <google/protobuf/port_undef.inc>
958