ArmNN
 20.05
PeriodicCounterSelectionResponseHandler Class Reference

#include <PeriodicCounterSelectionResponseHandler.hpp>

Inheritance diagram for PeriodicCounterSelectionResponseHandler:
CommandHandlerFunctor

Public Member Functions

 PeriodicCounterSelectionResponseHandler (uint32_t familyId, uint32_t packetId, uint32_t version, bool quietOperation=true)
 
void operator() (const armnn::profiling::Packet &packet) override
 
- Public Member Functions inherited from CommandHandlerFunctor
 CommandHandlerFunctor (uint32_t familyId, uint32_t packetId, uint32_t version)
 
uint32_t GetFamilyId () const
 
uint32_t GetPacketId () const
 
uint32_t GetVersion () const
 
virtual void operator() (const Packet &packet)=0
 
virtual ~CommandHandlerFunctor ()
 

Detailed Description

Definition at line 18 of file PeriodicCounterSelectionResponseHandler.hpp.

Constructor & Destructor Documentation

◆ PeriodicCounterSelectionResponseHandler()

PeriodicCounterSelectionResponseHandler ( uint32_t  familyId,
uint32_t  packetId,
uint32_t  version,
bool  quietOperation = true 
)
inline
Parameters
packetIdThe id of packets this handler will process.
versionThe version of that id.
quietOperationOptional parameter to turn off printouts. This is useful for unittests.

Definition at line 28 of file PeriodicCounterSelectionResponseHandler.hpp.

References PeriodicCounterSelectionResponseHandler::operator()().

32  : CommandHandlerFunctor(familyId, packetId, version)
33  , m_QuietOperation(quietOperation)
34  {}
CommandHandlerFunctor(uint32_t familyId, uint32_t packetId, uint32_t version)

Member Function Documentation

◆ operator()()

void operator() ( const armnn::profiling::Packet &  packet)
override

Definition at line 18 of file PeriodicCounterSelectionResponseHandler.cpp.

References armnn::profiling::ReadUint32().

Referenced by PeriodicCounterSelectionResponseHandler::PeriodicCounterSelectionResponseHandler().

19 {
20  if (!m_QuietOperation) // Are we supposed to print to stdout?
21  {
22  uint32_t period = profiling::ReadUint32(reinterpret_cast<const unsigned char*>(packet.GetData()), 0);
23  uint32_t numCounters = 0;
24  // First check if there are any counters mentioned.
25  if(packet.GetLength() > 4)
26  {
27  // Length will be 4 bytes for the period and then a list of 16 bit UIDS.
28  numCounters = ((packet.GetLength() - 4) / 2);
29  }
30  std::cout << "PeriodicCounterSelectionResponse: Collection interval = " << std::dec << period << "uSec"
31  << " Num counters activated = " << numCounters << std::endl;
32  }
33 }
uint32_t ReadUint32(const IPacketBufferPtr &packetBuffer, unsigned int offset)

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