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