1/* 2 * Copyright (c) 2022 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 16package ohos.hdi.nnrt.v1_0; 17 18import ohos.hdi.nnrt.v1_0.NnrtTypes; 19import ohos.hdi.nnrt.v1_0.ModelTypes; 20import ohos.hdi.nnrt.v1_0.IPreparedModel; 21 22interface INnrtDevice { 23 GetDeviceName([out] String name); 24 GetVendorName([out] String name); 25 GetDeviceType([out] enum DeviceType deviceType); 26 GetDeviceStatus([out] enum DeviceStatus status); 27 GetSupportedOperation([in] struct Model model, [out] boolean[] ops); 28 IsFloat16PrecisionSupported([out] boolean isSupported); 29 IsPerformanceModeSupported([out] boolean isSupported); 30 IsPrioritySupported([out] boolean isSupported); 31 IsDynamicInputSupported([out] boolean isSupported); 32 PrepareModel([in] struct Model model, [in] struct ModelConfig config, [out] IPreparedModel preparedModel); 33 IsModelCacheSupported([out] boolean isSupported); 34 PrepareModelFromModelCache([in] struct SharedBuffer[] modelCache, [in] struct ModelConfig config, 35 [out] IPreparedModel preparedModel); 36 AllocateBuffer([in] unsigned int length, [out] struct SharedBuffer buffer); 37 ReleaseBuffer([in] struct SharedBuffer buffer); 38}