IVGCVSW-4770 Fix segmentation fault in FileOnlyProfilingDecoratorTests
Signed-off-by: Jan Eilers <jan.eilers@arm.com>
Change-Id: I5725aa418b50fc14ce4e6638fe29a74d762cc304
diff --git a/src/profiling/test/ProfilingTestUtils.cpp b/src/profiling/test/ProfilingTestUtils.cpp
index 0f43728..9f6bc43 100644
--- a/src/profiling/test/ProfilingTestUtils.cpp
+++ b/src/profiling/test/ProfilingTestUtils.cpp
@@ -34,6 +34,24 @@
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 @@
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())