0f9633a58cc7cee177b8f12ceae2ad14c737bcdb
[platform/upstream/armnn.git] / src / armnn / LayersFwd.hpp
1 //
2 // Copyright © 2017 Arm Ltd. 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/BatchNormalizationLayer.hpp"
12 #include "layers/BatchToSpaceNdLayer.hpp"
13 #include "layers/ConcatLayer.hpp"
14 #include "layers/ConstantLayer.hpp"
15 #include "layers/ConvertFp16ToFp32Layer.hpp"
16 #include "layers/ConvertFp32ToFp16Layer.hpp"
17 #include "layers/Convolution2dLayer.hpp"
18 #include "layers/DebugLayer.hpp"
19 #include "layers/DepthwiseConvolution2dLayer.hpp"
20 #include "layers/DequantizeLayer.hpp"
21 #include "layers/DetectionPostProcessLayer.hpp"
22 #include "layers/DivisionLayer.hpp"
23 #include "layers/EqualLayer.hpp"
24 #include "layers/FakeQuantizationLayer.hpp"
25 #include "layers/FloorLayer.hpp"
26 #include "layers/FullyConnectedLayer.hpp"
27 #include "layers/GatherLayer.hpp"
28 #include "layers/GreaterLayer.hpp"
29 #include "layers/InputLayer.hpp"
30 #include "layers/L2NormalizationLayer.hpp"
31 #include "layers/LstmLayer.hpp"
32 #include "layers/MaximumLayer.hpp"
33 #include "layers/MeanLayer.hpp"
34 #include "layers/MemCopyLayer.hpp"
35 #include "layers/MergeLayer.hpp"
36 #include "layers/MinimumLayer.hpp"
37 #include "layers/MultiplicationLayer.hpp"
38 #include "layers/NormalizationLayer.hpp"
39 #include "layers/OutputLayer.hpp"
40 #include "layers/PadLayer.hpp"
41 #include "layers/PermuteLayer.hpp"
42 #include "layers/Pooling2dLayer.hpp"
43 #include "layers/PreCompiledLayer.hpp"
44 #include "layers/PreluLayer.hpp"
45 #include "layers/QuantizeLayer.hpp"
46 #include "layers/ReshapeLayer.hpp"
47 #include "layers/ResizeLayer.hpp"
48 #include "layers/RsqrtLayer.hpp"
49 #include "layers/SoftmaxLayer.hpp"
50 #include "layers/SpaceToBatchNdLayer.hpp"
51 #include "layers/SpaceToDepthLayer.hpp"
52 #include "layers/SplitterLayer.hpp"
53 #include "layers/StridedSliceLayer.hpp"
54 #include "layers/SubtractionLayer.hpp"
55 #include "layers/SwitchLayer.hpp"
56 #include "layers/TransposeConvolution2dLayer.hpp"
57
58 namespace armnn
59 {
60
61 template <LayerType Type>
62 struct LayerTypeOfImpl;
63
64 template <LayerType Type>
65 using LayerTypeOf = typename LayerTypeOfImpl<Type>::Type;
66
67 template <typename T>
68 constexpr LayerType LayerEnumOf(const T* = nullptr);
69
70 #define DECLARE_LAYER_IMPL(_, LayerName)                     \
71     class LayerName##Layer;                                  \
72     template <>                                              \
73     struct LayerTypeOfImpl<LayerType::_##LayerName>          \
74     {                                                        \
75         using Type = LayerName##Layer;                       \
76     };                                                       \
77     template <>                                              \
78     constexpr LayerType LayerEnumOf(const LayerName##Layer*) \
79     {                                                        \
80         return LayerType::_##LayerName;                      \
81     }
82
83 #define DECLARE_LAYER(LayerName) DECLARE_LAYER_IMPL(, LayerName)
84
85 DECLARE_LAYER(Activation)
86 DECLARE_LAYER(Addition)
87 DECLARE_LAYER(BatchNormalization)
88 DECLARE_LAYER(BatchToSpaceNd)
89 DECLARE_LAYER(Concat)
90 DECLARE_LAYER(Constant)
91 DECLARE_LAYER(ConvertFp16ToFp32)
92 DECLARE_LAYER(ConvertFp32ToFp16)
93 DECLARE_LAYER(Convolution2d)
94 DECLARE_LAYER(Debug)
95 DECLARE_LAYER(DepthwiseConvolution2d)
96 DECLARE_LAYER(Dequantize)
97 DECLARE_LAYER(DetectionPostProcess)
98 DECLARE_LAYER(Division)
99 DECLARE_LAYER(Equal)
100 DECLARE_LAYER(FakeQuantization)
101 DECLARE_LAYER(Floor)
102 DECLARE_LAYER(FullyConnected)
103 DECLARE_LAYER(Gather)
104 DECLARE_LAYER(Greater)
105 DECLARE_LAYER(Input)
106 DECLARE_LAYER(L2Normalization)
107 DECLARE_LAYER(Lstm)
108 DECLARE_LAYER(Maximum)
109 DECLARE_LAYER(Mean)
110 DECLARE_LAYER(MemCopy)
111 DECLARE_LAYER(Merge)
112 DECLARE_LAYER(Minimum)
113 DECLARE_LAYER(Multiplication)
114 DECLARE_LAYER(Normalization)
115 DECLARE_LAYER(Output)
116 DECLARE_LAYER(Pad)
117 DECLARE_LAYER(Permute)
118 DECLARE_LAYER(Pooling2d)
119 DECLARE_LAYER(PreCompiled)
120 DECLARE_LAYER(Prelu)
121 DECLARE_LAYER(Quantize)
122 DECLARE_LAYER(Reshape)
123 DECLARE_LAYER(Resize)
124 DECLARE_LAYER(Rsqrt)
125 DECLARE_LAYER(Softmax)
126 DECLARE_LAYER(SpaceToBatchNd)
127 DECLARE_LAYER(SpaceToDepth)
128 DECLARE_LAYER(Splitter)
129 DECLARE_LAYER(StridedSlice)
130 DECLARE_LAYER(Subtraction)
131 DECLARE_LAYER(Switch)
132 DECLARE_LAYER(TransposeConvolution2d)
133
134 }