ArmNN
 24.02
MinimumLayer.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 "MinimumLayer.hpp"
7 
8 #include "LayerCloneBase.hpp"
9 
10 #include <armnn/TypesUtils.hpp>
13 
14 namespace armnn
15 {
16 
17 MinimumLayer::MinimumLayer(const char* name)
18  : ElementwiseBaseLayer(2, 1, LayerType::Minimum, name)
19 {
20 }
21 
22 std::unique_ptr<IWorkload> MinimumLayer::CreateWorkload(const IWorkloadFactory& factory) const
23 {
24  MinimumQueueDescriptor descriptor;
25  SetAdditionalInfo(descriptor);
26 
27  return factory.CreateWorkload(LayerType::Minimum, descriptor, PrepInfoAndDesc(descriptor));
28 }
29 
31 {
32  return CloneBase<MinimumLayer>(graph, GetName());
33 }
34 
36 {
37  strategy.ExecuteStrategy(this, GetParameters(), {}, GetName());
38 }
39 
40 } // namespace armnn
WorkloadData.hpp
MinimumLayer.hpp
armnn::MinimumLayer::ExecuteStrategy
void ExecuteStrategy(IStrategy &strategy) const override
Apply a visitor to this layer.
Definition: MinimumLayer.cpp:35
TypesUtils.hpp
armnn::MinimumLayer::MinimumLayer
MinimumLayer(const char *name)
Constructor to create a MinimumLayer.
Definition: MinimumLayer.cpp:17
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
armnn::MinimumLayer::Clone
MinimumLayer * Clone(Graph &graph) const override
Creates a dynamically-allocated copy of this layer.
Definition: MinimumLayer.cpp:30
WorkloadFactory.hpp
armnn::Layer::GetName
const char * GetName() const override
Returns the name of the layer.
Definition: Layer.hpp:332
armnn::MinimumLayer
This layer represents a minimum operation.
Definition: MinimumLayer.hpp:14
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::LayerType::Minimum
@ Minimum
armnn::MinimumLayer::CreateWorkload
virtual std::unique_ptr< IWorkload > CreateWorkload(const IWorkloadFactory &factory) const override
Makes a workload for the Minimum type.
Definition: MinimumLayer.cpp:22
armnn::BinaryOperation::Minimum
@ Minimum
armnn
Copyright (c) 2021 ARM Limited and Contributors.
Definition: 01_00_quick_start.dox:6
armnn::MinimumQueueDescriptor
Definition: WorkloadData.hpp:473
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