blob: c3cadb5fe26fd32be2b3d3ca635e4cb2c4fb64ce [file] [log] [blame]
Michael Butlerf76acd02018-03-22 16:37:57 -07001/*
2 * Copyright (C) 2018 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef VTS_HAL_NEURALNETWORKS_V1_1_VTS_FUNCTIONAL_MODELS_H
18#define VTS_HAL_NEURALNETWORKS_V1_1_VTS_FUNCTIONAL_MODELS_H
19
20#define LOG_TAG "neuralnetworks_hidl_hal_test"
21
22#include "TestHarness.h"
23
24#include <android/hardware/neuralnetworks/1.0/types.h>
25#include <android/hardware/neuralnetworks/1.1/types.h>
26
27namespace android {
28namespace hardware {
29namespace neuralnetworks {
30namespace V1_1 {
31namespace vts {
32namespace functional {
33
34using MixedTypedExample = generated_tests::MixedTypedExampleType;
35
36#define FOR_EACH_TEST_MODEL(FN) \
37 FN(add) \
38 FN(add_broadcast_quant8) \
39 FN(add_quant8) \
40 FN(add_relaxed) \
41 FN(avg_pool_float_1) \
42 FN(avg_pool_float_1_relaxed) \
43 FN(avg_pool_float_2) \
44 FN(avg_pool_float_2_relaxed) \
45 FN(avg_pool_float_3) \
46 FN(avg_pool_float_3_relaxed) \
47 FN(avg_pool_float_4) \
48 FN(avg_pool_float_4_relaxed) \
49 FN(avg_pool_float_5) \
50 FN(avg_pool_quant8_1) \
51 FN(avg_pool_quant8_2) \
52 FN(avg_pool_quant8_3) \
53 FN(avg_pool_quant8_4) \
54 FN(avg_pool_quant8_5) \
55 FN(batch_to_space) \
56 FN(batch_to_space_float_1) \
57 FN(batch_to_space_quant8_1) \
58 FN(concat_float_1) \
59 FN(concat_float_1_relaxed) \
60 FN(concat_float_2) \
61 FN(concat_float_2_relaxed) \
62 FN(concat_float_3) \
63 FN(concat_float_3_relaxed) \
64 FN(concat_quant8_1) \
65 FN(concat_quant8_2) \
66 FN(concat_quant8_3) \
67 FN(conv_1_h3_w2_SAME) \
68 FN(conv_1_h3_w2_SAME_relaxed) \
69 FN(conv_1_h3_w2_VALID) \
70 FN(conv_1_h3_w2_VALID_relaxed) \
71 FN(conv_3_h3_w2_SAME) \
72 FN(conv_3_h3_w2_SAME_relaxed) \
73 FN(conv_3_h3_w2_VALID) \
74 FN(conv_3_h3_w2_VALID_relaxed) \
75 FN(conv_float) \
76 FN(conv_float_2) \
77 FN(conv_float_channels) \
78 FN(conv_float_channels_relaxed) \
79 FN(conv_float_channels_weights_as_inputs) \
80 FN(conv_float_channels_weights_as_inputs_relaxed) \
81 FN(conv_float_large) \
82 FN(conv_float_large_relaxed) \
83 FN(conv_float_large_weights_as_inputs) \
84 FN(conv_float_large_weights_as_inputs_relaxed) \
85 FN(conv_float_relaxed) \
86 FN(conv_float_weights_as_inputs) \
87 FN(conv_float_weights_as_inputs_relaxed) \
88 FN(conv_quant8) \
89 FN(conv_quant8_2) \
90 FN(conv_quant8_channels) \
91 FN(conv_quant8_channels_weights_as_inputs) \
92 FN(conv_quant8_large) \
93 FN(conv_quant8_large_weights_as_inputs) \
94 FN(conv_quant8_overflow) \
95 FN(conv_quant8_overflow_weights_as_inputs) \
96 FN(conv_quant8_weights_as_inputs) \
97 FN(depth_to_space_float_1) \
98 FN(depth_to_space_float_1_relaxed) \
99 FN(depth_to_space_float_2) \
100 FN(depth_to_space_float_2_relaxed) \
101 FN(depth_to_space_float_3) \
102 FN(depth_to_space_float_3_relaxed) \
103 FN(depth_to_space_quant8_1) \
104 FN(depth_to_space_quant8_2) \
105 FN(depthwise_conv) \
106 FN(depthwise_conv2d_float) \
107 FN(depthwise_conv2d_float_2) \
108 FN(depthwise_conv2d_float_large) \
109 FN(depthwise_conv2d_float_large_2) \
110 FN(depthwise_conv2d_float_large_2_weights_as_inputs) \
111 FN(depthwise_conv2d_float_large_relaxed) \
112 FN(depthwise_conv2d_float_large_weights_as_inputs) \
113 FN(depthwise_conv2d_float_large_weights_as_inputs_relaxed) \
114 FN(depthwise_conv2d_float_weights_as_inputs) \
115 FN(depthwise_conv2d_quant8) \
116 FN(depthwise_conv2d_quant8_2) \
117 FN(depthwise_conv2d_quant8_large) \
118 FN(depthwise_conv2d_quant8_large_weights_as_inputs) \
119 FN(depthwise_conv2d_quant8_weights_as_inputs) \
120 FN(depthwise_conv_relaxed) \
121 FN(dequantize) \
122 FN(div) \
123 FN(embedding_lookup) \
124 FN(embedding_lookup_relaxed) \
125 FN(floor) \
126 FN(floor_relaxed) \
127 FN(fully_connected_float) \
128 FN(fully_connected_float_2) \
129 FN(fully_connected_float_large) \
130 FN(fully_connected_float_large_weights_as_inputs) \
131 FN(fully_connected_float_relaxed) \
132 FN(fully_connected_float_weights_as_inputs) \
133 FN(fully_connected_float_weights_as_inputs_relaxed) \
134 FN(fully_connected_quant8) \
135 FN(fully_connected_quant8_2) \
136 FN(fully_connected_quant8_large) \
137 FN(fully_connected_quant8_large_weights_as_inputs) \
138 FN(fully_connected_quant8_weights_as_inputs) \
139 FN(hashtable_lookup_float) \
140 FN(hashtable_lookup_float_relaxed) \
141 FN(hashtable_lookup_quant8) \
142 FN(l2_normalization) \
143 FN(l2_normalization_2) \
144 FN(l2_normalization_large) \
145 FN(l2_normalization_large_relaxed) \
146 FN(l2_normalization_relaxed) \
147 FN(l2_pool_float) \
148 FN(l2_pool_float_2) \
149 FN(l2_pool_float_large) \
150 FN(l2_pool_float_relaxed) \
151 FN(local_response_norm_float_1) \
152 FN(local_response_norm_float_1_relaxed) \
153 FN(local_response_norm_float_2) \
154 FN(local_response_norm_float_2_relaxed) \
155 FN(local_response_norm_float_3) \
156 FN(local_response_norm_float_3_relaxed) \
157 FN(local_response_norm_float_4) \
158 FN(local_response_norm_float_4_relaxed) \
159 FN(logistic_float_1) \
160 FN(logistic_float_1_relaxed) \
161 FN(logistic_float_2) \
162 FN(logistic_float_2_relaxed) \
163 FN(logistic_quant8_1) \
164 FN(logistic_quant8_2) \
165 FN(lsh_projection) \
166 FN(lsh_projection_2) \
167 FN(lsh_projection_2_relaxed) \
168 FN(lsh_projection_relaxed) \
169 FN(lsh_projection_weights_as_inputs) \
170 FN(lsh_projection_weights_as_inputs_relaxed) \
171 FN(lstm) \
172 FN(lstm2) \
173 FN(lstm2_relaxed) \
174 FN(lstm2_state) \
175 FN(lstm2_state2) \
176 FN(lstm2_state2_relaxed) \
177 FN(lstm2_state_relaxed) \
178 FN(lstm3) \
179 FN(lstm3_relaxed) \
180 FN(lstm3_state) \
181 FN(lstm3_state2) \
182 FN(lstm3_state2_relaxed) \
183 FN(lstm3_state3) \
184 FN(lstm3_state3_relaxed) \
185 FN(lstm3_state_relaxed) \
186 FN(lstm_relaxed) \
187 FN(lstm_state) \
188 FN(lstm_state2) \
189 FN(lstm_state2_relaxed) \
190 FN(lstm_state_relaxed) \
191 FN(max_pool_float_1) \
192 FN(max_pool_float_1_relaxed) \
193 FN(max_pool_float_2) \
194 FN(max_pool_float_2_relaxed) \
195 FN(max_pool_float_3) \
196 FN(max_pool_float_3_relaxed) \
197 FN(max_pool_float_4) \
198 FN(max_pool_quant8_1) \
199 FN(max_pool_quant8_2) \
200 FN(max_pool_quant8_3) \
201 FN(max_pool_quant8_4) \
202 FN(mean) \
203 FN(mean_float_1) \
204 FN(mean_float_2) \
205 FN(mean_quant8_1) \
206 FN(mean_quant8_2) \
207 FN(mobilenet_224_gender_basic_fixed) \
208 FN(mobilenet_224_gender_basic_fixed_relaxed) \
209 FN(mobilenet_quantized) \
210 FN(mul) \
211 FN(mul_broadcast_quant8) \
212 FN(mul_quant8) \
213 FN(mul_relaxed) \
214 FN(mul_relu) \
215 FN(mul_relu_relaxed) \
216 FN(pad) \
217 FN(pad_float_1) \
218 FN(relu1_float_1) \
219 FN(relu1_float_1_relaxed) \
220 FN(relu1_float_2) \
221 FN(relu1_float_2_relaxed) \
222 FN(relu1_quant8_1) \
223 FN(relu1_quant8_2) \
224 FN(relu6_float_1) \
225 FN(relu6_float_1_relaxed) \
226 FN(relu6_float_2) \
227 FN(relu6_float_2_relaxed) \
228 FN(relu6_quant8_1) \
229 FN(relu6_quant8_2) \
230 FN(relu_float_1) \
231 FN(relu_float_1_relaxed) \
232 FN(relu_float_2) \
233 FN(relu_quant8_1) \
234 FN(relu_quant8_2) \
235 FN(reshape) \
236 FN(reshape_quant8) \
237 FN(reshape_quant8_weights_as_inputs) \
238 FN(reshape_relaxed) \
239 FN(reshape_weights_as_inputs) \
240 FN(reshape_weights_as_inputs_relaxed) \
241 FN(resize_bilinear) \
242 FN(resize_bilinear_2) \
243 FN(resize_bilinear_relaxed) \
244 FN(rnn) \
245 FN(rnn_relaxed) \
246 FN(rnn_state) \
247 FN(rnn_state_relaxed) \
248 FN(softmax_float_1) \
249 FN(softmax_float_1_relaxed) \
250 FN(softmax_float_2) \
251 FN(softmax_float_2_relaxed) \
252 FN(softmax_quant8_1) \
253 FN(softmax_quant8_2) \
254 FN(space_to_batch) \
255 FN(space_to_batch_float_1) \
256 FN(space_to_batch_float_2) \
257 FN(space_to_batch_float_3) \
258 FN(space_to_batch_quant8_1) \
259 FN(space_to_batch_quant8_2) \
260 FN(space_to_batch_quant8_3) \
261 FN(space_to_depth_float_1) \
262 FN(space_to_depth_float_1_relaxed) \
263 FN(space_to_depth_float_2) \
264 FN(space_to_depth_float_2_relaxed) \
265 FN(space_to_depth_float_3) \
266 FN(space_to_depth_float_3_relaxed) \
267 FN(space_to_depth_quant8_1) \
268 FN(space_to_depth_quant8_2) \
269 FN(squeeze) \
270 FN(squeeze_float_1) \
271 FN(squeeze_quant8_1) \
272 FN(strided_slice) \
273 FN(strided_slice_float_1) \
274 FN(strided_slice_float_10) \
275 FN(strided_slice_float_2) \
276 FN(strided_slice_float_3) \
277 FN(strided_slice_float_4) \
278 FN(strided_slice_float_5) \
279 FN(strided_slice_float_6) \
280 FN(strided_slice_float_7) \
281 FN(strided_slice_float_8) \
282 FN(strided_slice_float_9) \
283 FN(strided_slice_qaunt8_10) \
284 FN(strided_slice_quant8_1) \
285 FN(strided_slice_quant8_2) \
286 FN(strided_slice_quant8_3) \
287 FN(strided_slice_quant8_4) \
288 FN(strided_slice_quant8_5) \
289 FN(strided_slice_quant8_6) \
290 FN(strided_slice_quant8_7) \
291 FN(strided_slice_quant8_8) \
292 FN(strided_slice_quant8_9) \
293 FN(sub) \
294 FN(svdf) \
295 FN(svdf2) \
296 FN(svdf2_relaxed) \
297 FN(svdf_relaxed) \
298 FN(svdf_state) \
299 FN(svdf_state_relaxed) \
300 FN(tanh) \
301 FN(tanh_relaxed) \
302 FN(transpose) \
303 FN(transpose_float_1) \
304 FN(transpose_quant8_1)
305
306#define FORWARD_DECLARE_GENERATED_OBJECTS(function) \
307 namespace function { \
308 extern std::vector<MixedTypedExample> examples; \
309 Model createTestModel(); \
310 }
311
312FOR_EACH_TEST_MODEL(FORWARD_DECLARE_GENERATED_OBJECTS)
313
314#undef FORWARD_DECLARE_GENERATED_OBJECTS
315
316} // namespace functional
317} // namespace vts
318} // namespace V1_1
319} // namespace neuralnetworks
320} // namespace hardware
321} // namespace android
322
323#endif // VTS_HAL_NEURALNETWORKS_V1_1_VTS_FUNCTIONAL_MODELS_H