1 /*
2  * Copyright (C) 2023 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef OHOS_HDI_NNRT_V2_0_NNRTPREPAREMODELIMPL_H
17 #define OHOS_HDI_NNRT_V2_0_NNRTPREPAREMODELIMPL_H
18 #include "../../common/log.h"
19 
20 #include "v2_0/iprepared_model.h"
21 
22 namespace OHOS {
23 namespace HDI {
24 namespace Nnrt {
25 namespace V2_0 {
26 class NnrtPrepareModelImpl : public IPreparedModel {
27 public:
28     NnrtPrepareModelImpl() = default;
29     virtual ~NnrtPrepareModelImpl() = default;
30 
ExportModelCache(std::vector<SharedBuffer> & modelCache)31     int32_t ExportModelCache(std::vector<SharedBuffer>& modelCache)
32     {
33         LOGI("Export model cache.");
34         return NNRT_ReturnCode::NNRT_FAILED;
35     }
36 
GetInputDimRanges(std::vector<std::vector<uint32_t>> & minInputDims,std::vector<std::vector<uint32_t>> & maxInputDims)37     int32_t GetInputDimRanges(std::vector<std::vector<uint32_t>>& minInputDims,
38          std::vector<std::vector<uint32_t>>& maxInputDims)
39     {
40         LOGI("Get input dim ranges.");
41         return NNRT_ReturnCode::NNRT_FAILED;
42     }
43 
Run(const std::vector<IOTensor> & inputs,const std::vector<IOTensor> & outputs,std::vector<std::vector<int32_t>> & outputDims)44     int32_t Run(const std::vector<IOTensor>& inputs, const std::vector<IOTensor>& outputs,
45          std::vector<std::vector<int32_t>>& outputDims)
46     {
47         LOGI("Run prepare model.");
48         return NNRT_ReturnCode::NNRT_FAILED;
49     }
50 
GetVersion(uint32_t & majorVer,uint32_t & minorVer)51     int32_t GetVersion(uint32_t& majorVer, uint32_t& minorVer)
52     {
53         LOGI("Get version.");
54         return NNRT_ReturnCode::NNRT_FAILED;
55     }
56 };
57 } // V2_0
58 } // Nnrt
59 } // HDI
60 } // OHOS
61 
62 #endif // OHOS_HDI_NNRT_V2_0_NNRTPREPAREMODELIMPL_H