From e394bd99f1a55e099445823b7a951f0faa84d439 Mon Sep 17 00:00:00 2001 From: Keith Davis Date: Mon, 2 Dec 2019 15:12:19 +0000 Subject: IVGCVSW-4178 Add code to increment the 3 ArmNN counters * Increment at Runtime.cpp | BackendRegistry.cpp | LoadedNetwork.cpp * Update unit tests * UID generation is now handled by backends Signed-off-by: Keith Davis Change-Id: Ifa53763409078c14839675206d8b260cdc36a8df --- src/profiling/ProfilingUtils.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/profiling/ProfilingUtils.cpp') diff --git a/src/profiling/ProfilingUtils.cpp b/src/profiling/ProfilingUtils.cpp index 8a7d9147cc..0125f0db4b 100644 --- a/src/profiling/ProfilingUtils.cpp +++ b/src/profiling/ProfilingUtils.cpp @@ -6,7 +6,6 @@ #include "ProfilingUtils.hpp" #include -#include #include @@ -72,20 +71,17 @@ uint16_t GetNextUid(bool peekOnly) } } -std::vector GetNextCounterUids(uint16_t cores) +std::vector GetNextCounterUids(uint16_t firstUid, uint16_t cores) { - // The UID used for counters only. The first valid UID is 0 - static uint16_t counterUid = 0; - // Check that it is possible to generate the next counter UID without causing an overflow (throws in case of error) - ThrowIfCantGenerateNextUid(counterUid, cores); + ThrowIfCantGenerateNextUid(firstUid, cores); // Get the next counter UIDs size_t counterUidsSize = cores == 0 ? 1 : cores; std::vector counterUids(counterUidsSize, 0); for (size_t i = 0; i < counterUidsSize; i++) { - counterUids[i] = counterUid++; + counterUids[i] = firstUid++; } return counterUids; } -- cgit v1.2.1