ArmNN
 24.08
SubtractionLayer.cpp
Go to the documentation of this file.
1 //
2 // Copyright © 2017 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #include "SubtractionLayer.hpp"
7 
8 #include "LayerCloneBase.hpp"
9 
10 #include <armnn/TypesUtils.hpp>
13 
14 namespace armnn
15 {
16 
19 {
20 }
21 
22 std::unique_ptr<IWorkload> SubtractionLayer::CreateWorkload(const IWorkloadFactory& factory) const
23 {
24  SubtractionQueueDescriptor descriptor;
25  SetAdditionalInfo(descriptor);
26 
27  return factory.CreateWorkload(LayerType::Subtraction, descriptor, PrepInfoAndDesc(descriptor));
28 }
29 
31 {
32  return CloneBase<SubtractionLayer>(graph, GetName());
33 }
34 
36 {
37  strategy.ExecuteStrategy(this, GetParameters(), {}, GetName());
38 }
39 
40 } // namespace armnn
WorkloadData.hpp
armnn::SubtractionLayer
This layer represents a subtraction operation.
Definition: SubtractionLayer.hpp:14
TypesUtils.hpp
SubtractionLayer.hpp
armnn::ElementwiseBaseLayer
NOTE: this is an abstract class to encapsulate the element wise operations, it does not implement: st...
Definition: ElementwiseBaseLayer.hpp:16
armnn::IStrategy
Definition: IStrategy.hpp:16
WorkloadFactory.hpp
armnn::Layer::GetName
const char * GetName() const override
Returns the name of the layer.
Definition: Layer.hpp:332
armnn::SubtractionLayer::SubtractionLayer
SubtractionLayer(const char *name)
Constructor to create a SubtractionLayer.
Definition: SubtractionLayer.cpp:17
armnn::LayerType::Subtraction
@ Subtraction
armnn::Layer::PrepInfoAndDesc
WorkloadInfo PrepInfoAndDesc(QueueDescriptor &descriptor) const
Helper function to reduce duplication in *Layer::CreateWorkload.
Definition: Layer.hpp:409
armnn::IWorkloadFactory
Definition: WorkloadFactory.hpp:22
armnn::SubtractionLayer::CreateWorkload
virtual std::unique_ptr< IWorkload > CreateWorkload(const IWorkloadFactory &factory) const override
Makes a workload for the Subtraction type.
Definition: SubtractionLayer.cpp:22
armnn::Layer::SetAdditionalInfo
void SetAdditionalInfo(QueueDescriptor &descriptor) const
Definition: Layer.cpp:303
armnn::Layer::GetParameters
virtual const BaseDescriptor & GetParameters() const override
If the layer has a descriptor return it.
Definition: Layer.hpp:378
armnn::SubtractionQueueDescriptor
Definition: WorkloadData.hpp:276
armnn
Copyright (c) 2021 ARM Limited and Contributors.
Definition: 01_00_quick_start.dox:6
armnn::SubtractionLayer::ExecuteStrategy
void ExecuteStrategy(IStrategy &strategy) const override
Apply a visitor to this layer.
Definition: SubtractionLayer.cpp:35
armnn::SubtractionLayer::Clone
SubtractionLayer * Clone(Graph &graph) const override
Creates a dynamically-allocated copy of this layer.
Definition: SubtractionLayer.cpp:30
armnn::LayerType
LayerType
When adding a new layer, adapt also the LastLayer enum value in the enum class LayerType below.
Definition: Types.hpp:491
armnn::Graph
Definition: Graph.hpp:30
armnn::IWorkloadFactory::CreateWorkload
virtual std::unique_ptr< IWorkload > CreateWorkload(LayerType type, const QueueDescriptor &descriptor, const WorkloadInfo &info) const =0
Backends should implement their own CreateWorkload function with a switch statement.
armnn::IStrategy::ExecuteStrategy
virtual void ExecuteStrategy(const IConnectableLayer *layer, const armnn::BaseDescriptor &descriptor, const std::vector< armnn::ConstTensor > &constants, const char *name, const armnn::LayerBindingId id=0)=0
LayerCloneBase.hpp