• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 #pragma once
6 
7 #include "InternalTypes.hpp"
8 
9 #include "layers/ActivationLayer.hpp"
10 #include "layers/AdditionLayer.hpp"
11 #include "layers/ArgMinMaxLayer.hpp"
12 #include "layers/BatchNormalizationLayer.hpp"
13 #include "layers/BatchToSpaceNdLayer.hpp"
14 #include "layers/ComparisonLayer.hpp"
15 #include "layers/ConcatLayer.hpp"
16 #include "layers/ConstantLayer.hpp"
17 #include "layers/ConvertBf16ToFp32Layer.hpp"
18 #include "layers/ConvertFp16ToFp32Layer.hpp"
19 #include "layers/ConvertFp32ToBf16Layer.hpp"
20 #include "layers/ConvertFp32ToFp16Layer.hpp"
21 #include "layers/Convolution2dLayer.hpp"
22 #include "layers/DebugLayer.hpp"
23 #include "layers/DepthToSpaceLayer.hpp"
24 #include "layers/DepthwiseConvolution2dLayer.hpp"
25 #include "layers/DequantizeLayer.hpp"
26 #include "layers/DetectionPostProcessLayer.hpp"
27 #include "layers/DivisionLayer.hpp"
28 #include "layers/ElementwiseUnaryLayer.hpp"
29 #include "layers/FakeQuantizationLayer.hpp"
30 #include "layers/FillLayer.hpp"
31 #include "layers/FloorLayer.hpp"
32 #include "layers/FullyConnectedLayer.hpp"
33 #include "layers/GatherLayer.hpp"
34 #include "layers/InputLayer.hpp"
35 #include "layers/InstanceNormalizationLayer.hpp"
36 #include "layers/L2NormalizationLayer.hpp"
37 #include "layers/LogicalBinaryLayer.hpp"
38 #include "layers/LogSoftmaxLayer.hpp"
39 #include "layers/LstmLayer.hpp"
40 #include "layers/MapLayer.hpp"
41 #include "layers/MaximumLayer.hpp"
42 #include "layers/MeanLayer.hpp"
43 #include "layers/MemCopyLayer.hpp"
44 #include "layers/MemImportLayer.hpp"
45 #include "layers/MergeLayer.hpp"
46 #include "layers/MinimumLayer.hpp"
47 #include "layers/MultiplicationLayer.hpp"
48 #include "layers/NormalizationLayer.hpp"
49 #include "layers/OutputLayer.hpp"
50 #include "layers/PadLayer.hpp"
51 #include "layers/PermuteLayer.hpp"
52 #include "layers/Pooling2dLayer.hpp"
53 #include "layers/PreCompiledLayer.hpp"
54 #include "layers/PreluLayer.hpp"
55 #include "layers/QuantizeLayer.hpp"
56 #include "layers/QLstmLayer.hpp"
57 #include "layers/QuantizedLstmLayer.hpp"
58 #include "layers/RankLayer.hpp"
59 #include "layers/ReshapeLayer.hpp"
60 #include "layers/ResizeLayer.hpp"
61 #include "layers/SliceLayer.hpp"
62 #include "layers/SoftmaxLayer.hpp"
63 #include "layers/SpaceToBatchNdLayer.hpp"
64 #include "layers/SpaceToDepthLayer.hpp"
65 #include "layers/SplitterLayer.hpp"
66 #include "layers/StackLayer.hpp"
67 #include "layers/StandInLayer.hpp"
68 #include "layers/StridedSliceLayer.hpp"
69 #include "layers/SubtractionLayer.hpp"
70 #include "layers/SwitchLayer.hpp"
71 #include "layers/TransposeConvolution2dLayer.hpp"
72 #include "layers/TransposeLayer.hpp"
73 #include "layers/UnmapLayer.hpp"
74 
75 namespace armnn
76 {
77 
78 template <LayerType Type>
79 struct LayerTypeOfImpl;
80 
81 template <LayerType Type>
82 using LayerTypeOf = typename LayerTypeOfImpl<Type>::Type;
83 
84 template <typename T>
85 constexpr LayerType LayerEnumOf(const T* = nullptr);
86 
87 #define DECLARE_LAYER_IMPL(_, LayerName)                     \
88     class LayerName##Layer;                                  \
89     template <>                                              \
90     struct LayerTypeOfImpl<LayerType::_##LayerName>          \
91     {                                                        \
92         using Type = LayerName##Layer;                       \
93     };                                                       \
94     template <>                                              \
95     constexpr LayerType LayerEnumOf(const LayerName##Layer*) \
96     {                                                        \
97         return LayerType::_##LayerName;                      \
98     }
99 
100 #define DECLARE_LAYER(LayerName) DECLARE_LAYER_IMPL(, LayerName)
101 
102 DECLARE_LAYER(Activation)
103 DECLARE_LAYER(Addition)
104 DECLARE_LAYER(ArgMinMax)
105 DECLARE_LAYER(BatchNormalization)
106 DECLARE_LAYER(BatchToSpaceNd)
107 DECLARE_LAYER(Comparison)
108 DECLARE_LAYER(Concat)
109 DECLARE_LAYER(Constant)
110 DECLARE_LAYER(ConvertBf16ToFp32)
111 DECLARE_LAYER(ConvertFp16ToFp32)
112 DECLARE_LAYER(ConvertFp32ToBf16)
113 DECLARE_LAYER(ConvertFp32ToFp16)
114 DECLARE_LAYER(Convolution2d)
115 DECLARE_LAYER(Debug)
116 DECLARE_LAYER(DepthToSpace)
117 DECLARE_LAYER(DepthwiseConvolution2d)
118 DECLARE_LAYER(Dequantize)
119 DECLARE_LAYER(DetectionPostProcess)
120 DECLARE_LAYER(Division)
121 DECLARE_LAYER(ElementwiseUnary)
122 DECLARE_LAYER(FakeQuantization)
123 DECLARE_LAYER(Fill)
124 DECLARE_LAYER(Floor)
125 DECLARE_LAYER(FullyConnected)
126 DECLARE_LAYER(Gather)
127 DECLARE_LAYER(Input)
128 DECLARE_LAYER(InstanceNormalization)
129 DECLARE_LAYER(L2Normalization)
130 DECLARE_LAYER(LogicalBinary)
131 DECLARE_LAYER(LogSoftmax)
132 DECLARE_LAYER(Lstm)
133 DECLARE_LAYER(Map)
134 DECLARE_LAYER(Maximum)
135 DECLARE_LAYER(Mean)
136 DECLARE_LAYER(MemCopy)
137 DECLARE_LAYER(MemImport)
138 DECLARE_LAYER(Merge)
139 DECLARE_LAYER(Minimum)
140 DECLARE_LAYER(Multiplication)
141 DECLARE_LAYER(Normalization)
142 DECLARE_LAYER(Output)
143 DECLARE_LAYER(Pad)
144 DECLARE_LAYER(Permute)
145 DECLARE_LAYER(Pooling2d)
146 DECLARE_LAYER(PreCompiled)
147 DECLARE_LAYER(Prelu)
148 DECLARE_LAYER(Quantize)
149 DECLARE_LAYER(QLstm)
150 DECLARE_LAYER(QuantizedLstm)
151 DECLARE_LAYER(Rank)
152 DECLARE_LAYER(Reshape)
153 DECLARE_LAYER(Resize)
154 DECLARE_LAYER(Slice)
155 DECLARE_LAYER(Softmax)
156 DECLARE_LAYER(SpaceToBatchNd)
157 DECLARE_LAYER(SpaceToDepth)
158 DECLARE_LAYER(Splitter)
159 DECLARE_LAYER(Stack)
160 DECLARE_LAYER(StandIn)
161 DECLARE_LAYER(StridedSlice)
162 DECLARE_LAYER(Subtraction)
163 DECLARE_LAYER(Switch)
164 DECLARE_LAYER(Transpose)
165 DECLARE_LAYER(TransposeConvolution2d)
166 DECLARE_LAYER(Unmap)
167 
168 }
169