1 /** 2 * Copyright 2024 Huawei Technologies Co., Ltd 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 LITE_HIAI_FOUNDATION_WRAPPER_H 18 #define LITE_HIAI_FOUNDATION_WRAPPER_H 19 20 #include <string> 21 #include "neural_network_runtime/neural_network_runtime.h" 22 23 namespace mindspore::lite { 24 bool LoadHiaiFLibraryFromPath(void **handle_ptr); 25 bool UnLoadHiaiFLibrary(void *handle); 26 27 typedef enum { 28 /** Automatically adjusted by the system. */ 29 HIAI_BANDMODE_UNSET = 0, 30 /** Low bandwidth mode. */ 31 HIAI_BANDMODE_LOW = 1, 32 /** Medium bandwidth mode. */ 33 HIAI_BANDMODE_NORMAL = 2, 34 /** High bandwidth mode. */ 35 HIAI_BANDMODE_HIGH = 3, 36 } HiAI_BandMode; 37 38 using HMS_HiAIOptions_SetQuantConfigFunc = OH_NN_ReturnCode (*)(OH_NNCompilation*, void*, size_t); 39 using HMS_HiAIOptions_SetBandModeFunc = OH_NN_ReturnCode (*)(OH_NNCompilation*, HiAI_BandMode); 40 41 #define HIAIF_DECLARE_FUNC_PTR(func) extern func##Func func 42 HIAIF_DECLARE_FUNC_PTR(HMS_HiAIOptions_SetQuantConfig); 43 HIAIF_DECLARE_FUNC_PTR(HMS_HiAIOptions_SetBandMode); 44 #undef HIAIF_DECLARE_FUNC_PTR 45 } // mindspore::lite 46 47 #endif // LITE_HIAI_FOUNDATION_WRAPPER_H 48