ArmNN
 24.02
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.CreateWorkload(LayerType::Maximum, descriptor, PrepInfoAndDesc(descriptor));
27 }
28 
30 {
31  return CloneBase<MaximumLayer>(graph, GetName());
32 }
33 
35 {
36  strategy.ExecuteStrategy(this, GetParameters(), {}, GetName());
37 }
38 
39 } // namespace armnn
armnn::MaximumQueueDescriptor
Definition: WorkloadData.hpp:282
WorkloadData.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::MaximumLayer::ExecuteStrategy
void ExecuteStrategy(IStrategy &strategy) const override
Apply a visitor to this layer.
Definition: MaximumLayer.cpp:34
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::BinaryOperation::Maximum
@ Maximum
armnn::MaximumLayer::MaximumLayer
MaximumLayer(const char *name)
Constructor to create a MaximumLayer.
Definition: MaximumLayer.cpp:16
MaximumLayer.hpp
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::Layer::SetAdditionalInfo
void SetAdditionalInfo(QueueDescriptor &descriptor) const
Definition: Layer.cpp:287
armnn::Layer::GetParameters
virtual const BaseDescriptor & GetParameters() const override
If the layer has a descriptor return it.
Definition: Layer.hpp:378
armnn
Copyright (c) 2021 ARM Limited and Contributors.
Definition: 01_00_quick_start.dox:6
armnn::MaximumLayer::CreateWorkload
virtual std::unique_ptr< IWorkload > CreateWorkload(const IWorkloadFactory &factory) const override
Makes a workload for the Maximum type.
Definition: MaximumLayer.cpp:21
armnn::MaximumLayer::Clone
MaximumLayer * Clone(Graph &graph) const override
Creates a dynamically-allocated copy of this layer.
Definition: MaximumLayer.cpp:29
armnn::MaximumLayer
This layer represents a maximum operation.
Definition: MaximumLayer.hpp:14
armnn::LayerType::Maximum
@ Maximum
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