aboutsummaryrefslogtreecommitdiff
path: root/src/backends/neon/NeonRegistryInitializer.cpp
blob: fc981ab270594455a0b8d33b387580b8666fbbc0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
//
// Copyright © 2017 Arm Ltd. All rights reserved.
// SPDX-License-Identifier: MIT
//

#include "NeonBackend.hpp"

#include <armnn/BackendRegistry.hpp>
#include <armnn/Utils.hpp>

namespace
{

using namespace armnn;

static BackendRegistry::StaticRegistryInitializer g_RegisterHelper
{
    BackendRegistryInstance(),
    NeonBackend::GetIdStatic(),
    []()
    {
        // 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");
    }
};

} // Anonymous namespace