diff options
author | Jan Eilers <jan.eilers@arm.com> | 2020-07-01 18:09:39 +0100 |
---|---|---|
committer | TeresaARM <teresa.charlinreyes@arm.com> | 2020-07-06 17:57:20 +0000 |
commit | f78c767d229a9fc7a692fe4e7b71e36710966615 (patch) | |
tree | a232160d2f21a64a66e065e923e0bc77cb1f74ec /src/profiling/test/ProfilingTestUtils.cpp | |
parent | 06deacd58fbd4fbfd4884ab8024ef736f4f7105b (diff) | |
download | armnn-f78c767d229a9fc7a692fe4e7b71e36710966615.tar.gz |
IVGCVSW-4770 Fix segmentation fault in FileOnlyProfilingDecoratorTests
Signed-off-by: Jan Eilers <jan.eilers@arm.com>
Change-Id: I5725aa418b50fc14ce4e6638fe29a74d762cc304
Diffstat (limited to 'src/profiling/test/ProfilingTestUtils.cpp')
-rw-r--r-- | src/profiling/test/ProfilingTestUtils.cpp | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/src/profiling/test/ProfilingTestUtils.cpp b/src/profiling/test/ProfilingTestUtils.cpp index 0f437283f1..9f6bc43be8 100644 --- a/src/profiling/test/ProfilingTestUtils.cpp +++ b/src/profiling/test/ProfilingTestUtils.cpp @@ -34,6 +34,24 @@ uint32_t GetStreamMetaDataPacketSize() return headerSize + bodySize + payloadSize; } +std::vector<BackendId> GetSuitableBackendRegistered() +{ + std::vector<BackendId> suitableBackends; + if (BackendRegistryInstance().IsBackendRegistered(GetComputeDeviceAsCString(armnn::Compute::CpuRef))) + { + suitableBackends.push_back(armnn::Compute::CpuRef); + } + if (BackendRegistryInstance().IsBackendRegistered(GetComputeDeviceAsCString(armnn::Compute::CpuAcc))) + { + suitableBackends.push_back(armnn::Compute::CpuAcc); + } + if (BackendRegistryInstance().IsBackendRegistered(GetComputeDeviceAsCString(armnn::Compute::GpuAcc))) + { + suitableBackends.push_back(armnn::Compute::GpuAcc); + } + return suitableBackends; +} + inline unsigned int OffsetToNextWord(unsigned int numberOfBytes) { unsigned int uint32_t_size = sizeof(uint32_t); @@ -1199,17 +1217,6 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) bufferManager.MarkRead(inferenceReadableBuffer); } -bool HasSuitableBackendRegistered() -{ - // Only run the file only profiling unit tests on CpuRef until failure on build system can be debugged - if (BackendRegistryInstance().GetBackendIds().size() == 1 && - BackendRegistryInstance().IsBackendRegistered(GetComputeDeviceAsCString(armnn::Compute::CpuRef))) - { - return true; - } - return false; -} - bool CompareOutput(std::vector<std::string> output, std::vector<std::string> expectedOutput) { if (output.size() != expectedOutput.size()) |