aboutsummaryrefslogtreecommitdiff
path: root/src/profiling/test/ProfilingTestUtils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/profiling/test/ProfilingTestUtils.cpp')
-rw-r--r--src/profiling/test/ProfilingTestUtils.cpp29
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())