ArmNN
 21.02
PerJobCounterSelectionCommandHandler Class Reference

#include <PerJobCounterSelectionCommandHandler.hpp>

Inheritance diagram for PerJobCounterSelectionCommandHandler:

Public Member Functions

 PerJobCounterSelectionCommandHandler (uint32_t familyId, uint32_t packetId, uint32_t version, const ProfilingStateMachine &profilingStateMachine)
 
void operator() (const arm::pipe::Packet &packet) override
 

Detailed Description

Definition at line 19 of file PerJobCounterSelectionCommandHandler.hpp.

Constructor & Destructor Documentation

◆ PerJobCounterSelectionCommandHandler()

PerJobCounterSelectionCommandHandler ( uint32_t  familyId,
uint32_t  packetId,
uint32_t  version,
const ProfilingStateMachine profilingStateMachine 
)
inline

Definition at line 23 of file PerJobCounterSelectionCommandHandler.hpp.

References PerJobCounterSelectionCommandHandler::operator()().

27  : CommandHandlerFunctor(familyId, packetId, version)
28  , m_StateMachine(profilingStateMachine)
29  {}

Member Function Documentation

◆ operator()()

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

Definition at line 17 of file PerJobCounterSelectionCommandHandler.cpp.

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

Referenced by PerJobCounterSelectionCommandHandler::PerJobCounterSelectionCommandHandler().

18 {
19  ProfilingState currentState = m_StateMachine.GetCurrentState();
20  switch (currentState)
21  {
25  throw armnn::RuntimeException(fmt::format(
26  "Per-Job Counter Selection Command Handler invoked while in an incorrect state: {}",
27  GetProfilingStateName(currentState)));
29  // Process the packet
30  if (!(packet.GetPacketFamily() == 0u && packet.GetPacketId() == 5u))
31  {
32  throw armnn::InvalidArgumentException(fmt::format("Expected Packet family = 0, id = 5 but "
33  "received family = {}, id = {}",
34  packet.GetPacketFamily(),
35  packet.GetPacketId()));
36  }
37 
38  // Silently drop the packet
39 
40  break;
41  default:
42  throw armnn::RuntimeException(fmt::format("Unknown profiling service state: {}",
43  static_cast<int>(currentState)));
44  }
45 }
constexpr char const * GetProfilingStateName(ProfilingState state)

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