1 /**
2 * Copyright 2023 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 #include "neural_network_runtime/neural_network_runtime.h"
18 #include "neural_network_runtime_inner.h"
19
OH_NNModel_Construct(void)20 OH_NNModel *OH_NNModel_Construct(void) {
21 return NULL;
22 }
23
OH_NNExecutor_Run(OH_NNExecutor * executor)24 OH_NN_ReturnCode OH_NNExecutor_Run(OH_NNExecutor *executor) {
25 return OH_NN_SUCCESS;
26 }
27
OH_NNCompilation_Build(OH_NNCompilation * compilation)28 OH_NN_ReturnCode OH_NNCompilation_Build(OH_NNCompilation *compilation) {
29 return OH_NN_SUCCESS;
30 }
31
OH_NNCompilation_Destroy(OH_NNCompilation ** compilation)32 void OH_NNCompilation_Destroy(OH_NNCompilation **compilation) {}
33
OH_NNExecutor_Construct(OH_NNCompilation * compilation)34 OH_NNExecutor *OH_NNExecutor_Construct(OH_NNCompilation *compilation) {
35 return NULL;
36 }
37
OH_NNExecutor_Destroy(OH_NNExecutor ** executor)38 void OH_NNExecutor_Destroy(OH_NNExecutor **executor) {}
39
OH_NNCompilation_Construct(const OH_NNModel * model)40 OH_NNCompilation *OH_NNCompilation_Construct(const OH_NNModel *model) {
41 return NULL;
42 }
43
OH_NNDevice_GetAllDevicesID(const size_t ** allDevicesID,uint32_t * deviceCount)44 OH_NN_ReturnCode OH_NNDevice_GetAllDevicesID(const size_t **allDevicesID, uint32_t *deviceCount) {
45 return OH_NN_SUCCESS;
46 }
47
OH_NNExecutor_SetOutput(OH_NNExecutor * executor,uint32_t outputIndex,void * dataBuffer,size_t length)48 OH_NN_ReturnCode OH_NNExecutor_SetOutput(OH_NNExecutor *executor,
49 uint32_t outputIndex,
50 void *dataBuffer,
51 size_t length) {
52 return OH_NN_SUCCESS;
53 }
54
OH_NNCompilation_SetDevice(OH_NNCompilation * compilation,size_t deviceID)55 OH_NN_ReturnCode OH_NNCompilation_SetDevice(OH_NNCompilation *compilation, size_t deviceID) {
56 return OH_NN_SUCCESS;
57 }
58
OH_NNExecutor_SetInput(OH_NNExecutor * executor,uint32_t inputIndex,const OH_NN_Tensor * tensor,const void * dataBuffer,size_t length)59 OH_NN_ReturnCode OH_NNExecutor_SetInput(OH_NNExecutor *executor,
60 uint32_t inputIndex,
61 const OH_NN_Tensor *tensor,
62 const void *dataBuffer,
63 size_t length) {
64 return OH_NN_SUCCESS;
65 }
66
OH_NNModel_Destroy(OH_NNModel ** model)67 void OH_NNModel_Destroy(OH_NNModel **model) {}
68
OH_NNModel_GetAvailableOperations(OH_NNModel * model,size_t deviceID,const bool ** isSupported,uint32_t * opCount)69 OH_NN_ReturnCode OH_NNModel_GetAvailableOperations(OH_NNModel *model,
70 size_t deviceID,
71 const bool **isSupported,
72 uint32_t *opCount) {
73 return OH_NN_SUCCESS;
74 }
75
OH_NNModel_BuildFromLiteGraph(OH_NNModel * model,const void * liteGraph)76 OH_NN_ReturnCode OH_NNModel_BuildFromLiteGraph(OH_NNModel *model, const void *liteGraph) {
77 return OH_NN_SUCCESS;
78 }
79
OH_NNDevice_GetName(size_t deviceID,const char ** name)80 OH_NN_ReturnCode OH_NNDevice_GetName(size_t deviceID, const char **name) {
81 return OH_NN_SUCCESS;
82 }
83
OH_NNDevice_GetType(size_t deviceID,OH_NN_DeviceType * deviceType)84 OH_NN_ReturnCode OH_NNDevice_GetType(size_t deviceID, OH_NN_DeviceType *deviceType) {
85 return OH_NN_SUCCESS;
86 }
87
OH_NNCompilation_SetPriority(OH_NNCompilation * compilation,OH_NN_Priority priority)88 OH_NN_ReturnCode OH_NNCompilation_SetPriority(OH_NNCompilation *compilation, OH_NN_Priority priority) {
89 return OH_NN_SUCCESS;
90 }
91
OH_NNCompilation_EnableFloat16(OH_NNCompilation * compilation,bool enableFloat16)92 OH_NN_ReturnCode OH_NNCompilation_EnableFloat16(OH_NNCompilation *compilation, bool enableFloat16) {
93 return OH_NN_SUCCESS;
94 }
95
OH_NNCompilation_SetPerformanceMode(OH_NNCompilation * compilation,OH_NN_PerformanceMode performanceMode)96 OH_NN_ReturnCode OH_NNCompilation_SetPerformanceMode(OH_NNCompilation *compilation,
97 OH_NN_PerformanceMode performanceMode) {
98 return OH_NN_SUCCESS;
99 }
100