diff options
Diffstat (limited to 'src/backends/neon/NeonRegistryInitializer.cpp')
-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"); } }; |