ArmNN
 20.05
ConnectionAcknowledgedCommandHandler.hpp
Go to the documentation of this file.
1 //
2 // Copyright © 2019 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #pragma once
7 
10 #include "ISendCounterPacket.hpp"
12 #include <Packet.hpp>
14 
15 namespace armnn
16 {
17 
18 namespace profiling
19 {
20 
22 {
23 
24 typedef const std::unordered_map<BackendId, std::shared_ptr<armnn::profiling::IBackendProfilingContext>>&
25  BackendProfilingContexts;
26 
27 public:
29  uint32_t packetId,
30  uint32_t version,
31  ICounterDirectory& counterDirectory,
32  ISendCounterPacket& sendCounterPacket,
33  ISendTimelinePacket& sendTimelinePacket,
34  ProfilingStateMachine& profilingStateMachine,
35  Optional<BackendProfilingContexts> backendProfilingContexts = EmptyOptional())
36  : CommandHandlerFunctor(familyId, packetId, version)
37  , m_CounterDirectory(counterDirectory)
38  , m_SendCounterPacket(sendCounterPacket)
39  , m_SendTimelinePacket(sendTimelinePacket)
40  , m_StateMachine(profilingStateMachine)
41  , m_BackendProfilingContext(backendProfilingContexts)
42  {}
43 
44  void operator()(const Packet& packet) override;
45 
46  void setTimelineEnabled(bool timelineEnabled)
47  {
48  m_TimelineEnabled = timelineEnabled;
49  }
50 
51 private:
52  const ICounterDirectory& m_CounterDirectory;
53  ISendCounterPacket& m_SendCounterPacket;
54  ISendTimelinePacket& m_SendTimelinePacket;
55  ProfilingStateMachine& m_StateMachine;
56  Optional<BackendProfilingContexts> m_BackendProfilingContext;
57  bool m_TimelineEnabled = false;
58 };
59 
60 } // namespace profiling
61 
62 } // namespace armnn
63 
Copyright (c) 2020 ARM Limited.
EmptyOptional is used to initialize the Optional class in case we want to have default value for an O...
Definition: Optional.hpp:32
ConnectionAcknowledgedCommandHandler(uint32_t familyId, uint32_t packetId, uint32_t version, ICounterDirectory &counterDirectory, ISendCounterPacket &sendCounterPacket, ISendTimelinePacket &sendTimelinePacket, ProfilingStateMachine &profilingStateMachine, Optional< BackendProfilingContexts > backendProfilingContexts=EmptyOptional())