ArmNN
 21.08
NeonBackend.hpp
Go to the documentation of this file.
1 //
2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 #pragma once
6 
8 
9 namespace armnn
10 {
11 
12 // add new capabilities here..
14  {
15  {"NonConstWeights", false},
16  {"AsyncExecution", false}
17  });
18 
19 
21 {
22 public:
23  NeonBackend() = default;
24  ~NeonBackend() = default;
25 
26  static const BackendId& GetIdStatic();
27  const BackendId& GetId() const override { return GetIdStatic(); }
28 
30 
32  const IBackendInternal::IMemoryManagerSharedPtr& memoryManager = nullptr) const override;
33 
35  class TensorHandleFactoryRegistry& tensorHandleFactoryRegistry) const override;
36 
38  const ModelOptions& modelOptions) const override;
39 
41  const ModelOptions& modelOptions) const override;
42 
45  const IRuntime::CreationOptions&, IBackendProfilingPtr& backendProfiling) override;
48  IBackendInternal::ILayerSupportSharedPtr GetLayerSupport(const ModelOptions& modelOptions) const override;
49 
50  OptimizationViews OptimizeSubgraphView(const SubgraphView& subgraph) const override;
51 
52  std::vector<ITensorHandleFactory::FactoryId> GetHandleFactoryPreferences() const override;
53 
54  void RegisterTensorHandleFactories(class TensorHandleFactoryRegistry& registry) override;
55 
57  const ModelOptions& modelOptions) const override;
58 
60  {
61  return cpuAccCapabilities;
62  };
63 };
64 
65 } // namespace armnn
std::unique_ptr< IWorkloadFactory > IWorkloadFactoryPtr
std::vector< OptimizationPtr > Optimizations
IBackendInternal::IBackendProfilingContextPtr CreateBackendProfilingContext(const IRuntime::CreationOptions &, IBackendProfilingPtr &backendProfiling) override
Create context specifically used for profiling interaction from backends.
std::vector< ITensorHandleFactory::FactoryId > GetHandleFactoryPreferences() const override
(Optional) Returns a vector of supported TensorHandleFactory ids in preference order.
OptimizationViews OptimizeSubgraphView(const SubgraphView &subgraph) const override
std::vector< BackendOptions > ModelOptions
IWorkloadFactoryPtr CreateWorkloadFactory(const IBackendInternal::IMemoryManagerSharedPtr &memoryManager=nullptr) const override
Definition: NeonBackend.cpp:55
IBackendInternal::IBackendContextPtr CreateBackendContext(const IRuntime::CreationOptions &) const override
Create the runtime context of the backend.
Definition: NeonBackend.cpp:95
Copyright (c) 2021 ARM Limited and Contributors.
std::unique_ptr< IMemoryManager > IMemoryManagerUniquePtr
BackendCapabilities GetCapabilities() const override
Returns a BackendCapability if the backend lists the capability The BackendCapability must then be in...
Definition: NeonBackend.hpp:59
The SubgraphView class represents a subgraph of a Graph.
void RegisterTensorHandleFactories(class TensorHandleFactoryRegistry &registry) override
(Optional) Register TensorHandleFactories Either this method or CreateMemoryManager() and IWorkloadFa...
std::unique_ptr< armnn::profiling::IBackendProfiling > IBackendProfilingPtr
std::shared_ptr< IBackendModelContext > IBackendSpecificModelContextPtr
std::shared_ptr< IMemoryManager > IMemoryManagerSharedPtr
IBackendInternal::ILayerSupportSharedPtr GetLayerSupport() const override
IBackendInternal::IBackendSpecificModelContextPtr CreateBackendSpecificModelContext(const ModelOptions &modelOptions) const override
NeonBackend()=default
BackendOptions BackendCapabilities
const BackendId & GetId() const override
Definition: NeonBackend.hpp:27
std::shared_ptr< ILayerSupport > ILayerSupportSharedPtr
Struct for the users to pass backend specific options.
IBackendInternal::Optimizations GetOptimizations() const override
static const BackendId & GetIdStatic()
Definition: NeonBackend.cpp:43
~NeonBackend()=default
const BackendCapabilities cpuAccCapabilities("GpuAcc", { {"NonConstWeights", false}, {"AsyncExecution", false} })
std::shared_ptr< armnn::profiling::IBackendProfilingContext > IBackendProfilingContextPtr
This is the bridge between backend and backend profiling we&#39;ll keep it in the backend namespace...
IBackendInternal::IMemoryManagerUniquePtr CreateMemoryManager() const override
Definition: NeonBackend.cpp:49
std::unique_ptr< IBackendContext > IBackendContextPtr