From fd627ffaec8fd8801d980b4c91ee7c0607ab6aaf Mon Sep 17 00:00:00 2001 From: Jan Eilers Date: Thu, 25 Feb 2021 17:44:00 +0000 Subject: IVGCVSW-5687 Update Doxygen Docu * Update Doxygen Documentation for 21.02 release Signed-off-by: Jan Eilers Change-Id: I9ed2f9caab038836ea99d7b378d7899fe431a4e5 --- 21.02/_profiling_event_test_8cpp.xhtml | 186 +++++++++++++++++++++++++++++++++ 1 file changed, 186 insertions(+) create mode 100644 21.02/_profiling_event_test_8cpp.xhtml (limited to '21.02/_profiling_event_test_8cpp.xhtml') diff --git a/21.02/_profiling_event_test_8cpp.xhtml b/21.02/_profiling_event_test_8cpp.xhtml new file mode 100644 index 0000000000..8265e1ff17 --- /dev/null +++ b/21.02/_profiling_event_test_8cpp.xhtml @@ -0,0 +1,186 @@ + + + + + + + + + + + + + +ArmNN: src/armnn/test/ProfilingEventTest.cpp File Reference + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  21.02 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
ProfilingEventTest.cpp File Reference
+
+
+
#include <boost/test/unit_test.hpp>
+#include "ProfilingEvent.hpp"
+#include "Profiling.hpp"
+#include <thread>
+
+

Go to the source code of this file.

+ + + + + + +

+Functions

 BOOST_AUTO_TEST_CASE (ProfilingEventTest)
 
 BOOST_AUTO_TEST_CASE (ProfilingEventTestOnGpuAcc)
 
+

Function Documentation

+ +

◆ BOOST_AUTO_TEST_CASE() [1/2]

+ +
+
+ + + + + + + + +
BOOST_AUTO_TEST_CASE (ProfilingEventTest )
+
+ +

Definition at line 17 of file ProfilingEventTest.cpp.

+ +

References armnn::CpuAcc, ProfilerManager::GetInstance(), Event::GetMeasurements(), Event::GetName(), Event::GetParentEvent(), ProfilerManager::GetProfiler(), Event::Start(), and Event::Stop().

+
18 {
19  // Get a reference to the profiler manager.
21 
22  const char* eventName = "EventName";
23 
24  Event::Instruments insts1;
25  insts1.emplace_back(std::make_unique<WallClockTimer>());
26  Event testEvent(eventName,
27  nullptr,
28  nullptr,
29  BackendId(),
30  std::move(insts1));
31 
32  BOOST_CHECK_EQUAL(testEvent.GetName(), "EventName");
33 
34  // start the timer - outer
35  testEvent.Start();
36 
37  // wait for 10 microseconds
38  std::this_thread::sleep_for(std::chrono::microseconds(10));
39 
40  // stop the timer - outer
41  testEvent.Stop();
42 
43  BOOST_CHECK_GE(testEvent.GetMeasurements().front().m_Value, 10.0);
44 
45  // create a sub event with CpuAcc
46  BackendId cpuAccBackendId(Compute::CpuAcc);
47  Event::Instruments insts2;
48  insts2.emplace_back(std::make_unique<WallClockTimer>());
49  Event testEvent2(eventName,
50  profileManager.GetProfiler(),
51  &testEvent,
52  cpuAccBackendId,
53  std::move(insts2));
54 
55  BOOST_CHECK_EQUAL(&testEvent, testEvent2.GetParentEvent());
56  BOOST_CHECK_EQUAL(profileManager.GetProfiler(), testEvent2.GetProfiler());
57  BOOST_CHECK(cpuAccBackendId == testEvent2.GetBackendId());
58 }
Event class records measurements reported by BeginEvent()/EndEvent() and returns measurements when Ev...
+
static ProfilerManager & GetInstance()
Definition: Profiling.cpp:489
+
std::vector< InstrumentPtr > Instruments
+
IProfiler * GetProfiler()
Definition: Profiling.cpp:501
+ + +
+
+
+ +

◆ BOOST_AUTO_TEST_CASE() [2/2]

+ +
+
+ + + + + + + + +
BOOST_AUTO_TEST_CASE (ProfilingEventTestOnGpuAcc )
+
+ +

Definition at line 60 of file ProfilingEventTest.cpp.

+ +

References BOOST_AUTO_TEST_SUITE_END(), ProfilerManager::GetInstance(), Event::GetMeasurements(), Event::GetName(), Event::GetParentEvent(), ProfilerManager::GetProfiler(), armnn::GpuAcc, Event::Start(), and Event::Stop().

+
61 {
62  // Get a reference to the profiler manager.
64 
65  const char* eventName = "GPUEvent";
66 
67  Event::Instruments insts1;
68  insts1.emplace_back(std::make_unique<WallClockTimer>());
69  Event testEvent(eventName,
70  nullptr,
71  nullptr,
72  BackendId(),
73  std::move(insts1));
74 
75  BOOST_CHECK_EQUAL(testEvent.GetName(), "GPUEvent");
76 
77  // start the timer - outer
78  testEvent.Start();
79 
80  // wait for 10 microseconds
81  std::this_thread::sleep_for(std::chrono::microseconds(10));
82 
83  // stop the timer - outer
84  testEvent.Stop();
85 
86  BOOST_CHECK_GE(testEvent.GetMeasurements().front().m_Value, 10.0);
87 
88  // create a sub event
89  BackendId gpuAccBackendId(Compute::GpuAcc);
90  Event::Instruments insts2;
91  insts2.emplace_back(std::make_unique<WallClockTimer>());
92  Event testEvent2(eventName,
93  profileManager.GetProfiler(),
94  &testEvent,
95  gpuAccBackendId,
96  std::move(insts2));
97 
98  BOOST_CHECK_EQUAL(&testEvent, testEvent2.GetParentEvent());
99  BOOST_CHECK_EQUAL(profileManager.GetProfiler(), testEvent2.GetProfiler());
100  BOOST_CHECK(gpuAccBackendId == testEvent2.GetBackendId());
101 }
Event class records measurements reported by BeginEvent()/EndEvent() and returns measurements when Ev...
+
static ProfilerManager & GetInstance()
Definition: Profiling.cpp:489
+
std::vector< InstrumentPtr > Instruments
+
IProfiler * GetProfiler()
Definition: Profiling.cpp:501
+ + +
+
+
+
+
+ + + + -- cgit v1.2.1