diff options
author | Francis Murtagh <francis.murtagh@arm.com> | 2021-01-25 10:18:10 +0000 |
---|---|---|
committer | Francis Murtagh <francis.murtagh@arm.com> | 2021-01-25 10:18:20 +0000 |
commit | 5dc64fe99227efece77eb7cd14abc47474a48fb8 (patch) | |
tree | 09de113127e07707ad8edb20075463696055f736 /src/backends/neon | |
parent | 2686849118217ba692439407adb53ec3849d48ac (diff) | |
download | armnn-5dc64fe99227efece77eb7cd14abc47474a48fb8.tar.gz |
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 <francis.murtagh@arm.com>
Change-Id: Ib74aeb06abe5f88f21ecdd1edb2a1cd20ee2019d
Diffstat (limited to 'src/backends/neon')
-rw-r--r-- | src/backends/neon/NeonRegistryInitializer.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
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 <armnn/BackendRegistry.hpp> +#include <armnn/Utils.hpp> 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"); } }; |