From 549b9600a6eaf0727fa084465a75f173edf8f381 Mon Sep 17 00:00:00 2001 From: Nikhil Raj Date: Tue, 24 May 2022 11:32:07 +0100 Subject: Update 22.05 Doxygen Docs after updates to main Readme Signed-off-by: Nikhil Raj Change-Id: I56711772406a41ff81fa136a5fb6c59c9b9cf504 --- ...quest_counters_packet_handler_8cpp_source.xhtml | 118 +++++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 22.05/_request_counters_packet_handler_8cpp_source.xhtml (limited to '22.05/_request_counters_packet_handler_8cpp_source.xhtml') diff --git a/22.05/_request_counters_packet_handler_8cpp_source.xhtml b/22.05/_request_counters_packet_handler_8cpp_source.xhtml new file mode 100644 index 0000000000..37903cecbf --- /dev/null +++ b/22.05/_request_counters_packet_handler_8cpp_source.xhtml @@ -0,0 +1,118 @@ + + + + + + + + + + + + + +ArmNN: src/profiling/test/RequestCountersPacketHandler.cpp Source File + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  22.05 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
RequestCountersPacketHandler.cpp
+
+
+Go to the documentation of this file.
1 //
2 // Copyright © 2020 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
7 
8 #include <common/include/NumericCast.hpp>
9 #include <common/include/PacketVersionResolver.hpp>
10 #include <common/include/ProfilingException.hpp>
11 
12 #include <server/include/timelineDecoder/DirectoryCaptureCommandHandler.hpp>
13 
14 namespace arm
15 {
16 
17 namespace pipe
18 {
19 
21 {
22  std::vector<uint32_t> headers;
23  headers.push_back(m_CounterDirectoryMessageHeader); // counter directory
24  return headers;
25 }
26 
27 void RequestCountersPacketHandler::HandlePacket(const arm::pipe::Packet& packet)
28 {
29  if (packet.GetHeader() != m_CounterDirectoryMessageHeader)
30  {
31  return;
32  }
33  arm::pipe::PacketVersionResolver packetVersionResolver;
34  DirectoryCaptureCommandHandler directoryCaptureCommandHandler(
35  "ARMNN", 0, 2, packetVersionResolver.ResolvePacketVersion(0, 2).GetEncodedValue());
36  directoryCaptureCommandHandler.operator()(packet);
37  const ICounterDirectory& counterDirectory = directoryCaptureCommandHandler.GetCounterDirectory();
38  for (auto& category : counterDirectory.GetCategories())
39  {
40  // Remember we need to translate the Uid's from our CounterDirectory instance to the parent one.
41  std::vector<uint16_t> translatedCounters;
42  for (auto const& copyUid : category->m_Counters)
43  {
44  translatedCounters.emplace_back(directoryCaptureCommandHandler.TranslateUIDCopyToOriginal(copyUid));
45  }
46  m_IdList.insert(std::end(m_IdList), std::begin(translatedCounters), std::end(translatedCounters));
47  }
48  SendCounterSelectionPacket();
49 }
50 
51 void RequestCountersPacketHandler::SendCounterSelectionPacket()
52 {
53  uint32_t uint16_t_size = sizeof(uint16_t);
54  uint32_t uint32_t_size = sizeof(uint32_t);
55 
56  uint32_t offset = 0;
57  uint32_t bodySize = uint32_t_size + arm::pipe::numeric_cast<uint32_t>(m_IdList.size()) * uint16_t_size;
58 
59  auto uniqueData = std::make_unique<unsigned char[]>(bodySize);
60  auto data = reinterpret_cast<unsigned char*>(uniqueData.get());
61 
62  // Copy capturePeriod
63  WriteUint32(data, offset, m_CapturePeriod);
64 
65  // Copy m_IdList
66  offset += uint32_t_size;
67  for (const uint16_t& id : m_IdList)
68  {
69  WriteUint16(data, offset, id);
70  offset += uint16_t_size;
71  }
72 
73  arm::pipe::Packet packet(0x40000, bodySize, uniqueData);
74  m_Connection->ReturnPacket(packet);
75 }
76 
77 } // namespace pipe
78 
79 } // namespace arm
+
std::vector< uint32_t > GetHeadersAccepted() override
+ +
void HandlePacket(const arm::pipe::Packet &packet) override
+
std::enable_if_t< std::is_unsigned< Source >::value &&std::is_unsigned< Dest >::value, Dest > numeric_cast(Source source)
Definition: NumericCast.hpp:35
+
+
+ + + + -- cgit v1.2.1