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" |
| 13 | |
| 14 | #include <vector> |
| 15 | #include <thread> |
| 16 | #include <atomic> |
| 17 | |
| 18 | namespace armnn |
| 19 | { |
| 20 | |
| 21 | namespace profiling |
| 22 | { |
| 23 | |
| 24 | class PeriodicCounterSelectionCommandHandler : public CommandHandlerFunctor |
| 25 | { |
| 26 | |
| 27 | public: |
| 28 | PeriodicCounterSelectionCommandHandler(uint32_t packetId, uint32_t version, Holder& captureDataHolder, |
| 29 | IPeriodicCounterCapture& captureThread, |
| 30 | ISendCounterPacket& sendCounterPacket) |
| 31 | : CommandHandlerFunctor(packetId, version), |
| 32 | m_CaptureDataHolder(captureDataHolder), |
| 33 | m_CaptureThread(captureThread), |
| 34 | m_SendCounterPacket(sendCounterPacket) |
| 35 | {} |
| 36 | |
| 37 | void operator()(const Packet& packet) override; |
| 38 | |
| 39 | |
| 40 | private: |
| 41 | Holder& m_CaptureDataHolder; |
| 42 | IPeriodicCounterCapture& m_CaptureThread; |
| 43 | ISendCounterPacket& m_SendCounterPacket; |
| 44 | void ParseData(const Packet& packet, CaptureData& captureData); |
| 45 | }; |
| 46 | |
| 47 | } // namespace profiling |
| 48 | |
| 49 | } // namespace armnn |
| 50 | |