ArmNN
 20.02
PeriodicCounterSelectionResponseHandler.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 "../../../src/profiling/ProfilingUtils.hpp"
9 
10 #include <iostream>
11 
12 namespace armnn
13 {
14 
15 namespace gatordmock
16 {
17 
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 }
34 
35 } // namespace gatordmock
36 
37 } // namespace armnn
Copyright (c) 2020 ARM Limited.
uint32_t ReadUint32(const IPacketBufferPtr &packetBuffer, unsigned int offset)
uint32_t GetLength() const
Definition: Packet.hpp:74
const unsigned char * GetData() const
Definition: Packet.hpp:75