From 1bc497e3ffcf097b05d05d526e3af75ab3a6fa57 Mon Sep 17 00:00:00 2001 From: Nikhil Raj Date: Mon, 8 May 2023 16:16:33 +0100 Subject: Removing "shiftID" from BackendProfilingCounterRegisterMockBackendTest This test case has caused several problems over the years. All the problems are around using counter indices to identify counters rather than names. Updating the test to check for registered counter names. Signed-off-by: Nikhil Raj Signed-off-by: Colm Donelan Change-Id: Ic5ebc9b2d53f2db301a3067ecce4befc14dcb8a5 --- .../backendsCommon/test/BackendProfilingTests.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/backends/backendsCommon/test/BackendProfilingTests.cpp b/src/backends/backendsCommon/test/BackendProfilingTests.cpp index 9041b55c57..439eff0a79 100644 --- a/src/backends/backendsCommon/test/BackendProfilingTests.cpp +++ b/src/backends/backendsCommon/test/BackendProfilingTests.cpp @@ -167,17 +167,14 @@ TEST_CASE("BackendProfilingCounterRegisterMockBackendTest") // Create a runtime armnn::RuntimeImpl runtime(options); - unsigned int shiftedId = 0; - // Check if the MockBackends 3 dummy counters {0, 1, 2-5 (four cores)} are registered armnn::BackendId mockId = armnn::MockBackendId(); - const ICounterMappings& counterMap = GetProfilingService(&runtime).GetCounterMappings(); - CHECK(counterMap.GetGlobalId(0, mockId) == 5 + shiftedId); - CHECK(counterMap.GetGlobalId(1, mockId) == 6 + shiftedId); - CHECK(counterMap.GetGlobalId(2, mockId) == 7 + shiftedId); - CHECK(counterMap.GetGlobalId(3, mockId) == 8 + shiftedId); - CHECK(counterMap.GetGlobalId(4, mockId) == 9 + shiftedId); - CHECK(counterMap.GetGlobalId(5, mockId) == 10 + shiftedId); + + CHECK(GetProfilingService(&runtime).IsCategoryRegistered("MockCounters")); + CHECK(GetProfilingService(&runtime).IsCounterRegistered("Mock Counter One")); + CHECK(GetProfilingService(&runtime).IsCounterRegistered("Mock Counter Two")); + CHECK(GetProfilingService(&runtime).IsCounterRegistered("Mock MultiCore Counter")); + options.m_ProfilingOptions.m_EnableProfiling = false; GetProfilingService(&runtime).ResetExternalProfilingOptions( ConvertExternalProfilingOptions(options.m_ProfilingOptions), true); -- cgit v1.2.1