ArmNN
 21.11
MaximumLayer.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 "MaximumLayer.hpp"
7 
8 #include "LayerCloneBase.hpp"
9 
12 
13 namespace armnn
14 {
15 
16 MaximumLayer::MaximumLayer(const char* name)
17  : ElementwiseBaseLayer(2, 1, LayerType::Maximum, name)
18 {
19 }
20 
21 std::unique_ptr<IWorkload> MaximumLayer::CreateWorkload(const IWorkloadFactory& factory) const
22 {
23  MaximumQueueDescriptor descriptor;
24  SetAdditionalInfo(descriptor);
25 
26  return factory.CreateMaximum(descriptor, PrepInfoAndDesc(descriptor));
27 }
28 
30 {
31  return CloneBase<MaximumLayer>(graph, GetName());
32 }
33 
35 void MaximumLayer::Accept(ILayerVisitor& visitor) const
36 {
37  visitor.VisitMaximumLayer(this, GetName());
38 }
40 
41 } // namespace armnn
#define ARMNN_NO_DEPRECATE_WARN_BEGIN
Definition: Deprecated.hpp:33
MaximumLayer * Clone(Graph &graph) const override
Creates a dynamically-allocated copy of this layer.
virtual std::unique_ptr< IWorkload > CreateWorkload(const IWorkloadFactory &factory) const override
Makes a workload for the Maximum type.
Copyright (c) 2021 ARM Limited and Contributors.
virtual std::unique_ptr< IWorkload > CreateMaximum(const MaximumQueueDescriptor &descriptor, const WorkloadInfo &info) const
#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:381
MaximumLayer(const char *name)
Constructor to create a MaximumLayer.
void SetAdditionalInfo(QueueDescriptor &descriptor) const
Definition: Layer.cpp:245
NOTE: this is an abstract class to encapsulate the element wise operations, it does not implement: st...
ARMNN_NO_DEPRECATE_WARN_BEGIN void Accept(ILayerVisitor &visitor) const override
This layer represents a maximum operation.
const char * GetName() const override
Returns the name of the layer.
Definition: Layer.hpp:311
LayerType
When adding a new layer, adapt also the LastLayer enum value in the enum class LayerType below...
Definition: Types.hpp:443