2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
7 #include "InternalTypes.hpp"
9 #include "layers/AbsLayer.hpp"
10 #include "layers/ActivationLayer.hpp"
11 #include "layers/AdditionLayer.hpp"
12 #include "layers/BatchNormalizationLayer.hpp"
13 #include "layers/BatchToSpaceNdLayer.hpp"
14 #include "layers/ConcatLayer.hpp"
15 #include "layers/ConstantLayer.hpp"
16 #include "layers/ConvertFp16ToFp32Layer.hpp"
17 #include "layers/ConvertFp32ToFp16Layer.hpp"
18 #include "layers/Convolution2dLayer.hpp"
19 #include "layers/DebugLayer.hpp"
20 #include "layers/DepthwiseConvolution2dLayer.hpp"
21 #include "layers/DequantizeLayer.hpp"
22 #include "layers/DetectionPostProcessLayer.hpp"
23 #include "layers/DivisionLayer.hpp"
24 #include "layers/EqualLayer.hpp"
25 #include "layers/FakeQuantizationLayer.hpp"
26 #include "layers/FloorLayer.hpp"
27 #include "layers/FullyConnectedLayer.hpp"
28 #include "layers/GatherLayer.hpp"
29 #include "layers/GreaterLayer.hpp"
30 #include "layers/InputLayer.hpp"
31 #include "layers/L2NormalizationLayer.hpp"
32 #include "layers/LstmLayer.hpp"
33 #include "layers/MaximumLayer.hpp"
34 #include "layers/MeanLayer.hpp"
35 #include "layers/MemCopyLayer.hpp"
36 #include "layers/MemImportLayer.hpp"
37 #include "layers/MergeLayer.hpp"
38 #include "layers/MinimumLayer.hpp"
39 #include "layers/MultiplicationLayer.hpp"
40 #include "layers/NormalizationLayer.hpp"
41 #include "layers/OutputLayer.hpp"
42 #include "layers/PadLayer.hpp"
43 #include "layers/PermuteLayer.hpp"
44 #include "layers/Pooling2dLayer.hpp"
45 #include "layers/PreCompiledLayer.hpp"
46 #include "layers/PreluLayer.hpp"
47 #include "layers/QuantizeLayer.hpp"
48 #include "layers/QuantizedLstmLayer.hpp"
49 #include "layers/ReshapeLayer.hpp"
50 #include "layers/ResizeLayer.hpp"
51 #include "layers/RsqrtLayer.hpp"
52 #include "layers/SoftmaxLayer.hpp"
53 #include "layers/SpaceToBatchNdLayer.hpp"
54 #include "layers/SpaceToDepthLayer.hpp"
55 #include "layers/SplitterLayer.hpp"
56 #include "layers/StackLayer.hpp"
57 #include "layers/StridedSliceLayer.hpp"
58 #include "layers/SubtractionLayer.hpp"
59 #include "layers/SwitchLayer.hpp"
60 #include "layers/TransposeConvolution2dLayer.hpp"
65 template <LayerType Type>
66 struct LayerTypeOfImpl;
68 template <LayerType Type>
69 using LayerTypeOf = typename LayerTypeOfImpl<Type>::Type;
72 constexpr LayerType LayerEnumOf(const T* = nullptr);
74 #define DECLARE_LAYER_IMPL(_, LayerName) \
75 class LayerName##Layer; \
77 struct LayerTypeOfImpl<LayerType::_##LayerName> \
79 using Type = LayerName##Layer; \
82 constexpr LayerType LayerEnumOf(const LayerName##Layer*) \
84 return LayerType::_##LayerName; \
87 #define DECLARE_LAYER(LayerName) DECLARE_LAYER_IMPL(, LayerName)
90 DECLARE_LAYER(Activation)
91 DECLARE_LAYER(Addition)
92 DECLARE_LAYER(BatchNormalization)
93 DECLARE_LAYER(BatchToSpaceNd)
95 DECLARE_LAYER(Constant)
96 DECLARE_LAYER(ConvertFp16ToFp32)
97 DECLARE_LAYER(ConvertFp32ToFp16)
98 DECLARE_LAYER(Convolution2d)
100 DECLARE_LAYER(DepthwiseConvolution2d)
101 DECLARE_LAYER(Dequantize)
102 DECLARE_LAYER(DetectionPostProcess)
103 DECLARE_LAYER(Division)
105 DECLARE_LAYER(FakeQuantization)
107 DECLARE_LAYER(FullyConnected)
108 DECLARE_LAYER(Gather)
109 DECLARE_LAYER(Greater)
111 DECLARE_LAYER(L2Normalization)
113 DECLARE_LAYER(Maximum)
115 DECLARE_LAYER(MemCopy)
116 DECLARE_LAYER(MemImport)
118 DECLARE_LAYER(Minimum)
119 DECLARE_LAYER(Multiplication)
120 DECLARE_LAYER(Normalization)
121 DECLARE_LAYER(Output)
123 DECLARE_LAYER(Permute)
124 DECLARE_LAYER(Pooling2d)
125 DECLARE_LAYER(PreCompiled)
127 DECLARE_LAYER(Quantize)
128 DECLARE_LAYER(QuantizedLstm)
129 DECLARE_LAYER(Reshape)
130 DECLARE_LAYER(Resize)
132 DECLARE_LAYER(Softmax)
133 DECLARE_LAYER(SpaceToBatchNd)
134 DECLARE_LAYER(SpaceToDepth)
135 DECLARE_LAYER(Splitter)
137 DECLARE_LAYER(StridedSlice)
138 DECLARE_LAYER(Subtraction)
139 DECLARE_LAYER(Switch)
140 DECLARE_LAYER(TransposeConvolution2d)