openharmony 鸿蒙 capi-types-h

2026-08-25 浏览 (1)

types.h

Overview

Provides the model file types and device types supported by MindSpore Lite.

File to include: <mindspore/types.h>

Library: libmindspore_lite_ndk.so

System capability: SystemCapability.Ai.MindSpore

Since: 9

Related module: MindSpore

Summary

Structs

Nametypedef KeywordDescription
NNRTDeviceDescNNRTDeviceDescDefines NNRt device information, including the device ID and device name.

Enums

Nametypedef KeywordDescription
OH_AI_ModelTypeOH_AI_ModelTypeDefines model file types.
OH_AI_DeviceTypeOH_AI_DeviceTypeDefines supported device types.
OH_AI_NNRTDeviceTypeOH_AI_NNRTDeviceTypeDefines NNRt device types.
OH_AI_PerformanceModeOH_AI_PerformanceModeDefines performance modes of the NNRt device.
OH_AI_PriorityOH_AI_PriorityDefines NNRt inference task priorities.
OH_AI_OptimizationLevelOH_AI_OptimizationLevelDefines training optimization levels.
OH_AI_QuantizationTypeOH_AI_QuantizationTypeDefines quantization types.

Enum Description

OH_AI_ModelType

enum OH_AI_ModelType

Description

Defines model file types.

Since: 9

Enum ItemDescription
OH_AI_MODELTYPE_MINDIR = 0Model type of MindIR. The extension of the model file name is .ms.
OH_AI_MODELTYPE_INVALID = 0xFFFFFFFFInvalid model type.

OH_AI_DeviceType

enum OH_AI_DeviceType

Description

Defines the supported device types.

Since: 9

Enum ItemDescription
OH_AI_DEVICETYPE_CPU = 0Device type: CPU.
OH_AI_DEVICETYPE_GPUDevice type: GPU (reserved).
OH_AI_DEVICETYPE_KIRIN_NPUDevice type: Kirin NPU (reserved).
OH_AI_DEVICETYPE_NNRT = 60Device type: NNRt
OH_AI_DEVICETYPE_INVALID = 100Invalid device type.

OH_AI_NNRTDeviceType

enum OH_AI_NNRTDeviceType

Description

Defines NNRt device types.

Since: 10

Enum ItemDescription
OH_AI_NNRTDEVICE_OTHERS = 0Others (any device type except the following three types).
OH_AI_NNRTDEVICE_CPU = 1CPU.
OH_AI_NNRTDEVICE_GPU = 2GPU.
OH_AI_NNRTDEVICE_ACCELERATOR = 3Specific acceleration device.

OH_AI_PerformanceMode

enum OH_AI_PerformanceMode

Description

Defines performance modes of the NNRt device.

Since: 10

Enum ItemDescription
OH_AI_PERFORMANCE_NONE = 0No special settings.
OH_AI_PERFORMANCE_LOW = 1Low power consumption.
OH_AI_PERFORMANCE_MEDIUM = 2Power consumption and performance balancing.
OH_AI_PERFORMANCE_HIGH = 3High performance.
OH_AI_PERFORMANCE_EXTREME = 4Ultimate performance.

OH_AI_Priority

enum OH_AI_Priority

Description

Defines NNRt inference task priorities.

Since: 10

Enum ItemDescription
OH_AI_PRIORITY_NONE = 0No priority preference.
OH_AI_PRIORITY_LOW = 1Low priority.
OH_AI_PRIORITY_MEDIUM = 2Medium priority.
OH_AI_PRIORITY_HIGH = 3High priority.

OH_AI_OptimizationLevel

enum OH_AI_OptimizationLevel

Description

Defines training optimization levels.

Since: 11

Enum ItemDescription
OH_AI_KO0 = 0No optimization level.
OH_AI_KO2 = 2Converts the precision type of the network to float16 and keeps the precision type of the batch normalization layer and loss function as float32.
OH_AI_KO3 = 3Converts the precision type of the network (including the batch normalization layer) to float16.
OH_AI_KAUTO = 4Selects an optimization level based on the device.
OH_AI_KOPTIMIZATIONTYPE = 0xFFFFFFFFInvalid optimization level.

OH_AI_QuantizationType

enum OH_AI_QuantizationType

Description

Defines quantization types.

Since: 11

Enum ItemDescription
OH_AI_NO_QUANT = 0No quantification.
OH_AI_WEIGHT_QUANT = 1Weight quantization.
OH_AI_FULL_QUANT = 2Full quantization.
OH_AI_UNKNOWN_QUANT_TYPE = 0xFFFFFFFFInvalid quantization type.

你可能感兴趣的鸿蒙文章

openharmony 鸿蒙 capi-format-h

openharmony 鸿蒙 capi-tensor-h

openharmony 鸿蒙 capi-context-h

openharmony 鸿蒙 capi-mindspore-oh-ai-callbackparam

openharmony 鸿蒙 capi-mindspore-oh-ai-shapeinfo

openharmony 鸿蒙 capi-mindspore-oh-ai-contexthandle

openharmony 鸿蒙 capi-mindspore-oh-ai-traincfghandle

openharmony 鸿蒙 capi-mindspore-oh-ai-allocatorhandle

openharmony 鸿蒙 js-apis-mindSporeLite

openharmony 鸿蒙 capi-mindspore-oh-ai-tensorHandle

  • 所属分类: 后端技术
  • 本文标签: 软件 鸿蒙
  • 版权声明: 本文链接 https://seaxiang.com/blog/zDvsMqSb