blob: f4a49bcd91b097be2b67b40c7f0151d183554063 [file] [log] [blame]
Xusong Wangee80b022019-08-22 14:58:16 -07001/*
2 * Copyright (C) 2019 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#include <android/hardware/neuralnetworks/1.1/types.h>
18#include "TestHarness.h"
19
20namespace android::hardware::neuralnetworks::V1_1 {
21
22// Make sure that the HIDL enums are compatible with the values defined in
23// frameworks/ml/nn/tools/test_generator/test_harness/include/TestHarness.h.
24using namespace test_helper;
25#define CHECK_TEST_ENUM(EnumType, enumValue) \
26 static_assert(static_cast<EnumType>(Test##EnumType::enumValue) == EnumType::enumValue)
27
28CHECK_TEST_ENUM(OperationType, ADD);
29CHECK_TEST_ENUM(OperationType, AVERAGE_POOL_2D);
30CHECK_TEST_ENUM(OperationType, CONCATENATION);
31CHECK_TEST_ENUM(OperationType, CONV_2D);
32CHECK_TEST_ENUM(OperationType, DEPTHWISE_CONV_2D);
33CHECK_TEST_ENUM(OperationType, DEPTH_TO_SPACE);
34CHECK_TEST_ENUM(OperationType, DEQUANTIZE);
35CHECK_TEST_ENUM(OperationType, EMBEDDING_LOOKUP);
36CHECK_TEST_ENUM(OperationType, FLOOR);
37CHECK_TEST_ENUM(OperationType, FULLY_CONNECTED);
38CHECK_TEST_ENUM(OperationType, HASHTABLE_LOOKUP);
39CHECK_TEST_ENUM(OperationType, L2_NORMALIZATION);
40CHECK_TEST_ENUM(OperationType, L2_POOL_2D);
41CHECK_TEST_ENUM(OperationType, LOCAL_RESPONSE_NORMALIZATION);
42CHECK_TEST_ENUM(OperationType, LOGISTIC);
43CHECK_TEST_ENUM(OperationType, LSH_PROJECTION);
44CHECK_TEST_ENUM(OperationType, LSTM);
45CHECK_TEST_ENUM(OperationType, MAX_POOL_2D);
46CHECK_TEST_ENUM(OperationType, MUL);
47CHECK_TEST_ENUM(OperationType, RELU);
48CHECK_TEST_ENUM(OperationType, RELU1);
49CHECK_TEST_ENUM(OperationType, RELU6);
50CHECK_TEST_ENUM(OperationType, RESHAPE);
51CHECK_TEST_ENUM(OperationType, RESIZE_BILINEAR);
52CHECK_TEST_ENUM(OperationType, RNN);
53CHECK_TEST_ENUM(OperationType, SOFTMAX);
54CHECK_TEST_ENUM(OperationType, SPACE_TO_DEPTH);
55CHECK_TEST_ENUM(OperationType, SVDF);
56CHECK_TEST_ENUM(OperationType, TANH);
57CHECK_TEST_ENUM(OperationType, BATCH_TO_SPACE_ND);
58CHECK_TEST_ENUM(OperationType, DIV);
59CHECK_TEST_ENUM(OperationType, MEAN);
60CHECK_TEST_ENUM(OperationType, PAD);
61CHECK_TEST_ENUM(OperationType, SPACE_TO_BATCH_ND);
62CHECK_TEST_ENUM(OperationType, SQUEEZE);
63CHECK_TEST_ENUM(OperationType, STRIDED_SLICE);
64CHECK_TEST_ENUM(OperationType, SUB);
65CHECK_TEST_ENUM(OperationType, TRANSPOSE);
66
67#undef CHECK_TEST_ENUM
68
69} // namespace android::hardware::neuralnetworks::V1_1