6 #include <doctest/doctest.h> 13 using namespace armnn;
17 TEST_CASE(
"ProfilingEventTest")
22 const char* eventName =
"EventName";
25 insts1.emplace_back(std::make_unique<WallClockTimer>());
26 Event testEvent(eventName,
33 CHECK_EQ(testEvent.
GetName(),
"EventName");
39 std::this_thread::sleep_for(std::chrono::microseconds(10));
49 insts2.emplace_back(std::make_unique<WallClockTimer>());
50 Event testEvent2(eventName,
58 CHECK_EQ(profileManager.
GetProfiler(), testEvent2.GetProfiler());
59 CHECK(cpuAccBackendId == testEvent2.GetBackendId());
62 TEST_CASE(
"ProfilingEventTestOnGpuAcc")
67 const char* eventName =
"GPUEvent";
70 insts1.emplace_back(std::make_unique<WallClockTimer>());
71 Event testEvent(eventName,
78 CHECK_EQ(testEvent.
GetName(),
"GPUEvent");
84 std::this_thread::sleep_for(std::chrono::microseconds(10));
94 insts2.emplace_back(std::make_unique<WallClockTimer>());
95 Event testEvent2(eventName,
103 CHECK_EQ(profileManager.
GetProfiler(), testEvent2.GetProfiler());
104 CHECK(gpuAccBackendId == testEvent2.GetBackendId());
TEST_SUITE("TestConstTensorLayerVisitor")
Event class records measurements reported by BeginEvent()/EndEvent() and returns measurements when Ev...
static ProfilerManager & GetInstance()
std::vector< InstrumentPtr > Instruments
const std::string & GetName() const
Get the name of the event.
Copyright (c) 2021 ARM Limited and Contributors.
void Start()
Start the Event.
void Stop()
Stop the Event.
IProfiler * GetProfiler()
const std::vector< Measurement > GetMeasurements() const
Get the recorded measurements calculated between Start() and Stop()
GPU Execution: OpenCL: ArmCompute.
EmptyOptional is used to initialize the Optional class in case we want to have default value for an O...
CPU Execution: NEON: ArmCompute.
const Event * GetParentEvent() const
Get the pointer of the parent event.