#include <boost/test/unit_test.hpp>
#include "ProfilingEvent.hpp"
#include "Profiling.hpp"
#include <thread>
Go to the source code of this file.
◆ BOOST_AUTO_TEST_CASE() [1/2]
BOOST_AUTO_TEST_CASE |
( |
ProfilingEventTest |
| ) |
|
Definition at line 17 of file ProfilingEventTest.cpp.
References BOOST_CHECK(), armnn::CpuAcc, ProfilerManager::GetInstance(), Event::GetMeasurements(), Event::GetName(), Event::GetParentEvent(), ProfilerManager::GetProfiler(), Event::Start(), and Event::Stop().
22 const char* eventName =
"EventName";
25 insts1.emplace_back(std::make_unique<WallClockTimer>());
26 Event testEvent(eventName,
32 BOOST_CHECK_EQUAL(testEvent.GetName(),
"EventName");
38 std::this_thread::sleep_for(std::chrono::microseconds(10));
43 BOOST_CHECK_GE(testEvent.GetMeasurements().front().m_Value, 10.0);
46 BackendId cpuAccBackendId(Compute::CpuAcc);
48 insts2.emplace_back(std::make_unique<WallClockTimer>());
49 Event testEvent2(eventName,
55 BOOST_CHECK_EQUAL(&testEvent, testEvent2.GetParentEvent());
56 BOOST_CHECK_EQUAL(profileManager.
GetProfiler(), testEvent2.GetProfiler());
57 BOOST_CHECK(cpuAccBackendId == testEvent2.GetBackendId());
Event class records measurements reported by BeginEvent()/EndEvent() and returns measurements when Ev...
static ProfilerManager & GetInstance()
std::vector< InstrumentPtr > Instruments
BOOST_CHECK(profilingService.GetCurrentState()==ProfilingState::WaitingForAck)
◆ 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(), BOOST_CHECK(), ProfilerManager::GetInstance(), Event::GetMeasurements(), Event::GetName(), Event::GetParentEvent(), ProfilerManager::GetProfiler(), armnn::GpuAcc, Event::Start(), and Event::Stop().
65 const char* eventName =
"GPUEvent";
68 insts1.emplace_back(std::make_unique<WallClockTimer>());
69 Event testEvent(eventName,
75 BOOST_CHECK_EQUAL(testEvent.GetName(),
"GPUEvent");
81 std::this_thread::sleep_for(std::chrono::microseconds(10));
86 BOOST_CHECK_GE(testEvent.GetMeasurements().front().m_Value, 10.0);
89 BackendId gpuAccBackendId(Compute::GpuAcc);
91 insts2.emplace_back(std::make_unique<WallClockTimer>());
92 Event testEvent2(eventName,
98 BOOST_CHECK_EQUAL(&testEvent, testEvent2.GetParentEvent());
99 BOOST_CHECK_EQUAL(profileManager.
GetProfiler(), testEvent2.GetProfiler());
100 BOOST_CHECK(gpuAccBackendId == testEvent2.GetBackendId());
Event class records measurements reported by BeginEvent()/EndEvent() and returns measurements when Ev...
static ProfilerManager & GetInstance()
std::vector< InstrumentPtr > Instruments
BOOST_CHECK(profilingService.GetCurrentState()==ProfilingState::WaitingForAck)