Ferran Balaguer | 1b94172 | 2019-08-28 16:57:18 +0100 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2019 Arm Ltd. All rights reserved. |
| 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | |
| 6 | #pragma once |
| 7 | |
| 8 | #include "Packet.hpp" |
| 9 | #include "CommandHandlerFunctor.hpp" |
| 10 | #include "Holder.hpp" |
| 11 | #include "SendCounterPacket.hpp" |
| 12 | #include "IPeriodicCounterCapture.hpp" |
Matteo Martincigh | e848538 | 2019-10-10 14:08:21 +0100 | [diff] [blame^] | 13 | #include "ICounterValues.hpp" |
Ferran Balaguer | 1b94172 | 2019-08-28 16:57:18 +0100 | [diff] [blame] | 14 | |
| 15 | namespace armnn |
| 16 | { |
| 17 | |
| 18 | namespace profiling |
| 19 | { |
| 20 | |
| 21 | class PeriodicCounterSelectionCommandHandler : public CommandHandlerFunctor |
| 22 | { |
| 23 | |
| 24 | public: |
Matteo Martincigh | e848538 | 2019-10-10 14:08:21 +0100 | [diff] [blame^] | 25 | PeriodicCounterSelectionCommandHandler(uint32_t packetId, |
| 26 | uint32_t version, |
| 27 | Holder& captureDataHolder, |
| 28 | IPeriodicCounterCapture& periodicCounterCapture, |
| 29 | const IReadCounterValues& readCounterValue, |
| 30 | ISendCounterPacket& sendCounterPacket, |
| 31 | const ProfilingStateMachine& profilingStateMachine) |
| 32 | : CommandHandlerFunctor(packetId, version) |
| 33 | , m_CaptureDataHolder(captureDataHolder) |
| 34 | , m_PeriodicCounterCapture(periodicCounterCapture) |
| 35 | , m_ReadCounterValues(readCounterValue) |
| 36 | , m_SendCounterPacket(sendCounterPacket) |
| 37 | , m_StateMachine(profilingStateMachine) |
Ferran Balaguer | 1b94172 | 2019-08-28 16:57:18 +0100 | [diff] [blame] | 38 | {} |
| 39 | |
| 40 | void operator()(const Packet& packet) override; |
| 41 | |
Ferran Balaguer | 1b94172 | 2019-08-28 16:57:18 +0100 | [diff] [blame] | 42 | private: |
| 43 | Holder& m_CaptureDataHolder; |
Matteo Martincigh | e848538 | 2019-10-10 14:08:21 +0100 | [diff] [blame^] | 44 | IPeriodicCounterCapture& m_PeriodicCounterCapture; |
| 45 | const IReadCounterValues& m_ReadCounterValues; |
Ferran Balaguer | 1b94172 | 2019-08-28 16:57:18 +0100 | [diff] [blame] | 46 | ISendCounterPacket& m_SendCounterPacket; |
Matteo Martincigh | e848538 | 2019-10-10 14:08:21 +0100 | [diff] [blame^] | 47 | const ProfilingStateMachine& m_StateMachine; |
| 48 | |
Ferran Balaguer | 1b94172 | 2019-08-28 16:57:18 +0100 | [diff] [blame] | 49 | void ParseData(const Packet& packet, CaptureData& captureData); |
| 50 | }; |
| 51 | |
| 52 | } // namespace profiling |
| 53 | |
| 54 | } // namespace armnn |
| 55 | |