ArmNN
 20.05
ProfilingTestUtils.hpp
Go to the documentation of this file.
1 //
2 // Copyright © 2019 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #pragma once
7 
8 #include "ProfilingUtils.hpp"
9 #include "Runtime.hpp"
10 
11 #include <armnn/BackendId.hpp>
12 #include <armnn/Optional.hpp>
13 #include <armnn/Types.hpp>
14 #include <BufferManager.hpp>
15 #include <ProfilingService.hpp>
16 
17 using namespace armnn;
18 using namespace armnn::profiling;
19 
20 const static uint32_t bodyHeaderSize = 6;
21 
23 
24 inline unsigned int OffsetToNextWord(unsigned int numberOfBytes);
25 
26 void VerifyTimelineHeaderBinary(const unsigned char* readableData,
27  unsigned int& offset,
28  uint32_t packetDataLength);
29 
31  const std::string& label,
32  const unsigned char* readableData,
33  unsigned int& offset);
34 
36  const unsigned char* readableData,
37  unsigned int& offset);
38 
40  Optional<ProfilingGuid> relationshipGuid,
41  Optional<ProfilingGuid> headGuid,
42  Optional<ProfilingGuid> tailGuid,
43  const unsigned char* readableData,
44  unsigned int& offset);
45 
47  const unsigned char* readableData,
48  unsigned int& offset);
49 
52  Optional<ProfilingGuid> eventGuid,
53  const unsigned char* readableData,
54  unsigned int& offset);
55 
57 
58 namespace armnn
59 {
60 
61 namespace profiling
62 {
63 
65 {
66 public:
68  : m_ProfilingService(profilingService) {}
69  ~ProfilingServiceRuntimeHelper() = default;
70 
72  {
73  return GetBufferManager(m_ProfilingService);
74  }
76 
78  {
79  TransitionToState(m_ProfilingService, newState);
80  }
81 };
82 
83 } // namespace profiling
84 
85 } // namespace armnn
86 
void ForceTransitionToState(ProfilingState newState)
unsigned int OffsetToNextWord(unsigned int numberOfBytes)
void VerifyTimelineLabelBinaryPacketData(Optional< ProfilingGuid > guid, const std::string &label, const unsigned char *readableData, unsigned int &offset)
uint32_t GetStreamMetaDataPacketSize()
void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId)
Copyright (c) 2020 ARM Limited.
void VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType relationshipType, Optional< ProfilingGuid > relationshipGuid, Optional< ProfilingGuid > headGuid, Optional< ProfilingGuid > tailGuid, const unsigned char *readableData, unsigned int &offset)
void VerifyTimelineEventClassBinaryPacketData(ProfilingGuid guid, const unsigned char *readableData, unsigned int &offset)
void VerifyTimelineHeaderBinary(const unsigned char *readableData, unsigned int &offset, uint32_t packetDataLength)
armnn::profiling::ProfilingService profilingService
void VerifyTimelineEntityBinaryPacketData(Optional< ProfilingGuid > guid, const unsigned char *readableData, unsigned int &offset)
ProfilingServiceRuntimeHelper(ProfilingService &profilingService)
armnn::profiling::ProfilingService & m_ProfilingService
void VerifyTimelineEventBinaryPacket(Optional< uint64_t > timestamp, Optional< std::thread::id > threadId, Optional< ProfilingGuid > eventGuid, const unsigned char *readableData, unsigned int &offset)