ebfa5db6b16270c7b149ff0793aea0344581f2c7
[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/ConstantLayer.hpp"
14 #include "layers/ConvertFp16ToFp32Layer.hpp"
15 #include "layers/ConvertFp32ToFp16Layer.hpp"
16 #include "layers/Convolution2dLayer.hpp"
17 #include "layers/DebugLayer.hpp"
18 #include "layers/DepthwiseConvolution2dLayer.hpp"
19 #include "layers/DivisionLayer.hpp"
20 #include "layers/FakeQuantizationLayer.hpp"
21 #include "layers/FloorLayer.hpp"
22 #include "layers/FullyConnectedLayer.hpp"
23 #include "layers/InputLayer.hpp"
24 #include "layers/L2NormalizationLayer.hpp"
25 #include "layers/LstmLayer.hpp"
26 #include "layers/MaximumLayer.hpp"
27 #include "layers/MeanLayer.hpp"
28 #include "layers/MemCopyLayer.hpp"
29 #include "layers/MergerLayer.hpp"
30 #include "layers/MinimumLayer.hpp"
31 #include "layers/MultiplicationLayer.hpp"
32 #include "layers/NormalizationLayer.hpp"
33 #include "layers/OutputLayer.hpp"
34 #include "layers/PadLayer.hpp"
35 #include "layers/PermuteLayer.hpp"
36 #include "layers/Pooling2dLayer.hpp"
37 #include "layers/ReshapeLayer.hpp"
38 #include "layers/ResizeBilinearLayer.hpp"
39 #include "layers/SoftmaxLayer.hpp"
40 #include "layers/SpaceToBatchNdLayer.hpp"
41 #include "layers/SplitterLayer.hpp"
42 #include "layers/StridedSliceLayer.hpp"
43 #include "layers/SubtractionLayer.hpp"
44
45 namespace armnn
46 {
47
48 template <LayerType Type>
49 struct LayerTypeOfImpl;
50
51 template <LayerType Type>
52 using LayerTypeOf = typename LayerTypeOfImpl<Type>::Type;
53
54 template <typename T>
55 constexpr LayerType LayerEnumOf(const T* = nullptr);
56
57 #define DECLARE_LAYER_IMPL(_, LayerName)                     \
58     class LayerName##Layer;                                  \
59     template <>                                              \
60     struct LayerTypeOfImpl<LayerType::_##LayerName>          \
61     {                                                        \
62         using Type = LayerName##Layer;                       \
63     };                                                       \
64     template <>                                              \
65     constexpr LayerType LayerEnumOf(const LayerName##Layer*) \
66     {                                                        \
67         return LayerType::_##LayerName;                      \
68     }
69
70 #define DECLARE_LAYER(LayerName) DECLARE_LAYER_IMPL(, LayerName)
71
72 DECLARE_LAYER(Activation)
73 DECLARE_LAYER(Addition)
74 DECLARE_LAYER(BatchNormalization)
75 DECLARE_LAYER(BatchToSpaceNd)
76 DECLARE_LAYER(Constant)
77 DECLARE_LAYER(ConvertFp16ToFp32)
78 DECLARE_LAYER(ConvertFp32ToFp16)
79 DECLARE_LAYER(Convolution2d)
80 DECLARE_LAYER(Debug)
81 DECLARE_LAYER(DepthwiseConvolution2d)
82 DECLARE_LAYER(Division)
83 DECLARE_LAYER(FakeQuantization)
84 DECLARE_LAYER(Floor)
85 DECLARE_LAYER(FullyConnected)
86 DECLARE_LAYER(Input)
87 DECLARE_LAYER(L2Normalization)
88 DECLARE_LAYER(Lstm)
89 DECLARE_LAYER(Maximum)
90 DECLARE_LAYER(Mean)
91 DECLARE_LAYER(MemCopy)
92 DECLARE_LAYER(Merger)
93 DECLARE_LAYER(Minimum)
94 DECLARE_LAYER(Multiplication)
95 DECLARE_LAYER(Normalization)
96 DECLARE_LAYER(Output)
97 DECLARE_LAYER(Pad)
98 DECLARE_LAYER(Permute)
99 DECLARE_LAYER(Pooling2d)
100 DECLARE_LAYER(Reshape)
101 DECLARE_LAYER(ResizeBilinear)
102 DECLARE_LAYER(Softmax)
103 DECLARE_LAYER(SpaceToBatchNd)
104 DECLARE_LAYER(Splitter)
105 DECLARE_LAYER(StridedSlice)
106 DECLARE_LAYER(Subtraction)
107
108 }