ArmNN
 22.05
AdditionLayer.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 "AdditionLayer.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> AdditionLayer::CreateWorkload(const IWorkloadFactory& factory) const
23 {
24  AdditionQueueDescriptor descriptor;
25  SetAdditionalInfo(descriptor);
26 
27  return factory.CreateWorkload(LayerType::Addition, descriptor, PrepInfoAndDesc(descriptor));
28 }
29 
31 {
32  return CloneBase<AdditionLayer>(graph, GetName());
33 }
34 
36 void AdditionLayer::Accept(ILayerVisitor& visitor) const
37 {
38  visitor.VisitAdditionLayer(this, GetName());
39 }
41 
42 } // namespace armnn
#define ARMNN_NO_DEPRECATE_WARN_BEGIN
Definition: Deprecated.hpp:33
Copyright (c) 2021 ARM Limited and Contributors.
#define ARMNN_NO_DEPRECATE_WARN_END
Definition: Deprecated.hpp:34
WorkloadInfo PrepInfoAndDesc(QueueDescriptor &descriptor) const
Helper function to reduce duplication in *LayerCreateWorkload.
Definition: Layer.hpp:394
This layer represents an addition operation.
ARMNN_NO_DEPRECATE_WARN_BEGIN void Accept(ILayerVisitor &visitor) const override
void SetAdditionalInfo(QueueDescriptor &descriptor) const
Definition: Layer.cpp:274
AdditionLayer(const char *name)
Constructor to create an AdditionLayer.
NOTE: this is an abstract class to encapsulate the element wise operations, it does not implement: st...
virtual std::unique_ptr< IWorkload > CreateWorkload(const IWorkloadFactory &factory) const override
Makes a workload for the Addition type.
const char * GetName() const override
Returns the name of the layer.
Definition: Layer.hpp:317
AdditionLayer * Clone(Graph &graph) const override
Creates a dynamically-allocated copy of this layer.
virtual std::unique_ptr< IWorkload > CreateWorkload(LayerType type, const QueueDescriptor &descriptor, const WorkloadInfo &info) const
LayerType
When adding a new layer, adapt also the LastLayer enum value in the enum class LayerType below...
Definition: Types.hpp:467