/* * Copyright (c) 2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ohos.hdi.nnrt.v1_0; import ohos.hdi.nnrt.v1_0.NnrtTypes; import ohos.hdi.nnrt.v1_0.ModelTypes; import ohos.hdi.nnrt.v1_0.IPreparedModel; interface INnrtDevice { GetDeviceName([out] String name); GetVendorName([out] String name); GetDeviceType([out] enum DeviceType deviceType); GetDeviceStatus([out] enum DeviceStatus status); GetSupportedOperation([in] struct Model model, [out] boolean[] ops); IsFloat16PrecisionSupported([out] boolean isSupported); IsPerformanceModeSupported([out] boolean isSupported); IsPrioritySupported([out] boolean isSupported); IsDynamicInputSupported([out] boolean isSupported); PrepareModel([in] struct Model model, [in] struct ModelConfig config, [out] IPreparedModel preparedModel); IsModelCacheSupported([out] boolean isSupported); PrepareModelFromModelCache([in] struct SharedBuffer[] modelCache, [in] struct ModelConfig config, [out] IPreparedModel preparedModel); AllocateBuffer([in] unsigned int length, [out] struct SharedBuffer buffer); ReleaseBuffer([in] struct SharedBuffer buffer); }