From 5a64f22101ecdda4846e9d71428633f3ccd56fb2 Mon Sep 17 00:00:00 2001 From: Keith Davis Date: Wed, 4 Aug 2021 10:35:20 +0100 Subject: IVGCVSW-5980 Add Descriptor, TensorInfo and Convolution algorithm to JSON * Add GUID as field to layer details and profiling events * Add Optional GUID param to existing tests * Improve Details macro to be inline function * Fix some formatting Signed-off-by: Keith Davis Change-Id: I66f192a90a7642b3ee8e7dda0d3f428cce002581 --- src/armnn/test/ProfilerTests.cpp | 35 +++++++++++++++++++++++++---------- src/armnn/test/ProfilingEventTest.cpp | 12 ++++++++---- 2 files changed, 33 insertions(+), 14 deletions(-) (limited to 'src/armnn/test') diff --git a/src/armnn/test/ProfilerTests.cpp b/src/armnn/test/ProfilerTests.cpp index b27ad5a7a5..8fd97179f1 100644 --- a/src/armnn/test/ProfilerTests.cpp +++ b/src/armnn/test/ProfilerTests.cpp @@ -4,16 +4,13 @@ // #include -#include -#include #include -#include #include -#include #include +#include namespace armnn { @@ -216,7 +213,10 @@ TEST_CASE("WriteEventResults") // Need to directly create a ScopedProfilingEvent as the one created by the macro falls out of scope // immediately causing the Event.Stop() function method to be called immediately after the Event.Start() // function resulting in periodic test failures on the Dent and Smith HiKeys - armnn::ScopedProfilingEvent testEvent(armnn::Compute::CpuAcc, "test", armnn::WallClockTimer()); + armnn::ScopedProfilingEvent testEvent(armnn::Compute::CpuAcc, + armnn::EmptyOptional(), + "test", + armnn::WallClockTimer()); std::this_thread::sleep_for(std::chrono::milliseconds(10)); } @@ -288,18 +288,33 @@ TEST_CASE("ProfilerJsonPrinter") { // Test scoped macro. - ARMNN_SCOPED_PROFILING_EVENT_WITH_INSTRUMENTS(armnn::Compute::CpuAcc, "EnqueueWorkload", TestInstrument()) - ARMNN_SCOPED_PROFILING_EVENT_WITH_INSTRUMENTS(armnn::Compute::CpuAcc, "Level 0", TestInstrument()) + ARMNN_SCOPED_PROFILING_EVENT_WITH_INSTRUMENTS(armnn::Compute::CpuAcc, + armnn::EmptyOptional(), + "EnqueueWorkload", + TestInstrument()) + ARMNN_SCOPED_PROFILING_EVENT_WITH_INSTRUMENTS(armnn::Compute::CpuAcc, + armnn::EmptyOptional(), + "Level 0", + TestInstrument()) { { - ARMNN_SCOPED_PROFILING_EVENT_WITH_INSTRUMENTS(armnn::Compute::CpuAcc, "Level 1A", TestInstrument()) + ARMNN_SCOPED_PROFILING_EVENT_WITH_INSTRUMENTS(armnn::Compute::CpuAcc, + armnn::EmptyOptional(), + "Level 1A", + TestInstrument()) } { - ARMNN_SCOPED_PROFILING_EVENT_WITH_INSTRUMENTS(armnn::Compute::CpuAcc, "Level 1B", TestInstrument()) + ARMNN_SCOPED_PROFILING_EVENT_WITH_INSTRUMENTS(armnn::Compute::CpuAcc, + armnn::EmptyOptional(), + "Level 1B", + TestInstrument()) { - ARMNN_SCOPED_PROFILING_EVENT_WITH_INSTRUMENTS(armnn::Compute::CpuAcc, "Level 2A", TestInstrument()) + ARMNN_SCOPED_PROFILING_EVENT_WITH_INSTRUMENTS(armnn::Compute::CpuAcc, + armnn::EmptyOptional(), + "Level 2A", + TestInstrument()) } } } diff --git a/src/armnn/test/ProfilingEventTest.cpp b/src/armnn/test/ProfilingEventTest.cpp index 1e3d1eac7f..c61f4e2528 100644 --- a/src/armnn/test/ProfilingEventTest.cpp +++ b/src/armnn/test/ProfilingEventTest.cpp @@ -27,7 +27,8 @@ TEST_CASE("ProfilingEventTest") nullptr, nullptr, BackendId(), - std::move(insts1)); + std::move(insts1), + EmptyOptional()); CHECK_EQ(testEvent.GetName(), "EventName"); @@ -50,7 +51,8 @@ TEST_CASE("ProfilingEventTest") profileManager.GetProfiler(), &testEvent, cpuAccBackendId, - std::move(insts2)); + std::move(insts2), + EmptyOptional()); CHECK_EQ(&testEvent, testEvent2.GetParentEvent()); CHECK_EQ(profileManager.GetProfiler(), testEvent2.GetProfiler()); @@ -70,7 +72,8 @@ TEST_CASE("ProfilingEventTestOnGpuAcc") nullptr, nullptr, BackendId(), - std::move(insts1)); + std::move(insts1), + EmptyOptional()); CHECK_EQ(testEvent.GetName(), "GPUEvent"); @@ -93,7 +96,8 @@ TEST_CASE("ProfilingEventTestOnGpuAcc") profileManager.GetProfiler(), &testEvent, gpuAccBackendId, - std::move(insts2)); + std::move(insts2), + EmptyOptional()); CHECK_EQ(&testEvent, testEvent2.GetParentEvent()); CHECK_EQ(profileManager.GetProfiler(), testEvent2.GetProfiler()); -- cgit v1.2.1