1 // Generated by the protocol buffer compiler.  DO NOT EDIT!
2 // source: tensorflow/core/profiler/profiler_options.proto
3 
4 #include "tensorflow/core/profiler/profiler_options.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 {
ProfileOptions(::_pbi::ConstantInitialized)22 PROTOBUF_CONSTEXPR ProfileOptions::ProfileOptions(
23     ::_pbi::ConstantInitialized): _impl_{
24     /*decltype(_impl_.repository_path_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
25   , /*decltype(_impl_.host_tracer_level_)*/0u
26   , /*decltype(_impl_.device_tracer_level_)*/0u
27   , /*decltype(_impl_.python_tracer_level_)*/0u
28   , /*decltype(_impl_.include_dataset_ops_)*/false
29   , /*decltype(_impl_.enable_hlo_proto_)*/false
30   , /*decltype(_impl_.version_)*/0u
31   , /*decltype(_impl_.device_type_)*/0
32   , /*decltype(_impl_.start_timestamp_ns_)*/::uint64_t{0u}
33   , /*decltype(_impl_.duration_ms_)*/::uint64_t{0u}
34   , /*decltype(_impl_._cached_size_)*/{}} {}
35 struct ProfileOptionsDefaultTypeInternal {
ProfileOptionsDefaultTypeInternaltensorflow::ProfileOptionsDefaultTypeInternal36   PROTOBUF_CONSTEXPR ProfileOptionsDefaultTypeInternal()
37       : _instance(::_pbi::ConstantInitialized{}) {}
~ProfileOptionsDefaultTypeInternaltensorflow::ProfileOptionsDefaultTypeInternal38   ~ProfileOptionsDefaultTypeInternal() {}
39   union {  // NOLINT(misc-non-private-member-variables-in-classes)
40     ProfileOptions _instance;
41   };
42 };
43 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ProfileOptionsDefaultTypeInternal _ProfileOptions_default_instance_;
RemoteProfilerSessionManagerOptions(::_pbi::ConstantInitialized)44 PROTOBUF_CONSTEXPR RemoteProfilerSessionManagerOptions::RemoteProfilerSessionManagerOptions(
45     ::_pbi::ConstantInitialized): _impl_{
46     /*decltype(_impl_.service_addresses_)*/{}
47   , /*decltype(_impl_.profiler_options_)*/nullptr
48   , /*decltype(_impl_.session_creation_timestamp_ns_)*/::uint64_t{0u}
49   , /*decltype(_impl_.max_session_duration_ms_)*/::uint64_t{0u}
50   , /*decltype(_impl_.delay_ms_)*/::uint64_t{0u}
51   , /*decltype(_impl_._cached_size_)*/{}} {}
52 struct RemoteProfilerSessionManagerOptionsDefaultTypeInternal {
RemoteProfilerSessionManagerOptionsDefaultTypeInternaltensorflow::RemoteProfilerSessionManagerOptionsDefaultTypeInternal53   PROTOBUF_CONSTEXPR RemoteProfilerSessionManagerOptionsDefaultTypeInternal()
54       : _instance(::_pbi::ConstantInitialized{}) {}
~RemoteProfilerSessionManagerOptionsDefaultTypeInternaltensorflow::RemoteProfilerSessionManagerOptionsDefaultTypeInternal55   ~RemoteProfilerSessionManagerOptionsDefaultTypeInternal() {}
56   union {  // NOLINT(misc-non-private-member-variables-in-classes)
57     RemoteProfilerSessionManagerOptions _instance;
58   };
59 };
60 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 RemoteProfilerSessionManagerOptionsDefaultTypeInternal _RemoteProfilerSessionManagerOptions_default_instance_;
61 }  // namespace tensorflow
62 namespace tensorflow {
ProfileOptions_DeviceType_IsValid(int value)63 bool ProfileOptions_DeviceType_IsValid(int value) {
64   switch (value) {
65     case 0:
66     case 1:
67     case 2:
68     case 3:
69     case 4:
70       return true;
71     default:
72       return false;
73   }
74 }
75 
76 static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string> ProfileOptions_DeviceType_strings[5] = {};
77 
78 static const char ProfileOptions_DeviceType_names[] =
79   "CPU"
80   "GPU"
81   "PLUGGABLE_DEVICE"
82   "TPU"
83   "UNSPECIFIED";
84 
85 static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry ProfileOptions_DeviceType_entries[] = {
86   { {ProfileOptions_DeviceType_names + 0, 3}, 1 },
87   { {ProfileOptions_DeviceType_names + 3, 3}, 2 },
88   { {ProfileOptions_DeviceType_names + 6, 16}, 4 },
89   { {ProfileOptions_DeviceType_names + 22, 3}, 3 },
90   { {ProfileOptions_DeviceType_names + 25, 11}, 0 },
91 };
92 
93 static const int ProfileOptions_DeviceType_entries_by_number[] = {
94   4, // 0 -> UNSPECIFIED
95   0, // 1 -> CPU
96   1, // 2 -> GPU
97   3, // 3 -> TPU
98   2, // 4 -> PLUGGABLE_DEVICE
99 };
100 
ProfileOptions_DeviceType_Name(ProfileOptions_DeviceType value)101 const std::string& ProfileOptions_DeviceType_Name(
102     ProfileOptions_DeviceType value) {
103   static const bool dummy =
104       ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
105           ProfileOptions_DeviceType_entries,
106           ProfileOptions_DeviceType_entries_by_number,
107           5, ProfileOptions_DeviceType_strings);
108   (void) dummy;
109   int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
110       ProfileOptions_DeviceType_entries,
111       ProfileOptions_DeviceType_entries_by_number,
112       5, value);
113   return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() :
114                      ProfileOptions_DeviceType_strings[idx].get();
115 }
ProfileOptions_DeviceType_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,ProfileOptions_DeviceType * value)116 bool ProfileOptions_DeviceType_Parse(
117     ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, ProfileOptions_DeviceType* value) {
118   int int_value;
119   bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue(
120       ProfileOptions_DeviceType_entries, 5, name, &int_value);
121   if (success) {
122     *value = static_cast<ProfileOptions_DeviceType>(int_value);
123   }
124   return success;
125 }
126 #if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
127 constexpr ProfileOptions_DeviceType ProfileOptions::UNSPECIFIED;
128 constexpr ProfileOptions_DeviceType ProfileOptions::CPU;
129 constexpr ProfileOptions_DeviceType ProfileOptions::GPU;
130 constexpr ProfileOptions_DeviceType ProfileOptions::TPU;
131 constexpr ProfileOptions_DeviceType ProfileOptions::PLUGGABLE_DEVICE;
132 constexpr ProfileOptions_DeviceType ProfileOptions::DeviceType_MIN;
133 constexpr ProfileOptions_DeviceType ProfileOptions::DeviceType_MAX;
134 constexpr int ProfileOptions::DeviceType_ARRAYSIZE;
135 #endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
136 
137 // ===================================================================
138 
139 class ProfileOptions::_Internal {
140  public:
141 };
142 
ProfileOptions(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)143 ProfileOptions::ProfileOptions(::PROTOBUF_NAMESPACE_ID::Arena* arena,
144                          bool is_message_owned)
145   : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
146   SharedCtor(arena, is_message_owned);
147   // @@protoc_insertion_point(arena_constructor:tensorflow.ProfileOptions)
148 }
ProfileOptions(const ProfileOptions & from)149 ProfileOptions::ProfileOptions(const ProfileOptions& from)
150   : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
151   ProfileOptions* const _this = this; (void)_this;
152   new (&_impl_) Impl_{
153       decltype(_impl_.repository_path_){}
154     , decltype(_impl_.host_tracer_level_){}
155     , decltype(_impl_.device_tracer_level_){}
156     , decltype(_impl_.python_tracer_level_){}
157     , decltype(_impl_.include_dataset_ops_){}
158     , decltype(_impl_.enable_hlo_proto_){}
159     , decltype(_impl_.version_){}
160     , decltype(_impl_.device_type_){}
161     , decltype(_impl_.start_timestamp_ns_){}
162     , decltype(_impl_.duration_ms_){}
163     , /*decltype(_impl_._cached_size_)*/{}};
164 
165   _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
166   _impl_.repository_path_.InitDefault();
167   #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
168     _impl_.repository_path_.Set("", GetArenaForAllocation());
169   #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
170   if (!from._internal_repository_path().empty()) {
171     _this->_impl_.repository_path_.Set(from._internal_repository_path(),
172       _this->GetArenaForAllocation());
173   }
174   ::memcpy(&_impl_.host_tracer_level_, &from._impl_.host_tracer_level_,
175     static_cast<size_t>(reinterpret_cast<char*>(&_impl_.duration_ms_) -
176     reinterpret_cast<char*>(&_impl_.host_tracer_level_)) + sizeof(_impl_.duration_ms_));
177   // @@protoc_insertion_point(copy_constructor:tensorflow.ProfileOptions)
178 }
179 
SharedCtor(::_pb::Arena * arena,bool is_message_owned)180 inline void ProfileOptions::SharedCtor(
181     ::_pb::Arena* arena, bool is_message_owned) {
182   (void)arena;
183   (void)is_message_owned;
184   new (&_impl_) Impl_{
185       decltype(_impl_.repository_path_){}
186     , decltype(_impl_.host_tracer_level_){0u}
187     , decltype(_impl_.device_tracer_level_){0u}
188     , decltype(_impl_.python_tracer_level_){0u}
189     , decltype(_impl_.include_dataset_ops_){false}
190     , decltype(_impl_.enable_hlo_proto_){false}
191     , decltype(_impl_.version_){0u}
192     , decltype(_impl_.device_type_){0}
193     , decltype(_impl_.start_timestamp_ns_){::uint64_t{0u}}
194     , decltype(_impl_.duration_ms_){::uint64_t{0u}}
195     , /*decltype(_impl_._cached_size_)*/{}
196   };
197   _impl_.repository_path_.InitDefault();
198   #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
199     _impl_.repository_path_.Set("", GetArenaForAllocation());
200   #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
201 }
202 
~ProfileOptions()203 ProfileOptions::~ProfileOptions() {
204   // @@protoc_insertion_point(destructor:tensorflow.ProfileOptions)
205   if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
206   (void)arena;
207     return;
208   }
209   SharedDtor();
210 }
211 
SharedDtor()212 inline void ProfileOptions::SharedDtor() {
213   GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
214   _impl_.repository_path_.Destroy();
215 }
216 
SetCachedSize(int size) const217 void ProfileOptions::SetCachedSize(int size) const {
218   _impl_._cached_size_.Set(size);
219 }
220 
Clear()221 void ProfileOptions::Clear() {
222 // @@protoc_insertion_point(message_clear_start:tensorflow.ProfileOptions)
223   ::uint32_t cached_has_bits = 0;
224   // Prevent compiler warnings about cached_has_bits being unused
225   (void) cached_has_bits;
226 
227   _impl_.repository_path_.ClearToEmpty();
228   ::memset(&_impl_.host_tracer_level_, 0, static_cast<size_t>(
229       reinterpret_cast<char*>(&_impl_.duration_ms_) -
230       reinterpret_cast<char*>(&_impl_.host_tracer_level_)) + sizeof(_impl_.duration_ms_));
231   _internal_metadata_.Clear<std::string>();
232 }
233 
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)234 const char* ProfileOptions::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
235 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
236   while (!ctx->Done(&ptr)) {
237     ::uint32_t tag;
238     ptr = ::_pbi::ReadTag(ptr, &tag);
239     switch (tag >> 3) {
240       // bool include_dataset_ops = 1;
241       case 1:
242         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
243           _impl_.include_dataset_ops_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
244           CHK_(ptr);
245         } else {
246           goto handle_unusual;
247         }
248         continue;
249       // uint32 host_tracer_level = 2;
250       case 2:
251         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 16)) {
252           _impl_.host_tracer_level_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
253           CHK_(ptr);
254         } else {
255           goto handle_unusual;
256         }
257         continue;
258       // uint32 device_tracer_level = 3;
259       case 3:
260         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 24)) {
261           _impl_.device_tracer_level_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
262           CHK_(ptr);
263         } else {
264           goto handle_unusual;
265         }
266         continue;
267       // uint32 python_tracer_level = 4;
268       case 4:
269         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 32)) {
270           _impl_.python_tracer_level_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
271           CHK_(ptr);
272         } else {
273           goto handle_unusual;
274         }
275         continue;
276       // uint32 version = 5;
277       case 5:
278         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 40)) {
279           _impl_.version_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
280           CHK_(ptr);
281         } else {
282           goto handle_unusual;
283         }
284         continue;
285       // .tensorflow.ProfileOptions.DeviceType device_type = 6;
286       case 6:
287         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 48)) {
288           ::uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
289           CHK_(ptr);
290           _internal_set_device_type(static_cast<::tensorflow::ProfileOptions_DeviceType>(val));
291         } else {
292           goto handle_unusual;
293         }
294         continue;
295       // bool enable_hlo_proto = 7;
296       case 7:
297         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 56)) {
298           _impl_.enable_hlo_proto_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
299           CHK_(ptr);
300         } else {
301           goto handle_unusual;
302         }
303         continue;
304       // uint64 start_timestamp_ns = 8;
305       case 8:
306         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 64)) {
307           _impl_.start_timestamp_ns_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
308           CHK_(ptr);
309         } else {
310           goto handle_unusual;
311         }
312         continue;
313       // uint64 duration_ms = 9;
314       case 9:
315         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 72)) {
316           _impl_.duration_ms_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
317           CHK_(ptr);
318         } else {
319           goto handle_unusual;
320         }
321         continue;
322       // string repository_path = 10;
323       case 10:
324         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 82)) {
325           auto str = _internal_mutable_repository_path();
326           ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
327           CHK_(ptr);
328           CHK_(::_pbi::VerifyUTF8(str, nullptr));
329         } else {
330           goto handle_unusual;
331         }
332         continue;
333       default:
334         goto handle_unusual;
335     }  // switch
336   handle_unusual:
337     if ((tag == 0) || ((tag & 7) == 4)) {
338       CHK_(ptr);
339       ctx->SetLastTag(tag);
340       goto message_done;
341     }
342     ptr = UnknownFieldParse(
343         tag,
344         _internal_metadata_.mutable_unknown_fields<std::string>(),
345         ptr, ctx);
346     CHK_(ptr != nullptr);
347   }  // while
348 message_done:
349   return ptr;
350 failure:
351   ptr = nullptr;
352   goto message_done;
353 #undef CHK_
354 }
355 
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const356 ::uint8_t* ProfileOptions::_InternalSerialize(
357     ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
358   // @@protoc_insertion_point(serialize_to_array_start:tensorflow.ProfileOptions)
359   ::uint32_t cached_has_bits = 0;
360   (void) cached_has_bits;
361 
362   // bool include_dataset_ops = 1;
363   if (this->_internal_include_dataset_ops() != 0) {
364     target = stream->EnsureSpace(target);
365     target = ::_pbi::WireFormatLite::WriteBoolToArray(1, this->_internal_include_dataset_ops(), target);
366   }
367 
368   // uint32 host_tracer_level = 2;
369   if (this->_internal_host_tracer_level() != 0) {
370     target = stream->EnsureSpace(target);
371     target = ::_pbi::WireFormatLite::WriteUInt32ToArray(2, this->_internal_host_tracer_level(), target);
372   }
373 
374   // uint32 device_tracer_level = 3;
375   if (this->_internal_device_tracer_level() != 0) {
376     target = stream->EnsureSpace(target);
377     target = ::_pbi::WireFormatLite::WriteUInt32ToArray(3, this->_internal_device_tracer_level(), target);
378   }
379 
380   // uint32 python_tracer_level = 4;
381   if (this->_internal_python_tracer_level() != 0) {
382     target = stream->EnsureSpace(target);
383     target = ::_pbi::WireFormatLite::WriteUInt32ToArray(4, this->_internal_python_tracer_level(), target);
384   }
385 
386   // uint32 version = 5;
387   if (this->_internal_version() != 0) {
388     target = stream->EnsureSpace(target);
389     target = ::_pbi::WireFormatLite::WriteUInt32ToArray(5, this->_internal_version(), target);
390   }
391 
392   // .tensorflow.ProfileOptions.DeviceType device_type = 6;
393   if (this->_internal_device_type() != 0) {
394     target = stream->EnsureSpace(target);
395     target = ::_pbi::WireFormatLite::WriteEnumToArray(
396       6, this->_internal_device_type(), target);
397   }
398 
399   // bool enable_hlo_proto = 7;
400   if (this->_internal_enable_hlo_proto() != 0) {
401     target = stream->EnsureSpace(target);
402     target = ::_pbi::WireFormatLite::WriteBoolToArray(7, this->_internal_enable_hlo_proto(), target);
403   }
404 
405   // uint64 start_timestamp_ns = 8;
406   if (this->_internal_start_timestamp_ns() != 0) {
407     target = stream->EnsureSpace(target);
408     target = ::_pbi::WireFormatLite::WriteUInt64ToArray(8, this->_internal_start_timestamp_ns(), target);
409   }
410 
411   // uint64 duration_ms = 9;
412   if (this->_internal_duration_ms() != 0) {
413     target = stream->EnsureSpace(target);
414     target = ::_pbi::WireFormatLite::WriteUInt64ToArray(9, this->_internal_duration_ms(), target);
415   }
416 
417   // string repository_path = 10;
418   if (!this->_internal_repository_path().empty()) {
419     ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
420       this->_internal_repository_path().data(), static_cast<int>(this->_internal_repository_path().length()),
421       ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
422       "tensorflow.ProfileOptions.repository_path");
423     target = stream->WriteStringMaybeAliased(
424         10, this->_internal_repository_path(), target);
425   }
426 
427   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
428     target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
429         static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
430   }
431   // @@protoc_insertion_point(serialize_to_array_end:tensorflow.ProfileOptions)
432   return target;
433 }
434 
ByteSizeLong() const435 size_t ProfileOptions::ByteSizeLong() const {
436 // @@protoc_insertion_point(message_byte_size_start:tensorflow.ProfileOptions)
437   size_t total_size = 0;
438 
439   ::uint32_t cached_has_bits = 0;
440   // Prevent compiler warnings about cached_has_bits being unused
441   (void) cached_has_bits;
442 
443   // string repository_path = 10;
444   if (!this->_internal_repository_path().empty()) {
445     total_size += 1 +
446       ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
447         this->_internal_repository_path());
448   }
449 
450   // uint32 host_tracer_level = 2;
451   if (this->_internal_host_tracer_level() != 0) {
452     total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_host_tracer_level());
453   }
454 
455   // uint32 device_tracer_level = 3;
456   if (this->_internal_device_tracer_level() != 0) {
457     total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_device_tracer_level());
458   }
459 
460   // uint32 python_tracer_level = 4;
461   if (this->_internal_python_tracer_level() != 0) {
462     total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_python_tracer_level());
463   }
464 
465   // bool include_dataset_ops = 1;
466   if (this->_internal_include_dataset_ops() != 0) {
467     total_size += 1 + 1;
468   }
469 
470   // bool enable_hlo_proto = 7;
471   if (this->_internal_enable_hlo_proto() != 0) {
472     total_size += 1 + 1;
473   }
474 
475   // uint32 version = 5;
476   if (this->_internal_version() != 0) {
477     total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_version());
478   }
479 
480   // .tensorflow.ProfileOptions.DeviceType device_type = 6;
481   if (this->_internal_device_type() != 0) {
482     total_size += 1 +
483       ::_pbi::WireFormatLite::EnumSize(this->_internal_device_type());
484   }
485 
486   // uint64 start_timestamp_ns = 8;
487   if (this->_internal_start_timestamp_ns() != 0) {
488     total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_start_timestamp_ns());
489   }
490 
491   // uint64 duration_ms = 9;
492   if (this->_internal_duration_ms() != 0) {
493     total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_duration_ms());
494   }
495 
496   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
497     total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
498   }
499   int cached_size = ::_pbi::ToCachedSize(total_size);
500   SetCachedSize(cached_size);
501   return total_size;
502 }
503 
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)504 void ProfileOptions::CheckTypeAndMergeFrom(
505     const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
506   MergeFrom(*::_pbi::DownCast<const ProfileOptions*>(
507       &from));
508 }
509 
MergeFrom(const ProfileOptions & from)510 void ProfileOptions::MergeFrom(const ProfileOptions& from) {
511   ProfileOptions* const _this = this;
512   // @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.ProfileOptions)
513   GOOGLE_DCHECK_NE(&from, _this);
514   ::uint32_t cached_has_bits = 0;
515   (void) cached_has_bits;
516 
517   if (!from._internal_repository_path().empty()) {
518     _this->_internal_set_repository_path(from._internal_repository_path());
519   }
520   if (from._internal_host_tracer_level() != 0) {
521     _this->_internal_set_host_tracer_level(from._internal_host_tracer_level());
522   }
523   if (from._internal_device_tracer_level() != 0) {
524     _this->_internal_set_device_tracer_level(from._internal_device_tracer_level());
525   }
526   if (from._internal_python_tracer_level() != 0) {
527     _this->_internal_set_python_tracer_level(from._internal_python_tracer_level());
528   }
529   if (from._internal_include_dataset_ops() != 0) {
530     _this->_internal_set_include_dataset_ops(from._internal_include_dataset_ops());
531   }
532   if (from._internal_enable_hlo_proto() != 0) {
533     _this->_internal_set_enable_hlo_proto(from._internal_enable_hlo_proto());
534   }
535   if (from._internal_version() != 0) {
536     _this->_internal_set_version(from._internal_version());
537   }
538   if (from._internal_device_type() != 0) {
539     _this->_internal_set_device_type(from._internal_device_type());
540   }
541   if (from._internal_start_timestamp_ns() != 0) {
542     _this->_internal_set_start_timestamp_ns(from._internal_start_timestamp_ns());
543   }
544   if (from._internal_duration_ms() != 0) {
545     _this->_internal_set_duration_ms(from._internal_duration_ms());
546   }
547   _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
548 }
549 
CopyFrom(const ProfileOptions & from)550 void ProfileOptions::CopyFrom(const ProfileOptions& from) {
551 // @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.ProfileOptions)
552   if (&from == this) return;
553   Clear();
554   MergeFrom(from);
555 }
556 
IsInitialized() const557 bool ProfileOptions::IsInitialized() const {
558   return true;
559 }
560 
InternalSwap(ProfileOptions * other)561 void ProfileOptions::InternalSwap(ProfileOptions* other) {
562   using std::swap;
563   auto* lhs_arena = GetArenaForAllocation();
564   auto* rhs_arena = other->GetArenaForAllocation();
565   _internal_metadata_.InternalSwap(&other->_internal_metadata_);
566   ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
567       &_impl_.repository_path_, lhs_arena,
568       &other->_impl_.repository_path_, rhs_arena
569   );
570   ::PROTOBUF_NAMESPACE_ID::internal::memswap<
571       PROTOBUF_FIELD_OFFSET(ProfileOptions, _impl_.duration_ms_)
572       + sizeof(ProfileOptions::_impl_.duration_ms_)  // NOLINT
573       - PROTOBUF_FIELD_OFFSET(ProfileOptions, _impl_.host_tracer_level_)>(
574           reinterpret_cast<char*>(&_impl_.host_tracer_level_),
575           reinterpret_cast<char*>(&other->_impl_.host_tracer_level_));
576 }
577 
GetTypeName() const578 std::string ProfileOptions::GetTypeName() const {
579   return "tensorflow.ProfileOptions";
580 }
581 
582 
583 // ===================================================================
584 
585 class RemoteProfilerSessionManagerOptions::_Internal {
586  public:
587   static const ::tensorflow::ProfileOptions& profiler_options(const RemoteProfilerSessionManagerOptions* msg);
588 };
589 
590 const ::tensorflow::ProfileOptions&
profiler_options(const RemoteProfilerSessionManagerOptions * msg)591 RemoteProfilerSessionManagerOptions::_Internal::profiler_options(const RemoteProfilerSessionManagerOptions* msg) {
592   return *msg->_impl_.profiler_options_;
593 }
RemoteProfilerSessionManagerOptions(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)594 RemoteProfilerSessionManagerOptions::RemoteProfilerSessionManagerOptions(::PROTOBUF_NAMESPACE_ID::Arena* arena,
595                          bool is_message_owned)
596   : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
597   SharedCtor(arena, is_message_owned);
598   // @@protoc_insertion_point(arena_constructor:tensorflow.RemoteProfilerSessionManagerOptions)
599 }
RemoteProfilerSessionManagerOptions(const RemoteProfilerSessionManagerOptions & from)600 RemoteProfilerSessionManagerOptions::RemoteProfilerSessionManagerOptions(const RemoteProfilerSessionManagerOptions& from)
601   : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
602   RemoteProfilerSessionManagerOptions* const _this = this; (void)_this;
603   new (&_impl_) Impl_{
604       decltype(_impl_.service_addresses_){from._impl_.service_addresses_}
605     , decltype(_impl_.profiler_options_){nullptr}
606     , decltype(_impl_.session_creation_timestamp_ns_){}
607     , decltype(_impl_.max_session_duration_ms_){}
608     , decltype(_impl_.delay_ms_){}
609     , /*decltype(_impl_._cached_size_)*/{}};
610 
611   _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
612   if (from._internal_has_profiler_options()) {
613     _this->_impl_.profiler_options_ = new ::tensorflow::ProfileOptions(*from._impl_.profiler_options_);
614   }
615   ::memcpy(&_impl_.session_creation_timestamp_ns_, &from._impl_.session_creation_timestamp_ns_,
616     static_cast<size_t>(reinterpret_cast<char*>(&_impl_.delay_ms_) -
617     reinterpret_cast<char*>(&_impl_.session_creation_timestamp_ns_)) + sizeof(_impl_.delay_ms_));
618   // @@protoc_insertion_point(copy_constructor:tensorflow.RemoteProfilerSessionManagerOptions)
619 }
620 
SharedCtor(::_pb::Arena * arena,bool is_message_owned)621 inline void RemoteProfilerSessionManagerOptions::SharedCtor(
622     ::_pb::Arena* arena, bool is_message_owned) {
623   (void)arena;
624   (void)is_message_owned;
625   new (&_impl_) Impl_{
626       decltype(_impl_.service_addresses_){arena}
627     , decltype(_impl_.profiler_options_){nullptr}
628     , decltype(_impl_.session_creation_timestamp_ns_){::uint64_t{0u}}
629     , decltype(_impl_.max_session_duration_ms_){::uint64_t{0u}}
630     , decltype(_impl_.delay_ms_){::uint64_t{0u}}
631     , /*decltype(_impl_._cached_size_)*/{}
632   };
633 }
634 
~RemoteProfilerSessionManagerOptions()635 RemoteProfilerSessionManagerOptions::~RemoteProfilerSessionManagerOptions() {
636   // @@protoc_insertion_point(destructor:tensorflow.RemoteProfilerSessionManagerOptions)
637   if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
638   (void)arena;
639     return;
640   }
641   SharedDtor();
642 }
643 
SharedDtor()644 inline void RemoteProfilerSessionManagerOptions::SharedDtor() {
645   GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
646   _impl_.service_addresses_.~RepeatedPtrField();
647   if (this != internal_default_instance()) delete _impl_.profiler_options_;
648 }
649 
SetCachedSize(int size) const650 void RemoteProfilerSessionManagerOptions::SetCachedSize(int size) const {
651   _impl_._cached_size_.Set(size);
652 }
653 
Clear()654 void RemoteProfilerSessionManagerOptions::Clear() {
655 // @@protoc_insertion_point(message_clear_start:tensorflow.RemoteProfilerSessionManagerOptions)
656   ::uint32_t cached_has_bits = 0;
657   // Prevent compiler warnings about cached_has_bits being unused
658   (void) cached_has_bits;
659 
660   _impl_.service_addresses_.Clear();
661   if (GetArenaForAllocation() == nullptr && _impl_.profiler_options_ != nullptr) {
662     delete _impl_.profiler_options_;
663   }
664   _impl_.profiler_options_ = nullptr;
665   ::memset(&_impl_.session_creation_timestamp_ns_, 0, static_cast<size_t>(
666       reinterpret_cast<char*>(&_impl_.delay_ms_) -
667       reinterpret_cast<char*>(&_impl_.session_creation_timestamp_ns_)) + sizeof(_impl_.delay_ms_));
668   _internal_metadata_.Clear<std::string>();
669 }
670 
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)671 const char* RemoteProfilerSessionManagerOptions::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
672 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
673   while (!ctx->Done(&ptr)) {
674     ::uint32_t tag;
675     ptr = ::_pbi::ReadTag(ptr, &tag);
676     switch (tag >> 3) {
677       // .tensorflow.ProfileOptions profiler_options = 1;
678       case 1:
679         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
680           ptr = ctx->ParseMessage(_internal_mutable_profiler_options(), ptr);
681           CHK_(ptr);
682         } else {
683           goto handle_unusual;
684         }
685         continue;
686       // repeated string service_addresses = 2;
687       case 2:
688         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
689           ptr -= 1;
690           do {
691             ptr += 1;
692             auto str = _internal_add_service_addresses();
693             ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
694             CHK_(ptr);
695             CHK_(::_pbi::VerifyUTF8(str, nullptr));
696             if (!ctx->DataAvailable(ptr)) break;
697           } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr));
698         } else {
699           goto handle_unusual;
700         }
701         continue;
702       // uint64 session_creation_timestamp_ns = 3;
703       case 3:
704         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 24)) {
705           _impl_.session_creation_timestamp_ns_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
706           CHK_(ptr);
707         } else {
708           goto handle_unusual;
709         }
710         continue;
711       // uint64 max_session_duration_ms = 4;
712       case 4:
713         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 32)) {
714           _impl_.max_session_duration_ms_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
715           CHK_(ptr);
716         } else {
717           goto handle_unusual;
718         }
719         continue;
720       // uint64 delay_ms = 5;
721       case 5:
722         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 40)) {
723           _impl_.delay_ms_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
724           CHK_(ptr);
725         } else {
726           goto handle_unusual;
727         }
728         continue;
729       default:
730         goto handle_unusual;
731     }  // switch
732   handle_unusual:
733     if ((tag == 0) || ((tag & 7) == 4)) {
734       CHK_(ptr);
735       ctx->SetLastTag(tag);
736       goto message_done;
737     }
738     ptr = UnknownFieldParse(
739         tag,
740         _internal_metadata_.mutable_unknown_fields<std::string>(),
741         ptr, ctx);
742     CHK_(ptr != nullptr);
743   }  // while
744 message_done:
745   return ptr;
746 failure:
747   ptr = nullptr;
748   goto message_done;
749 #undef CHK_
750 }
751 
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const752 ::uint8_t* RemoteProfilerSessionManagerOptions::_InternalSerialize(
753     ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
754   // @@protoc_insertion_point(serialize_to_array_start:tensorflow.RemoteProfilerSessionManagerOptions)
755   ::uint32_t cached_has_bits = 0;
756   (void) cached_has_bits;
757 
758   // .tensorflow.ProfileOptions profiler_options = 1;
759   if (this->_internal_has_profiler_options()) {
760     target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
761       InternalWriteMessage(1, _Internal::profiler_options(this),
762         _Internal::profiler_options(this).GetCachedSize(), target, stream);
763   }
764 
765   // repeated string service_addresses = 2;
766   for (int i = 0, n = this->_internal_service_addresses_size(); i < n; i++) {
767     const auto& s = this->_internal_service_addresses(i);
768     ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
769       s.data(), static_cast<int>(s.length()),
770       ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
771       "tensorflow.RemoteProfilerSessionManagerOptions.service_addresses");
772     target = stream->WriteString(2, s, target);
773   }
774 
775   // uint64 session_creation_timestamp_ns = 3;
776   if (this->_internal_session_creation_timestamp_ns() != 0) {
777     target = stream->EnsureSpace(target);
778     target = ::_pbi::WireFormatLite::WriteUInt64ToArray(3, this->_internal_session_creation_timestamp_ns(), target);
779   }
780 
781   // uint64 max_session_duration_ms = 4;
782   if (this->_internal_max_session_duration_ms() != 0) {
783     target = stream->EnsureSpace(target);
784     target = ::_pbi::WireFormatLite::WriteUInt64ToArray(4, this->_internal_max_session_duration_ms(), target);
785   }
786 
787   // uint64 delay_ms = 5;
788   if (this->_internal_delay_ms() != 0) {
789     target = stream->EnsureSpace(target);
790     target = ::_pbi::WireFormatLite::WriteUInt64ToArray(5, this->_internal_delay_ms(), target);
791   }
792 
793   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
794     target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
795         static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
796   }
797   // @@protoc_insertion_point(serialize_to_array_end:tensorflow.RemoteProfilerSessionManagerOptions)
798   return target;
799 }
800 
ByteSizeLong() const801 size_t RemoteProfilerSessionManagerOptions::ByteSizeLong() const {
802 // @@protoc_insertion_point(message_byte_size_start:tensorflow.RemoteProfilerSessionManagerOptions)
803   size_t total_size = 0;
804 
805   ::uint32_t cached_has_bits = 0;
806   // Prevent compiler warnings about cached_has_bits being unused
807   (void) cached_has_bits;
808 
809   // repeated string service_addresses = 2;
810   total_size += 1 *
811       ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.service_addresses_.size());
812   for (int i = 0, n = _impl_.service_addresses_.size(); i < n; i++) {
813     total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
814       _impl_.service_addresses_.Get(i));
815   }
816 
817   // .tensorflow.ProfileOptions profiler_options = 1;
818   if (this->_internal_has_profiler_options()) {
819     total_size += 1 +
820       ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
821         *_impl_.profiler_options_);
822   }
823 
824   // uint64 session_creation_timestamp_ns = 3;
825   if (this->_internal_session_creation_timestamp_ns() != 0) {
826     total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_session_creation_timestamp_ns());
827   }
828 
829   // uint64 max_session_duration_ms = 4;
830   if (this->_internal_max_session_duration_ms() != 0) {
831     total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_max_session_duration_ms());
832   }
833 
834   // uint64 delay_ms = 5;
835   if (this->_internal_delay_ms() != 0) {
836     total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_delay_ms());
837   }
838 
839   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
840     total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
841   }
842   int cached_size = ::_pbi::ToCachedSize(total_size);
843   SetCachedSize(cached_size);
844   return total_size;
845 }
846 
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)847 void RemoteProfilerSessionManagerOptions::CheckTypeAndMergeFrom(
848     const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
849   MergeFrom(*::_pbi::DownCast<const RemoteProfilerSessionManagerOptions*>(
850       &from));
851 }
852 
MergeFrom(const RemoteProfilerSessionManagerOptions & from)853 void RemoteProfilerSessionManagerOptions::MergeFrom(const RemoteProfilerSessionManagerOptions& from) {
854   RemoteProfilerSessionManagerOptions* const _this = this;
855   // @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.RemoteProfilerSessionManagerOptions)
856   GOOGLE_DCHECK_NE(&from, _this);
857   ::uint32_t cached_has_bits = 0;
858   (void) cached_has_bits;
859 
860   _this->_impl_.service_addresses_.MergeFrom(from._impl_.service_addresses_);
861   if (from._internal_has_profiler_options()) {
862     _this->_internal_mutable_profiler_options()->::tensorflow::ProfileOptions::MergeFrom(
863         from._internal_profiler_options());
864   }
865   if (from._internal_session_creation_timestamp_ns() != 0) {
866     _this->_internal_set_session_creation_timestamp_ns(from._internal_session_creation_timestamp_ns());
867   }
868   if (from._internal_max_session_duration_ms() != 0) {
869     _this->_internal_set_max_session_duration_ms(from._internal_max_session_duration_ms());
870   }
871   if (from._internal_delay_ms() != 0) {
872     _this->_internal_set_delay_ms(from._internal_delay_ms());
873   }
874   _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
875 }
876 
CopyFrom(const RemoteProfilerSessionManagerOptions & from)877 void RemoteProfilerSessionManagerOptions::CopyFrom(const RemoteProfilerSessionManagerOptions& from) {
878 // @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.RemoteProfilerSessionManagerOptions)
879   if (&from == this) return;
880   Clear();
881   MergeFrom(from);
882 }
883 
IsInitialized() const884 bool RemoteProfilerSessionManagerOptions::IsInitialized() const {
885   return true;
886 }
887 
InternalSwap(RemoteProfilerSessionManagerOptions * other)888 void RemoteProfilerSessionManagerOptions::InternalSwap(RemoteProfilerSessionManagerOptions* other) {
889   using std::swap;
890   _internal_metadata_.InternalSwap(&other->_internal_metadata_);
891   _impl_.service_addresses_.InternalSwap(&other->_impl_.service_addresses_);
892   ::PROTOBUF_NAMESPACE_ID::internal::memswap<
893       PROTOBUF_FIELD_OFFSET(RemoteProfilerSessionManagerOptions, _impl_.delay_ms_)
894       + sizeof(RemoteProfilerSessionManagerOptions::_impl_.delay_ms_)  // NOLINT
895       - PROTOBUF_FIELD_OFFSET(RemoteProfilerSessionManagerOptions, _impl_.profiler_options_)>(
896           reinterpret_cast<char*>(&_impl_.profiler_options_),
897           reinterpret_cast<char*>(&other->_impl_.profiler_options_));
898 }
899 
GetTypeName() const900 std::string RemoteProfilerSessionManagerOptions::GetTypeName() const {
901   return "tensorflow.RemoteProfilerSessionManagerOptions";
902 }
903 
904 
905 // @@protoc_insertion_point(namespace_scope)
906 }  // namespace tensorflow
907 PROTOBUF_NAMESPACE_OPEN
908 template<> PROTOBUF_NOINLINE ::tensorflow::ProfileOptions*
CreateMaybeMessage(Arena * arena)909 Arena::CreateMaybeMessage< ::tensorflow::ProfileOptions >(Arena* arena) {
910   return Arena::CreateMessageInternal< ::tensorflow::ProfileOptions >(arena);
911 }
912 template<> PROTOBUF_NOINLINE ::tensorflow::RemoteProfilerSessionManagerOptions*
CreateMaybeMessage(Arena * arena)913 Arena::CreateMaybeMessage< ::tensorflow::RemoteProfilerSessionManagerOptions >(Arena* arena) {
914   return Arena::CreateMessageInternal< ::tensorflow::RemoteProfilerSessionManagerOptions >(arena);
915 }
916 PROTOBUF_NAMESPACE_CLOSE
917 
918 // @@protoc_insertion_point(global_scope)
919 #include <google/protobuf/port_undef.inc>
920