ArmNN
 21.02
DeactivateTimelineReportingCommandHandler Class Reference

#include <DeactivateTimelineReportingCommandHandler.hpp>

Inheritance diagram for DeactivateTimelineReportingCommandHandler:

Public Member Functions

 DeactivateTimelineReportingCommandHandler (uint32_t familyId, uint32_t packetId, uint32_t version, std::atomic< bool > &timelineReporting, ProfilingStateMachine &profilingStateMachine, INotifyBackends &notifyBackends)
 
void operator() (const arm::pipe::Packet &packet) override
 

Detailed Description

Constructor & Destructor Documentation

◆ DeactivateTimelineReportingCommandHandler()

DeactivateTimelineReportingCommandHandler ( uint32_t  familyId,
uint32_t  packetId,
uint32_t  version,
std::atomic< bool > &  timelineReporting,
ProfilingStateMachine profilingStateMachine,
INotifyBackends notifyBackends 
)
inline

Definition at line 24 of file DeactivateTimelineReportingCommandHandler.hpp.

References DeactivateTimelineReportingCommandHandler::operator()().

30  : CommandHandlerFunctor(familyId, packetId, version)
31  , m_TimelineReporting(timelineReporting)
32  , m_StateMachine(profilingStateMachine)
33  , m_BackendNotifier(notifyBackends)
34  {}

Member Function Documentation

◆ operator()()

void operator() ( const arm::pipe::Packet &  packet)
override

Definition at line 18 of file DeactivateTimelineReportingCommandHandler.cpp.

References armnn::profiling::Active, ProfilingStateMachine::GetCurrentState(), armnn::profiling::GetProfilingStateName(), armnn::profiling::NotConnected, INotifyBackends::NotifyBackendsForTimelineReporting(), armnn::profiling::Uninitialised, and armnn::profiling::WaitingForAck.

Referenced by DeactivateTimelineReportingCommandHandler::DeactivateTimelineReportingCommandHandler().

19 {
20  ProfilingState currentState = m_StateMachine.GetCurrentState();
21 
22  switch ( currentState )
23  {
27  throw RuntimeException(fmt::format(
28  "Deactivate Timeline Reporting Command Handler invoked while in a wrong state: {}",
29  GetProfilingStateName(currentState)));
31  if (!(packet.GetPacketFamily() == 0u && packet.GetPacketId() == 7u))
32  {
33  throw armnn::Exception(std::string("Expected Packet family = 0, id = 7 but received family =")
34  + std::to_string(packet.GetPacketFamily())
35  +" id = " + std::to_string(packet.GetPacketId()));
36  }
37 
38  m_TimelineReporting.store(false);
39 
40  // Notify Backends
41  m_BackendNotifier.NotifyBackendsForTimelineReporting();
42 
43  break;
44  default:
45  throw RuntimeException(fmt::format("Unknown profiling service state: {}",
46  static_cast<int>(currentState)));
47  }
48 }
virtual void NotifyBackendsForTimelineReporting()=0
Base class for all ArmNN exceptions so that users can filter to just those.
Definition: Exceptions.hpp:46
constexpr char const * GetProfilingStateName(ProfilingState state)

The documentation for this class was generated from the following files: