ArmNN
 20.02
PerJobCounterSelectionCommandHandler.cpp
Go to the documentation of this file.
1 //
2 // Copyright © 2019 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
7 
8 #include <boost/format.hpp>
9 
10 namespace armnn
11 {
12 
13 namespace profiling
14 {
15 
17 {
18  ProfilingState currentState = m_StateMachine.GetCurrentState();
19  switch (currentState)
20  {
24  throw RuntimeException(boost::str(boost::format("Per-Job Counter Selection Command Handler invoked while in "
25  "an wrong state: %1%")
26  % GetProfilingStateName(currentState)));
28  // Process the packet
29  if (!(packet.GetPacketFamily() == 0u && packet.GetPacketId() == 5u))
30  {
31  throw armnn::InvalidArgumentException(boost::str(boost::format("Expected Packet family = 0, id = 5 but "
32  "received family = %1%, id = %2%")
33  % packet.GetPacketFamily()
34  % packet.GetPacketId()));
35  }
36 
37  // Silently drop the packet
38 
39  break;
40  default:
41  throw RuntimeException(boost::str(boost::format("Unknown profiling service state: %1%")
42  % static_cast<int>(currentState)));
43  }
44 }
45 
46 } // namespace profiling
47 
48 } // namespace armnn
Copyright (c) 2020 ARM Limited.
uint32_t GetPacketFamily() const
Definition: Packet.hpp:70
uint32_t GetPacketId() const
Definition: Packet.hpp:71
constexpr char const * GetProfilingStateName(ProfilingState state)