Keith Davis | 33ed221 | 2020-03-30 10:43:41 +0100 | [diff] [blame] | 1 | // |
Jim Flynn | bbfe603 | 2020-07-20 16:57:44 +0100 | [diff] [blame] | 2 | // Copyright © 2020 Arm Ltd and Contributors. All rights reserved. |
Keith Davis | 33ed221 | 2020-03-30 10:43:41 +0100 | [diff] [blame] | 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | |
| 6 | #pragma once |
| 7 | |
Keith Davis | 33ed221 | 2020-03-30 10:43:41 +0100 | [diff] [blame] | 8 | #include "ProfilingStateMachine.hpp" |
Keith Davis | 33ed221 | 2020-03-30 10:43:41 +0100 | [diff] [blame] | 9 | #include "SendTimelinePacket.hpp" |
| 10 | #include "IReportStructure.hpp" |
Keith Davis | 33ed221 | 2020-03-30 10:43:41 +0100 | [diff] [blame] | 11 | #include "INotifyBackends.hpp" |
| 12 | |
Finn Williams | 0c8cb99 | 2020-05-07 10:38:15 +0100 | [diff] [blame] | 13 | #include "armnn/Optional.hpp" |
| 14 | |
Jim Flynn | bbfe603 | 2020-07-20 16:57:44 +0100 | [diff] [blame] | 15 | #include <common/include/CommandHandlerFunctor.hpp> |
| 16 | #include <common/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 | |
Jim Flynn | bbfe603 | 2020-07-20 16:57:44 +0100 | [diff] [blame] | 25 | class ActivateTimelineReportingCommandHandler : public arm::pipe::CommandHandlerFunctor |
Keith Davis | 33ed221 | 2020-03-30 10:43:41 +0100 | [diff] [blame] | 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 | |
Jim Flynn | bbfe603 | 2020-07-20 16:57:44 +0100 | [diff] [blame] | 44 | void operator()(const arm::pipe::Packet& packet) override; |
Keith Davis | 33ed221 | 2020-03-30 10:43:41 +0100 | [diff] [blame] | 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 |