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 | |
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> |
18 | extern PROTOBUF_INTERNAL_EXPORT_tensorflow_2fcore_2fprotobuf_2fdevice_5fproperties_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_DeviceProperties_tensorflow_2fcore_2fprotobuf_2fdevice_5fproperties_2eproto; |
19 | extern PROTOBUF_INTERNAL_EXPORT_tensorflow_2fcore_2fprotobuf_2fdevice_5fproperties_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_DeviceProperties_EnvironmentEntry_DoNotUse_tensorflow_2fcore_2fprotobuf_2fdevice_5fproperties_2eproto; |
20 | namespace tensorflow { |
21 | class DeviceProperties_EnvironmentEntry_DoNotUseDefaultTypeInternal { |
22 | public: |
23 | ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<DeviceProperties_EnvironmentEntry_DoNotUse> _instance; |
24 | } _DeviceProperties_EnvironmentEntry_DoNotUse_default_instance_; |
25 | class DevicePropertiesDefaultTypeInternal { |
26 | public: |
27 | ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<DeviceProperties> _instance; |
28 | } _DeviceProperties_default_instance_; |
29 | class NamedDeviceDefaultTypeInternal { |
30 | public: |
31 | ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<NamedDevice> _instance; |
32 | } _NamedDevice_default_instance_; |
33 | } // namespace tensorflow |
34 | static void InitDefaultsscc_info_DeviceProperties_tensorflow_2fcore_2fprotobuf_2fdevice_5fproperties_2eproto() { |
35 | GOOGLE_PROTOBUF_VERIFY_VERSION; |
36 | |
37 | { |
38 | void* ptr = &::tensorflow::_DeviceProperties_default_instance_; |
39 | new (ptr) ::tensorflow::DeviceProperties(); |
40 | ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); |
41 | } |
42 | ::tensorflow::DeviceProperties::InitAsDefaultInstance(); |
43 | } |
44 | |
45 | ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_DeviceProperties_tensorflow_2fcore_2fprotobuf_2fdevice_5fproperties_2eproto = |
46 | {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsscc_info_DeviceProperties_tensorflow_2fcore_2fprotobuf_2fdevice_5fproperties_2eproto}, { |
47 | &scc_info_DeviceProperties_EnvironmentEntry_DoNotUse_tensorflow_2fcore_2fprotobuf_2fdevice_5fproperties_2eproto.base,}}; |
48 | |
49 | static void InitDefaultsscc_info_DeviceProperties_EnvironmentEntry_DoNotUse_tensorflow_2fcore_2fprotobuf_2fdevice_5fproperties_2eproto() { |
50 | GOOGLE_PROTOBUF_VERIFY_VERSION; |
51 | |
52 | { |
53 | void* ptr = &::tensorflow::_DeviceProperties_EnvironmentEntry_DoNotUse_default_instance_; |
54 | new (ptr) ::tensorflow::DeviceProperties_EnvironmentEntry_DoNotUse(); |
55 | } |
56 | ::tensorflow::DeviceProperties_EnvironmentEntry_DoNotUse::InitAsDefaultInstance(); |
57 | } |
58 | |
59 | ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_DeviceProperties_EnvironmentEntry_DoNotUse_tensorflow_2fcore_2fprotobuf_2fdevice_5fproperties_2eproto = |
60 | {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_DeviceProperties_EnvironmentEntry_DoNotUse_tensorflow_2fcore_2fprotobuf_2fdevice_5fproperties_2eproto}, {}}; |
61 | |
62 | static void InitDefaultsscc_info_NamedDevice_tensorflow_2fcore_2fprotobuf_2fdevice_5fproperties_2eproto() { |
63 | GOOGLE_PROTOBUF_VERIFY_VERSION; |
64 | |
65 | { |
66 | void* ptr = &::tensorflow::_NamedDevice_default_instance_; |
67 | new (ptr) ::tensorflow::NamedDevice(); |
68 | ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); |
69 | } |
70 | ::tensorflow::NamedDevice::InitAsDefaultInstance(); |
71 | } |
72 | |
73 | ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_NamedDevice_tensorflow_2fcore_2fprotobuf_2fdevice_5fproperties_2eproto = |
74 | {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsscc_info_NamedDevice_tensorflow_2fcore_2fprotobuf_2fdevice_5fproperties_2eproto}, { |
75 | &scc_info_DeviceProperties_tensorflow_2fcore_2fprotobuf_2fdevice_5fproperties_2eproto.base,}}; |
76 | |
77 | static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_tensorflow_2fcore_2fprotobuf_2fdevice_5fproperties_2eproto[3]; |
78 | static constexpr ::PROTOBUF_NAMESPACE_ID::EnumDescriptor const** file_level_enum_descriptors_tensorflow_2fcore_2fprotobuf_2fdevice_5fproperties_2eproto = nullptr; |
79 | static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_tensorflow_2fcore_2fprotobuf_2fdevice_5fproperties_2eproto = nullptr; |
80 | |
81 | const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_tensorflow_2fcore_2fprotobuf_2fdevice_5fproperties_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { |
82 | PROTOBUF_FIELD_OFFSET(::tensorflow::DeviceProperties_EnvironmentEntry_DoNotUse, _has_bits_), |
83 | PROTOBUF_FIELD_OFFSET(::tensorflow::DeviceProperties_EnvironmentEntry_DoNotUse, _internal_metadata_), |
84 | ~0u, // no _extensions_ |
85 | ~0u, // no _oneof_case_ |
86 | ~0u, // no _weak_field_map_ |
87 | PROTOBUF_FIELD_OFFSET(::tensorflow::DeviceProperties_EnvironmentEntry_DoNotUse, key_), |
88 | PROTOBUF_FIELD_OFFSET(::tensorflow::DeviceProperties_EnvironmentEntry_DoNotUse, value_), |
89 | 0, |
90 | 1, |
91 | ~0u, // no _has_bits_ |
92 | PROTOBUF_FIELD_OFFSET(::tensorflow::DeviceProperties, _internal_metadata_), |
93 | ~0u, // no _extensions_ |
94 | ~0u, // no _oneof_case_ |
95 | ~0u, // no _weak_field_map_ |
96 | PROTOBUF_FIELD_OFFSET(::tensorflow::DeviceProperties, type_), |
97 | PROTOBUF_FIELD_OFFSET(::tensorflow::DeviceProperties, vendor_), |
98 | PROTOBUF_FIELD_OFFSET(::tensorflow::DeviceProperties, model_), |
99 | PROTOBUF_FIELD_OFFSET(::tensorflow::DeviceProperties, frequency_), |
100 | PROTOBUF_FIELD_OFFSET(::tensorflow::DeviceProperties, num_cores_), |
101 | PROTOBUF_FIELD_OFFSET(::tensorflow::DeviceProperties, environment_), |
102 | PROTOBUF_FIELD_OFFSET(::tensorflow::DeviceProperties, num_registers_), |
103 | PROTOBUF_FIELD_OFFSET(::tensorflow::DeviceProperties, l1_cache_size_), |
104 | PROTOBUF_FIELD_OFFSET(::tensorflow::DeviceProperties, l2_cache_size_), |
105 | PROTOBUF_FIELD_OFFSET(::tensorflow::DeviceProperties, l3_cache_size_), |
106 | PROTOBUF_FIELD_OFFSET(::tensorflow::DeviceProperties, shared_memory_size_per_multiprocessor_), |
107 | PROTOBUF_FIELD_OFFSET(::tensorflow::DeviceProperties, memory_size_), |
108 | PROTOBUF_FIELD_OFFSET(::tensorflow::DeviceProperties, bandwidth_), |
109 | ~0u, // no _has_bits_ |
110 | PROTOBUF_FIELD_OFFSET(::tensorflow::NamedDevice, _internal_metadata_), |
111 | ~0u, // no _extensions_ |
112 | ~0u, // no _oneof_case_ |
113 | ~0u, // no _weak_field_map_ |
114 | PROTOBUF_FIELD_OFFSET(::tensorflow::NamedDevice, name_), |
115 | PROTOBUF_FIELD_OFFSET(::tensorflow::NamedDevice, properties_), |
116 | }; |
117 | static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { |
118 | { 0, 7, sizeof(::tensorflow::DeviceProperties_EnvironmentEntry_DoNotUse)}, |
119 | { 9, -1, sizeof(::tensorflow::DeviceProperties)}, |
120 | { 27, -1, sizeof(::tensorflow::NamedDevice)}, |
121 | }; |
122 | |
123 | static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = { |
124 | reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::tensorflow::_DeviceProperties_EnvironmentEntry_DoNotUse_default_instance_), |
125 | reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::tensorflow::_DeviceProperties_default_instance_), |
126 | reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::tensorflow::_NamedDevice_default_instance_), |
127 | }; |
128 | |
129 | const char descriptor_table_protodef_tensorflow_2fcore_2fprotobuf_2fdevice_5fproperties_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = |
130 | "\n0tensorflow/core/protobuf/device_proper" |
131 | "ties.proto\022\ntensorflow\"\220\003\n\020DevicePropert" |
132 | "ies\022\014\n\004type\030\001 \001(\t\022\016\n\006vendor\030\002 \001(\t\022\r\n\005mod" |
133 | "el\030\003 \001(\t\022\021\n\tfrequency\030\004 \001(\003\022\021\n\tnum_cores" |
134 | "\030\005 \001(\003\022B\n\013environment\030\006 \003(\0132-.tensorflow" |
135 | ".DeviceProperties.EnvironmentEntry\022\025\n\rnu" |
136 | "m_registers\030\007 \001(\003\022\025\n\rl1_cache_size\030\010 \001(\003" |
137 | "\022\025\n\rl2_cache_size\030\t \001(\003\022\025\n\rl3_cache_size" |
138 | "\030\n \001(\003\022-\n%shared_memory_size_per_multipr" |
139 | "ocessor\030\013 \001(\003\022\023\n\013memory_size\030\014 \001(\003\022\021\n\tba" |
140 | "ndwidth\030\r \001(\003\0322\n\020EnvironmentEntry\022\013\n\003key" |
141 | "\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"M\n\013NamedDevice" |
142 | "\022\014\n\004name\030\001 \001(\t\0220\n\nproperties\030\002 \001(\0132\034.ten" |
143 | "sorflow.DevicePropertiesBrB\026DeviceProper" |
144 | "tiesProtosZUgithub.com/tensorflow/tensor" |
145 | "flow/tensorflow/go/core/protobuf/for_cor" |
146 | "e_protos_go_proto\370\001\001b\006proto3" |
147 | ; |
148 | static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_tensorflow_2fcore_2fprotobuf_2fdevice_5fproperties_2eproto_deps[1] = { |
149 | }; |
150 | static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_tensorflow_2fcore_2fprotobuf_2fdevice_5fproperties_2eproto_sccs[3] = { |
151 | &scc_info_DeviceProperties_tensorflow_2fcore_2fprotobuf_2fdevice_5fproperties_2eproto.base, |
152 | &scc_info_DeviceProperties_EnvironmentEntry_DoNotUse_tensorflow_2fcore_2fprotobuf_2fdevice_5fproperties_2eproto.base, |
153 | &scc_info_NamedDevice_tensorflow_2fcore_2fprotobuf_2fdevice_5fproperties_2eproto.base, |
154 | }; |
155 | static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_tensorflow_2fcore_2fprotobuf_2fdevice_5fproperties_2eproto_once; |
156 | static bool descriptor_table_tensorflow_2fcore_2fprotobuf_2fdevice_5fproperties_2eproto_initialized = false; |
157 | const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_tensorflow_2fcore_2fprotobuf_2fdevice_5fproperties_2eproto = { |
158 | &descriptor_table_tensorflow_2fcore_2fprotobuf_2fdevice_5fproperties_2eproto_initialized, descriptor_table_protodef_tensorflow_2fcore_2fprotobuf_2fdevice_5fproperties_2eproto, "tensorflow/core/protobuf/device_properties.proto" , 668, |
159 | &descriptor_table_tensorflow_2fcore_2fprotobuf_2fdevice_5fproperties_2eproto_once, descriptor_table_tensorflow_2fcore_2fprotobuf_2fdevice_5fproperties_2eproto_sccs, descriptor_table_tensorflow_2fcore_2fprotobuf_2fdevice_5fproperties_2eproto_deps, 3, 0, |
160 | schemas, file_default_instances, TableStruct_tensorflow_2fcore_2fprotobuf_2fdevice_5fproperties_2eproto::offsets, |
161 | file_level_metadata_tensorflow_2fcore_2fprotobuf_2fdevice_5fproperties_2eproto, 3, file_level_enum_descriptors_tensorflow_2fcore_2fprotobuf_2fdevice_5fproperties_2eproto, file_level_service_descriptors_tensorflow_2fcore_2fprotobuf_2fdevice_5fproperties_2eproto, |
162 | }; |
163 | |
164 | // Force running AddDescriptors() at dynamic initialization time. |
165 | static bool dynamic_init_dummy_tensorflow_2fcore_2fprotobuf_2fdevice_5fproperties_2eproto = ( ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptors(&descriptor_table_tensorflow_2fcore_2fprotobuf_2fdevice_5fproperties_2eproto), true); |
166 | namespace tensorflow { |
167 | |
168 | // =================================================================== |
169 | |
170 | DeviceProperties_EnvironmentEntry_DoNotUse::DeviceProperties_EnvironmentEntry_DoNotUse() {} |
171 | DeviceProperties_EnvironmentEntry_DoNotUse::DeviceProperties_EnvironmentEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena* arena) |
172 | : SuperType(arena) {} |
173 | void DeviceProperties_EnvironmentEntry_DoNotUse::MergeFrom(const DeviceProperties_EnvironmentEntry_DoNotUse& other) { |
174 | MergeFromInternal(other); |
175 | } |
176 | ::PROTOBUF_NAMESPACE_ID::Metadata DeviceProperties_EnvironmentEntry_DoNotUse::GetMetadata() const { |
177 | return GetMetadataStatic(); |
178 | } |
179 | void DeviceProperties_EnvironmentEntry_DoNotUse::MergeFrom( |
180 | const ::PROTOBUF_NAMESPACE_ID::Message& other) { |
181 | ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom(other); |
182 | } |
183 | |
184 | |
185 | // =================================================================== |
186 | |
187 | void DeviceProperties::InitAsDefaultInstance() { |
188 | } |
189 | class DeviceProperties::_Internal { |
190 | public: |
191 | }; |
192 | |
193 | DeviceProperties::DeviceProperties() |
194 | : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { |
195 | SharedCtor(); |
196 | // @@protoc_insertion_point(constructor:tensorflow.DeviceProperties) |
197 | } |
198 | DeviceProperties::DeviceProperties(::PROTOBUF_NAMESPACE_ID::Arena* arena) |
199 | : ::PROTOBUF_NAMESPACE_ID::Message(), |
200 | _internal_metadata_(arena), |
201 | environment_(arena) { |
202 | SharedCtor(); |
203 | RegisterArenaDtor(arena); |
204 | // @@protoc_insertion_point(arena_constructor:tensorflow.DeviceProperties) |
205 | } |
206 | DeviceProperties::DeviceProperties(const DeviceProperties& from) |
207 | : ::PROTOBUF_NAMESPACE_ID::Message(), |
208 | _internal_metadata_(nullptr) { |
209 | _internal_metadata_.MergeFrom(from._internal_metadata_); |
210 | environment_.MergeFrom(from.environment_); |
211 | type_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); |
212 | if (!from.type().empty()) { |
213 | type_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.type(), |
214 | GetArenaNoVirtual()); |
215 | } |
216 | vendor_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); |
217 | if (!from.vendor().empty()) { |
218 | vendor_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.vendor(), |
219 | GetArenaNoVirtual()); |
220 | } |
221 | model_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); |
222 | if (!from.model().empty()) { |
223 | model_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.model(), |
224 | GetArenaNoVirtual()); |
225 | } |
226 | ::memcpy(&frequency_, &from.frequency_, |
227 | static_cast<size_t>(reinterpret_cast<char*>(&bandwidth_) - |
228 | reinterpret_cast<char*>(&frequency_)) + sizeof(bandwidth_)); |
229 | // @@protoc_insertion_point(copy_constructor:tensorflow.DeviceProperties) |
230 | } |
231 | |
232 | void DeviceProperties::SharedCtor() { |
233 | ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_DeviceProperties_tensorflow_2fcore_2fprotobuf_2fdevice_5fproperties_2eproto.base); |
234 | type_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); |
235 | vendor_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); |
236 | model_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); |
237 | ::memset(&frequency_, 0, static_cast<size_t>( |
238 | reinterpret_cast<char*>(&bandwidth_) - |
239 | reinterpret_cast<char*>(&frequency_)) + sizeof(bandwidth_)); |
240 | } |
241 | |
242 | DeviceProperties::~DeviceProperties() { |
243 | // @@protoc_insertion_point(destructor:tensorflow.DeviceProperties) |
244 | SharedDtor(); |
245 | } |
246 | |
247 | void DeviceProperties::SharedDtor() { |
248 | GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr); |
249 | type_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); |
250 | vendor_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); |
251 | model_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); |
252 | } |
253 | |
254 | void DeviceProperties::ArenaDtor(void* object) { |
255 | DeviceProperties* _this = reinterpret_cast< DeviceProperties* >(object); |
256 | (void)_this; |
257 | } |
258 | void DeviceProperties::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { |
259 | } |
260 | void DeviceProperties::SetCachedSize(int size) const { |
261 | _cached_size_.Set(size); |
262 | } |
263 | const DeviceProperties& DeviceProperties::default_instance() { |
264 | ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_DeviceProperties_tensorflow_2fcore_2fprotobuf_2fdevice_5fproperties_2eproto.base); |
265 | return *internal_default_instance(); |
266 | } |
267 | |
268 | |
269 | void DeviceProperties::Clear() { |
270 | // @@protoc_insertion_point(message_clear_start:tensorflow.DeviceProperties) |
271 | ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; |
272 | // Prevent compiler warnings about cached_has_bits being unused |
273 | (void) cached_has_bits; |
274 | |
275 | environment_.Clear(); |
276 | type_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); |
277 | vendor_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); |
278 | model_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); |
279 | ::memset(&frequency_, 0, static_cast<size_t>( |
280 | reinterpret_cast<char*>(&bandwidth_) - |
281 | reinterpret_cast<char*>(&frequency_)) + sizeof(bandwidth_)); |
282 | _internal_metadata_.Clear(); |
283 | } |
284 | |
285 | #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER |
286 | const char* DeviceProperties::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { |
287 | #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure |
288 | ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena; |
289 | while (!ctx->Done(&ptr)) { |
290 | ::PROTOBUF_NAMESPACE_ID::uint32 tag; |
291 | ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); |
292 | CHK_(ptr); |
293 | switch (tag >> 3) { |
294 | // string type = 1; |
295 | case 1: |
296 | if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { |
297 | ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_type(), ptr, ctx, "tensorflow.DeviceProperties.type" ); |
298 | CHK_(ptr); |
299 | } else goto handle_unusual; |
300 | continue; |
301 | // string vendor = 2; |
302 | case 2: |
303 | if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { |
304 | ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_vendor(), ptr, ctx, "tensorflow.DeviceProperties.vendor" ); |
305 | CHK_(ptr); |
306 | } else goto handle_unusual; |
307 | continue; |
308 | // string model = 3; |
309 | case 3: |
310 | if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { |
311 | ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_model(), ptr, ctx, "tensorflow.DeviceProperties.model" ); |
312 | CHK_(ptr); |
313 | } else goto handle_unusual; |
314 | continue; |
315 | // int64 frequency = 4; |
316 | case 4: |
317 | if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) { |
318 | frequency_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); |
319 | CHK_(ptr); |
320 | } else goto handle_unusual; |
321 | continue; |
322 | // int64 num_cores = 5; |
323 | case 5: |
324 | if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) { |
325 | num_cores_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); |
326 | CHK_(ptr); |
327 | } else goto handle_unusual; |
328 | continue; |
329 | // map<string, string> environment = 6; |
330 | case 6: |
331 | if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 50)) { |
332 | ptr -= 1; |
333 | do { |
334 | ptr += 1; |
335 | ptr = ctx->ParseMessage(&environment_, ptr); |
336 | CHK_(ptr); |
337 | if (!ctx->DataAvailable(ptr)) break; |
338 | } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 50); |
339 | } else goto handle_unusual; |
340 | continue; |
341 | // int64 num_registers = 7; |
342 | case 7: |
343 | if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 56)) { |
344 | num_registers_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); |
345 | CHK_(ptr); |
346 | } else goto handle_unusual; |
347 | continue; |
348 | // int64 l1_cache_size = 8; |
349 | case 8: |
350 | if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 64)) { |
351 | l1_cache_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); |
352 | CHK_(ptr); |
353 | } else goto handle_unusual; |
354 | continue; |
355 | // int64 l2_cache_size = 9; |
356 | case 9: |
357 | if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 72)) { |
358 | l2_cache_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); |
359 | CHK_(ptr); |
360 | } else goto handle_unusual; |
361 | continue; |
362 | // int64 l3_cache_size = 10; |
363 | case 10: |
364 | if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 80)) { |
365 | l3_cache_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); |
366 | CHK_(ptr); |
367 | } else goto handle_unusual; |
368 | continue; |
369 | // int64 shared_memory_size_per_multiprocessor = 11; |
370 | case 11: |
371 | if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 88)) { |
372 | shared_memory_size_per_multiprocessor_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); |
373 | CHK_(ptr); |
374 | } else goto handle_unusual; |
375 | continue; |
376 | // int64 memory_size = 12; |
377 | case 12: |
378 | if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 96)) { |
379 | memory_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); |
380 | CHK_(ptr); |
381 | } else goto handle_unusual; |
382 | continue; |
383 | // int64 bandwidth = 13; |
384 | case 13: |
385 | if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 104)) { |
386 | bandwidth_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); |
387 | CHK_(ptr); |
388 | } else goto handle_unusual; |
389 | continue; |
390 | default: { |
391 | handle_unusual: |
392 | if ((tag & 7) == 4 || tag == 0) { |
393 | ctx->SetLastTag(tag); |
394 | goto success; |
395 | } |
396 | ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); |
397 | CHK_(ptr != nullptr); |
398 | continue; |
399 | } |
400 | } // switch |
401 | } // while |
402 | success: |
403 | return ptr; |
404 | failure: |
405 | ptr = nullptr; |
406 | goto success; |
407 | #undef CHK_ |
408 | } |
409 | #else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER |
410 | bool DeviceProperties::MergePartialFromCodedStream( |
411 | ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { |
412 | #define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure |
413 | ::PROTOBUF_NAMESPACE_ID::uint32 tag; |
414 | // @@protoc_insertion_point(parse_start:tensorflow.DeviceProperties) |
415 | for (;;) { |
416 | ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); |
417 | tag = p.first; |
418 | if (!p.second) goto handle_unusual; |
419 | switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { |
420 | // string type = 1; |
421 | case 1: { |
422 | if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { |
423 | DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( |
424 | input, this->mutable_type())); |
425 | DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( |
426 | this->type().data(), static_cast<int>(this->type().length()), |
427 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, |
428 | "tensorflow.DeviceProperties.type" )); |
429 | } else { |
430 | goto handle_unusual; |
431 | } |
432 | break; |
433 | } |
434 | |
435 | // string vendor = 2; |
436 | case 2: { |
437 | if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) { |
438 | DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( |
439 | input, this->mutable_vendor())); |
440 | DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( |
441 | this->vendor().data(), static_cast<int>(this->vendor().length()), |
442 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, |
443 | "tensorflow.DeviceProperties.vendor" )); |
444 | } else { |
445 | goto handle_unusual; |
446 | } |
447 | break; |
448 | } |
449 | |
450 | // string model = 3; |
451 | case 3: { |
452 | if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (26 & 0xFF)) { |
453 | DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( |
454 | input, this->mutable_model())); |
455 | DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( |
456 | this->model().data(), static_cast<int>(this->model().length()), |
457 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, |
458 | "tensorflow.DeviceProperties.model" )); |
459 | } else { |
460 | goto handle_unusual; |
461 | } |
462 | break; |
463 | } |
464 | |
465 | // int64 frequency = 4; |
466 | case 4: { |
467 | if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (32 & 0xFF)) { |
468 | |
469 | DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< |
470 | ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( |
471 | input, &frequency_))); |
472 | } else { |
473 | goto handle_unusual; |
474 | } |
475 | break; |
476 | } |
477 | |
478 | // int64 num_cores = 5; |
479 | case 5: { |
480 | if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (40 & 0xFF)) { |
481 | |
482 | DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< |
483 | ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( |
484 | input, &num_cores_))); |
485 | } else { |
486 | goto handle_unusual; |
487 | } |
488 | break; |
489 | } |
490 | |
491 | // map<string, string> environment = 6; |
492 | case 6: { |
493 | if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (50 & 0xFF)) { |
494 | DeviceProperties_EnvironmentEntry_DoNotUse::Parser< ::PROTOBUF_NAMESPACE_ID::internal::MapField< |
495 | DeviceProperties_EnvironmentEntry_DoNotUse, |
496 | std::string, std::string, |
497 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING, |
498 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING, |
499 | 0 >, |
500 | ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string > > parser(&environment_); |
501 | DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessageNoVirtual( |
502 | input, &parser)); |
503 | DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( |
504 | parser.key().data(), static_cast<int>(parser.key().length()), |
505 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, |
506 | "tensorflow.DeviceProperties.EnvironmentEntry.key" )); |
507 | DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( |
508 | parser.value().data(), static_cast<int>(parser.value().length()), |
509 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, |
510 | "tensorflow.DeviceProperties.EnvironmentEntry.value" )); |
511 | } else { |
512 | goto handle_unusual; |
513 | } |
514 | break; |
515 | } |
516 | |
517 | // int64 num_registers = 7; |
518 | case 7: { |
519 | if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (56 & 0xFF)) { |
520 | |
521 | DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< |
522 | ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( |
523 | input, &num_registers_))); |
524 | } else { |
525 | goto handle_unusual; |
526 | } |
527 | break; |
528 | } |
529 | |
530 | // int64 l1_cache_size = 8; |
531 | case 8: { |
532 | if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (64 & 0xFF)) { |
533 | |
534 | DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< |
535 | ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( |
536 | input, &l1_cache_size_))); |
537 | } else { |
538 | goto handle_unusual; |
539 | } |
540 | break; |
541 | } |
542 | |
543 | // int64 l2_cache_size = 9; |
544 | case 9: { |
545 | if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (72 & 0xFF)) { |
546 | |
547 | DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< |
548 | ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( |
549 | input, &l2_cache_size_))); |
550 | } else { |
551 | goto handle_unusual; |
552 | } |
553 | break; |
554 | } |
555 | |
556 | // int64 l3_cache_size = 10; |
557 | case 10: { |
558 | if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (80 & 0xFF)) { |
559 | |
560 | DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< |
561 | ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( |
562 | input, &l3_cache_size_))); |
563 | } else { |
564 | goto handle_unusual; |
565 | } |
566 | break; |
567 | } |
568 | |
569 | // int64 shared_memory_size_per_multiprocessor = 11; |
570 | case 11: { |
571 | if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (88 & 0xFF)) { |
572 | |
573 | DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< |
574 | ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( |
575 | input, &shared_memory_size_per_multiprocessor_))); |
576 | } else { |
577 | goto handle_unusual; |
578 | } |
579 | break; |
580 | } |
581 | |
582 | // int64 memory_size = 12; |
583 | case 12: { |
584 | if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (96 & 0xFF)) { |
585 | |
586 | DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< |
587 | ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( |
588 | input, &memory_size_))); |
589 | } else { |
590 | goto handle_unusual; |
591 | } |
592 | break; |
593 | } |
594 | |
595 | // int64 bandwidth = 13; |
596 | case 13: { |
597 | if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (104 & 0xFF)) { |
598 | |
599 | DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< |
600 | ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( |
601 | input, &bandwidth_))); |
602 | } else { |
603 | goto handle_unusual; |
604 | } |
605 | break; |
606 | } |
607 | |
608 | default: { |
609 | handle_unusual: |
610 | if (tag == 0) { |
611 | goto success; |
612 | } |
613 | DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( |
614 | input, tag, _internal_metadata_.mutable_unknown_fields())); |
615 | break; |
616 | } |
617 | } |
618 | } |
619 | success: |
620 | // @@protoc_insertion_point(parse_success:tensorflow.DeviceProperties) |
621 | return true; |
622 | failure: |
623 | // @@protoc_insertion_point(parse_failure:tensorflow.DeviceProperties) |
624 | return false; |
625 | #undef DO_ |
626 | } |
627 | #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER |
628 | |
629 | void DeviceProperties::SerializeWithCachedSizes( |
630 | ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { |
631 | // @@protoc_insertion_point(serialize_start:tensorflow.DeviceProperties) |
632 | ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; |
633 | (void) cached_has_bits; |
634 | |
635 | // string type = 1; |
636 | if (this->type().size() > 0) { |
637 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( |
638 | this->type().data(), static_cast<int>(this->type().length()), |
639 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, |
640 | "tensorflow.DeviceProperties.type" ); |
641 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased( |
642 | 1, this->type(), output); |
643 | } |
644 | |
645 | // string vendor = 2; |
646 | if (this->vendor().size() > 0) { |
647 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( |
648 | this->vendor().data(), static_cast<int>(this->vendor().length()), |
649 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, |
650 | "tensorflow.DeviceProperties.vendor" ); |
651 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased( |
652 | 2, this->vendor(), output); |
653 | } |
654 | |
655 | // string model = 3; |
656 | if (this->model().size() > 0) { |
657 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( |
658 | this->model().data(), static_cast<int>(this->model().length()), |
659 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, |
660 | "tensorflow.DeviceProperties.model" ); |
661 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased( |
662 | 3, this->model(), output); |
663 | } |
664 | |
665 | // int64 frequency = 4; |
666 | if (this->frequency() != 0) { |
667 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(4, this->frequency(), output); |
668 | } |
669 | |
670 | // int64 num_cores = 5; |
671 | if (this->num_cores() != 0) { |
672 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(5, this->num_cores(), output); |
673 | } |
674 | |
675 | // map<string, string> environment = 6; |
676 | if (!this->environment().empty()) { |
677 | typedef ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >::const_pointer |
678 | ConstPtr; |
679 | typedef ConstPtr SortItem; |
680 | typedef ::PROTOBUF_NAMESPACE_ID::internal::CompareByDerefFirst<SortItem> Less; |
681 | struct Utf8Check { |
682 | static void Check(ConstPtr p) { |
683 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( |
684 | p->first.data(), static_cast<int>(p->first.length()), |
685 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, |
686 | "tensorflow.DeviceProperties.EnvironmentEntry.key" ); |
687 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( |
688 | p->second.data(), static_cast<int>(p->second.length()), |
689 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, |
690 | "tensorflow.DeviceProperties.EnvironmentEntry.value" ); |
691 | } |
692 | }; |
693 | |
694 | if (output->IsSerializationDeterministic() && |
695 | this->environment().size() > 1) { |
696 | ::std::unique_ptr<SortItem[]> items( |
697 | new SortItem[this->environment().size()]); |
698 | typedef ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >::size_type size_type; |
699 | size_type n = 0; |
700 | for (::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >::const_iterator |
701 | it = this->environment().begin(); |
702 | it != this->environment().end(); ++it, ++n) { |
703 | items[static_cast<ptrdiff_t>(n)] = SortItem(&*it); |
704 | } |
705 | ::std::sort(&items[0], &items[static_cast<ptrdiff_t>(n)], Less()); |
706 | for (size_type i = 0; i < n; i++) { |
707 | DeviceProperties_EnvironmentEntry_DoNotUse::Funcs::SerializeToCodedStream(6, items[static_cast<ptrdiff_t>(i)]->first, items[static_cast<ptrdiff_t>(i)]->second, output); |
708 | Utf8Check::Check(&(*items[static_cast<ptrdiff_t>(i)])); |
709 | } |
710 | } else { |
711 | for (::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >::const_iterator |
712 | it = this->environment().begin(); |
713 | it != this->environment().end(); ++it) { |
714 | DeviceProperties_EnvironmentEntry_DoNotUse::Funcs::SerializeToCodedStream(6, it->first, it->second, output); |
715 | Utf8Check::Check(&(*it)); |
716 | } |
717 | } |
718 | } |
719 | |
720 | // int64 num_registers = 7; |
721 | if (this->num_registers() != 0) { |
722 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(7, this->num_registers(), output); |
723 | } |
724 | |
725 | // int64 l1_cache_size = 8; |
726 | if (this->l1_cache_size() != 0) { |
727 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(8, this->l1_cache_size(), output); |
728 | } |
729 | |
730 | // int64 l2_cache_size = 9; |
731 | if (this->l2_cache_size() != 0) { |
732 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(9, this->l2_cache_size(), output); |
733 | } |
734 | |
735 | // int64 l3_cache_size = 10; |
736 | if (this->l3_cache_size() != 0) { |
737 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(10, this->l3_cache_size(), output); |
738 | } |
739 | |
740 | // int64 shared_memory_size_per_multiprocessor = 11; |
741 | if (this->shared_memory_size_per_multiprocessor() != 0) { |
742 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(11, this->shared_memory_size_per_multiprocessor(), output); |
743 | } |
744 | |
745 | // int64 memory_size = 12; |
746 | if (this->memory_size() != 0) { |
747 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(12, this->memory_size(), output); |
748 | } |
749 | |
750 | // int64 bandwidth = 13; |
751 | if (this->bandwidth() != 0) { |
752 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(13, this->bandwidth(), output); |
753 | } |
754 | |
755 | if (_internal_metadata_.have_unknown_fields()) { |
756 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( |
757 | _internal_metadata_.unknown_fields(), output); |
758 | } |
759 | // @@protoc_insertion_point(serialize_end:tensorflow.DeviceProperties) |
760 | } |
761 | |
762 | ::PROTOBUF_NAMESPACE_ID::uint8* DeviceProperties::InternalSerializeWithCachedSizesToArray( |
763 | ::PROTOBUF_NAMESPACE_ID::uint8* target) const { |
764 | // @@protoc_insertion_point(serialize_to_array_start:tensorflow.DeviceProperties) |
765 | ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; |
766 | (void) cached_has_bits; |
767 | |
768 | // string type = 1; |
769 | if (this->type().size() > 0) { |
770 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( |
771 | this->type().data(), static_cast<int>(this->type().length()), |
772 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, |
773 | "tensorflow.DeviceProperties.type" ); |
774 | target = |
775 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray( |
776 | 1, this->type(), target); |
777 | } |
778 | |
779 | // string vendor = 2; |
780 | if (this->vendor().size() > 0) { |
781 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( |
782 | this->vendor().data(), static_cast<int>(this->vendor().length()), |
783 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, |
784 | "tensorflow.DeviceProperties.vendor" ); |
785 | target = |
786 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray( |
787 | 2, this->vendor(), target); |
788 | } |
789 | |
790 | // string model = 3; |
791 | if (this->model().size() > 0) { |
792 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( |
793 | this->model().data(), static_cast<int>(this->model().length()), |
794 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, |
795 | "tensorflow.DeviceProperties.model" ); |
796 | target = |
797 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray( |
798 | 3, this->model(), target); |
799 | } |
800 | |
801 | // int64 frequency = 4; |
802 | if (this->frequency() != 0) { |
803 | target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(4, this->frequency(), target); |
804 | } |
805 | |
806 | // int64 num_cores = 5; |
807 | if (this->num_cores() != 0) { |
808 | target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(5, this->num_cores(), target); |
809 | } |
810 | |
811 | // map<string, string> environment = 6; |
812 | if (!this->environment().empty()) { |
813 | typedef ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >::const_pointer |
814 | ConstPtr; |
815 | typedef ConstPtr SortItem; |
816 | typedef ::PROTOBUF_NAMESPACE_ID::internal::CompareByDerefFirst<SortItem> Less; |
817 | struct Utf8Check { |
818 | static void Check(ConstPtr p) { |
819 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( |
820 | p->first.data(), static_cast<int>(p->first.length()), |
821 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, |
822 | "tensorflow.DeviceProperties.EnvironmentEntry.key" ); |
823 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( |
824 | p->second.data(), static_cast<int>(p->second.length()), |
825 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, |
826 | "tensorflow.DeviceProperties.EnvironmentEntry.value" ); |
827 | } |
828 | }; |
829 | |
830 | if (false && |
831 | this->environment().size() > 1) { |
832 | ::std::unique_ptr<SortItem[]> items( |
833 | new SortItem[this->environment().size()]); |
834 | typedef ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >::size_type size_type; |
835 | size_type n = 0; |
836 | for (::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >::const_iterator |
837 | it = this->environment().begin(); |
838 | it != this->environment().end(); ++it, ++n) { |
839 | items[static_cast<ptrdiff_t>(n)] = SortItem(&*it); |
840 | } |
841 | ::std::sort(&items[0], &items[static_cast<ptrdiff_t>(n)], Less()); |
842 | for (size_type i = 0; i < n; i++) { |
843 | target = DeviceProperties_EnvironmentEntry_DoNotUse::Funcs::SerializeToArray(6, items[static_cast<ptrdiff_t>(i)]->first, items[static_cast<ptrdiff_t>(i)]->second, target); |
844 | Utf8Check::Check(&(*items[static_cast<ptrdiff_t>(i)])); |
845 | } |
846 | } else { |
847 | for (::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >::const_iterator |
848 | it = this->environment().begin(); |
849 | it != this->environment().end(); ++it) { |
850 | target = DeviceProperties_EnvironmentEntry_DoNotUse::Funcs::SerializeToArray(6, it->first, it->second, target); |
851 | Utf8Check::Check(&(*it)); |
852 | } |
853 | } |
854 | } |
855 | |
856 | // int64 num_registers = 7; |
857 | if (this->num_registers() != 0) { |
858 | target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(7, this->num_registers(), target); |
859 | } |
860 | |
861 | // int64 l1_cache_size = 8; |
862 | if (this->l1_cache_size() != 0) { |
863 | target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(8, this->l1_cache_size(), target); |
864 | } |
865 | |
866 | // int64 l2_cache_size = 9; |
867 | if (this->l2_cache_size() != 0) { |
868 | target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(9, this->l2_cache_size(), target); |
869 | } |
870 | |
871 | // int64 l3_cache_size = 10; |
872 | if (this->l3_cache_size() != 0) { |
873 | target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(10, this->l3_cache_size(), target); |
874 | } |
875 | |
876 | // int64 shared_memory_size_per_multiprocessor = 11; |
877 | if (this->shared_memory_size_per_multiprocessor() != 0) { |
878 | target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(11, this->shared_memory_size_per_multiprocessor(), target); |
879 | } |
880 | |
881 | // int64 memory_size = 12; |
882 | if (this->memory_size() != 0) { |
883 | target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(12, this->memory_size(), target); |
884 | } |
885 | |
886 | // int64 bandwidth = 13; |
887 | if (this->bandwidth() != 0) { |
888 | target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(13, this->bandwidth(), target); |
889 | } |
890 | |
891 | if (_internal_metadata_.have_unknown_fields()) { |
892 | target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( |
893 | _internal_metadata_.unknown_fields(), target); |
894 | } |
895 | // @@protoc_insertion_point(serialize_to_array_end:tensorflow.DeviceProperties) |
896 | return target; |
897 | } |
898 | |
899 | size_t DeviceProperties::ByteSizeLong() const { |
900 | // @@protoc_insertion_point(message_byte_size_start:tensorflow.DeviceProperties) |
901 | size_t total_size = 0; |
902 | |
903 | if (_internal_metadata_.have_unknown_fields()) { |
904 | total_size += |
905 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( |
906 | _internal_metadata_.unknown_fields()); |
907 | } |
908 | ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; |
909 | // Prevent compiler warnings about cached_has_bits being unused |
910 | (void) cached_has_bits; |
911 | |
912 | // map<string, string> environment = 6; |
913 | total_size += 1 * |
914 | ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->environment_size()); |
915 | for (::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >::const_iterator |
916 | it = this->environment().begin(); |
917 | it != this->environment().end(); ++it) { |
918 | total_size += DeviceProperties_EnvironmentEntry_DoNotUse::Funcs::ByteSizeLong(it->first, it->second); |
919 | } |
920 | |
921 | // string type = 1; |
922 | if (this->type().size() > 0) { |
923 | total_size += 1 + |
924 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( |
925 | this->type()); |
926 | } |
927 | |
928 | // string vendor = 2; |
929 | if (this->vendor().size() > 0) { |
930 | total_size += 1 + |
931 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( |
932 | this->vendor()); |
933 | } |
934 | |
935 | // string model = 3; |
936 | if (this->model().size() > 0) { |
937 | total_size += 1 + |
938 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( |
939 | this->model()); |
940 | } |
941 | |
942 | // int64 frequency = 4; |
943 | if (this->frequency() != 0) { |
944 | total_size += 1 + |
945 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( |
946 | this->frequency()); |
947 | } |
948 | |
949 | // int64 num_cores = 5; |
950 | if (this->num_cores() != 0) { |
951 | total_size += 1 + |
952 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( |
953 | this->num_cores()); |
954 | } |
955 | |
956 | // int64 num_registers = 7; |
957 | if (this->num_registers() != 0) { |
958 | total_size += 1 + |
959 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( |
960 | this->num_registers()); |
961 | } |
962 | |
963 | // int64 l1_cache_size = 8; |
964 | if (this->l1_cache_size() != 0) { |
965 | total_size += 1 + |
966 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( |
967 | this->l1_cache_size()); |
968 | } |
969 | |
970 | // int64 l2_cache_size = 9; |
971 | if (this->l2_cache_size() != 0) { |
972 | total_size += 1 + |
973 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( |
974 | this->l2_cache_size()); |
975 | } |
976 | |
977 | // int64 l3_cache_size = 10; |
978 | if (this->l3_cache_size() != 0) { |
979 | total_size += 1 + |
980 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( |
981 | this->l3_cache_size()); |
982 | } |
983 | |
984 | // int64 shared_memory_size_per_multiprocessor = 11; |
985 | if (this->shared_memory_size_per_multiprocessor() != 0) { |
986 | total_size += 1 + |
987 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( |
988 | this->shared_memory_size_per_multiprocessor()); |
989 | } |
990 | |
991 | // int64 memory_size = 12; |
992 | if (this->memory_size() != 0) { |
993 | total_size += 1 + |
994 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( |
995 | this->memory_size()); |
996 | } |
997 | |
998 | // int64 bandwidth = 13; |
999 | if (this->bandwidth() != 0) { |
1000 | total_size += 1 + |
1001 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( |
1002 | this->bandwidth()); |
1003 | } |
1004 | |
1005 | int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); |
1006 | SetCachedSize(cached_size); |
1007 | return total_size; |
1008 | } |
1009 | |
1010 | void DeviceProperties::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { |
1011 | // @@protoc_insertion_point(generalized_merge_from_start:tensorflow.DeviceProperties) |
1012 | GOOGLE_DCHECK_NE(&from, this); |
1013 | const DeviceProperties* source = |
1014 | ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<DeviceProperties>( |
1015 | &from); |
1016 | if (source == nullptr) { |
1017 | // @@protoc_insertion_point(generalized_merge_from_cast_fail:tensorflow.DeviceProperties) |
1018 | ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); |
1019 | } else { |
1020 | // @@protoc_insertion_point(generalized_merge_from_cast_success:tensorflow.DeviceProperties) |
1021 | MergeFrom(*source); |
1022 | } |
1023 | } |
1024 | |
1025 | void DeviceProperties::MergeFrom(const DeviceProperties& from) { |
1026 | // @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.DeviceProperties) |
1027 | GOOGLE_DCHECK_NE(&from, this); |
1028 | _internal_metadata_.MergeFrom(from._internal_metadata_); |
1029 | ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; |
1030 | (void) cached_has_bits; |
1031 | |
1032 | environment_.MergeFrom(from.environment_); |
1033 | if (from.type().size() > 0) { |
1034 | set_type(from.type()); |
1035 | } |
1036 | if (from.vendor().size() > 0) { |
1037 | set_vendor(from.vendor()); |
1038 | } |
1039 | if (from.model().size() > 0) { |
1040 | set_model(from.model()); |
1041 | } |
1042 | if (from.frequency() != 0) { |
1043 | set_frequency(from.frequency()); |
1044 | } |
1045 | if (from.num_cores() != 0) { |
1046 | set_num_cores(from.num_cores()); |
1047 | } |
1048 | if (from.num_registers() != 0) { |
1049 | set_num_registers(from.num_registers()); |
1050 | } |
1051 | if (from.l1_cache_size() != 0) { |
1052 | set_l1_cache_size(from.l1_cache_size()); |
1053 | } |
1054 | if (from.l2_cache_size() != 0) { |
1055 | set_l2_cache_size(from.l2_cache_size()); |
1056 | } |
1057 | if (from.l3_cache_size() != 0) { |
1058 | set_l3_cache_size(from.l3_cache_size()); |
1059 | } |
1060 | if (from.shared_memory_size_per_multiprocessor() != 0) { |
1061 | set_shared_memory_size_per_multiprocessor(from.shared_memory_size_per_multiprocessor()); |
1062 | } |
1063 | if (from.memory_size() != 0) { |
1064 | set_memory_size(from.memory_size()); |
1065 | } |
1066 | if (from.bandwidth() != 0) { |
1067 | set_bandwidth(from.bandwidth()); |
1068 | } |
1069 | } |
1070 | |
1071 | void DeviceProperties::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { |
1072 | // @@protoc_insertion_point(generalized_copy_from_start:tensorflow.DeviceProperties) |
1073 | if (&from == this) return; |
1074 | Clear(); |
1075 | MergeFrom(from); |
1076 | } |
1077 | |
1078 | void DeviceProperties::CopyFrom(const DeviceProperties& from) { |
1079 | // @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.DeviceProperties) |
1080 | if (&from == this) return; |
1081 | Clear(); |
1082 | MergeFrom(from); |
1083 | } |
1084 | |
1085 | bool DeviceProperties::IsInitialized() const { |
1086 | return true; |
1087 | } |
1088 | |
1089 | void DeviceProperties::InternalSwap(DeviceProperties* other) { |
1090 | using std::swap; |
1091 | _internal_metadata_.Swap(&other->_internal_metadata_); |
1092 | environment_.Swap(&other->environment_); |
1093 | type_.Swap(&other->type_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), |
1094 | GetArenaNoVirtual()); |
1095 | vendor_.Swap(&other->vendor_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), |
1096 | GetArenaNoVirtual()); |
1097 | model_.Swap(&other->model_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), |
1098 | GetArenaNoVirtual()); |
1099 | swap(frequency_, other->frequency_); |
1100 | swap(num_cores_, other->num_cores_); |
1101 | swap(num_registers_, other->num_registers_); |
1102 | swap(l1_cache_size_, other->l1_cache_size_); |
1103 | swap(l2_cache_size_, other->l2_cache_size_); |
1104 | swap(l3_cache_size_, other->l3_cache_size_); |
1105 | swap(shared_memory_size_per_multiprocessor_, other->shared_memory_size_per_multiprocessor_); |
1106 | swap(memory_size_, other->memory_size_); |
1107 | swap(bandwidth_, other->bandwidth_); |
1108 | } |
1109 | |
1110 | ::PROTOBUF_NAMESPACE_ID::Metadata DeviceProperties::GetMetadata() const { |
1111 | return GetMetadataStatic(); |
1112 | } |
1113 | |
1114 | |
1115 | // =================================================================== |
1116 | |
1117 | void NamedDevice::InitAsDefaultInstance() { |
1118 | ::tensorflow::_NamedDevice_default_instance_._instance.get_mutable()->properties_ = const_cast< ::tensorflow::DeviceProperties*>( |
1119 | ::tensorflow::DeviceProperties::internal_default_instance()); |
1120 | } |
1121 | class NamedDevice::_Internal { |
1122 | public: |
1123 | static const ::tensorflow::DeviceProperties& properties(const NamedDevice* msg); |
1124 | }; |
1125 | |
1126 | const ::tensorflow::DeviceProperties& |
1127 | NamedDevice::_Internal::properties(const NamedDevice* msg) { |
1128 | return *msg->properties_; |
1129 | } |
1130 | void NamedDevice::unsafe_arena_set_allocated_properties( |
1131 | ::tensorflow::DeviceProperties* properties) { |
1132 | if (GetArenaNoVirtual() == nullptr) { |
1133 | delete properties_; |
1134 | } |
1135 | properties_ = properties; |
1136 | if (properties) { |
1137 | |
1138 | } else { |
1139 | |
1140 | } |
1141 | // @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.NamedDevice.properties) |
1142 | } |
1143 | NamedDevice::NamedDevice() |
1144 | : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { |
1145 | SharedCtor(); |
1146 | // @@protoc_insertion_point(constructor:tensorflow.NamedDevice) |
1147 | } |
1148 | NamedDevice::NamedDevice(::PROTOBUF_NAMESPACE_ID::Arena* arena) |
1149 | : ::PROTOBUF_NAMESPACE_ID::Message(), |
1150 | _internal_metadata_(arena) { |
1151 | SharedCtor(); |
1152 | RegisterArenaDtor(arena); |
1153 | // @@protoc_insertion_point(arena_constructor:tensorflow.NamedDevice) |
1154 | } |
1155 | NamedDevice::NamedDevice(const NamedDevice& from) |
1156 | : ::PROTOBUF_NAMESPACE_ID::Message(), |
1157 | _internal_metadata_(nullptr) { |
1158 | _internal_metadata_.MergeFrom(from._internal_metadata_); |
1159 | name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); |
1160 | if (!from.name().empty()) { |
1161 | name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name(), |
1162 | GetArenaNoVirtual()); |
1163 | } |
1164 | if (from.has_properties()) { |
1165 | properties_ = new ::tensorflow::DeviceProperties(*from.properties_); |
1166 | } else { |
1167 | properties_ = nullptr; |
1168 | } |
1169 | // @@protoc_insertion_point(copy_constructor:tensorflow.NamedDevice) |
1170 | } |
1171 | |
1172 | void NamedDevice::SharedCtor() { |
1173 | ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_NamedDevice_tensorflow_2fcore_2fprotobuf_2fdevice_5fproperties_2eproto.base); |
1174 | name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); |
1175 | properties_ = nullptr; |
1176 | } |
1177 | |
1178 | NamedDevice::~NamedDevice() { |
1179 | // @@protoc_insertion_point(destructor:tensorflow.NamedDevice) |
1180 | SharedDtor(); |
1181 | } |
1182 | |
1183 | void NamedDevice::SharedDtor() { |
1184 | GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr); |
1185 | name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); |
1186 | if (this != internal_default_instance()) delete properties_; |
1187 | } |
1188 | |
1189 | void NamedDevice::ArenaDtor(void* object) { |
1190 | NamedDevice* _this = reinterpret_cast< NamedDevice* >(object); |
1191 | (void)_this; |
1192 | } |
1193 | void NamedDevice::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { |
1194 | } |
1195 | void NamedDevice::SetCachedSize(int size) const { |
1196 | _cached_size_.Set(size); |
1197 | } |
1198 | const NamedDevice& NamedDevice::default_instance() { |
1199 | ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_NamedDevice_tensorflow_2fcore_2fprotobuf_2fdevice_5fproperties_2eproto.base); |
1200 | return *internal_default_instance(); |
1201 | } |
1202 | |
1203 | |
1204 | void NamedDevice::Clear() { |
1205 | // @@protoc_insertion_point(message_clear_start:tensorflow.NamedDevice) |
1206 | ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; |
1207 | // Prevent compiler warnings about cached_has_bits being unused |
1208 | (void) cached_has_bits; |
1209 | |
1210 | name_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); |
1211 | if (GetArenaNoVirtual() == nullptr && properties_ != nullptr) { |
1212 | delete properties_; |
1213 | } |
1214 | properties_ = nullptr; |
1215 | _internal_metadata_.Clear(); |
1216 | } |
1217 | |
1218 | #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER |
1219 | const char* NamedDevice::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { |
1220 | #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure |
1221 | ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena; |
1222 | while (!ctx->Done(&ptr)) { |
1223 | ::PROTOBUF_NAMESPACE_ID::uint32 tag; |
1224 | ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); |
1225 | CHK_(ptr); |
1226 | switch (tag >> 3) { |
1227 | // string name = 1; |
1228 | case 1: |
1229 | if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { |
1230 | ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_name(), ptr, ctx, "tensorflow.NamedDevice.name" ); |
1231 | CHK_(ptr); |
1232 | } else goto handle_unusual; |
1233 | continue; |
1234 | // .tensorflow.DeviceProperties properties = 2; |
1235 | case 2: |
1236 | if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { |
1237 | ptr = ctx->ParseMessage(mutable_properties(), ptr); |
1238 | CHK_(ptr); |
1239 | } else goto handle_unusual; |
1240 | continue; |
1241 | default: { |
1242 | handle_unusual: |
1243 | if ((tag & 7) == 4 || tag == 0) { |
1244 | ctx->SetLastTag(tag); |
1245 | goto success; |
1246 | } |
1247 | ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); |
1248 | CHK_(ptr != nullptr); |
1249 | continue; |
1250 | } |
1251 | } // switch |
1252 | } // while |
1253 | success: |
1254 | return ptr; |
1255 | failure: |
1256 | ptr = nullptr; |
1257 | goto success; |
1258 | #undef CHK_ |
1259 | } |
1260 | #else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER |
1261 | bool NamedDevice::MergePartialFromCodedStream( |
1262 | ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { |
1263 | #define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure |
1264 | ::PROTOBUF_NAMESPACE_ID::uint32 tag; |
1265 | // @@protoc_insertion_point(parse_start:tensorflow.NamedDevice) |
1266 | for (;;) { |
1267 | ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); |
1268 | tag = p.first; |
1269 | if (!p.second) goto handle_unusual; |
1270 | switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { |
1271 | // string name = 1; |
1272 | case 1: { |
1273 | if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { |
1274 | DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( |
1275 | input, this->mutable_name())); |
1276 | DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( |
1277 | this->name().data(), static_cast<int>(this->name().length()), |
1278 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, |
1279 | "tensorflow.NamedDevice.name" )); |
1280 | } else { |
1281 | goto handle_unusual; |
1282 | } |
1283 | break; |
1284 | } |
1285 | |
1286 | // .tensorflow.DeviceProperties properties = 2; |
1287 | case 2: { |
1288 | if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) { |
1289 | DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( |
1290 | input, mutable_properties())); |
1291 | } else { |
1292 | goto handle_unusual; |
1293 | } |
1294 | break; |
1295 | } |
1296 | |
1297 | default: { |
1298 | handle_unusual: |
1299 | if (tag == 0) { |
1300 | goto success; |
1301 | } |
1302 | DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( |
1303 | input, tag, _internal_metadata_.mutable_unknown_fields())); |
1304 | break; |
1305 | } |
1306 | } |
1307 | } |
1308 | success: |
1309 | // @@protoc_insertion_point(parse_success:tensorflow.NamedDevice) |
1310 | return true; |
1311 | failure: |
1312 | // @@protoc_insertion_point(parse_failure:tensorflow.NamedDevice) |
1313 | return false; |
1314 | #undef DO_ |
1315 | } |
1316 | #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER |
1317 | |
1318 | void NamedDevice::SerializeWithCachedSizes( |
1319 | ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { |
1320 | // @@protoc_insertion_point(serialize_start:tensorflow.NamedDevice) |
1321 | ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; |
1322 | (void) cached_has_bits; |
1323 | |
1324 | // string name = 1; |
1325 | if (this->name().size() > 0) { |
1326 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( |
1327 | this->name().data(), static_cast<int>(this->name().length()), |
1328 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, |
1329 | "tensorflow.NamedDevice.name" ); |
1330 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased( |
1331 | 1, this->name(), output); |
1332 | } |
1333 | |
1334 | // .tensorflow.DeviceProperties properties = 2; |
1335 | if (this->has_properties()) { |
1336 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( |
1337 | 2, _Internal::properties(this), output); |
1338 | } |
1339 | |
1340 | if (_internal_metadata_.have_unknown_fields()) { |
1341 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( |
1342 | _internal_metadata_.unknown_fields(), output); |
1343 | } |
1344 | // @@protoc_insertion_point(serialize_end:tensorflow.NamedDevice) |
1345 | } |
1346 | |
1347 | ::PROTOBUF_NAMESPACE_ID::uint8* NamedDevice::InternalSerializeWithCachedSizesToArray( |
1348 | ::PROTOBUF_NAMESPACE_ID::uint8* target) const { |
1349 | // @@protoc_insertion_point(serialize_to_array_start:tensorflow.NamedDevice) |
1350 | ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; |
1351 | (void) cached_has_bits; |
1352 | |
1353 | // string name = 1; |
1354 | if (this->name().size() > 0) { |
1355 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( |
1356 | this->name().data(), static_cast<int>(this->name().length()), |
1357 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, |
1358 | "tensorflow.NamedDevice.name" ); |
1359 | target = |
1360 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray( |
1361 | 1, this->name(), target); |
1362 | } |
1363 | |
1364 | // .tensorflow.DeviceProperties properties = 2; |
1365 | if (this->has_properties()) { |
1366 | target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: |
1367 | InternalWriteMessageToArray( |
1368 | 2, _Internal::properties(this), target); |
1369 | } |
1370 | |
1371 | if (_internal_metadata_.have_unknown_fields()) { |
1372 | target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( |
1373 | _internal_metadata_.unknown_fields(), target); |
1374 | } |
1375 | // @@protoc_insertion_point(serialize_to_array_end:tensorflow.NamedDevice) |
1376 | return target; |
1377 | } |
1378 | |
1379 | size_t NamedDevice::ByteSizeLong() const { |
1380 | // @@protoc_insertion_point(message_byte_size_start:tensorflow.NamedDevice) |
1381 | size_t total_size = 0; |
1382 | |
1383 | if (_internal_metadata_.have_unknown_fields()) { |
1384 | total_size += |
1385 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( |
1386 | _internal_metadata_.unknown_fields()); |
1387 | } |
1388 | ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; |
1389 | // Prevent compiler warnings about cached_has_bits being unused |
1390 | (void) cached_has_bits; |
1391 | |
1392 | // string name = 1; |
1393 | if (this->name().size() > 0) { |
1394 | total_size += 1 + |
1395 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( |
1396 | this->name()); |
1397 | } |
1398 | |
1399 | // .tensorflow.DeviceProperties properties = 2; |
1400 | if (this->has_properties()) { |
1401 | total_size += 1 + |
1402 | ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( |
1403 | *properties_); |
1404 | } |
1405 | |
1406 | int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); |
1407 | SetCachedSize(cached_size); |
1408 | return total_size; |
1409 | } |
1410 | |
1411 | void NamedDevice::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { |
1412 | // @@protoc_insertion_point(generalized_merge_from_start:tensorflow.NamedDevice) |
1413 | GOOGLE_DCHECK_NE(&from, this); |
1414 | const NamedDevice* source = |
1415 | ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<NamedDevice>( |
1416 | &from); |
1417 | if (source == nullptr) { |
1418 | // @@protoc_insertion_point(generalized_merge_from_cast_fail:tensorflow.NamedDevice) |
1419 | ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); |
1420 | } else { |
1421 | // @@protoc_insertion_point(generalized_merge_from_cast_success:tensorflow.NamedDevice) |
1422 | MergeFrom(*source); |
1423 | } |
1424 | } |
1425 | |
1426 | void NamedDevice::MergeFrom(const NamedDevice& from) { |
1427 | // @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.NamedDevice) |
1428 | GOOGLE_DCHECK_NE(&from, this); |
1429 | _internal_metadata_.MergeFrom(from._internal_metadata_); |
1430 | ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; |
1431 | (void) cached_has_bits; |
1432 | |
1433 | if (from.name().size() > 0) { |
1434 | set_name(from.name()); |
1435 | } |
1436 | if (from.has_properties()) { |
1437 | mutable_properties()->::tensorflow::DeviceProperties::MergeFrom(from.properties()); |
1438 | } |
1439 | } |
1440 | |
1441 | void NamedDevice::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { |
1442 | // @@protoc_insertion_point(generalized_copy_from_start:tensorflow.NamedDevice) |
1443 | if (&from == this) return; |
1444 | Clear(); |
1445 | MergeFrom(from); |
1446 | } |
1447 | |
1448 | void NamedDevice::CopyFrom(const NamedDevice& from) { |
1449 | // @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.NamedDevice) |
1450 | if (&from == this) return; |
1451 | Clear(); |
1452 | MergeFrom(from); |
1453 | } |
1454 | |
1455 | bool NamedDevice::IsInitialized() const { |
1456 | return true; |
1457 | } |
1458 | |
1459 | void NamedDevice::InternalSwap(NamedDevice* other) { |
1460 | using std::swap; |
1461 | _internal_metadata_.Swap(&other->_internal_metadata_); |
1462 | name_.Swap(&other->name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), |
1463 | GetArenaNoVirtual()); |
1464 | swap(properties_, other->properties_); |
1465 | } |
1466 | |
1467 | ::PROTOBUF_NAMESPACE_ID::Metadata NamedDevice::GetMetadata() const { |
1468 | return GetMetadataStatic(); |
1469 | } |
1470 | |
1471 | |
1472 | // @@protoc_insertion_point(namespace_scope) |
1473 | } // namespace tensorflow |
1474 | PROTOBUF_NAMESPACE_OPEN |
1475 | template<> PROTOBUF_NOINLINE ::tensorflow::DeviceProperties_EnvironmentEntry_DoNotUse* Arena::CreateMaybeMessage< ::tensorflow::DeviceProperties_EnvironmentEntry_DoNotUse >(Arena* arena) { |
1476 | return Arena::CreateMessageInternal< ::tensorflow::DeviceProperties_EnvironmentEntry_DoNotUse >(arena); |
1477 | } |
1478 | template<> PROTOBUF_NOINLINE ::tensorflow::DeviceProperties* Arena::CreateMaybeMessage< ::tensorflow::DeviceProperties >(Arena* arena) { |
1479 | return Arena::CreateMessageInternal< ::tensorflow::DeviceProperties >(arena); |
1480 | } |
1481 | template<> PROTOBUF_NOINLINE ::tensorflow::NamedDevice* Arena::CreateMaybeMessage< ::tensorflow::NamedDevice >(Arena* arena) { |
1482 | return Arena::CreateMessageInternal< ::tensorflow::NamedDevice >(arena); |
1483 | } |
1484 | PROTOBUF_NAMESPACE_CLOSE |
1485 | |
1486 | // @@protoc_insertion_point(global_scope) |
1487 | #include <google/protobuf/port_undef.inc> |
1488 | |