blob: fc981ab270594455a0b8d33b387580b8666fbbc0 [file] [log] [blame]
Matteo Martincighe67edb22019-08-14 14:05:46 +01001//
2// Copyright © 2017 Arm Ltd. All rights reserved.
3// SPDX-License-Identifier: MIT
4//
5
6#include "NeonBackend.hpp"
7
Matteo Martincighc601aa62019-10-29 15:03:22 +00008#include <armnn/BackendRegistry.hpp>
Francis Murtagh5dc64fe2021-01-25 10:18:10 +00009#include <armnn/Utils.hpp>
Matteo Martincighe67edb22019-08-14 14:05:46 +010010
11namespace
12{
13
14using namespace armnn;
15
16static BackendRegistry::StaticRegistryInitializer g_RegisterHelper
17{
18 BackendRegistryInstance(),
19 NeonBackend::GetIdStatic(),
20 []()
21 {
Francis Murtagh5dc64fe2021-01-25 10:18:10 +000022 // Check if device supports Neon.
23 if (NeonDetected())
24 {
25 return IBackendInternalUniquePtr(new NeonBackend);
26 }
27
28 // If device does not support Neon throw exception so the Backend is not added to supportedBackends
29 ARMNN_LOG(info) << "Neon support not found on device, could not register CpuAcc Backend.";
30 throw armnn::BackendUnavailableException(
31 "Neon support not found on device, could not register CpuAcc Backend.\n");
Matteo Martincighe67edb22019-08-14 14:05:46 +010032 }
33};
34
35} // Anonymous namespace