From f78c767d229a9fc7a692fe4e7b71e36710966615 Mon Sep 17 00:00:00 2001 From: Jan Eilers Date: Wed, 1 Jul 2020 18:09:39 +0100 Subject: IVGCVSW-4770 Fix segmentation fault in FileOnlyProfilingDecoratorTests Signed-off-by: Jan Eilers Change-Id: I5725aa418b50fc14ce4e6638fe29a74d762cc304 --- src/profiling/test/ProfilingTestUtils.cpp | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) (limited to 'src/profiling/test/ProfilingTestUtils.cpp') 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 GetSuitableBackendRegistered() +{ + std::vector 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 output, std::vector expectedOutput) { if (output.size() != expectedOutput.size()) -- cgit v1.2.1