1 /* 2 * Copyright (C) 2017 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 ANDROID_HARDWARE_V1_0_HEXAGON_OPERATIONS_H 18 #define ANDROID_HARDWARE_V1_0_HEXAGON_OPERATIONS_H 19 20 #include <android/hardware/neuralnetworks/1.0/types.h> 21 #include <functional> 22 #include <map> 23 #include "HexagonUtils.h" 24 #include "hexagon_nn_controller/hexagon_nn_controller.h" 25 26 namespace android { 27 namespace hardware { 28 namespace neuralnetworks { 29 namespace V1_0 { 30 namespace implementation { 31 namespace hexagon { 32 33 class Model; 34 using HexagonModel = ::android::hardware::neuralnetworks::V1_0::implementation::hexagon::Model; 35 36 using ::android::hardware::neuralnetworks::V1_0::Operand; 37 38 using OperationTuple = std::pair<OperationType, OperandType>; 39 40 using HexagonOperationFn = 41 std::function<bool(const std::vector<uint32_t>& /* ins */, 42 const std::vector<uint32_t>& /* outs */, HexagonModel* /* model */)>; 43 44 using OperationTable = std::map<OperationTuple, HexagonOperationFn>; 45 OperationTable& getOperationPrepareTable(); 46 OperationTable& getOperationCheckTable(); 47 48 } // namespace hexagon 49 } // namespace implementation 50 } // namespace V1_0 51 } // namespace neuralnetworks 52 } // namespace hardware 53 } // namespace android 54 55 #endif // ANDROID_HARDWARE_V1_0_HEXAGON_OPERATIONS_H 56