ArmNN
 22.11
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  {"ProtectedContentAllocation", false},
18  {"ConstantTensorsAsInputs", true},
19  {"PreImportIOTensors", false},
20  {"ExternallyManagedMemory", true},
21  {"MultiAxisPacking", false},
22  {"SingleAxisPacking", true}
23  });
24 
25 
27 {
28 public:
29  NeonBackend() = default;
30  ~NeonBackend() = default;
31 
32  static const BackendId& GetIdStatic();
33  const BackendId& GetId() const override { return GetIdStatic(); }
34 
36 
38  const IBackendInternal::IMemoryManagerSharedPtr& memoryManager = nullptr) const override;
39 
41  class TensorHandleFactoryRegistry& tensorHandleFactoryRegistry) const override;
42 
44  const ModelOptions& modelOptions) const override;
45 
47  const ModelOptions& modelOptions) const override;
48 
51  const IRuntime::CreationOptions&, IBackendProfilingPtr& backendProfiling) override;
53  IBackendInternal::ILayerSupportSharedPtr GetLayerSupport(const ModelOptions& modelOptions) const override;
54 
56  const ModelOptions& modelOptions) const override;
57 
58  std::vector<ITensorHandleFactory::FactoryId> GetHandleFactoryPreferences() const override;
59 
60  void RegisterTensorHandleFactories(class TensorHandleFactoryRegistry& registry) override;
61 
63  const ModelOptions& modelOptions) const override;
64 
66  {
67  return cpuAccCapabilities;
68  };
69 
70  std::unique_ptr<ICustomAllocator> GetDefaultAllocator() const override;
71 };
72 
73 } // namespace armnn
std::unique_ptr< IWorkloadFactory > IWorkloadFactoryPtr
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.
std::vector< BackendOptions > ModelOptions
IWorkloadFactoryPtr CreateWorkloadFactory(const IBackendInternal::IMemoryManagerSharedPtr &memoryManager=nullptr) const override
Definition: NeonBackend.cpp:56
IBackendInternal::IBackendContextPtr CreateBackendContext(const IRuntime::CreationOptions &) const override
Create the runtime context of the backend.
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:65
std::unique_ptr< ICustomAllocator > GetDefaultAllocator() const override
Returns the default memory allocator for the backend.
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::shared_ptr< IBackendModelContext > IBackendSpecificModelContextPtr
std::shared_ptr< IMemoryManager > IMemoryManagerSharedPtr
IBackendInternal::ILayerSupportSharedPtr GetLayerSupport() const override
OptimizationViews OptimizeSubgraphView(const SubgraphView &subgraph, const ModelOptions &modelOptions) const override
IBackendInternal::IBackendSpecificModelContextPtr CreateBackendSpecificModelContext(const ModelOptions &modelOptions) const override
NeonBackend()=default
BackendOptions BackendCapabilities
std::shared_ptr< arm::pipe::IBackendProfilingContext > IBackendProfilingContextPtr
This is the bridge between backend and backend profiling we&#39;ll keep it in the backend namespace...
const BackendId & GetId() const override
Definition: NeonBackend.hpp:33
std::shared_ptr< ILayerSupport > ILayerSupportSharedPtr
Struct for the users to pass backend specific options.
std::unique_ptr< arm::pipe::IBackendProfiling > IBackendProfilingPtr
const BackendCapabilities cpuAccCapabilities("CpuAcc", { {"NonConstWeights", false}, {"AsyncExecution", false}, {"ProtectedContentAllocation", false}, {"ConstantTensorsAsInputs", true}, {"PreImportIOTensors", false}, {"ExternallyManagedMemory", true}, {"MultiAxisPacking", false}, {"SingleAxisPacking", true} })
static const BackendId & GetIdStatic()
Definition: NeonBackend.cpp:44
~NeonBackend()=default
IBackendInternal::IMemoryManagerUniquePtr CreateMemoryManager() const override
Definition: NeonBackend.cpp:50
std::unique_ptr< IBackendContext > IBackendContextPtr