2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // See LICENSE file in the project root for full license information.
7 #include "InternalTypes.hpp"
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"
38 template <LayerType Type>
39 struct LayerTypeOfImpl;
41 template <LayerType Type>
42 using LayerTypeOf = typename LayerTypeOfImpl<Type>::Type;
45 constexpr LayerType LayerEnumOf(const T* = nullptr);
47 #define DECLARE_LAYER_IMPL(_, LayerName) \
48 class LayerName##Layer; \
50 struct LayerTypeOfImpl<LayerType::_##LayerName> \
52 using Type = LayerName##Layer; \
55 constexpr LayerType LayerEnumOf(const LayerName##Layer*) \
57 return LayerType::_##LayerName; \
60 #define DECLARE_LAYER(LayerName) DECLARE_LAYER_IMPL(, LayerName)
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)
72 DECLARE_LAYER(FullyConnected)
74 DECLARE_LAYER(L2Normalization)
76 DECLARE_LAYER(MemCopy)
78 DECLARE_LAYER(Multiplication)
79 DECLARE_LAYER(Normalization)
81 DECLARE_LAYER(Permute)
82 DECLARE_LAYER(Pooling2d)
83 DECLARE_LAYER(Reshape)
84 DECLARE_LAYER(ResizeBilinear)
85 DECLARE_LAYER(Softmax)
86 DECLARE_LAYER(Splitter)