1 // 2 // Copyright © 2020 Arm Ltd and Contributors. All rights reserved. 3 // SPDX-License-Identifier: MIT 4 // 5 6 #pragma once 7 8 #include "ProfilingStateMachine.hpp" 9 #include "SendTimelinePacket.hpp" 10 #include "IReportStructure.hpp" 11 #include "INotifyBackends.hpp" 12 13 #include "armnn/Optional.hpp" 14 15 #include <common/include/CommandHandlerFunctor.hpp> 16 #include <common/include/Packet.hpp> 17 18 19 namespace armnn 20 { 21 22 namespace profiling 23 { 24 25 class ActivateTimelineReportingCommandHandler : public arm::pipe::CommandHandlerFunctor 26 { 27 public: ActivateTimelineReportingCommandHandler(uint32_t familyId,uint32_t packetId,uint32_t version,SendTimelinePacket & sendTimelinePacket,ProfilingStateMachine & profilingStateMachine,Optional<IReportStructure &> reportStructure,std::atomic<bool> & timelineReporting,INotifyBackends & notifyBackends)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 arm::pipe::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