Keith Davis | 33ed221 | 2020-03-30 10:43:41 +0100 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2020 Arm Ltd. All rights reserved. |
| 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | |
| 6 | #pragma once |
| 7 | |
| 8 | #include "CommandHandlerFunctor.hpp" |
| 9 | #include "ProfilingStateMachine.hpp" |
Keith Davis | 33ed221 | 2020-03-30 10:43:41 +0100 | [diff] [blame] | 10 | #include "SendTimelinePacket.hpp" |
| 11 | #include "IReportStructure.hpp" |
Keith Davis | 33ed221 | 2020-03-30 10:43:41 +0100 | [diff] [blame] | 12 | #include "INotifyBackends.hpp" |
| 13 | |
Finn Williams | 0c8cb99 | 2020-05-07 10:38:15 +0100 | [diff] [blame] | 14 | #include "armnn/Optional.hpp" |
| 15 | |
Finn Williams | 56b465d | 2020-05-15 13:34:12 +0100 | [diff] [blame] | 16 | #include <Packet.hpp> |
Finn Williams | 0c8cb99 | 2020-05-07 10:38:15 +0100 | [diff] [blame] | 17 | |
| 18 | |
Keith Davis | 33ed221 | 2020-03-30 10:43:41 +0100 | [diff] [blame] | 19 | namespace armnn |
| 20 | { |
| 21 | |
| 22 | namespace profiling |
| 23 | { |
| 24 | |
| 25 | class ActivateTimelineReportingCommandHandler : public CommandHandlerFunctor |
| 26 | { |
| 27 | public: |
| 28 | ActivateTimelineReportingCommandHandler(uint32_t familyId, |
| 29 | uint32_t packetId, |
| 30 | uint32_t version, |
| 31 | SendTimelinePacket& sendTimelinePacket, |
| 32 | ProfilingStateMachine& profilingStateMachine, |
| 33 | Optional<IReportStructure&> reportStructure, |
| 34 | std::atomic<bool>& timelineReporting, |
| 35 | INotifyBackends& notifyBackends) |
| 36 | : CommandHandlerFunctor(familyId, packetId, version), |
| 37 | m_SendTimelinePacket(sendTimelinePacket), |
| 38 | m_StateMachine(profilingStateMachine), |
| 39 | m_TimelineReporting(timelineReporting), |
| 40 | m_BackendNotifier(notifyBackends), |
| 41 | m_ReportStructure(reportStructure) |
| 42 | {} |
| 43 | |
| 44 | void operator()(const Packet& packet) override; |
| 45 | |
| 46 | private: |
| 47 | SendTimelinePacket& m_SendTimelinePacket; |
| 48 | ProfilingStateMachine& m_StateMachine; |
| 49 | std::atomic<bool>& m_TimelineReporting; |
| 50 | INotifyBackends& m_BackendNotifier; |
| 51 | |
| 52 | Optional<IReportStructure&> m_ReportStructure; |
| 53 | }; |
| 54 | |
| 55 | } // namespace profiling |
| 56 | |
| 57 | } // namespace armnn |