xref: /aosp_15_r20/external/armnn/src/armnn/LayersFwd.hpp (revision 89c4ff92f2867872bb9e2354d150bf0c8c502810)
1 //
2 // Copyright © 2017-2023 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 #pragma once
6 
7 #include "InternalTypes.hpp"
8 
9 #include "layers/ActivationLayer.hpp"
10 #include "layers/AdditionLayer.hpp"
11 #include "layers/ArgMinMaxLayer.hpp"
12 #include "layers/BatchMatMulLayer.hpp"
13 #include "layers/BatchNormalizationLayer.hpp"
14 #include "layers/BatchToSpaceNdLayer.hpp"
15 #include "layers/CastLayer.hpp"
16 #include "layers/ChannelShuffleLayer.hpp"
17 #include "layers/ComparisonLayer.hpp"
18 #include "layers/ConcatLayer.hpp"
19 #include "layers/ConstantLayer.hpp"
20 #include "layers/ConvertFp16ToFp32Layer.hpp"
21 #include "layers/ConvertFp32ToFp16Layer.hpp"
22 #include "layers/Convolution2dLayer.hpp"
23 #include "layers/Convolution3dLayer.hpp"
24 #include "layers/DebugLayer.hpp"
25 #include "layers/DepthToSpaceLayer.hpp"
26 #include "layers/DepthwiseConvolution2dLayer.hpp"
27 #include "layers/DequantizeLayer.hpp"
28 #include "layers/DetectionPostProcessLayer.hpp"
29 #include "layers/DivisionLayer.hpp"
30 #include "layers/ElementwiseBinaryLayer.hpp"
31 #include "layers/ElementwiseUnaryLayer.hpp"
32 #include "layers/FakeQuantizationLayer.hpp"
33 #include "layers/FillLayer.hpp"
34 #include "layers/FloorLayer.hpp"
35 #include "layers/FullyConnectedLayer.hpp"
36 #include "layers/GatherLayer.hpp"
37 #include "layers/GatherNdLayer.hpp"
38 #include "layers/InputLayer.hpp"
39 #include "layers/InstanceNormalizationLayer.hpp"
40 #include "layers/L2NormalizationLayer.hpp"
41 #include "layers/LogicalBinaryLayer.hpp"
42 #include "layers/LogSoftmaxLayer.hpp"
43 #include "layers/LstmLayer.hpp"
44 #include "layers/MapLayer.hpp"
45 #include "layers/MaximumLayer.hpp"
46 #include "layers/MeanLayer.hpp"
47 #include "layers/MemCopyLayer.hpp"
48 #include "layers/MemImportLayer.hpp"
49 #include "layers/MergeLayer.hpp"
50 #include "layers/MinimumLayer.hpp"
51 #include "layers/MultiplicationLayer.hpp"
52 #include "layers/NormalizationLayer.hpp"
53 #include "layers/OutputLayer.hpp"
54 #include "layers/PadLayer.hpp"
55 #include "layers/PermuteLayer.hpp"
56 #include "layers/Pooling2dLayer.hpp"
57 #include "layers/Pooling3dLayer.hpp"
58 #include "layers/PreCompiledLayer.hpp"
59 #include "layers/PreluLayer.hpp"
60 #include "layers/QuantizeLayer.hpp"
61 #include "layers/QLstmLayer.hpp"
62 #include "layers/QuantizedLstmLayer.hpp"
63 #include "layers/RankLayer.hpp"
64 #include "layers/ReduceLayer.hpp"
65 #include "layers/ReshapeLayer.hpp"
66 #include "layers/ResizeLayer.hpp"
67 #include "layers/ShapeLayer.hpp"
68 #include "layers/SliceLayer.hpp"
69 #include "layers/SoftmaxLayer.hpp"
70 #include "layers/SpaceToBatchNdLayer.hpp"
71 #include "layers/SpaceToDepthLayer.hpp"
72 #include "layers/SplitterLayer.hpp"
73 #include "layers/StackLayer.hpp"
74 #include "layers/StandInLayer.hpp"
75 #include "layers/StridedSliceLayer.hpp"
76 #include "layers/SubtractionLayer.hpp"
77 #include "layers/SwitchLayer.hpp"
78 #include "layers/TransposeConvolution2dLayer.hpp"
79 #include "layers/TransposeLayer.hpp"
80 #include "layers/UnidirectionalSequenceLstmLayer.hpp"
81 #include "layers/UnmapLayer.hpp"
82 
83 namespace armnn
84 {
85 
86 template <LayerType Type>
87 struct LayerTypeOfImpl;
88 
89 template <LayerType Type>
90 using LayerTypeOf = typename LayerTypeOfImpl<Type>::Type;
91 
92 template <typename T>
93 constexpr LayerType LayerEnumOf(const T* = nullptr);
94 
95 #define DECLARE_LAYER_IMPL(_, LayerName)                     \
96     class LayerName##Layer;                                  \
97     template <>                                              \
98     struct LayerTypeOfImpl<LayerType::_##LayerName>          \
99     {                                                        \
100         using Type = LayerName##Layer;                       \
101     };                                                       \
102     template <>                                              \
103     constexpr LayerType LayerEnumOf(const LayerName##Layer*) \
104     {                                                        \
105         return LayerType::_##LayerName;                      \
106     }
107 
108 #define DECLARE_LAYER(LayerName) DECLARE_LAYER_IMPL(, LayerName)
109 
110 DECLARE_LAYER(Activation)
111 DECLARE_LAYER(Addition)
112 DECLARE_LAYER(ArgMinMax)
113 DECLARE_LAYER(BatchMatMul)
114 DECLARE_LAYER(BatchNormalization)
115 DECLARE_LAYER(BatchToSpaceNd)
116 DECLARE_LAYER(Cast)
117 DECLARE_LAYER(ChannelShuffle)
118 DECLARE_LAYER(Comparison)
119 DECLARE_LAYER(Concat)
120 DECLARE_LAYER(Constant)
121 DECLARE_LAYER(ConvertFp16ToFp32)
122 DECLARE_LAYER(ConvertFp32ToFp16)
123 DECLARE_LAYER(Convolution2d)
124 DECLARE_LAYER(Convolution3d)
125 DECLARE_LAYER(Debug)
126 DECLARE_LAYER(DepthToSpace)
127 DECLARE_LAYER(DepthwiseConvolution2d)
128 DECLARE_LAYER(Dequantize)
129 DECLARE_LAYER(DetectionPostProcess)
130 DECLARE_LAYER(Division)
131 DECLARE_LAYER(ElementwiseBinary)
132 DECLARE_LAYER(ElementwiseUnary)
133 DECLARE_LAYER(FakeQuantization)
134 DECLARE_LAYER(Fill)
135 DECLARE_LAYER(Floor)
136 DECLARE_LAYER(FullyConnected)
137 DECLARE_LAYER(Gather)
138 DECLARE_LAYER(GatherNd)
139 DECLARE_LAYER(Input)
140 DECLARE_LAYER(InstanceNormalization)
141 DECLARE_LAYER(L2Normalization)
142 DECLARE_LAYER(LogicalBinary)
143 DECLARE_LAYER(LogSoftmax)
144 DECLARE_LAYER(Lstm)
145 DECLARE_LAYER(Map)
146 DECLARE_LAYER(Maximum)
147 DECLARE_LAYER(Mean)
148 DECLARE_LAYER(MemCopy)
149 DECLARE_LAYER(MemImport)
150 DECLARE_LAYER(Merge)
151 DECLARE_LAYER(Minimum)
152 DECLARE_LAYER(Multiplication)
153 DECLARE_LAYER(Normalization)
154 DECLARE_LAYER(Output)
155 DECLARE_LAYER(Pad)
156 DECLARE_LAYER(Permute)
157 DECLARE_LAYER(Pooling2d)
158 DECLARE_LAYER(Pooling3d)
159 DECLARE_LAYER(PreCompiled)
160 DECLARE_LAYER(Prelu)
161 DECLARE_LAYER(Quantize)
162 DECLARE_LAYER(QLstm)
163 DECLARE_LAYER(QuantizedLstm)
164 DECLARE_LAYER(Rank)
165 DECLARE_LAYER(Reduce)
166 DECLARE_LAYER(Reshape)
167 DECLARE_LAYER(Resize)
168 DECLARE_LAYER(Shape)
169 DECLARE_LAYER(Slice)
170 DECLARE_LAYER(Softmax)
171 DECLARE_LAYER(SpaceToBatchNd)
172 DECLARE_LAYER(SpaceToDepth)
173 DECLARE_LAYER(Splitter)
174 DECLARE_LAYER(Stack)
175 DECLARE_LAYER(StandIn)
176 DECLARE_LAYER(StridedSlice)
177 DECLARE_LAYER(Subtraction)
178 DECLARE_LAYER(Switch)
179 DECLARE_LAYER(Transpose)
180 DECLARE_LAYER(TransposeConvolution2d)
181 DECLARE_LAYER(UnidirectionalSequenceLstm)
182 DECLARE_LAYER(Unmap)
183 }
184