diff options
author | Cathal Corbett <cathal.corbett@arm.com> | 2022-03-04 12:11:09 +0000 |
---|---|---|
committer | Cathal Corbett <cathal.corbett@arm.com> | 2022-03-04 12:11:09 +0000 |
commit | 6f073727ad98d94f43a3938ddeac3f5a231ad959 (patch) | |
tree | d691d5f28846d66729cd0b4c52761d4d9a90305f /src/profiling/test | |
parent | ae91a5e058da31e912c0768f516b2ef013c3b39e (diff) | |
download | armnn-6f073727ad98d94f43a3938ddeac3f5a231ad959.tar.gz |
IVGCVSW-6814 Remove references to armnn:BackendId in the profiling code
Signed-off-by: Cathal Corbett <cathal.corbett@arm.com>
Change-Id: Ib399a5eee9e52882800ec3e02e4173424a7c19b1
Diffstat (limited to 'src/profiling/test')
-rw-r--r-- | src/profiling/test/ProfilingMocks.hpp | 4 | ||||
-rw-r--r-- | src/profiling/test/ProfilingTestUtils.hpp | 1 | ||||
-rw-r--r-- | src/profiling/test/ProfilingTests.cpp | 28 |
3 files changed, 16 insertions, 17 deletions
diff --git a/src/profiling/test/ProfilingMocks.hpp b/src/profiling/test/ProfilingMocks.hpp index 5e7d31a914..93145031ea 100644 --- a/src/profiling/test/ProfilingMocks.hpp +++ b/src/profiling/test/ProfilingMocks.hpp @@ -505,7 +505,7 @@ public: return counterSetPtr; } - const Counter* RegisterCounter(const armnn::BackendId& backendId, + const Counter* RegisterCounter(const std::string& backendId, const uint16_t uid, const std::string& parentCategoryName, uint16_t counterClass, @@ -676,7 +676,7 @@ public: void RegisterMapping(uint16_t globalCounterId, uint16_t backendCounterId, - const armnn::BackendId& backendId) + const std::string& backendId) { m_CounterMapping.RegisterMapping(globalCounterId, backendCounterId, backendId); } diff --git a/src/profiling/test/ProfilingTestUtils.hpp b/src/profiling/test/ProfilingTestUtils.hpp index 16c6dde4ea..32a156ee42 100644 --- a/src/profiling/test/ProfilingTestUtils.hpp +++ b/src/profiling/test/ProfilingTestUtils.hpp @@ -8,7 +8,6 @@ #include "ProfilingUtils.hpp" #include "Runtime.hpp" -#include <armnn/BackendId.hpp> #include <armnn/Optional.hpp> #include <BufferManager.hpp> #include <ProfilingService.hpp> diff --git a/src/profiling/test/ProfilingTests.cpp b/src/profiling/test/ProfilingTests.cpp index cba6ebd475..0a98af2817 100644 --- a/src/profiling/test/ProfilingTests.cpp +++ b/src/profiling/test/ProfilingTests.cpp @@ -1786,7 +1786,7 @@ TEST_CASE("CounterSelectionCommandHandlerParseData") const uint32_t packetId = 0x40000; uint32_t version = 1; - const std::unordered_map<armnn::BackendId, + const std::unordered_map<std::string, std::shared_ptr<IBackendProfilingContext>> backendProfilingContext; CounterIdMap counterIdMap; Holder holder; @@ -2342,7 +2342,7 @@ TEST_CASE("CheckPeriodicCounterCaptureThread") ProfilingStateMachine profilingStateMachine; - const std::unordered_map<armnn::BackendId, + const std::unordered_map<std::string, std::shared_ptr<IBackendProfilingContext>> backendProfilingContext; CounterIdMap counterIdMap; Holder data; @@ -3382,8 +3382,8 @@ TEST_CASE("CheckCounterIdMap") uint16_t globalCounterIds = 0; - armnn::BackendId cpuRefId(armnn::Compute::CpuRef); - armnn::BackendId cpuAccId(armnn::Compute::CpuAcc); + std::string cpuRefId(GetComputeDeviceAsCString(armnn::Compute::CpuRef)); + std::string cpuAccId(GetComputeDeviceAsCString(armnn::Compute::CpuAcc)); std::vector<uint16_t> cpuRefCounters = {0, 1, 2, 3}; std::vector<uint16_t> cpuAccCounters = {0, 1}; @@ -3399,12 +3399,12 @@ TEST_CASE("CheckCounterIdMap") ++globalCounterIds; } - CHECK(counterIdMap.GetBackendId(0) == (std::pair<uint16_t, armnn::BackendId>(0, cpuRefId))); - CHECK(counterIdMap.GetBackendId(1) == (std::pair<uint16_t, armnn::BackendId>(1, cpuRefId))); - CHECK(counterIdMap.GetBackendId(2) == (std::pair<uint16_t, armnn::BackendId>(2, cpuRefId))); - CHECK(counterIdMap.GetBackendId(3) == (std::pair<uint16_t, armnn::BackendId>(3, cpuRefId))); - CHECK(counterIdMap.GetBackendId(4) == (std::pair<uint16_t, armnn::BackendId>(0, cpuAccId))); - CHECK(counterIdMap.GetBackendId(5) == (std::pair<uint16_t, armnn::BackendId>(1, cpuAccId))); + CHECK(counterIdMap.GetBackendId(0) == (std::pair<uint16_t, std::string>(0, cpuRefId))); + CHECK(counterIdMap.GetBackendId(1) == (std::pair<uint16_t, std::string>(1, cpuRefId))); + CHECK(counterIdMap.GetBackendId(2) == (std::pair<uint16_t, std::string>(2, cpuRefId))); + CHECK(counterIdMap.GetBackendId(3) == (std::pair<uint16_t, std::string>(3, cpuRefId))); + CHECK(counterIdMap.GetBackendId(4) == (std::pair<uint16_t, std::string>(0, cpuAccId))); + CHECK(counterIdMap.GetBackendId(5) == (std::pair<uint16_t, std::string>(1, cpuAccId))); CHECK(counterIdMap.GetGlobalId(0, cpuRefId) == 0); CHECK(counterIdMap.GetGlobalId(1, cpuRefId) == 1); @@ -3417,7 +3417,7 @@ TEST_CASE("CheckCounterIdMap") TEST_CASE("CheckRegisterBackendCounters") { uint16_t globalCounterIds = INFERENCES_RUN; - armnn::BackendId cpuRefId(armnn::Compute::CpuRef); + std::string cpuRefId(GetComputeDeviceAsCString(armnn::Compute::CpuRef)); // Reset the profiling service to the uninitialized state ProfilingOptions options; @@ -3474,8 +3474,8 @@ TEST_CASE("CheckCounterStatusQuery") ProfilingService profilingService; profilingService.ResetExternalProfilingOptions(options, true); - const armnn::BackendId cpuRefId(armnn::Compute::CpuRef); - const armnn::BackendId cpuAccId(armnn::Compute::CpuAcc); + const std::string cpuRefId(GetComputeDeviceAsCString(armnn::Compute::CpuRef)); + const std::string cpuAccId(GetComputeDeviceAsCString(armnn::Compute::CpuAcc)); // Create BackendProfiling for each backend BackendProfiling backendProfilingCpuRef(options, profilingService, cpuRefId); @@ -3610,7 +3610,7 @@ TEST_CASE("CheckRegisterCounters") CaptureData captureData; MockProfilingService mockProfilingService(mockBuffer, options.m_EnableProfiling, captureData); - armnn::BackendId cpuRefId(armnn::Compute::CpuRef); + std::string cpuRefId(GetComputeDeviceAsCString(armnn::Compute::CpuRef)); mockProfilingService.RegisterMapping(6, 0, cpuRefId); mockProfilingService.RegisterMapping(7, 1, cpuRefId); |