ArmNN
 20.05
SendTimelinePacketTests.cpp
Go to the documentation of this file.
1 //
2 // Copyright © 2019 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #include "ProfilingMocks.hpp"
7 
8 #include <BufferManager.hpp>
9 #include <ProfilingService.hpp>
10 #include <ProfilingUtils.hpp>
11 #include <SendTimelinePacket.hpp>
13 
14 #include <boost/test/unit_test.hpp>
16 
17 #include <functional>
18 #include <Runtime.hpp>
19 
20 using namespace armnn::profiling;
21 
22 BOOST_AUTO_TEST_SUITE(SendTimelinePacketTests)
23 
24 BOOST_AUTO_TEST_CASE(SendTimelineMessageDirectoryPackageTest)
25 {
26  MockBufferManager mockBuffer(512);
27  TimelinePacketWriterFactory timelinePacketWriterFactory(mockBuffer);
28  std::unique_ptr<ISendTimelinePacket> sendTimelinePacket = timelinePacketWriterFactory.GetSendTimelinePacket();
29 
30  sendTimelinePacket->SendTimelineMessageDirectoryPackage();
31 
32  // Get the readable buffer
33  auto packetBuffer = mockBuffer.GetReadableBuffer();
34 
35  unsigned int uint8_t_size = sizeof(uint8_t);
36  unsigned int uint32_t_size = sizeof(uint32_t);
37  unsigned int uint64_t_size = sizeof(uint64_t);
38 
39  // Check the packet header
40  unsigned int offset = 0;
41  uint32_t packetHeaderWord0 = ReadUint32(packetBuffer, offset);
42  uint32_t packetFamily = (packetHeaderWord0 >> 26) & 0x0000003F;
43  uint32_t packetClass = (packetHeaderWord0 >> 19) & 0x0000007F;
44  uint32_t packetType = (packetHeaderWord0 >> 16) & 0x00000007;
45  uint32_t streamId = (packetHeaderWord0 >> 0) & 0x00000007;
46 
47  BOOST_CHECK(packetFamily == 1);
48  BOOST_CHECK(packetClass == 0);
49  BOOST_CHECK(packetType == 0);
50  BOOST_CHECK(streamId == 0);
51 
52  offset += uint32_t_size;
53  uint32_t packetHeaderWord1 = ReadUint32(packetBuffer, offset);
54  uint32_t sequenceNumbered = (packetHeaderWord1 >> 24) & 0x00000001;
55  uint32_t dataLength = (packetHeaderWord1 >> 0) & 0x00FFFFFF;
56  BOOST_CHECK(sequenceNumbered == 0);
57  BOOST_CHECK(dataLength == 419);
58 
59  offset += uint32_t_size;
60  uint8_t readStreamVersion = ReadUint8(packetBuffer, offset);
61  BOOST_CHECK(readStreamVersion == 4);
62  offset += uint8_t_size;
63  uint8_t readPointerBytes = ReadUint8(packetBuffer, offset);
64  BOOST_CHECK(readPointerBytes == uint64_t_size);
65  offset += uint8_t_size;
66  uint8_t readThreadIdBytes = ReadUint8(packetBuffer, offset);
67  BOOST_CHECK(readThreadIdBytes == ThreadIdSize);
68 
69  offset += uint8_t_size;
70  uint32_t DeclCount = ReadUint32(packetBuffer, offset);
71  BOOST_CHECK(DeclCount == 5);
72 
73  offset += uint32_t_size;
74  SwTraceMessage swTraceMessage = ReadSwTraceMessage(packetBuffer->GetReadableData(), offset);
75 
76  BOOST_CHECK(swTraceMessage.m_Id == 0);
77  BOOST_CHECK(swTraceMessage.m_Name == "declareLabel");
78  BOOST_CHECK(swTraceMessage.m_UiName == "declare label");
79  BOOST_CHECK(swTraceMessage.m_ArgTypes.size() == 2);
80  BOOST_CHECK(swTraceMessage.m_ArgTypes[0] == 'p');
81  BOOST_CHECK(swTraceMessage.m_ArgTypes[1] == 's');
82  BOOST_CHECK(swTraceMessage.m_ArgNames.size() == 2);
83  BOOST_CHECK(swTraceMessage.m_ArgNames[0] == "guid");
84  BOOST_CHECK(swTraceMessage.m_ArgNames[1] == "value");
85 
86  swTraceMessage = ReadSwTraceMessage(packetBuffer->GetReadableData(), offset);
87 
88  BOOST_CHECK(swTraceMessage.m_Id == 1);
89  BOOST_CHECK(swTraceMessage.m_Name == "declareEntity");
90  BOOST_CHECK(swTraceMessage.m_UiName == "declare entity");
91  BOOST_CHECK(swTraceMessage.m_ArgTypes.size() == 1);
92  BOOST_CHECK(swTraceMessage.m_ArgTypes[0] == 'p');
93  BOOST_CHECK(swTraceMessage.m_ArgNames.size() == 1);
94  BOOST_CHECK(swTraceMessage.m_ArgNames[0] == "guid");
95 
96  swTraceMessage = ReadSwTraceMessage(packetBuffer->GetReadableData(), offset);
97 
98  BOOST_CHECK(swTraceMessage.m_Id == 2);
99  BOOST_CHECK(swTraceMessage.m_Name == "declareEventClass");
100  BOOST_CHECK(swTraceMessage.m_UiName == "declare event class");
101  BOOST_CHECK(swTraceMessage.m_ArgTypes.size() == 1);
102  BOOST_CHECK(swTraceMessage.m_ArgTypes[0] == 'p');
103  BOOST_CHECK(swTraceMessage.m_ArgNames.size() == 1);
104  BOOST_CHECK(swTraceMessage.m_ArgNames[0] == "guid");
105 
106  swTraceMessage = ReadSwTraceMessage(packetBuffer->GetReadableData(), offset);
107 
108  BOOST_CHECK(swTraceMessage.m_Id == 3);
109  BOOST_CHECK(swTraceMessage.m_Name == "declareRelationship");
110  BOOST_CHECK(swTraceMessage.m_UiName == "declare relationship");
111  BOOST_CHECK(swTraceMessage.m_ArgTypes.size() == 4);
112  BOOST_CHECK(swTraceMessage.m_ArgTypes[0] == 'I');
113  BOOST_CHECK(swTraceMessage.m_ArgTypes[1] == 'p');
114  BOOST_CHECK(swTraceMessage.m_ArgTypes[2] == 'p');
115  BOOST_CHECK(swTraceMessage.m_ArgTypes[3] == 'p');
116  BOOST_CHECK(swTraceMessage.m_ArgNames.size() == 4);
117  BOOST_CHECK(swTraceMessage.m_ArgNames[0] == "relationshipType");
118  BOOST_CHECK(swTraceMessage.m_ArgNames[1] == "relationshipGuid");
119  BOOST_CHECK(swTraceMessage.m_ArgNames[2] == "headGuid");
120  BOOST_CHECK(swTraceMessage.m_ArgNames[3] == "tailGuid");
121 
122  swTraceMessage = ReadSwTraceMessage(packetBuffer->GetReadableData(), offset);
123 
124  BOOST_CHECK(swTraceMessage.m_Id == 4);
125  BOOST_CHECK(swTraceMessage.m_Name == "declareEvent");
126  BOOST_CHECK(swTraceMessage.m_UiName == "declare event");
127  BOOST_CHECK(swTraceMessage.m_ArgTypes.size() == 3);
128  BOOST_CHECK(swTraceMessage.m_ArgTypes[0] == '@');
129  BOOST_CHECK(swTraceMessage.m_ArgTypes[1] == 't');
130  BOOST_CHECK(swTraceMessage.m_ArgTypes[2] == 'p');
131  BOOST_CHECK(swTraceMessage.m_ArgNames.size() == 3);
132  BOOST_CHECK(swTraceMessage.m_ArgNames[0] == "timestamp");
133  BOOST_CHECK(swTraceMessage.m_ArgNames[1] == "threadId");
134  BOOST_CHECK(swTraceMessage.m_ArgNames[2] == "eventGuid");
135 }
136 
137 BOOST_AUTO_TEST_CASE(SendTimelineEntityWithEventClassPacketTest)
138 {
139  MockBufferManager bufferManager(40);
140  TimelinePacketWriterFactory timelinePacketWriterFactory(bufferManager);
141  std::unique_ptr<ISendTimelinePacket> sendTimelinePacket = timelinePacketWriterFactory.GetSendTimelinePacket();
142 
143  const uint64_t entityBinaryPacketProfilingGuid = 123456u;
144  sendTimelinePacket->SendTimelineEntityBinaryPacket(entityBinaryPacketProfilingGuid);
145 
146  const uint64_t eventClassBinaryPacketProfilingGuid = 789123u;
147  sendTimelinePacket->SendTimelineEventClassBinaryPacket(eventClassBinaryPacketProfilingGuid);
148 
149  // Commit the messages
150  sendTimelinePacket->Commit();
151 
152  // Get the readable buffer
153  auto packetBuffer = bufferManager.GetReadableBuffer();
154 
155  unsigned int uint32_t_size = sizeof(uint32_t);
156  unsigned int uint64_t_size = sizeof(uint64_t);
157 
158  // Check the packet header
159  unsigned int offset = 0;
160 
161  // Reading TimelineEntityClassBinaryPacket
162  uint32_t entityBinaryPacketHeaderWord0 = ReadUint32(packetBuffer, offset);
163  uint32_t entityBinaryPacketFamily = (entityBinaryPacketHeaderWord0 >> 26) & 0x0000003F;
164  uint32_t entityBinaryPacketClass = (entityBinaryPacketHeaderWord0 >> 19) & 0x0000007F;
165  uint32_t entityBinaryPacketType = (entityBinaryPacketHeaderWord0 >> 16) & 0x00000007;
166  uint32_t entityBinaryPacketStreamId = (entityBinaryPacketHeaderWord0 >> 0) & 0x00000007;
167 
168  BOOST_CHECK(entityBinaryPacketFamily == 1);
169  BOOST_CHECK(entityBinaryPacketClass == 0);
170  BOOST_CHECK(entityBinaryPacketType == 1);
171  BOOST_CHECK(entityBinaryPacketStreamId == 0);
172 
173  offset += uint32_t_size;
174 
175  uint32_t entityBinaryPacketHeaderWord1 = ReadUint32(packetBuffer, offset);
176 
177  uint32_t entityBinaryPacketSequenceNumbered = (entityBinaryPacketHeaderWord1 >> 24) & 0x00000001;
178  uint32_t entityBinaryPacketDataLength = (entityBinaryPacketHeaderWord1 >> 0) & 0x00FFFFFF;
179 
180  BOOST_CHECK(entityBinaryPacketSequenceNumbered == 0);
181  BOOST_CHECK(entityBinaryPacketDataLength == 24);
182 
183  // Check the decl_id
184  offset += uint32_t_size;
185  uint32_t entitytDecId = ReadUint32(packetBuffer, offset);
186 
187  BOOST_CHECK(entitytDecId == uint32_t(1));
188 
189  // Check the profiling GUID
190  offset += uint32_t_size;
191  uint64_t readProfilingGuid = ReadUint64(packetBuffer, offset);
192 
193  BOOST_CHECK(readProfilingGuid == entityBinaryPacketProfilingGuid);
194 
195  // Reading TimelineEventClassBinaryPacket
196  offset += uint64_t_size;
197 
198  uint32_t eventClassDeclId = ReadUint32(packetBuffer, offset);
199  BOOST_CHECK(eventClassDeclId == uint32_t(2));
200 
201  // Check the profiling GUID
202  offset += uint32_t_size;
203  readProfilingGuid = ReadUint64(packetBuffer, offset);
204  BOOST_CHECK(readProfilingGuid == eventClassBinaryPacketProfilingGuid);
205 
206  bufferManager.MarkRead(packetBuffer);
207 }
208 
209 BOOST_AUTO_TEST_CASE(SendEventClassAfterTimelineEntityPacketTest)
210 {
211  unsigned int uint32_t_size = sizeof(uint32_t);
212  unsigned int uint64_t_size = sizeof(uint64_t);
213 
214  MockBufferManager bufferManager(512);
215  TimelinePacketWriterFactory timelinePacketWriterFactory(bufferManager);
216  std::unique_ptr<ISendTimelinePacket> sendTimelinePacket = timelinePacketWriterFactory.GetSendTimelinePacket();
217 
218  // Send TimelineEntityClassBinaryPacket
219  const uint64_t entityBinaryPacketProfilingGuid = 123456u;
220  sendTimelinePacket->SendTimelineEntityBinaryPacket(entityBinaryPacketProfilingGuid);
221 
222  // Commit the buffer
223  sendTimelinePacket->Commit();
224 
225  // Get the readable buffer
226  auto packetBuffer = bufferManager.GetReadableBuffer();
227 
228  // Check the packet header
229  unsigned int offset = 0;
230 
231  // Reading TimelineEntityClassBinaryPacket
232  uint32_t entityBinaryPacketHeaderWord0 = ReadUint32(packetBuffer, offset);
233  uint32_t entityBinaryPacketFamily = (entityBinaryPacketHeaderWord0 >> 26) & 0x0000003F;
234  uint32_t entityBinaryPacketClass = (entityBinaryPacketHeaderWord0 >> 19) & 0x0000007F;
235  uint32_t entityBinaryPacketType = (entityBinaryPacketHeaderWord0 >> 16) & 0x00000007;
236  uint32_t entityBinaryPacketStreamId = (entityBinaryPacketHeaderWord0 >> 0) & 0x00000007;
237 
238  BOOST_CHECK(entityBinaryPacketFamily == 1);
239  BOOST_CHECK(entityBinaryPacketClass == 0);
240  BOOST_CHECK(entityBinaryPacketType == 1);
241  BOOST_CHECK(entityBinaryPacketStreamId == 0);
242 
243  offset += uint32_t_size;
244  uint32_t entityBinaryPacketHeaderWord1 = ReadUint32(packetBuffer, offset);
245  uint32_t entityBinaryPacketSequenceNumbered = (entityBinaryPacketHeaderWord1 >> 24) & 0x00000001;
246  uint32_t entityBinaryPacketDataLength = (entityBinaryPacketHeaderWord1 >> 0) & 0x00FFFFFF;
247  BOOST_CHECK(entityBinaryPacketSequenceNumbered == 0);
248  BOOST_CHECK(entityBinaryPacketDataLength == 12);
249 
250  // Check the decl_id
251  offset += uint32_t_size;
252  uint32_t entitytDecId = ReadUint32(packetBuffer, offset);
253 
254  BOOST_CHECK(entitytDecId == uint32_t(1));
255 
256  // Check the profiling GUID
257  offset += uint32_t_size;
258  uint64_t readProfilingGuid = ReadUint64(packetBuffer, offset);
259 
260  BOOST_CHECK(readProfilingGuid == entityBinaryPacketProfilingGuid);
261 
262  bufferManager.MarkRead(packetBuffer);
263 
264  // Send TimelineEventClassBinaryPacket
265  const uint64_t eventClassBinaryPacketProfilingGuid = 789123u;
266  sendTimelinePacket->SendTimelineEventClassBinaryPacket(eventClassBinaryPacketProfilingGuid);
267 
268  // Commit the buffer
269  sendTimelinePacket->Commit();
270 
271  // Get the readable buffer
272  packetBuffer = bufferManager.GetReadableBuffer();
273 
274  // Check the packet header
275  offset = 0;
276 
277  // Reading TimelineEventClassBinaryPacket
278  uint32_t eventClassBinaryPacketHeaderWord0 = ReadUint32(packetBuffer, offset);
279  uint32_t eventClassBinaryPacketFamily = (eventClassBinaryPacketHeaderWord0 >> 26) & 0x0000003F;
280  uint32_t eventClassBinaryPacketClass = (eventClassBinaryPacketHeaderWord0 >> 19) & 0x0000007F;
281  uint32_t eventClassBinaryPacketType = (eventClassBinaryPacketHeaderWord0 >> 16) & 0x00000007;
282  uint32_t eventClassBinaryPacketStreamId = (eventClassBinaryPacketHeaderWord0 >> 0) & 0x00000007;
283 
284  BOOST_CHECK(eventClassBinaryPacketFamily == 1);
285  BOOST_CHECK(eventClassBinaryPacketClass == 0);
286  BOOST_CHECK(eventClassBinaryPacketType == 1);
287  BOOST_CHECK(eventClassBinaryPacketStreamId == 0);
288 
289  offset += uint32_t_size;
290  uint32_t eventClassBinaryPacketHeaderWord1 = ReadUint32(packetBuffer, offset);
291  uint32_t eventClassBinaryPacketSequenceNumbered = (eventClassBinaryPacketHeaderWord1 >> 24) & 0x00000001;
292  uint32_t eventClassBinaryPacketDataLength = (eventClassBinaryPacketHeaderWord1 >> 0) & 0x00FFFFFF;
293  BOOST_CHECK(eventClassBinaryPacketSequenceNumbered == 0);
294  BOOST_CHECK(eventClassBinaryPacketDataLength == 12);
295 
296  offset += uint32_t_size;
297  uint32_t eventClassDeclId = ReadUint32(packetBuffer, offset);
298  BOOST_CHECK(eventClassDeclId == uint32_t(2));
299 
300  // Check the profiling GUID
301  offset += uint32_t_size;
302  readProfilingGuid = ReadUint64(packetBuffer, offset);
303  BOOST_CHECK(readProfilingGuid == eventClassBinaryPacketProfilingGuid);
304 
305  bufferManager.MarkRead(packetBuffer);
306 
307  // Send TimelineEventBinaryPacket
308  const uint64_t timestamp = 456789u;
309  const std::thread::id threadId = std::this_thread::get_id();
310  const uint64_t eventProfilingGuid = 123456u;
311  sendTimelinePacket->SendTimelineEventBinaryPacket(timestamp, threadId, eventProfilingGuid);
312 
313  // Commit the buffer
314  sendTimelinePacket->Commit();
315 
316  // Get the readable buffer
317  packetBuffer = bufferManager.GetReadableBuffer();
318 
319  // Check the packet header
320  offset = 0;
321 
322  // Reading TimelineEventBinaryPacket
323  uint32_t eventBinaryPacketHeaderWord0 = ReadUint32(packetBuffer, offset);
324  uint32_t eventBinaryPacketFamily = (eventBinaryPacketHeaderWord0 >> 26) & 0x0000003F;
325  uint32_t eventBinaryPacketClass = (eventBinaryPacketHeaderWord0 >> 19) & 0x0000007F;
326  uint32_t eventBinaryPacketType = (eventBinaryPacketHeaderWord0 >> 16) & 0x00000007;
327  uint32_t eventBinaryPacketStreamId = (eventBinaryPacketHeaderWord0 >> 0) & 0x00000007;
328 
329  BOOST_CHECK(eventBinaryPacketFamily == 1);
330  BOOST_CHECK(eventBinaryPacketClass == 0);
331  BOOST_CHECK(eventBinaryPacketType == 1);
332  BOOST_CHECK(eventBinaryPacketStreamId == 0);
333 
334  offset += uint32_t_size;
335  uint32_t eventBinaryPacketHeaderWord1 = ReadUint32(packetBuffer, offset);
336  uint32_t eventBinaryPacketSequenceNumbered = (eventBinaryPacketHeaderWord1 >> 24) & 0x00000001;
337  uint32_t eventBinaryPacketDataLength = (eventBinaryPacketHeaderWord1 >> 0) & 0x00FFFFFF;
338  BOOST_CHECK(eventBinaryPacketSequenceNumbered == 0);
339  BOOST_CHECK(eventBinaryPacketDataLength == 20 + ThreadIdSize);
340 
341  // Check the decl_id
342  offset += uint32_t_size;
343  uint32_t eventDeclId = ReadUint32(packetBuffer, offset);
344  BOOST_CHECK(eventDeclId == 4);
345 
346  // Check the timestamp
347  offset += uint32_t_size;
348  uint64_t eventTimestamp = ReadUint64(packetBuffer, offset);
349  BOOST_CHECK(eventTimestamp == timestamp);
350 
351  // Check the thread id
352  offset += uint64_t_size;
353  std::vector<uint8_t> readThreadId(ThreadIdSize, 0);
354  ReadBytes(packetBuffer, offset, ThreadIdSize, readThreadId.data());
355  BOOST_CHECK(readThreadId == threadId);
356 
357  // Check the profiling GUID
358  offset += ThreadIdSize;
359  readProfilingGuid = ReadUint64(packetBuffer, offset);
360  BOOST_CHECK(readProfilingGuid == eventProfilingGuid);
361 }
362 
363 BOOST_AUTO_TEST_CASE(SendTimelinePacketTests2)
364 {
365  MockBufferManager bufferManager(40);
366  TimelinePacketWriterFactory timelinePacketWriterFactory(bufferManager);
367  std::unique_ptr<ISendTimelinePacket> sendTimelinePacket = timelinePacketWriterFactory.GetSendTimelinePacket();
368 
369  BOOST_CHECK_THROW(sendTimelinePacket->SendTimelineMessageDirectoryPackage(),
371 }
372 
373 BOOST_AUTO_TEST_CASE(SendTimelinePacketTests3)
374 {
375  MockBufferManager bufferManager(512);
376  TimelinePacketWriterFactory timelinePacketWriterFactory(bufferManager);
377  std::unique_ptr<ISendTimelinePacket> sendTimelinePacket = timelinePacketWriterFactory.GetSendTimelinePacket();
378 
379  // Send TimelineEntityClassBinaryPacket
380  const uint64_t entityBinaryPacketProfilingGuid = 123456u;
381  sendTimelinePacket->SendTimelineEntityBinaryPacket(entityBinaryPacketProfilingGuid);
382 
383  // Commit the buffer
384  sendTimelinePacket->Commit();
385 
386  // Get the readable buffer
387  auto packetBuffer = bufferManager.GetReadableBuffer();
388 
389  // Send TimelineEventClassBinaryPacket
390  const uint64_t eventClassBinaryPacketProfilingGuid = 789123u;
391  BOOST_CHECK_THROW(sendTimelinePacket->SendTimelineEventClassBinaryPacket(eventClassBinaryPacketProfilingGuid),
393 }
394 
395 BOOST_AUTO_TEST_CASE(GetGuidsFromProfilingService)
396 {
398  options.m_ProfilingOptions.m_EnableProfiling = true;
399  armnn::Runtime runtime(options);
401 
402  profilingService.ResetExternalProfilingOptions(options.m_ProfilingOptions, true);
403  ProfilingStaticGuid staticGuid = profilingService.GetStaticId("dummy");
404  std::hash<std::string> hasher;
405  uint64_t hash = static_cast<uint64_t>(hasher("dummy"));
406  ProfilingStaticGuid expectedStaticValue(hash | MIN_STATIC_GUID);
407  BOOST_CHECK(staticGuid == expectedStaticValue);
408  ProfilingDynamicGuid dynamicGuid = profilingService.GetNextGuid();
409  uint64_t dynamicGuidValue = static_cast<uint64_t>(dynamicGuid);
410  ++dynamicGuidValue;
411  ProfilingDynamicGuid expectedDynamicValue(dynamicGuidValue);
412  dynamicGuid = profilingService.GetNextGuid();
413  BOOST_CHECK(dynamicGuid == expectedDynamicValue);
414 }
415 
416 BOOST_AUTO_TEST_CASE(GetTimelinePackerWriterFromProfilingService)
417 {
419  options.m_EnableProfiling = true;
421  profilingService.ResetExternalProfilingOptions(options, true);
422 
423  std::unique_ptr<ISendTimelinePacket> writer = profilingService.GetSendTimelinePacket();
424  BOOST_CHECK(writer != nullptr);
425 }
426 
427 BOOST_AUTO_TEST_CASE(CheckStaticGuidsAndEvents)
428 {
432 
433  std::hash<std::string> hasher;
434 
435  uint64_t hash = static_cast<uint64_t>(hasher(LabelsAndEventClasses::NAME_LABEL));
436  ProfilingStaticGuid expectedNameGuid(hash | MIN_STATIC_GUID);
437  BOOST_CHECK(LabelsAndEventClasses::NAME_GUID == expectedNameGuid);
438 
439  hash = static_cast<uint64_t>(hasher(LabelsAndEventClasses::TYPE_LABEL));
440  ProfilingStaticGuid expectedTypeGuid(hash | MIN_STATIC_GUID);
441  BOOST_CHECK(LabelsAndEventClasses::TYPE_GUID == expectedTypeGuid);
442 
443  hash = static_cast<uint64_t>(hasher(LabelsAndEventClasses::INDEX_LABEL));
444  ProfilingStaticGuid expectedIndexGuid(hash | MIN_STATIC_GUID);
445  BOOST_CHECK(LabelsAndEventClasses::INDEX_GUID == expectedIndexGuid);
446 
447  hash = static_cast<uint64_t>(hasher("ARMNN_PROFILING_SOL"));
448  ProfilingStaticGuid expectedSol(hash | MIN_STATIC_GUID);
450 
451  hash = static_cast<uint64_t>(hasher("ARMNN_PROFILING_EOL"));
452  ProfilingStaticGuid expectedEol(hash | MIN_STATIC_GUID);
454 }
455 
BOOST_AUTO_TEST_SUITE(TensorflowLiteParser)
static ARMNN_DLLEXPORT std::string TYPE_LABEL
void ReadBytes(const IPacketBufferPtr &packetBuffer, unsigned int offset, unsigned int valueSize, uint8_t outValue[])
uint64_t ReadUint64(const IPacketBufferPtr &packetBuffer, unsigned int offset)
Strongly typed guids to distinguish between those generated at runtime, and those that are statically...
Definition: Types.hpp:296
static ARMNN_DLLEXPORT std::string NAME_LABEL
uint8_t ReadUint8(const IPacketBufferPtr &packetBuffer, unsigned int offset)
BOOST_CHECK(profilingService.GetCurrentState()==ProfilingState::WaitingForAck)
static ARMNN_DLLEXPORT ProfilingStaticGuid ARMNN_PROFILING_EOL_EVENT_CLASS
static ARMNN_DLLEXPORT ProfilingStaticGuid NAME_GUID
static ARMNN_DLLEXPORT ProfilingStaticGuid ARMNN_PROFILING_SOL_EVENT_CLASS
SwTraceMessage ReadSwTraceMessage(const unsigned char *packetBuffer, unsigned int &offset)
void MarkRead(IPacketBufferPtr &packetBuffer) override
static ProfilingStaticGuid GetStaticId(const std::string &str)
std::vector< std::string > m_ArgNames
IPacketBufferPtr GetReadableBuffer() override
std::unique_ptr< ISendTimelinePacket > GetSendTimelinePacket() const override
static ARMNN_DLLEXPORT std::string INDEX_LABEL
void ResetExternalProfilingOptions(const ExternalProfilingOptions &options, bool resetProfilingService=false)
BOOST_AUTO_TEST_CASE(CheckConvolution2dLayer)
constexpr unsigned int ThreadIdSize
uint32_t ReadUint32(const IPacketBufferPtr &packetBuffer, unsigned int offset)
armnn::profiling::ProfilingService profilingService
BOOST_AUTO_TEST_SUITE_END()
static ARMNN_DLLEXPORT ProfilingStaticGuid INDEX_GUID
static ARMNN_DLLEXPORT ProfilingStaticGuid TYPE_GUID
static ProfilingDynamicGuid GetNextGuid()
std::unique_ptr< ISendTimelinePacket > GetSendTimelinePacket() const
armnn::Runtime::CreationOptions::ExternalProfilingOptions options
ExternalProfilingOptions m_ProfilingOptions
Definition: IRuntime.hpp:83