Xusong Wang | ee80b02 | 2019-08-22 14:58:16 -0700 | [diff] [blame^] | 1 | /* |
| 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.0/types.h> |
| 18 | #include "TestHarness.h" |
| 19 | |
| 20 | namespace android::hardware::neuralnetworks::V1_0 { |
| 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. |
| 24 | using namespace test_helper; |
| 25 | #define CHECK_TEST_ENUM(EnumType, enumValue) \ |
| 26 | static_assert(static_cast<EnumType>(Test##EnumType::enumValue) == EnumType::enumValue) |
| 27 | |
| 28 | CHECK_TEST_ENUM(OperandType, FLOAT32); |
| 29 | CHECK_TEST_ENUM(OperandType, INT32); |
| 30 | CHECK_TEST_ENUM(OperandType, UINT32); |
| 31 | CHECK_TEST_ENUM(OperandType, TENSOR_FLOAT32); |
| 32 | CHECK_TEST_ENUM(OperandType, TENSOR_INT32); |
| 33 | CHECK_TEST_ENUM(OperandType, TENSOR_QUANT8_ASYMM); |
| 34 | |
| 35 | CHECK_TEST_ENUM(OperandLifeTime, TEMPORARY_VARIABLE); |
| 36 | CHECK_TEST_ENUM(OperandLifeTime, MODEL_INPUT); |
| 37 | CHECK_TEST_ENUM(OperandLifeTime, MODEL_OUTPUT); |
| 38 | CHECK_TEST_ENUM(OperandLifeTime, CONSTANT_COPY); |
| 39 | CHECK_TEST_ENUM(OperandLifeTime, CONSTANT_REFERENCE); |
| 40 | CHECK_TEST_ENUM(OperandLifeTime, NO_VALUE); |
| 41 | |
| 42 | CHECK_TEST_ENUM(OperationType, ADD); |
| 43 | CHECK_TEST_ENUM(OperationType, AVERAGE_POOL_2D); |
| 44 | CHECK_TEST_ENUM(OperationType, CONCATENATION); |
| 45 | CHECK_TEST_ENUM(OperationType, CONV_2D); |
| 46 | CHECK_TEST_ENUM(OperationType, DEPTHWISE_CONV_2D); |
| 47 | CHECK_TEST_ENUM(OperationType, DEPTH_TO_SPACE); |
| 48 | CHECK_TEST_ENUM(OperationType, DEQUANTIZE); |
| 49 | CHECK_TEST_ENUM(OperationType, EMBEDDING_LOOKUP); |
| 50 | CHECK_TEST_ENUM(OperationType, FLOOR); |
| 51 | CHECK_TEST_ENUM(OperationType, FULLY_CONNECTED); |
| 52 | CHECK_TEST_ENUM(OperationType, HASHTABLE_LOOKUP); |
| 53 | CHECK_TEST_ENUM(OperationType, L2_NORMALIZATION); |
| 54 | CHECK_TEST_ENUM(OperationType, L2_POOL_2D); |
| 55 | CHECK_TEST_ENUM(OperationType, LOCAL_RESPONSE_NORMALIZATION); |
| 56 | CHECK_TEST_ENUM(OperationType, LOGISTIC); |
| 57 | CHECK_TEST_ENUM(OperationType, LSH_PROJECTION); |
| 58 | CHECK_TEST_ENUM(OperationType, LSTM); |
| 59 | CHECK_TEST_ENUM(OperationType, MAX_POOL_2D); |
| 60 | CHECK_TEST_ENUM(OperationType, MUL); |
| 61 | CHECK_TEST_ENUM(OperationType, RELU); |
| 62 | CHECK_TEST_ENUM(OperationType, RELU1); |
| 63 | CHECK_TEST_ENUM(OperationType, RELU6); |
| 64 | CHECK_TEST_ENUM(OperationType, RESHAPE); |
| 65 | CHECK_TEST_ENUM(OperationType, RESIZE_BILINEAR); |
| 66 | CHECK_TEST_ENUM(OperationType, RNN); |
| 67 | CHECK_TEST_ENUM(OperationType, SOFTMAX); |
| 68 | CHECK_TEST_ENUM(OperationType, SPACE_TO_DEPTH); |
| 69 | CHECK_TEST_ENUM(OperationType, SVDF); |
| 70 | CHECK_TEST_ENUM(OperationType, TANH); |
| 71 | |
| 72 | #undef CHECK_TEST_ENUM |
| 73 | |
| 74 | } // namespace android::hardware::neuralnetworks::V1_0 |