From de36e4a9c299028e792c3a5bd99ad0816d806077 Mon Sep 17 00:00:00 2001 From: Ryan OShea Date: Fri, 13 Mar 2020 16:26:19 +0000 Subject: IVGCVSW-3726 Upload ArmNN Doxygen files * Upload current ArmNN Doxygen files Signed-off-by: Ryan OShea Change-Id: I8989ed16ee40a99a4495b100bd009cf3e24a7285 --- Documentation/_backend_profiling_8cpp_source.html | 129 ++++++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 Documentation/_backend_profiling_8cpp_source.html (limited to 'Documentation/_backend_profiling_8cpp_source.html') diff --git a/Documentation/_backend_profiling_8cpp_source.html b/Documentation/_backend_profiling_8cpp_source.html new file mode 100644 index 0000000000..85485d9290 --- /dev/null +++ b/Documentation/_backend_profiling_8cpp_source.html @@ -0,0 +1,129 @@ + + + + + + + +ArmNN: src/profiling/backends/BackendProfiling.cpp Source File + + + + + + + + + + + + + + +
+
+ + + + + + +
+
ArmNN +  NotReleased +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
BackendProfiling.cpp
+
+
+Go to the documentation of this file.
1 //
2 // Copyright © 2020 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #include "BackendProfiling.hpp"
8 
9 namespace armnn
10 {
11 
12 namespace profiling
13 {
14 
15 std::unique_ptr<IRegisterBackendCounters>
16  BackendProfiling::GetCounterRegistrationInterface(uint16_t currentMaxGlobalCounterID)
17 {
18  return std::make_unique<RegisterBackendCounters>(RegisterBackendCounters(currentMaxGlobalCounterID, m_BackendId));
19 }
20 
21 std::unique_ptr<ISendTimelinePacket> BackendProfiling::GetSendTimelinePacket()
22 {
23  return m_ProfilingService.GetSendTimelinePacket();
24 }
25 
27 {
28  // The profiling service is our Guid Generator.
29  return m_ProfilingService;
30 }
31 
32 void BackendProfiling::ReportCounters(const std::vector<Timestamp>& timestamps)
33 {
34  for (const auto timestampInfo : timestamps)
35  {
36  std::vector<CounterValue> backendCounterValues = timestampInfo.counterValues;
37  for_each(backendCounterValues.begin(), backendCounterValues.end(), [&](CounterValue& backendCounterValue)
38  {
39  // translate the counterId to globalCounterId
40  backendCounterValue.counterId = m_ProfilingService.GetCounterMappings().GetGlobalId(
41  backendCounterValue.counterId, m_BackendId);
42  });
43 
44  // Send Periodic Counter Capture Packet for the Timestamp
46  timestampInfo.timestamp, backendCounterValues);
47  }
48 }
49 
51 {
52  uint16_t globalCounterId = m_ProfilingService.GetCounterMappings().GetGlobalId(backendCounterId, m_BackendId);
53  CaptureData captureData = m_ProfilingService.GetCaptureData();
54 
55  CounterStatus counterStatus(backendCounterId, globalCounterId, false, 0);
56 
57  if (captureData.IsCounterIdInCaptureData(globalCounterId))
58  {
59  counterStatus.m_Enabled = true;
60  counterStatus.m_SamplingRateInMicroseconds = captureData.GetCapturePeriod();
61  }
62 
63  return counterStatus;
64 }
65 
66 std::vector<CounterStatus> BackendProfiling::GetActiveCounters()
67 {
68  CaptureData captureData = m_ProfilingService.GetCaptureData();
69 
70  const std::vector<uint16_t>& globalCounterIds = captureData.GetCounterIds();
71  std::vector<CounterStatus> activeCounterIds;
72 
73  for (auto globalCounterId : globalCounterIds) {
74  // Get pair of local counterId and backendId using globalCounterId
75  const std::pair<uint16_t, armnn::BackendId>& backendCounterIdPair =
77  if (backendCounterIdPair.second == m_BackendId)
78  {
79  activeCounterIds.emplace_back(backendCounterIdPair.first,
80  globalCounterId,
81  true,
82  captureData.GetCapturePeriod());
83  }
84  }
85 
86  return activeCounterIds;
87 }
88 
90 {
91  return m_ProfilingService.IsProfilingEnabled();
92 }
93 
94 } // namespace profiling
95 } // namespace armnn
IProfilingGuidGenerator & GetProfilingGuidGenerator() override
+ +
virtual std::unique_ptr< ISendTimelinePacket > GetSendTimelinePacket() const =0
+
CounterStatus GetCounterStatus(uint16_t backendCounterId) override
+
virtual const ICounterMappings & GetCounterMappings() const =0
+
const ICounterMappings & GetCounterMappings() const override
+ + +
const std::vector< uint16_t > & GetCounterIds() const
Definition: Holder.cpp:49
+
virtual void SendPeriodicCounterCapturePacket(uint64_t timestamp, const IndexValuePairsVector &values)=0
Create and write a PeriodicCounterCapturePacket from the parameters to the buffer.
+
uint32_t GetCapturePeriod() const
Definition: Holder.cpp:44
+
virtual uint16_t GetGlobalId(uint16_t backendCounterId, const armnn::BackendId &backendId) const =0
+
bool IsProfilingEnabled() const override
+ +
virtual ISendCounterPacket & GetSendCounterPacket()=0
+
bool IsCounterIdInCaptureData(uint16_t counterId)
Definition: Holder.cpp:61
+ +
std::unique_ptr< IRegisterBackendCounters > GetCounterRegistrationInterface(uint16_t currentMaxGlobalCounterID) override
+
virtual const std::pair< uint16_t, armnn::BackendId > & GetBackendId(uint16_t globalCounterId) const =0
+ +
virtual CaptureData GetCaptureData()=0
+ +
static ProfilingService & Instance()
+
void ReportCounters(const std::vector< Timestamp > &) override
+ +
virtual bool IsProfilingEnabled() const =0
+ + +
std::vector< CounterStatus > GetActiveCounters() override
+
std::unique_ptr< ISendTimelinePacket > GetSendTimelinePacket() override
+
+
+ + + + -- cgit v1.2.1