Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 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 | |
| 10 | #include <armnn/BackendId.hpp> |
| 11 | #include <armnn/Optional.hpp> |
| 12 | #include <armnn/Types.hpp> |
| 13 | #include <BufferManager.hpp> |
| 14 | #include <ProfilingService.hpp> |
| 15 | |
| 16 | using namespace armnn; |
| 17 | using namespace armnn::profiling; |
| 18 | |
| 19 | inline unsigned int OffsetToNextWord(unsigned int numberOfBytes); |
| 20 | |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 21 | void VerifyTimelineHeaderBinary(const unsigned char* readableData, |
| 22 | unsigned int& offset, |
| 23 | uint32_t packetDataLength); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 24 | |
Keith Davis | 97da5e2 | 2020-03-05 16:25:28 +0000 | [diff] [blame] | 25 | void VerifyTimelineLabelBinaryPacketData(Optional<ProfilingGuid> guid, |
| 26 | const std::string& label, |
| 27 | const unsigned char* readableData, |
| 28 | unsigned int& offset); |
| 29 | |
| 30 | void VerifyTimelineEventClassBinaryPacketData(ProfilingGuid guid, |
| 31 | const unsigned char* readableData, |
| 32 | unsigned int& offset); |
| 33 | |
| 34 | void VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType relationshipType, |
| 35 | Optional<ProfilingGuid> relationshipGuid, |
| 36 | Optional<ProfilingGuid> headGuid, |
| 37 | Optional<ProfilingGuid> tailGuid, |
| 38 | const unsigned char* readableData, |
| 39 | unsigned int& offset); |
| 40 | |
| 41 | void VerifyTimelineEntityBinaryPacketData(Optional<ProfilingGuid> guid, |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 42 | const unsigned char* readableData, |
| 43 | unsigned int& offset); |
| 44 | |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 45 | void VerifyTimelineEventBinaryPacket(Optional<uint64_t> timestamp, |
| 46 | Optional<std::thread::id> threadId, |
| 47 | Optional<ProfilingGuid> eventGuid, |
| 48 | const unsigned char* readableData, |
| 49 | unsigned int& offset); |
| 50 | |
| 51 | void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId); |
| 52 | |
| 53 | namespace armnn |
| 54 | { |
| 55 | |
| 56 | namespace profiling |
| 57 | { |
| 58 | |
| 59 | class ProfilingServiceRuntimeHelper : public ProfilingService |
| 60 | { |
| 61 | public: |
Sadik Armagan | 3184c90 | 2020-03-18 10:57:30 +0000 | [diff] [blame] | 62 | ProfilingServiceRuntimeHelper(ProfilingService& profilingService) |
| 63 | : m_ProfilingService(profilingService) {} |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 64 | ~ProfilingServiceRuntimeHelper() = default; |
| 65 | |
| 66 | BufferManager& GetProfilingBufferManager() |
| 67 | { |
Sadik Armagan | 3184c90 | 2020-03-18 10:57:30 +0000 | [diff] [blame] | 68 | return GetBufferManager(m_ProfilingService); |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 69 | } |
Sadik Armagan | 3184c90 | 2020-03-18 10:57:30 +0000 | [diff] [blame] | 70 | armnn::profiling::ProfilingService& m_ProfilingService; |
Narumol Prangnawarat | df31cfe | 2019-11-22 11:26:06 +0000 | [diff] [blame] | 71 | }; |
| 72 | |
| 73 | } // namespace profiling |
| 74 | |
| 75 | } // namespace armnn |
| 76 | |