Release 18.08
[platform/upstream/armnn.git] / src / armnn / LayersFwd.hpp
1 //
2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // See LICENSE file in the project root for full license information.
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/ConstantLayer.hpp"
13 #include "layers/ConvertFp16ToFp32Layer.hpp"
14 #include "layers/ConvertFp32ToFp16Layer.hpp"
15 #include "layers/Convolution2dLayer.hpp"
16 #include "layers/DepthwiseConvolution2dLayer.hpp"
17 #include "layers/FakeQuantizationLayer.hpp"
18 #include "layers/FloorLayer.hpp"
19 #include "layers/FullyConnectedLayer.hpp"
20 #include "layers/InputLayer.hpp"
21 #include "layers/L2NormalizationLayer.hpp"
22 #include "layers/LstmLayer.hpp"
23 #include "layers/MemCopyLayer.hpp"
24 #include "layers/MergerLayer.hpp"
25 #include "layers/MultiplicationLayer.hpp"
26 #include "layers/NormalizationLayer.hpp"
27 #include "layers/OutputLayer.hpp"
28 #include "layers/PermuteLayer.hpp"
29 #include "layers/Pooling2dLayer.hpp"
30 #include "layers/ReshapeLayer.hpp"
31 #include "layers/ResizeBilinearLayer.hpp"
32 #include "layers/SoftmaxLayer.hpp"
33 #include "layers/SplitterLayer.hpp"
34
35 namespace armnn
36 {
37
38 template <LayerType Type>
39 struct LayerTypeOfImpl;
40
41 template <LayerType Type>
42 using LayerTypeOf = typename LayerTypeOfImpl<Type>::Type;
43
44 template <typename T>
45 constexpr LayerType LayerEnumOf(const T* = nullptr);
46
47 #define DECLARE_LAYER_IMPL(_, LayerName)                     \
48     class LayerName##Layer;                                  \
49     template <>                                              \
50     struct LayerTypeOfImpl<LayerType::_##LayerName>          \
51     {                                                        \
52         using Type = LayerName##Layer;                       \
53     };                                                       \
54     template <>                                              \
55     constexpr LayerType LayerEnumOf(const LayerName##Layer*) \
56     {                                                        \
57         return LayerType::_##LayerName;                      \
58     }
59
60 #define DECLARE_LAYER(LayerName) DECLARE_LAYER_IMPL(, LayerName)
61
62 DECLARE_LAYER(Activation)
63 DECLARE_LAYER(Addition)
64 DECLARE_LAYER(BatchNormalization)
65 DECLARE_LAYER(Constant)
66 DECLARE_LAYER(ConvertFp16ToFp32)
67 DECLARE_LAYER(ConvertFp32ToFp16)
68 DECLARE_LAYER(Convolution2d)
69 DECLARE_LAYER(DepthwiseConvolution2d)
70 DECLARE_LAYER(FakeQuantization)
71 DECLARE_LAYER(Floor)
72 DECLARE_LAYER(FullyConnected)
73 DECLARE_LAYER(Input)
74 DECLARE_LAYER(L2Normalization)
75 DECLARE_LAYER(Lstm)
76 DECLARE_LAYER(MemCopy)
77 DECLARE_LAYER(Merger)
78 DECLARE_LAYER(Multiplication)
79 DECLARE_LAYER(Normalization)
80 DECLARE_LAYER(Output)
81 DECLARE_LAYER(Permute)
82 DECLARE_LAYER(Pooling2d)
83 DECLARE_LAYER(Reshape)
84 DECLARE_LAYER(ResizeBilinear)
85 DECLARE_LAYER(Softmax)
86 DECLARE_LAYER(Splitter)
87
88 }