aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikhil Raj <nikhil.raj@arm.com>2023-05-08 16:16:33 +0100
committerNikhil Raj Arm <nikhil.raj@arm.com>2023-05-09 19:18:07 +0000
commit1bc497e3ffcf097b05d05d526e3af75ab3a6fa57 (patch)
tree463e95ba946840c7b1b869b93538bf5b846795bd
parentfe1827dbbecb64043f403267aeaa48da5965bd9f (diff)
downloadarmnn-1bc497e3ffcf097b05d05d526e3af75ab3a6fa57.tar.gz
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 <nikhil.raj@arm.com> Signed-off-by: Colm Donelan <colm.donelan@arm.com> Change-Id: Ic5ebc9b2d53f2db301a3067ecce4befc14dcb8a5
-rw-r--r--src/backends/backendsCommon/test/BackendProfilingTests.cpp15
1 files 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);