ArmNN
 23.05
UnmapLayer.cpp
Go to the documentation of this file.
1 //
2 // Copyright © 2020 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 #include "UnmapLayer.hpp"
6 
7 #include "LayerCloneBase.hpp"
8 
9 #include <armnn/TypesUtils.hpp>
13 
14 namespace armnn
15 {
16 
17 UnmapLayer::UnmapLayer(const char* name)
18  : Layer(1, 0, LayerType::Unmap, name)
19 {
20 }
21 
23 {
24  return CloneBase<UnmapLayer>(graph, GetName());
25 }
26 
27 std::unique_ptr<IWorkload> UnmapLayer::CreateWorkload(const IWorkloadFactory& factory) const
28 {
29  IgnoreUnused(factory);
30  UnmapQueueDescriptor descriptor;
31  SetAdditionalInfo(descriptor);
32 
33  //This is different from other workloads. Does not get created by the workload factory.
34  return std::make_unique<UnmapWorkload>(descriptor, PrepInfoAndDesc(descriptor));
35 }
36 
38 {
39  // validates that the input is connected.
42 }
43 
45 {
46  IgnoreUnused(strategy);
47  throw armnn::Exception("UnmapLayer should not appear in an input graph");
48 }
49 
50 } // namespace armnn
armnn::UnmapLayer::ExecuteStrategy
void ExecuteStrategy(IStrategy &strategy) const override
Apply a visitor to this layer.
Definition: UnmapLayer.cpp:44
armnn::UnmapLayer::Clone
UnmapLayer * Clone(Graph &graph) const override
Creates a dynamically-allocated copy of this layer.
Definition: UnmapLayer.cpp:22
armnn::UnmapLayer::ValidateTensorShapesFromInputs
void ValidateTensorShapesFromInputs() override
Check if the input tensor shape(s) will lead to a valid configuration of UnmapLayer.
Definition: UnmapLayer.cpp:37
armnn::UnmapQueueDescriptor
Definition: WorkloadData.hpp:81
armnn::Layer::GetNumOutputSlots
unsigned int GetNumOutputSlots() const override
Returns the number of connectable output slots.
Definition: Layer.hpp:322
armnn::Exception
Base class for all ArmNN exceptions so that users can filter to just those.
Definition: Exceptions.hpp:46
CHECK_LOCATION
#define CHECK_LOCATION()
Definition: Exceptions.hpp:203
armnn::Layer::VerifyLayerConnections
void VerifyLayerConnections(unsigned int expectedConnections, const CheckLocation &location) const
Definition: Layer.cpp:378
armnn::Layer
Definition: Layer.hpp:217
armnn::IgnoreUnused
void IgnoreUnused(Ts &&...)
Definition: IgnoreUnused.hpp:14
armnn::UnmapLayer
This layer represents a memory copy operation.
Definition: UnmapLayer.hpp:13
armnn::IWorkloadFactory
Definition: WorkloadFactory.hpp:22
WorkloadFactory.hpp
armnn::Layer::SetAdditionalInfo
void SetAdditionalInfo(QueueDescriptor &descriptor) const
Definition: Layer.cpp:274
armnn
Copyright (c) 2021 ARM Limited and Contributors.
Definition: 01_00_quick_start.dox:6
armnn::IStrategy
Definition: IStrategy.hpp:16
armnn::UnmapLayer::CreateWorkload
virtual std::unique_ptr< IWorkload > CreateWorkload(const IWorkloadFactory &factory) const override
Makes a workload for the Unmap type.
Definition: UnmapLayer.cpp:27
armnn::LayerType
LayerType
When adding a new layer, adapt also the LastLayer enum value in the enum class LayerType below.
Definition: Types.hpp:479
armnn::Layer::PrepInfoAndDesc
WorkloadInfo PrepInfoAndDesc(QueueDescriptor &descriptor) const
Helper function to reduce duplication in *Layer::CreateWorkload.
Definition: Layer.hpp:396
UnmapLayer.hpp
armnn::UnmapLayer::UnmapLayer
UnmapLayer(const char *name)
Constructor to create a UnmapLayer.
Definition: UnmapLayer.cpp:17
LayerCloneBase.hpp
armnn::LayerType::Unmap
@ Unmap
armnn::Graph
Definition: Graph.hpp:30
ARMNN_ASSERT
#define ARMNN_ASSERT(COND)
Definition: Assert.hpp:14
armnn::Layer::GetName
const char * GetName() const override
Returns the name of the layer.
Definition: Layer.hpp:319
TypesUtils.hpp
WorkloadData.hpp
UnmapWorkload.hpp