ArmNN
 23.05
NeonBackend.cpp
Go to the documentation of this file.
1 //
2 // Copyright © 2017-2023 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #include "NeonBackend.hpp"
7 #include "NeonBackendId.hpp"
10 #include "NeonLayerSupport.hpp"
12 
14 #include <armnn/Descriptors.hpp>
15 
19 
22 
24 
35 
36 #include <Optimizer.hpp>
37 
38 #include <arm_compute/core/Types.h>
39 #include <arm_compute/runtime/Allocator.h>
40 
41 namespace armnn
42 {
43 
45 {
46  static const BackendId s_Id{NeonBackendId()};
47  return s_Id;
48 }
49 
51 {
52  return std::make_unique<NeonMemoryManager>(std::make_unique<arm_compute::Allocator>(),
54 }
55 
57  const IBackendInternal::IMemoryManagerSharedPtr& memoryManager) const
58 {
59  return std::make_unique<NeonWorkloadFactory>(
60  PolymorphicPointerDowncast<NeonMemoryManager>(memoryManager));
61 }
62 
64  const IBackendInternal::IMemoryManagerSharedPtr& memoryManager, const ModelOptions& modelOptions) const
65 {
66  return std::make_unique<NeonWorkloadFactory>(
67  PolymorphicPointerDowncast<NeonMemoryManager>(memoryManager), CreateBackendSpecificModelContext(modelOptions));
68 }
69 
71  class TensorHandleFactoryRegistry& tensorHandleFactoryRegistry) const
72 {
73  auto memoryManager = std::make_shared<NeonMemoryManager>(std::make_unique<arm_compute::Allocator>(),
75 
76  tensorHandleFactoryRegistry.RegisterMemoryManager(memoryManager);
77 
78  auto factory = std::make_unique<NeonTensorHandleFactory>(memoryManager);
79  // Register copy and import factory pair
80  tensorHandleFactoryRegistry.RegisterCopyAndImportFactoryPair(factory->GetId(), factory->GetId());
81  // Register the factory
82  tensorHandleFactoryRegistry.RegisterFactory(std::move(factory));
83 
84 
85  return std::make_unique<NeonWorkloadFactory>(
86  PolymorphicPointerDowncast<NeonMemoryManager>(memoryManager));
87 }
88 
90  TensorHandleFactoryRegistry& tensorHandleFactoryRegistry, const ModelOptions& modelOptions) const
91 {
92  auto memoryManager = std::make_shared<NeonMemoryManager>(std::make_unique<arm_compute::Allocator>(),
94 
95  tensorHandleFactoryRegistry.RegisterMemoryManager(memoryManager);
96 
97  auto factory = std::make_unique<NeonTensorHandleFactory>(memoryManager);
98  // Register copy and import factory pair
99  tensorHandleFactoryRegistry.RegisterCopyAndImportFactoryPair(factory->GetId(), factory->GetId());
100  // Register the factory
101  tensorHandleFactoryRegistry.RegisterFactory(std::move(factory));
102 
103  return std::make_unique<NeonWorkloadFactory>(
104  PolymorphicPointerDowncast<NeonMemoryManager>(memoryManager), CreateBackendSpecificModelContext(modelOptions));
105 }
106 
108 {
109  return IBackendContextPtr{};
110 }
111 
114 {
116 }
117 
119  const ModelOptions& modelOptions) const
120 {
122 }
123 
125 {
126  static ILayerSupportSharedPtr layerSupport
127  {
129  };
130  return layerSupport;
131 }
132 
134 {
135  static ILayerSupportSharedPtr layerSupport
136  {
138  };
139  return layerSupport;
140 }
141 
143  const ModelOptions& modelOptions) const
144 {
145  OptimizationViews optimizationViews(modelOptions);
146 
147  auto it = subgraph.endIConnectable();
148  std::map<LayerGuid, Layer*> untouched;
149 
150  while (it != subgraph.beginIConnectable())
151  {
152  --it;
153  Layer& base = *(PolymorphicDowncast<Layer*>(*it));
154  untouched.insert({base.GetGuid(), &base});
155  }
156 
157  it = subgraph.endIConnectable();
158  while (it != subgraph.beginIConnectable())
159  {
160  --it;
161  Layer& base = *(PolymorphicDowncast<Layer*>(*it));
162 
163  // Fuse activation into previous layer if supported by backend
167  || base.GetType() == LayerType::Subtraction || base.GetType() == LayerType::Division)
168  && (base.GetAdditionalInformation<ActivationDescriptor>() == nullptr))
169  {
170  for (auto output = base.BeginOutputSlots(); output != base.EndOutputSlots(); ++output)
171  {
172  if (output->GetNumConnections() == 1)
173  {
174  for (auto&& childInput : output->GetConnections())
175  {
176  if ((childInput->GetOwningLayer().GetType() == LayerType::Activation) &&
177  (checkDataTypeInputandOutput(childInput->GetOwningLayer())))
178  {
179  Layer& child = childInput->GetOwningLayer();
180 
181  auto* activationLayer = PolymorphicDowncast<ActivationLayer*>(&child);
182 
183  const std::string name = std::string("fused-") + child.GetName() + std::string("-into-") +
184  base.GetName();
185 
186  // Get params from activation layer
187  ActivationDescriptor activationDesc = activationLayer->GetParameters();
188 
189  if (base.GetType() == LayerType::Convolution2d)
190  {
191  Convolution2dLayer* baseLayer = PolymorphicDowncast<Convolution2dLayer*>(&base);
192 
193  Optional<TensorInfo> biases;
194 
195  if (baseLayer->GetParameters().m_BiasEnabled)
196  {
197  biases = baseLayer->GetInputSlot(2).GetConnectedOutputSlot()->GetTensorInfo();
198  }
199 
202  activationLayer->GetInputSlot(0).GetConnectedOutputSlot()->GetTensorInfo(),
203  baseLayer->GetParameters(),
205  biases,
206  false,
207  &activationDesc);
208 
209  if (status)
210  {
211  FuseConvolution2dLayer<Convolution2dLayer>(optimizationViews,
212  baseLayer,
213  activationLayer,
214  activationDesc,
215  name);
216  untouched.erase(baseLayer->GetGuid());
217  untouched.erase(activationLayer->GetGuid());
218  }
219  }
220  else if (base.GetType() == LayerType::DepthwiseConvolution2d)
221  {
222  DepthwiseConvolution2dLayer* baseLayer =
223  PolymorphicDowncast<DepthwiseConvolution2dLayer*>(&base);
224 
225  Optional<TensorInfo> biases;
226 
227  if (baseLayer->GetParameters().m_BiasEnabled)
228  {
229  biases = baseLayer->GetInputSlot(2).GetConnectedOutputSlot()->GetTensorInfo();
230  }
231 
234  activationLayer->GetInputSlot(0).GetConnectedOutputSlot()->GetTensorInfo(),
235  baseLayer->GetParameters(),
237  biases,
238  &activationDesc);
239 
240  if (status)
241  {
242  FuseDepthwiseConvolution2dLayer<DepthwiseConvolution2dLayer>(optimizationViews,
243  baseLayer,
244  activationLayer,
245  activationDesc,
246  name);
247  untouched.erase(baseLayer->GetGuid());
248  untouched.erase(activationLayer->GetGuid());
249  }
250  }
251  else if (base.GetType() == LayerType::FullyConnected)
252  {
253  FullyConnectedLayer* baseLayer = PolymorphicDowncast<FullyConnectedLayer*>(&base);
254  FullyConnectedDescriptor descriptor = baseLayer->GetParameters();
255 
256  // As bias is optional only try to get TensorInfo from input if bias is enabled.
257  Optional<TensorInfo> biases;
258  if (descriptor.m_BiasEnabled)
259  {
260  biases = baseLayer->GetInputSlot(2).GetConnectedOutputSlot()->GetTensorInfo();
261  }
262 
265  activationLayer->GetInputSlot(0).GetConnectedOutputSlot()->GetTensorInfo(),
267  biases,
268  baseLayer->GetParameters(),
269  &activationDesc);
270 
271  if (status)
272  {
273  FuseFullyConnectedLayer<FullyConnectedLayer>(optimizationViews,
274  baseLayer,
275  activationLayer,
276  activationDesc,
277  name);
278  untouched.erase(baseLayer->GetGuid());
279  untouched.erase(activationLayer->GetGuid());
280  }
281  }
282  else if (base.GetType() == LayerType::BatchNormalization)
283  {
284  BatchNormalizationLayer* baseLayer =
285  PolymorphicDowncast<BatchNormalizationLayer*>(&base);
286 
289  activationLayer->GetInputSlot(0).GetConnectedOutputSlot()->GetTensorInfo(),
290  baseLayer->m_Mean->GetTensorInfo(),
291  baseLayer->m_Variance->GetTensorInfo(),
292  baseLayer->m_Beta->GetTensorInfo(),
293  baseLayer->m_Gamma->GetTensorInfo(),
294  baseLayer->GetParameters(),
295  &activationDesc);
296 
297  if (status)
298  {
299  BatchNormalizationLayer* replacementLayer =
300  FuseBatchNormalizationLayer<BatchNormalizationLayer>(optimizationViews,
301  baseLayer,
302  activationLayer,
303  activationDesc,
304  name);
305 
306  replacementLayer->m_Beta = std::move(baseLayer->m_Beta);
307  replacementLayer->m_Gamma = std::move(baseLayer->m_Gamma);
308  replacementLayer->m_Mean = std::move(baseLayer->m_Mean);
309  replacementLayer->m_Variance = std::move(baseLayer->m_Variance);
310  untouched.erase(baseLayer->GetGuid());
311  untouched.erase(activationLayer->GetGuid());
312  }
313  }
314  else if (base.GetType() == LayerType::Addition)
315  {
316  AdditionLayer* baseLayer = PolymorphicDowncast<AdditionLayer*>(&base);
317 
321  activationLayer->GetInputSlot(0).GetConnectedOutputSlot()->GetTensorInfo(),
322  &activationDesc);
323 
324  if (status)
325  {
326  FuseAdditionLayer<AdditionLayer>(optimizationViews,
327  baseLayer,
328  activationLayer,
329  activationDesc,
330  name);
331  untouched.erase(baseLayer->GetGuid());
332  untouched.erase(activationLayer->GetGuid());
333  }
334  }
335  else if (base.GetType() == LayerType::Division)
336  {
337  DivisionLayer* baseLayer = PolymorphicDowncast<DivisionLayer*>(&base);
338 
342  activationLayer->GetInputSlot(0).GetConnectedOutputSlot()->GetTensorInfo(),
343  &activationDesc);
344 
345  if (status)
346  {
347  FuseDivisionLayer<DivisionLayer>(optimizationViews,
348  baseLayer,
349  activationLayer,
350  activationDesc,
351  name);
352  untouched.erase(baseLayer->GetGuid());
353  untouched.erase(activationLayer->GetGuid());
354  }
355  }
356  else if (base.GetType() == LayerType::Multiplication)
357  {
358  MultiplicationLayer* baseLayer = PolymorphicDowncast<MultiplicationLayer*>(&base);
359 
363  activationLayer->GetInputSlot(0).GetConnectedOutputSlot()->GetTensorInfo(),
364  &activationDesc);
365 
366  if (status)
367  {
368  FuseMultiplicationLayer<MultiplicationLayer>(optimizationViews,
369  baseLayer,
370  activationLayer,
371  activationDesc,
372  name);
373  untouched.erase(baseLayer->GetGuid());
374  untouched.erase(activationLayer->GetGuid());
375  }
376  }
377  else if (base.GetType() == LayerType::Subtraction)
378  {
379  SubtractionLayer* baseLayer = PolymorphicDowncast<SubtractionLayer*>(&base);
380 
384  activationLayer->GetInputSlot(0).GetConnectedOutputSlot()->GetTensorInfo(),
385  &activationDesc);
386 
387  if (status)
388  {
389  FuseSubtractionLayer<SubtractionLayer>(optimizationViews,
390  baseLayer,
391  activationLayer,
392  activationDesc,
393  name);
394  untouched.erase(baseLayer->GetGuid());
395  untouched.erase(activationLayer->GetGuid());
396  }
397  }
398  else if (base.GetType() == LayerType::ElementwiseBinary)
399  {
400  ElementwiseBinaryLayer* baseLayer = PolymorphicDowncast<ElementwiseBinaryLayer*>(&base);
401 
402  if (baseLayer->GetParameters().m_Operation == BinaryOperation::Add)
403  {
407  activationLayer->GetInputSlot(0).GetConnectedOutputSlot()->GetTensorInfo(),
408  &activationDesc);
409 
410  if (status)
411  {
412  FuseElementwiseBinaryLayer<ElementwiseBinaryLayer>(optimizationViews,
413  baseLayer,
414  activationLayer,
415  activationDesc,
417  name);
418  untouched.erase(baseLayer->GetGuid());
419  untouched.erase(activationLayer->GetGuid());
420  }
421  }
422  else if (baseLayer->GetParameters().m_Operation == BinaryOperation::Div)
423  {
427  activationLayer->GetInputSlot(0).GetConnectedOutputSlot()->GetTensorInfo(),
428  &activationDesc);
429 
430  if (status)
431  {
432  FuseElementwiseBinaryLayer<ElementwiseBinaryLayer>(optimizationViews,
433  baseLayer,
434  activationLayer,
435  activationDesc,
437  name);
438  untouched.erase(baseLayer->GetGuid());
439  untouched.erase(activationLayer->GetGuid());
440  }
441  }
442  else if (baseLayer->GetParameters().m_Operation == BinaryOperation::Mul)
443  {
447  activationLayer->GetInputSlot(0).GetConnectedOutputSlot()->GetTensorInfo(),
448  &activationDesc);
449 
450  if (status)
451  {
452  FuseElementwiseBinaryLayer<ElementwiseBinaryLayer>(optimizationViews,
453  baseLayer,
454  activationLayer,
455  activationDesc,
457  name);
458  untouched.erase(baseLayer->GetGuid());
459  untouched.erase(activationLayer->GetGuid());
460  }
461  }
462  else if (baseLayer->GetParameters().m_Operation == BinaryOperation::Sub)
463  {
467  activationLayer->GetInputSlot(0).GetConnectedOutputSlot()->GetTensorInfo(),
468  &activationDesc);
469 
470  if (status)
471  {
472  FuseElementwiseBinaryLayer<ElementwiseBinaryLayer>(optimizationViews,
473  baseLayer,
474  activationLayer,
475  activationDesc,
477  name);
478  untouched.erase(baseLayer->GetGuid());
479  untouched.erase(activationLayer->GetGuid());
480  }
481  }
482  // No fusion available for other BinaryOperations
483  }
484  }
485  }
486  }
487  }
488  }
489 
490  // Separate reduce layer with multiple axes into multiple reduce layers with 1 axis.
491  if (base.GetType() == LayerType::Reduce)
492  {
493  ReduceLayer* baseLayer = PolymorphicDowncast<ReduceLayer*>(&base);
494  ReduceDescriptor reduceDescriptor = baseLayer->GetParameters();
495 
496  if (!reduceDescriptor.m_vAxis.empty() && reduceDescriptor.m_vAxis.size() > 1)
497  {
498  // Add new layers to the graph and connect them.
499  std::vector<IConnectableLayer*> layers = ChainReduceLayers<ReduceLayer>(optimizationViews,
500  baseLayer,
501  reduceDescriptor);
502 
503  // Replace existing baselayer with new subgraph.
504  ReplaceLayers<ReduceLayer>(optimizationViews, baseLayer, layers);
505  untouched.erase(baseLayer->GetGuid());
506  }
507  }
508  }
509 
510  if (optimizationViews.GetSubstitutions().empty())
511  {
512  optimizationViews.AddUntouchedSubgraph(SubgraphView(subgraph));
513  }
514  else
515  {
516  ReportUntouchedLayers(optimizationViews, untouched);
517  }
518 
519  return optimizationViews;
520 }
521 
522 std::vector<ITensorHandleFactory::FactoryId> NeonBackend::GetHandleFactoryPreferences() const
523 {
524  return std::vector<ITensorHandleFactory::FactoryId>() = { NeonTensorHandleFactory::GetIdStatic() };
525 }
526 
528 {
529  auto memoryManager = std::make_shared<NeonMemoryManager>(std::make_unique<arm_compute::Allocator>(),
531 
532  registry.RegisterMemoryManager(memoryManager);
533 
534  auto factory = std::make_unique<NeonTensorHandleFactory>(memoryManager);
535  // Register copy and import factory pair
536  registry.RegisterCopyAndImportFactoryPair(factory->GetId(), factory->GetId());
537  // Register the factory
538  registry.RegisterFactory(std::move(factory));
539 }
540 
541 std::unique_ptr<ICustomAllocator> NeonBackend::GetDefaultAllocator() const
542 {
543  return std::make_unique<DefaultAllocator>();
544 }
545 
546 
547 } // namespace armnn
IMemoryManager.hpp
armnn::BatchNormalizationLayer::m_Mean
std::shared_ptr< ConstTensorHandle > m_Mean
A unique pointer to store Mean values.
Definition: BatchNormalizationLayer.hpp:19
armnn::BackendId
Definition: BackendId.hpp:75
armnn::ElementwiseBinaryLayer
This layer represents a elementwiseBinary operation.
Definition: ElementwiseBinaryLayer.hpp:14
armnn::LayerType::FullyConnected
@ FullyConnected
armnn::Convolution2dDescriptor::m_BiasEnabled
bool m_BiasEnabled
Enable/disable bias.
Definition: Descriptors.hpp:570
armnn::NeonBackendId
constexpr const char * NeonBackendId()
Definition: NeonBackendId.hpp:10
armnn::FullyConnectedDescriptor::m_BiasEnabled
bool m_BiasEnabled
Enable/disable bias.
Definition: Descriptors.hpp:514
armnn::BatchNormalizationLayer
This layer represents a batch normalization operation.
Definition: BatchNormalizationLayer.hpp:15
armnn::NeonBackend::CreateBackendContext
IBackendInternal::IBackendContextPtr CreateBackendContext(const IRuntime::CreationOptions &) const override
Create the runtime context of the backend.
Definition: NeonBackend.cpp:107
armnn::NeonBackend::GetDefaultAllocator
std::unique_ptr< ICustomAllocator > GetDefaultAllocator() const override
Returns the default memory allocator for the backend.
Definition: NeonBackend.cpp:541
armnn::NeonBackendModelContext
The NeonBackendModelContext is used to pass in Neon specific backend ModelOptions.
Definition: NeonBackendModelContext.hpp:19
armnn::NeonBackend::CreateMemoryManager
IBackendInternal::IMemoryManagerUniquePtr CreateMemoryManager() const override
Definition: NeonBackend.cpp:50
armnn::NeonBackend::GetIdStatic
static const BackendId & GetIdStatic()
Definition: NeonBackend.cpp:44
armnn::InputSlot::GetConnectedOutputSlot
const OutputSlot * GetConnectedOutputSlot() const
Definition: Layer.hpp:56
NeonBackendModelContext.hpp
armnn::ActivationDescriptor
An ActivationDescriptor for the ActivationLayer.
Definition: Descriptors.hpp:36
armnn::TensorHandleFactoryRegistry
Definition: TensorHandleFactoryRegistry.hpp:23
armnn::LayerType::ElementwiseBinary
@ ElementwiseBinary
armnn::FullyConnectedDescriptor
A FullyConnectedDescriptor for the FullyConnectedLayer.
Definition: Descriptors.hpp:495
IBackendContext.hpp
armnn::SubgraphView::beginIConnectable
IConnectableLayerIterator beginIConnectable()
Definition: SubgraphView.cpp:324
armnn::LayerType::Subtraction
@ Subtraction
armnn::NeonTensorHandleFactory::GetIdStatic
static const FactoryId & GetIdStatic()
Definition: NeonTensorHandleFactory.cpp:89
armnn::IBackendInternal::IWorkloadFactoryPtr
std::unique_ptr< IWorkloadFactory > IWorkloadFactoryPtr
Definition: IBackendInternal.hpp:89
armnn::LayerType::Convolution2d
@ Convolution2d
armnn::ReduceDescriptor::m_vAxis
std::vector< uint32_t > m_vAxis
The indices of the dimensions to reduce.
Definition: Descriptors.hpp:1523
armnn::ReduceDescriptor
A ReduceDescriptor for the REDUCE operators.
Definition: Descriptors.hpp:1505
armnn::IRuntime::CreationOptions
Definition: IRuntime.hpp:85
armnn::MultiplicationLayer
This layer represents a multiplication operation.
Definition: MultiplicationLayer.hpp:14
PolymorphicDowncast.hpp
armnn::Layer
Definition: Layer.hpp:217
armnn::ModelOptions
std::vector< BackendOptions > ModelOptions
Definition: BackendOptions.hpp:18
armnn::NeonConvolution2dWorkloadValidate
arm_compute::Status NeonConvolution2dWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const Convolution2dDescriptor &descriptor, const TensorInfo &weights, const Optional< TensorInfo > &biases, bool isFastMathEnabled, const ActivationDescriptor *activationDescriptor)
Definition: NeonConvolution2dWorkload.cpp:24
armnn::NeonBackend::RegisterTensorHandleFactories
void RegisterTensorHandleFactories(class TensorHandleFactoryRegistry &registry) override
(Optional) Register TensorHandleFactories Either this method or CreateMemoryManager() and IWorkloadFa...
Definition: NeonBackend.cpp:527
ArmComputeSubgraphUtils.hpp
armnn::DepthwiseConvolution2dDescriptor::m_BiasEnabled
bool m_BiasEnabled
Enable/disable bias.
Definition: Descriptors.hpp:696
armnn::NeonBackend::CreateBackendProfilingContext
IBackendInternal::IBackendProfilingContextPtr CreateBackendProfilingContext(const IRuntime::CreationOptions &, IBackendProfilingPtr &backendProfiling) override
Create context specifically used for profiling interaction from backends.
Definition: NeonBackend.cpp:112
armnn::LayerType::Addition
@ Addition
armnn::LayerType::BatchNormalization
@ BatchNormalization
armnn::LayerType::Reduce
@ Reduce
NeonSubtractionWorkload.hpp
armnn::TensorHandleFactoryRegistry::RegisterFactory
void RegisterFactory(std::unique_ptr< ITensorHandleFactory > allocator)
Register a TensorHandleFactory and transfer ownership.
Definition: TensorHandleFactoryRegistry.cpp:12
NeonLayerSupport.hpp
armnn::LayerType::Division
@ Division
armnn::IBackendInternal::IMemoryManagerSharedPtr
std::shared_ptr< IMemoryManager > IMemoryManagerSharedPtr
Definition: IBackendInternal.hpp:99
armnn::ReportUntouchedLayers
void ReportUntouchedLayers(OptimizationViews &optimizationViews, std::map< LayerGuid, Layer * > untouched)
Definition: SubgraphUtils.hpp:52
armnn
Copyright (c) 2021 ARM Limited and Contributors.
Definition: 01_00_quick_start.dox:6
armnn::IBackendInternal::IMemoryManagerUniquePtr
std::unique_ptr< IMemoryManager > IMemoryManagerUniquePtr
Definition: IBackendInternal.hpp:98
armnn::SubgraphView::endIConnectable
IConnectableLayerIterator endIConnectable()
Definition: SubgraphView.cpp:329
NeonBackend.hpp
armnn::OutputSlot::GetTensorInfo
const TensorInfo & GetTensorInfo() const override
Definition: Layer.cpp:92
NeonWorkloadFactory.hpp
armnn::NeonAdditionWorkloadValidate
arm_compute::Status NeonAdditionWorkloadValidate(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, const ActivationDescriptor *activationDescriptor)
Definition: NeonAdditionWorkload.cpp:20
armnn::NeonFullyConnectedWorkloadValidate
arm_compute::Status NeonFullyConnectedWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const TensorInfo &weights, const Optional< TensorInfo > &biases, const FullyConnectedDescriptor &descriptor, const ActivationDescriptor *activationDescriptor)
Definition: NeonFullyConnectedWorkload.cpp:24
armnn::OptimizationViews
Definition: OptimizationViews.hpp:17
NeonReduceWorkload.hpp
armnn::LayerType::Activation
@ Activation
armnn::BinaryOperation::Sub
@ Sub
NeonMultiplicationWorkload.hpp
armnn::NeonBackend::CreateBackendSpecificModelContext
IBackendInternal::IBackendSpecificModelContextPtr CreateBackendSpecificModelContext(const ModelOptions &modelOptions) const override
Definition: NeonBackend.cpp:118
NeonDivisionWorkload.hpp
NeonBatchNormalizationWorkload.hpp
armnn::IBackendInternal::IBackendSpecificModelContextPtr
std::shared_ptr< IBackendModelContext > IBackendSpecificModelContextPtr
Definition: IBackendInternal.hpp:96
armnn::LayerType::DepthwiseConvolution2d
@ DepthwiseConvolution2d
BaseMemoryManager.hpp
NeonFullyConnectedWorkload.hpp
armnn::OptimizationViews::AddUntouchedSubgraph
void AddUntouchedSubgraph(SubgraphView &&subgraph)
Definition: OptimizationViews.hpp:48
armnn::NeonBatchNormalizationValidate
arm_compute::Status NeonBatchNormalizationValidate(const TensorInfo &input, const TensorInfo &output, const TensorInfo &mean, const TensorInfo &var, const TensorInfo &beta, const TensorInfo &gamma, const BatchNormalizationDescriptor &descriptor, const ActivationDescriptor *activationDescriptor)
Definition: NeonBatchNormalizationWorkload.cpp:24
armnn::SubtractionLayer
This layer represents a subtraction operation.
Definition: SubtractionLayer.hpp:14
armnn::TensorHandleFactoryRegistry::RegisterCopyAndImportFactoryPair
void RegisterCopyAndImportFactoryPair(ITensorHandleFactory::FactoryId copyFactoryId, ITensorHandleFactory::FactoryId importFactoryId)
Register a pair of TensorHandleFactory Id for Memory Copy and TensorHandleFactory Id for Memory Impor...
Definition: TensorHandleFactoryRegistry.cpp:66
armnn::BinaryOperation::Mul
@ Mul
Optimizer.hpp
NeonBackendId.hpp
armnn::Layer::GetType
LayerType GetType() const override
Returns the armnn::LayerType of this layer.
Definition: Layer.hpp:273
armnn::SubgraphView
The SubgraphView class represents a subgraph of a Graph.
Definition: SubgraphView.hpp:31
armnn::IBackendInternal::IBackendProfilingContextPtr
std::shared_ptr< arm::pipe::IBackendProfilingContext > IBackendProfilingContextPtr
This is the bridge between backend and backend profiling we'll keep it in the backend namespace.
Definition: IBackendInternal.hpp:92
ArmComputeUtils.hpp
armnn::Layer::BeginOutputSlots
std::vector< OutputSlot >::iterator BeginOutputSlots()
Definition: Layer.hpp:253
armnn::Status
Status
Definition: Types.hpp:42
NeonConvolution2dWorkload.hpp
armnn::ReduceLayer
This layer represents a reduction operation.
Definition: ReduceLayer.hpp:14
NeonTensorHandleFactory.hpp
armnn::IBackendInternal::ILayerSupportSharedPtr
std::shared_ptr< ILayerSupport > ILayerSupportSharedPtr
Definition: IBackendInternal.hpp:94
armnn::NeonSubtractionWorkloadValidate
arm_compute::Status NeonSubtractionWorkloadValidate(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, const ActivationDescriptor *activationDescriptor)
Definition: NeonSubtractionWorkload.cpp:22
armnn::FullyConnectedLayer
This layer represents a fully connected operation.
Definition: FullyConnectedLayer.hpp:15
BackendRegistry.hpp
armnn::BatchNormalizationLayer::m_Beta
std::shared_ptr< ConstTensorHandle > m_Beta
A unique pointer to store Beta values.
Definition: BatchNormalizationLayer.hpp:23
armnn::Layer::EndOutputSlots
std::vector< OutputSlot >::iterator EndOutputSlots()
Definition: Layer.hpp:254
armnn::Layer::GetInputSlot
const InputSlot & GetInputSlot(unsigned int index) const override
Get a const input slot handle by slot index.
Definition: Layer.hpp:324
armnn::NeonBackend::OptimizeSubgraphView
OptimizationViews OptimizeSubgraphView(const SubgraphView &subgraph, const ModelOptions &modelOptions) const override
Definition: NeonBackend.cpp:142
NeonDepthwiseConvolutionWorkload.hpp
NeonAdditionWorkload.hpp
armnn::Layer::GetAdditionalInformation
std::shared_ptr< T > GetAdditionalInformation() const
Definition: Layer.hpp:355
armnn::BinaryOperation::Add
@ Add
armnn::DepthwiseConvolution2dLayer
This layer represents a depthwise convolution 2d operation.
Definition: DepthwiseConvolution2dLayer.hpp:15
armnn::Layer::GetGuid
LayerGuid GetGuid() const final
Returns the unique id of the layer.
Definition: Layer.hpp:330
armnn::ElementwiseBinaryDescriptor::m_Operation
BinaryOperation m_Operation
Specifies the elementwiseBinary operation to execute.
Definition: Descriptors.hpp:125
armnn::NeonBackend::GetLayerSupport
IBackendInternal::ILayerSupportSharedPtr GetLayerSupport() const override
Definition: NeonBackend.cpp:124
armnn::AdditionLayer
This layer represents an addition operation.
Definition: AdditionLayer.hpp:13
armnn::Optional
Definition: Optional.hpp:270
armnn::NeonDivisionWorkloadValidate
arm_compute::Status NeonDivisionWorkloadValidate(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, const ActivationDescriptor *activationDescriptor)
Definition: NeonDivisionWorkload.cpp:18
Descriptors.hpp
armnn::BaseMemoryManager::MemoryAffinity::Offset
@ Offset
armnn::IBackendInternal::IBackendContextPtr
std::unique_ptr< IBackendContext > IBackendContextPtr
Definition: IBackendInternal.hpp:90
armnn::NeonMultiplicationWorkloadValidate
arm_compute::Status NeonMultiplicationWorkloadValidate(const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, const ActivationDescriptor *activationDescriptor)
Definition: NeonMultiplicationWorkload.cpp:19
armnn::IBackendInternal::IBackendProfilingPtr
std::unique_ptr< arm::pipe::IBackendProfiling > IBackendProfilingPtr
Definition: IBackendInternal.hpp:93
armnn::OptimizationViews::GetSubstitutions
const Substitutions & GetSubstitutions() const
Definition: OptimizationViews.hpp:53
armnn::TensorHandleFactoryRegistry::RegisterMemoryManager
void RegisterMemoryManager(std::shared_ptr< IMemoryManager > memoryManger)
Register a memory manager with shared ownership.
Definition: TensorHandleFactoryRegistry.cpp:34
armnn::Layer::GetName
const char * GetName() const override
Returns the name of the layer.
Definition: Layer.hpp:319
armnn::DivisionLayer
This layer represents a division operation.
Definition: DivisionLayer.hpp:14
armnn::Convolution2dLayer
This layer represents a convolution 2d operation.
Definition: Convolution2dLayer.hpp:15
armnn::BatchNormalizationLayer::m_Gamma
std::shared_ptr< ConstTensorHandle > m_Gamma
A unique pointer to store Gamma values.
Definition: BatchNormalizationLayer.hpp:25
DefaultAllocator.hpp
armnn::NeonBackend::GetHandleFactoryPreferences
std::vector< ITensorHandleFactory::FactoryId > GetHandleFactoryPreferences() const override
(Optional) Returns a vector of supported TensorHandleFactory ids in preference order.
Definition: NeonBackend.cpp:522
armnn::LayerWithParameters::GetParameters
const Parameters & GetParameters() const override
If the layer has a descriptor return it.
Definition: LayerWithParameters.hpp:19
armnn::LayerType::Multiplication
@ Multiplication
armnn::BinaryOperation::Div
@ Div
armnn::NeonDepthwiseConvolutionWorkloadValidate
arm_compute::Status NeonDepthwiseConvolutionWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const DepthwiseConvolution2dDescriptor &descriptor, const TensorInfo &weights, const Optional< TensorInfo > &biases, const ActivationDescriptor *activationDescriptor)
Definition: NeonDepthwiseConvolutionWorkload.cpp:29
armnn::NeonBackend::CreateWorkloadFactory
IWorkloadFactoryPtr CreateWorkloadFactory(const IBackendInternal::IMemoryManagerSharedPtr &memoryManager=nullptr) const override
Definition: NeonBackend.cpp:56
armnn::NeonLayerSupport
Definition: NeonLayerSupport.hpp:14
armnn::BatchNormalizationLayer::m_Variance
std::shared_ptr< ConstTensorHandle > m_Variance
A unique pointer to store Variance values.
Definition: BatchNormalizationLayer.hpp:21