From 5dc64fe99227efece77eb7cd14abc47474a48fb8 Mon Sep 17 00:00:00 2001 From: Francis Murtagh Date: Mon, 25 Jan 2021 10:18:10 +0000 Subject: IVGCVSW-5525 Handle Neon optionality on 32 bit linux platforms * Add neon detection for linux using HWCAPs * Add test to check for backend throwing BackendUnavailable exception Signed-off-by: Francis Murtagh Change-Id: Ib74aeb06abe5f88f21ecdd1edb2a1cd20ee2019d --- src/backends/neon/NeonRegistryInitializer.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/backends/neon') diff --git a/src/backends/neon/NeonRegistryInitializer.cpp b/src/backends/neon/NeonRegistryInitializer.cpp index fd2e84dd5f..fc981ab270 100644 --- a/src/backends/neon/NeonRegistryInitializer.cpp +++ b/src/backends/neon/NeonRegistryInitializer.cpp @@ -6,6 +6,7 @@ #include "NeonBackend.hpp" #include +#include namespace { @@ -18,7 +19,16 @@ static BackendRegistry::StaticRegistryInitializer g_RegisterHelper NeonBackend::GetIdStatic(), []() { - return IBackendInternalUniquePtr(new NeonBackend); + // Check if device supports Neon. + if (NeonDetected()) + { + return IBackendInternalUniquePtr(new NeonBackend); + } + + // If device does not support Neon throw exception so the Backend is not added to supportedBackends + ARMNN_LOG(info) << "Neon support not found on device, could not register CpuAcc Backend."; + throw armnn::BackendUnavailableException( + "Neon support not found on device, could not register CpuAcc Backend.\n"); } }; -- cgit v1.2.1