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/ArgMinMaxLayer.hpp"
13 #include "layers/BatchNormalizationLayer.hpp"
14 #include "layers/BatchToSpaceNdLayer.hpp"
15 #include "layers/ConcatLayer.hpp"
16 #include "layers/ConstantLayer.hpp"
17 #include "layers/ConvertFp16ToFp32Layer.hpp"
18 #include "layers/ConvertFp32ToFp16Layer.hpp"
19 #include "layers/Convolution2dLayer.hpp"
20 #include "layers/DebugLayer.hpp"
21 #include "layers/DepthwiseConvolution2dLayer.hpp"
22 #include "layers/DequantizeLayer.hpp"
23 #include "layers/DetectionPostProcessLayer.hpp"
24 #include "layers/DivisionLayer.hpp"
25 #include "layers/EqualLayer.hpp"
26 #include "layers/FakeQuantizationLayer.hpp"
27 #include "layers/FloorLayer.hpp"
28 #include "layers/FullyConnectedLayer.hpp"
29 #include "layers/GatherLayer.hpp"
30 #include "layers/GreaterLayer.hpp"
31 #include "layers/InputLayer.hpp"
32 #include "layers/L2NormalizationLayer.hpp"
33 #include "layers/LstmLayer.hpp"
34 #include "layers/MaximumLayer.hpp"
35 #include "layers/MeanLayer.hpp"
36 #include "layers/MemCopyLayer.hpp"
37 #include "layers/MemImportLayer.hpp"
38 #include "layers/MergeLayer.hpp"
39 #include "layers/MinimumLayer.hpp"
40 #include "layers/MultiplicationLayer.hpp"
41 #include "layers/NormalizationLayer.hpp"
42 #include "layers/OutputLayer.hpp"
43 #include "layers/PadLayer.hpp"
44 #include "layers/PermuteLayer.hpp"
45 #include "layers/Pooling2dLayer.hpp"
46 #include "layers/PreCompiledLayer.hpp"
47 #include "layers/PreluLayer.hpp"
48 #include "layers/QuantizeLayer.hpp"
49 #include "layers/QuantizedLstmLayer.hpp"
50 #include "layers/ReshapeLayer.hpp"
51 #include "layers/ResizeLayer.hpp"
52 #include "layers/RsqrtLayer.hpp"
53 #include "layers/SoftmaxLayer.hpp"
54 #include "layers/SpaceToBatchNdLayer.hpp"
55 #include "layers/SpaceToDepthLayer.hpp"
56 #include "layers/SplitterLayer.hpp"
57 #include "layers/StackLayer.hpp"
58 #include "layers/StridedSliceLayer.hpp"
59 #include "layers/SubtractionLayer.hpp"
60 #include "layers/SwitchLayer.hpp"
61 #include "layers/TransposeConvolution2dLayer.hpp"
66 template <LayerType Type>
67 struct LayerTypeOfImpl;
69 template <LayerType Type>
70 using LayerTypeOf = typename LayerTypeOfImpl<Type>::Type;
73 constexpr LayerType LayerEnumOf(const T* = nullptr);
75 #define DECLARE_LAYER_IMPL(_, LayerName) \
76 class LayerName##Layer; \
78 struct LayerTypeOfImpl<LayerType::_##LayerName> \
80 using Type = LayerName##Layer; \
83 constexpr LayerType LayerEnumOf(const LayerName##Layer*) \
85 return LayerType::_##LayerName; \
88 #define DECLARE_LAYER(LayerName) DECLARE_LAYER_IMPL(, LayerName)
91 DECLARE_LAYER(Activation)
92 DECLARE_LAYER(Addition)
93 DECLARE_LAYER(ArgMinMax)
94 DECLARE_LAYER(BatchNormalization)
95 DECLARE_LAYER(BatchToSpaceNd)
97 DECLARE_LAYER(Constant)
98 DECLARE_LAYER(ConvertFp16ToFp32)
99 DECLARE_LAYER(ConvertFp32ToFp16)
100 DECLARE_LAYER(Convolution2d)
102 DECLARE_LAYER(DepthwiseConvolution2d)
103 DECLARE_LAYER(Dequantize)
104 DECLARE_LAYER(DetectionPostProcess)
105 DECLARE_LAYER(Division)
107 DECLARE_LAYER(FakeQuantization)
109 DECLARE_LAYER(FullyConnected)
110 DECLARE_LAYER(Gather)
111 DECLARE_LAYER(Greater)
113 DECLARE_LAYER(L2Normalization)
115 DECLARE_LAYER(Maximum)
117 DECLARE_LAYER(MemCopy)
118 DECLARE_LAYER(MemImport)
120 DECLARE_LAYER(Minimum)
121 DECLARE_LAYER(Multiplication)
122 DECLARE_LAYER(Normalization)
123 DECLARE_LAYER(Output)
125 DECLARE_LAYER(Permute)
126 DECLARE_LAYER(Pooling2d)
127 DECLARE_LAYER(PreCompiled)
129 DECLARE_LAYER(Quantize)
130 DECLARE_LAYER(QuantizedLstm)
131 DECLARE_LAYER(Reshape)
132 DECLARE_LAYER(Resize)
134 DECLARE_LAYER(Softmax)
135 DECLARE_LAYER(SpaceToBatchNd)
136 DECLARE_LAYER(SpaceToDepth)
137 DECLARE_LAYER(Splitter)
139 DECLARE_LAYER(StridedSlice)
140 DECLARE_LAYER(Subtraction)
141 DECLARE_LAYER(Switch)
142 DECLARE_LAYER(TransposeConvolution2d)