blob: 3941f4bc569d2dd6346cdbd3630da6bafb485f16 [file] [log] [blame]
telsoa014fcda012018-03-09 14:13:49 +00001//
2// Copyright © 2017 Arm Ltd. All rights reserved.
David Beckecb56cd2018-09-05 12:52:57 +01003// SPDX-License-Identifier: MIT
telsoa014fcda012018-03-09 14:13:49 +00004//
5#pragma once
6
David Beck3cc9a622018-10-12 10:38:31 +01007#include <armnn/ILayerSupport.hpp>
arovir01a6824102018-08-28 17:40:45 +01008
telsoa014fcda012018-03-09 14:13:49 +00009namespace armnn
10{
11
arovir014424b0a2018-10-04 10:46:04 +010012class RefLayerSupport : public ILayerSupport
13{
arovir011c7c81b2018-10-08 11:34:28 +010014public:
15 bool IsActivationSupported(const TensorInfo& input,
16 const TensorInfo& output,
17 const ActivationDescriptor& descriptor,
18 Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override;
19
20 bool IsAdditionSupported(const TensorInfo& input0,
21 const TensorInfo& input1,
22 const TensorInfo& output,
23 Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override;
24
25 bool IsBatchNormalizationSupported(const TensorInfo& input,
26 const TensorInfo& output,
27 const TensorInfo& mean,
28 const TensorInfo& var,
29 const TensorInfo& beta,
30 const TensorInfo& gamma,
31 const BatchNormalizationDescriptor& descriptor,
32 Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override;
33
Éanna Ó Catháin4e1e1362018-11-12 11:36:34 +000034 bool IsBatchToSpaceNdSupported(const TensorInfo& input,
35 const TensorInfo& output,
36 const BatchToSpaceNdDescriptor& descriptor,
37 Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override;
38
arovir011c7c81b2018-10-08 11:34:28 +010039 bool IsConstantSupported(const TensorInfo& output,
40 Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override;
41
42 bool IsConvertFp16ToFp32Supported(const TensorInfo& input,
43 const TensorInfo& output,
44 Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override;
45
46 bool IsConvertFp32ToFp16Supported(const TensorInfo& input,
47 const TensorInfo& output,
48 Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override;
49
50 bool IsConvolution2dSupported(const TensorInfo& input,
51 const TensorInfo& output,
52 const Convolution2dDescriptor& descriptor,
53 const TensorInfo& weights,
54 const Optional<TensorInfo>& biases,
55 Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override;
56
Nattapat Chaimanowongcfdcadf2018-12-06 11:54:33 +000057 bool IsDebugSupported(const TensorInfo& input,
58 const TensorInfo& output,
59 const DebugDescriptor& descriptor,
60 Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override;
61
arovir011c7c81b2018-10-08 11:34:28 +010062 bool IsDepthwiseConvolutionSupported(const TensorInfo& input,
63 const TensorInfo& output,
64 const DepthwiseConvolution2dDescriptor& descriptor,
65 const TensorInfo& weights,
66 const Optional<TensorInfo>& biases,
67 Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override;
68
69 bool IsDivisionSupported(const TensorInfo& input0,
70 const TensorInfo& input1,
71 const TensorInfo& output,
72 Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override;
73
FrancisMurtagh30cdfca2018-12-18 12:57:35 +000074 bool IsEqualSupported(const TensorInfo& input0,
75 const TensorInfo& input1,
76 const TensorInfo& output,
77 Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override;
78
arovir011c7c81b2018-10-08 11:34:28 +010079 bool IsFakeQuantizationSupported(const TensorInfo& input,
80 const FakeQuantizationDescriptor& descriptor,
81 Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override;
82
83 bool IsFloorSupported(const TensorInfo& input,
84 const TensorInfo& output,
85 Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override;
86
87 bool IsFullyConnectedSupported(const TensorInfo& input,
88 const TensorInfo& output,
89 const TensorInfo& weights,
90 const TensorInfo& biases,
91 const FullyConnectedDescriptor& descriptor,
92 Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override;
93
FrancisMurtagh878f0232018-12-19 10:56:15 +000094 bool IsGreaterSupported(const TensorInfo& input0,
95 const TensorInfo& input1,
96 const TensorInfo& ouput,
97 Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override;
98
arovir011c7c81b2018-10-08 11:34:28 +010099 bool IsInputSupported(const TensorInfo& input,
100 Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override;
101
102 bool IsL2NormalizationSupported(const TensorInfo& input,
103 const TensorInfo& output,
104 const L2NormalizationDescriptor& descriptor,
105 Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override;
106
107 bool IsLstmSupported(const TensorInfo& input,
108 const TensorInfo& outputStateIn,
109 const TensorInfo& cellStateIn,
110 const TensorInfo& scratchBuffer,
111 const TensorInfo& outputStateOut,
112 const TensorInfo& cellStateOut,
113 const TensorInfo& output,
114 const LstmDescriptor& descriptor,
115 const TensorInfo& inputToForgetWeights,
116 const TensorInfo& inputToCellWeights,
117 const TensorInfo& inputToOutputWeights,
118 const TensorInfo& recurrentToForgetWeights,
119 const TensorInfo& recurrentToCellWeights,
120 const TensorInfo& recurrentToOutputWeights,
121 const TensorInfo& forgetGateBias,
122 const TensorInfo& cellBias,
123 const TensorInfo& outputGateBias,
124 const TensorInfo* inputToInputWeights,
125 const TensorInfo* recurrentToInputWeights,
126 const TensorInfo* cellToInputWeights,
127 const TensorInfo* inputGateBias,
128 const TensorInfo* projectionWeights,
129 const TensorInfo* projectionBias,
130 const TensorInfo* cellToForgetWeights,
131 const TensorInfo* cellToOutputWeights,
132 Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override;
133
saoste012df12b32018-11-28 16:57:20 +0000134 bool IsMaximumSupported(const TensorInfo& input0,
135 const TensorInfo& input1,
136 const TensorInfo& output,
137 Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override;
138
arovir011c7c81b2018-10-08 11:34:28 +0100139 bool IsMeanSupported(const TensorInfo& input,
140 const TensorInfo& output,
141 const MeanDescriptor& descriptor,
142 Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override;
143
144 bool IsMergerSupported(const std::vector<const TensorInfo*> inputs,
Nikhil Raj8599a412018-11-19 14:51:07 +0000145 const TensorInfo& output,
arovir011c7c81b2018-10-08 11:34:28 +0100146 const OriginsDescriptor& descriptor,
147 Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override;
148
Éanna Ó Catháin20e58802018-12-04 10:29:06 +0000149 bool IsMinimumSupported(const TensorInfo& input0,
150 const TensorInfo& input1,
151 const TensorInfo& output,
152 Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override;
153
arovir011c7c81b2018-10-08 11:34:28 +0100154 bool IsMultiplicationSupported(const TensorInfo& input0,
155 const TensorInfo& input1,
156 const TensorInfo& output,
157 Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override;
158
159 bool IsNormalizationSupported(const TensorInfo& input,
160 const TensorInfo& output,
161 const NormalizationDescriptor& descriptor,
162 Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override;
163
164 bool IsOutputSupported(const TensorInfo& output,
165 Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override;
166
167 bool IsPadSupported(const TensorInfo& input,
168 const TensorInfo& output,
169 const PadDescriptor& descriptor,
170 Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override;
171
172 bool IsPermuteSupported(const TensorInfo& input,
173 const TensorInfo& output,
174 const PermuteDescriptor& descriptor,
175 Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override;
176
177 bool IsPooling2dSupported(const TensorInfo& input,
178 const TensorInfo& output,
179 const Pooling2dDescriptor& descriptor,
180 Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override;
181
182 bool IsReshapeSupported(const TensorInfo& input,
183 Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override;
184
185 bool IsResizeBilinearSupported(const TensorInfo& input,
186 Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override;
187
188 bool IsSoftmaxSupported(const TensorInfo& input,
189 const TensorInfo& output,
190 const SoftmaxDescriptor& descriptor,
191 Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override;
192
Nattapat Chaimanowong3ea76d52018-11-09 14:10:38 +0000193 bool IsSpaceToBatchNdSupported(const TensorInfo& input,
194 const TensorInfo& output,
195 const SpaceToBatchNdDescriptor& descriptor,
196 Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override;
197
arovir011c7c81b2018-10-08 11:34:28 +0100198 bool IsSplitterSupported(const TensorInfo& input,
199 const ViewsDescriptor& descriptor,
200 Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override;
201
Nattapat Chaimanowong1216b582018-11-23 15:33:41 +0000202 bool IsStridedSliceSupported(const TensorInfo& input,
203 const TensorInfo& output,
204 const StridedSliceDescriptor& descriptor,
205 Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override;
206
arovir011c7c81b2018-10-08 11:34:28 +0100207 bool IsSubtractionSupported(const TensorInfo& input0,
208 const TensorInfo& input1,
209 const TensorInfo& output,
210 Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override;
arovir014424b0a2018-10-04 10:46:04 +0100211};
212
Aron Virginas-Tarb5acbb72018-10-15 11:11:51 +0100213} // namespace armnn