blob: 57da0102da579d4851501f28a10d28f465843fc4 [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
Michael K. Sanders941d61a2018-10-19 14:39:09 +010034using MixedTypedExample = test_helper::MixedTypedExample;
Michael Butlerf76acd02018-03-22 16:37:57 -070035
Michael Butlerf2036fd2018-04-23 12:51:03 -070036#define FOR_EACH_TEST_MODEL(FN) \
Michael Butlerf2036fd2018-04-23 12:51:03 -070037 FN(add_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -070038 FN(avg_pool_float_1_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -070039 FN(avg_pool_float_2_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -070040 FN(avg_pool_float_3_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -070041 FN(avg_pool_float_4_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -070042 FN(avg_pool_float_5_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -070043 FN(batch_to_space) \
44 FN(batch_to_space_float_1) \
45 FN(batch_to_space_float_1_relaxed) \
46 FN(batch_to_space_quant8_1) \
47 FN(batch_to_space_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -070048 FN(concat_float_1_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -070049 FN(concat_float_2_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -070050 FN(concat_float_3_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -070051 FN(conv_1_h3_w2_SAME_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -070052 FN(conv_1_h3_w2_VALID_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -070053 FN(conv_3_h3_w2_SAME_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -070054 FN(conv_3_h3_w2_VALID_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -070055 FN(conv_float_2_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -070056 FN(conv_float_channels_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -070057 FN(conv_float_channels_weights_as_inputs_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -070058 FN(conv_float_large_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -070059 FN(conv_float_large_weights_as_inputs_relaxed) \
60 FN(conv_float_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -070061 FN(conv_float_weights_as_inputs_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -070062 FN(depth_to_space_float_1_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -070063 FN(depth_to_space_float_2_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -070064 FN(depth_to_space_float_3_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -070065 FN(depthwise_conv2d_float_2_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -070066 FN(depthwise_conv2d_float_large_2_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -070067 FN(depthwise_conv2d_float_large_2_weights_as_inputs_relaxed) \
68 FN(depthwise_conv2d_float_large_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -070069 FN(depthwise_conv2d_float_large_weights_as_inputs_relaxed) \
70 FN(depthwise_conv2d_float_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -070071 FN(depthwise_conv2d_float_weights_as_inputs_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -070072 FN(depthwise_conv_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -070073 FN(dequantize_relaxed) \
74 FN(div) \
75 FN(div_broadcast_float) \
76 FN(div_broadcast_float_relaxed) \
77 FN(div_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -070078 FN(embedding_lookup_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -070079 FN(floor_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -070080 FN(fully_connected_float_2_relaxed) \
81 FN(fully_connected_float_4d_simple) \
82 FN(fully_connected_float_4d_simple_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -070083 FN(fully_connected_float_large_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -070084 FN(fully_connected_float_large_weights_as_inputs_relaxed) \
85 FN(fully_connected_float_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -070086 FN(fully_connected_float_weights_as_inputs_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -070087 FN(hashtable_lookup_float_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -070088 FN(l2_normalization_2_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -070089 FN(l2_normalization_large_relaxed) \
90 FN(l2_normalization_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -070091 FN(l2_pool_float_2_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -070092 FN(l2_pool_float_large_relaxed) \
93 FN(l2_pool_float_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -070094 FN(local_response_norm_float_1_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -070095 FN(local_response_norm_float_2_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -070096 FN(local_response_norm_float_3_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -070097 FN(local_response_norm_float_4_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -070098 FN(logistic_float_1_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -070099 FN(logistic_float_2_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -0700100 FN(lsh_projection_2_relaxed) \
101 FN(lsh_projection_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -0700102 FN(lsh_projection_weights_as_inputs_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -0700103 FN(lstm2_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -0700104 FN(lstm2_state2_relaxed) \
105 FN(lstm2_state_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -0700106 FN(lstm3_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -0700107 FN(lstm3_state2_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -0700108 FN(lstm3_state3_relaxed) \
109 FN(lstm3_state_relaxed) \
110 FN(lstm_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -0700111 FN(lstm_state2_relaxed) \
112 FN(lstm_state_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -0700113 FN(max_pool_float_1_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -0700114 FN(max_pool_float_2_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -0700115 FN(max_pool_float_3_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -0700116 FN(max_pool_float_4_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -0700117 FN(mean) \
118 FN(mean_float_1) \
119 FN(mean_float_1_relaxed) \
120 FN(mean_float_2) \
121 FN(mean_float_2_relaxed) \
122 FN(mean_quant8_1) \
123 FN(mean_quant8_2) \
124 FN(mean_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -0700125 FN(mobilenet_224_gender_basic_fixed_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -0700126 FN(mul_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -0700127 FN(mul_relu_relaxed) \
128 FN(pad) \
129 FN(pad_float_1) \
130 FN(pad_float_1_relaxed) \
131 FN(pad_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -0700132 FN(relu1_float_1_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -0700133 FN(relu1_float_2_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -0700134 FN(relu6_float_1_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -0700135 FN(relu6_float_2_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -0700136 FN(relu_float_1_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -0700137 FN(relu_float_2_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -0700138 FN(reshape_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -0700139 FN(reshape_weights_as_inputs_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -0700140 FN(resize_bilinear_2_relaxed) \
141 FN(resize_bilinear_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -0700142 FN(rnn_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -0700143 FN(rnn_state_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -0700144 FN(softmax_float_1_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -0700145 FN(softmax_float_2_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -0700146 FN(space_to_batch) \
147 FN(space_to_batch_float_1) \
148 FN(space_to_batch_float_1_relaxed) \
149 FN(space_to_batch_float_2) \
150 FN(space_to_batch_float_2_relaxed) \
151 FN(space_to_batch_float_3) \
152 FN(space_to_batch_float_3_relaxed) \
153 FN(space_to_batch_quant8_1) \
154 FN(space_to_batch_quant8_2) \
155 FN(space_to_batch_quant8_3) \
156 FN(space_to_batch_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -0700157 FN(space_to_depth_float_1_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -0700158 FN(space_to_depth_float_2_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -0700159 FN(space_to_depth_float_3_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -0700160 FN(squeeze) \
161 FN(squeeze_float_1) \
162 FN(squeeze_float_1_relaxed) \
163 FN(squeeze_quant8_1) \
164 FN(squeeze_relaxed) \
165 FN(strided_slice) \
166 FN(strided_slice_float_1) \
167 FN(strided_slice_float_10) \
168 FN(strided_slice_float_10_relaxed) \
169 FN(strided_slice_float_11) \
170 FN(strided_slice_float_11_relaxed) \
171 FN(strided_slice_float_1_relaxed) \
172 FN(strided_slice_float_2) \
173 FN(strided_slice_float_2_relaxed) \
174 FN(strided_slice_float_3) \
175 FN(strided_slice_float_3_relaxed) \
176 FN(strided_slice_float_4) \
177 FN(strided_slice_float_4_relaxed) \
178 FN(strided_slice_float_5) \
179 FN(strided_slice_float_5_relaxed) \
180 FN(strided_slice_float_6) \
181 FN(strided_slice_float_6_relaxed) \
182 FN(strided_slice_float_7) \
183 FN(strided_slice_float_7_relaxed) \
184 FN(strided_slice_float_8) \
185 FN(strided_slice_float_8_relaxed) \
186 FN(strided_slice_float_9) \
187 FN(strided_slice_float_9_relaxed) \
188 FN(strided_slice_qaunt8_10) \
189 FN(strided_slice_qaunt8_11) \
190 FN(strided_slice_quant8_1) \
191 FN(strided_slice_quant8_2) \
192 FN(strided_slice_quant8_3) \
193 FN(strided_slice_quant8_4) \
194 FN(strided_slice_quant8_5) \
195 FN(strided_slice_quant8_6) \
196 FN(strided_slice_quant8_7) \
197 FN(strided_slice_quant8_8) \
198 FN(strided_slice_quant8_9) \
199 FN(strided_slice_relaxed) \
200 FN(sub) \
201 FN(sub_broadcast_float) \
202 FN(sub_broadcast_float_relaxed) \
203 FN(sub_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -0700204 FN(svdf2_relaxed) \
205 FN(svdf_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -0700206 FN(svdf_state_relaxed) \
Michael Butlerf2036fd2018-04-23 12:51:03 -0700207 FN(tanh_relaxed) \
208 FN(transpose) \
209 FN(transpose_float_1) \
210 FN(transpose_float_1_relaxed) \
211 FN(transpose_quant8_1) \
212 FN(transpose_relaxed)
Michael Butlerf76acd02018-03-22 16:37:57 -0700213
214#define FORWARD_DECLARE_GENERATED_OBJECTS(function) \
215 namespace function { \
216 extern std::vector<MixedTypedExample> examples; \
217 Model createTestModel(); \
218 }
219
220FOR_EACH_TEST_MODEL(FORWARD_DECLARE_GENERATED_OBJECTS)
221
222#undef FORWARD_DECLARE_GENERATED_OBJECTS
223
224} // namespace functional
225} // namespace vts
226} // namespace V1_1
227} // namespace neuralnetworks
228} // namespace hardware
229} // namespace android
230
231#endif // VTS_HAL_NEURALNETWORKS_V1_1_VTS_FUNCTIONAL_MODELS_H