2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
7 #include "InternalTypes.hpp"
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"
48 template <LayerType Type>
49 struct LayerTypeOfImpl;
51 template <LayerType Type>
52 using LayerTypeOf = typename LayerTypeOfImpl<Type>::Type;
55 constexpr LayerType LayerEnumOf(const T* = nullptr);
57 #define DECLARE_LAYER_IMPL(_, LayerName) \
58 class LayerName##Layer; \
60 struct LayerTypeOfImpl<LayerType::_##LayerName> \
62 using Type = LayerName##Layer; \
65 constexpr LayerType LayerEnumOf(const LayerName##Layer*) \
67 return LayerType::_##LayerName; \
70 #define DECLARE_LAYER(LayerName) DECLARE_LAYER_IMPL(, LayerName)
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)
81 DECLARE_LAYER(DepthwiseConvolution2d)
82 DECLARE_LAYER(Division)
83 DECLARE_LAYER(FakeQuantization)
85 DECLARE_LAYER(FullyConnected)
87 DECLARE_LAYER(L2Normalization)
89 DECLARE_LAYER(Maximum)
91 DECLARE_LAYER(MemCopy)
93 DECLARE_LAYER(Minimum)
94 DECLARE_LAYER(Multiplication)
95 DECLARE_LAYER(Normalization)
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)