## 概述

PhonePC/2in1TabletTV

定义CANN Kit单算子接口，用于单算子的创建、计算以及Tensor和Buffer的管理。

**引用文件：** <CANNKit/hiai\_single\_op.h>

**库：** libhiai\_foundation.so

**系统能力：** SystemCapability.AI.HiAIFoundation

**起始版本：** 5.0.0(12)

**相关模块：** [CANN](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit)

## 汇总

PhonePC/2in1TabletTV

### 结构体

PhonePC/2in1TabletTV

展开

| 名称 | 描述 |
| --- | --- |
| struct [HiAISingleOpDescriptor\_ConvolutionParam](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit-sopdesc-convparam) | [HMS\_HiAISingleOpDescriptor\_CreateConvolution](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hms_hiaisingleopdescriptor_createconvolution)输入参数。 |
| struct [HiAI\_SingleOpExecutorConvolutionParam](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit-sopexec-convparam) | [HMS\_HiAISingleOpExecutor\_CreateConvolution](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hms_hiaisingleopexecutor_createconvolution)输入参数。 |
| struct [HiAI\_SingleOpExecutorFusedConvolutionActivationParam](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit-sopexec-fusedconv-actparam) | [HMS\_HiAISingleOpExecutor\_CreateFusedConvolutionActivation](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hms_hiaisingleopexecutor_createfusedconvolutionactivation)输入参数。 |

### 类型定义

PhonePC/2in1TabletTV

展开

| 名称 | 描述 |
| --- | --- |
| typedef struct [HiAI\_SingleOpTensorDesc](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleoptensordesc) [HiAI\_SingleOpTensorDesc](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleoptensordesc) | 单算子Tensor描述的句柄。 |
| typedef struct [HiAI\_SingleOpBuffer](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleopbuffer) [HiAI\_SingleOpBuffer](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleopbuffer) | 单算子Buffer句柄。 |
| typedef struct [HiAI\_SingleOpTensor](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleoptensor) [HiAI\_SingleOpTensor](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleoptensor) | 单算子Tensor句柄。 |
| typedef struct [HiAI\_SingleOpOptions](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleopoptions) [HiAI\_SingleOpOptions](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleopoptions) | 单算子选项句柄。 |
| typedef struct [HiAI\_SingleOpDescriptor](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleopdescriptor) [HiAI\_SingleOpDescriptor](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleopdescriptor) | 单算子的算子描述句柄。 |
| typedef struct [HiAISingleOpDescriptor\_ConvolutionParam](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit-sopdesc-convparam) | [HMS\_HiAISingleOpDescriptor\_CreateConvolution](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hms_hiaisingleopdescriptor_createconvolution)输入参数。 |
| typedef struct [HiAI\_SingleOpExecutorConvolutionParam](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit-sopexec-convparam) | [HMS\_HiAISingleOpExecutor\_CreateConvolution](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hms_hiaisingleopexecutor_createconvolution)输入参数。 |
| typedef struct [HiAI\_SingleOpExecutorFusedConvolutionActivationParam](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit-sopexec-fusedconv-actparam) | [HMS\_HiAISingleOpExecutor\_CreateFusedConvolutionActivation](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hms_hiaisingleopexecutor_createfusedconvolutionactivation)输入参数。 |
| typedef struct [HiAI\_SingleOpExecutor](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleopexecutor) [HiAI\_SingleOpExecutor](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleopexecutor) | 单算子执行器句柄。 |

### 枚举

PhonePC/2in1TabletTV

展开

| 名称 | 描述 |
| --- | --- |
| [HiAI\_SingleOpDataType](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleopdatatype) {  HIAI\_SINGLEOP\_DT\_FLOAT = 0,  HIAI\_SINGLEOP\_DT\_FLOAT16 = 1,  HIAI\_SINGLEOP\_DT\_UNDEFINED = 17  } | 单算子张量数据类型枚举。 |
| [HiAI\_SingleOpFormat](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleopformat) {  HIAI\_SINGLEOP\_FORMAT\_NCHW = 0,  HIAI\_SINGLEOP\_FORMAT\_NHWC = 1,  HIAI\_SINGLEOP\_FORMAT\_ND = 2,  HIAI\_SINGLEOP\_FORMAT\_NC1HWC0 = 3,  HIAI\_SINGLEOP\_FORMAT\_NC4HW4 = 28,  HIAI\_SINGLEOP\_FORMAT\_NC8HW8 = 31,  HIAI\_SINGLEOP\_FORMAT\_RESERVED = 255  } | 单算子张量排布格式枚举。 |
| [HiAI\_SingleOpConvMode](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleopconvmode) {  HIAI\_SINGLEOP\_CONV\_MODE\_COMMON = 0,  HIAI\_SINGLEOP\_CONV\_MODE\_TRANSPOSED = 1,  HIAI\_SINGLEOP\_CONV\_MODE\_DEPTHWISE = 2  } | 单算子卷积模式枚举。 |
| [HiAI\_SingleOpPadMode](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleoppadmode) {  HIAI\_SINGLEOP\_PAD\_MODE\_SPECIFIC = 0,  HIAI\_SINGLEOP\_PAD\_MODE\_SAME = 1,  HIAI\_SINGLEOP\_PAD\_MODE\_SAME\_UPPER = 2,  HIAI\_SINGLEOP\_PAD\_MODE\_SAME\_LOWER = 3,  HIAI\_SINGLEOP\_PAD\_MODE\_VALID = 4  } | 单算子填充模式枚举。 |
| [HiAI\_SingleOpActivationType](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleopactivationtype) {  HIAI\_SINGLEOP\_ACTIVATION\_TYPE\_RELU = 0,  HIAI\_SINGLEOP\_ACTIVATION\_TYPE\_RELU6 = 1  } | 单算子激活模式枚举。 |
| [HiAI\_SingleOpSupportStatus](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleopsupportstatus) {  HIAI\_SINGLEOP\_OPTIMIZED = 0,  HIAI\_SINGLEOP\_COMMON = 1,  HIAI\_SINGLEOP\_UNSUPPORTED = 2  } | 单算子支持状态枚举。 |

### 函数

PhonePC/2in1TabletTV

展开

| 名称 | 描述 |
| --- | --- |
| [HiAI\_SingleOpTensorDesc](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleoptensordesc) \* [HMS\_HiAISingleOpTensorDesc\_Create](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hms_hiaisingleoptensordesc_create) (const int64\_t \*dims, size\_t dimNum, [HiAI\_SingleOpDataType](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleopdatatype) dataType, [HiAI\_SingleOpFormat](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleopformat) format, bool isVirtual) | 创建[HiAI\_SingleOpTensorDesc](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleoptensordesc)对象。 |
| size\_t [HMS\_HiAISingleOpTensorDesc\_GetDimensionCount](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hms_hiaisingleoptensordesc_getdimensioncount) (const [HiAI\_SingleOpTensorDesc](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleoptensordesc) \*tensorDesc) | 查询[HiAI\_SingleOpTensorDesc](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleoptensordesc)的维度数量。 |
| int64\_t [HMS\_HiAISingleOpTensorDesc\_GetDimension](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hms_hiaisingleoptensordesc_getdimension) (const [HiAI\_SingleOpTensorDesc](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleoptensordesc) \*tensorDesc, size\_t index) | 查询[HiAI\_SingleOpTensorDesc](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleoptensordesc)指定索引的维度长度。 |
| [HiAI\_SingleOpDataType](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleopdatatype) [HMS\_HiAISingleOpTensorDesc\_GetDataType](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hms_hiaisingleoptensordesc_getdatatype) (const [HiAI\_SingleOpTensorDesc](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleoptensordesc) \*tensorDesc) | 查询[HiAI\_SingleOpTensorDesc](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleoptensordesc)的数据类型。 |
| [HiAI\_SingleOpFormat](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleopformat) [HMS\_HiAISingleOpTensorDesc\_GetFormat](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hms_hiaisingleoptensordesc_getformat) (const [HiAI\_SingleOpTensorDesc](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleoptensordesc) \*tensorDesc) | 查询[HiAI\_SingleOpTensorDesc](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleoptensordesc)的排布格式。 |
| bool [HMS\_HiAISingleOpTensorDesc\_IsVirtual](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hms_hiaisingleoptensordesc_isvirtual) (const [HiAI\_SingleOpTensorDesc](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleoptensordesc) \*tensorDesc) | 查询[HiAI\_SingleOpTensorDesc](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleoptensordesc)是否为虚拟张量。 |
| size\_t [HMS\_HiAISingleOpTensorDesc\_GetByteSize](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hms_hiaisingleoptensordesc_getbytesize) (const [HiAI\_SingleOpTensorDesc](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleoptensordesc) \*tensorDesc) | 查询基于[HiAI\_SingleOpTensorDesc](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleoptensordesc)的维度和数据类型计算的数据占用字节数。 |
| void [HMS\_HiAISingleOpTensorDesc\_Destroy](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hms_hiaisingleoptensordesc_destroy) ([HiAI\_SingleOpTensorDesc](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleoptensordesc) \*\*tensorDesc) | 释放[HiAI\_SingleOpTensorDesc](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleoptensordesc)对象。 |
| [HiAI\_SingleOpBuffer](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleopbuffer) \* [HMS\_HiAISingleOpBuffer\_Create](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hms_hiaisingleopbuffer_create) (size\_t dataSize) | 按照指定的内存大小创建[HiAI\_SingleOpBuffer](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleopbuffer)对象。 |
| size\_t [HMS\_HiAISingleOpBuffer\_GetSize](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hms_hiaisingleopbuffer_getsize) (const [HiAI\_SingleOpBuffer](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleopbuffer) \*buffer) | 查询[HiAI\_SingleOpBuffer](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleopbuffer)的字节大小。 |
| void \* [HMS\_HiAISingleOpBuffer\_GetData](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hms_hiaisingleopbuffer_getdata) (const [HiAI\_SingleOpBuffer](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleopbuffer) \*buffer) | 查询[HiAI\_SingleOpBuffer](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleopbuffer)的内存地址。 |
| OH\_NN\_ReturnCode [HMS\_HiAISingleOpBuffer\_Destroy](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hms_hiaisingleopbuffer_destroy) ([HiAI\_SingleOpBuffer](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleopbuffer) \*\*buffer) | 释放[HiAI\_SingleOpBuffer](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleopbuffer)对象。 |
| [HiAI\_SingleOpTensor](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleoptensor) \* [HMS\_HiAISingleOpTensor\_CreateFromTensorDesc](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hms_hiaisingleoptensor_createfromtensordesc) (const [HiAI\_SingleOpTensorDesc](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleoptensordesc) \*desc) | 根据[HiAI\_SingleOpTensorDesc](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleoptensordesc)创建[HiAI\_SingleOpTensor](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleoptensor)对象。 |
| [HiAI\_SingleOpTensor](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleoptensor) \* [HMS\_HiAISingleOpTensor\_CreateFromSingleOpBuffer](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hms_hiaisingleoptensor_createfromsingleopbuffer) (const [HiAI\_SingleOpTensorDesc](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleoptensordesc) \*desc, void \*data, size\_t dataSize) | 根据[HiAI\_SingleOpTensorDesc](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleoptensordesc)、[HiAI\_SingleOpBuffer](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleopbuffer)的内存地址和数据大小创建[HiAI\_SingleOpTensor](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleoptensor)对象。 |
| [HiAI\_SingleOpTensor](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleoptensor) \* [HMS\_HiAISingleOpTensor\_CreateFromConst](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hms_hiaisingleoptensor_createfromconst) (const [HiAI\_SingleOpTensorDesc](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleoptensordesc) \*desc, void \*data, size\_t dataSize) | 根据[HiAI\_SingleOpTensorDesc](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleoptensordesc)、常量数据（如卷积权重、偏置等）的内存地址和数据大小创建[HiAI\_SingleOpTensor](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleoptensor)对象。 |
| [HiAI\_SingleOpTensorDesc](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleoptensordesc) \* [HMS\_HiAISingleOpTensor\_GetTensorDesc](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hms_hiaisingleoptensor_gettensordesc) (const [HiAI\_SingleOpTensor](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleoptensor) \*tensor) | 获取[HiAI\_SingleOpTensor](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleoptensor)的Tensor描述。 |
| [HiAI\_SingleOpBuffer](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleopbuffer) \* [HMS\_HiAISingleOpTensor\_GetBuffer](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hms_hiaisingleoptensor_getbuffer) (const [HiAI\_SingleOpTensor](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleoptensor) \*tensor) | 获取[HiAI\_SingleOpTensor](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleoptensor)的Buffer。 |
| OH\_NN\_ReturnCode [HMS\_HiAISingleOpTensor\_Destroy](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hms_hiaisingleoptensor_destroy) ([HiAI\_SingleOpTensor](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleoptensor) \*\*tensor) | 释放[HiAI\_SingleOpTensor](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleoptensor)对象。 |
| [HiAI\_SingleOpOptions](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleopoptions) \* [HMS\_HiAISingleOpOptions\_Create](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hms_hiaisingleopoptions_create) (void) | 创建[HiAI\_SingleOpOptions](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleopoptions)对象。 |
| void [HMS\_HiAISingleOpOptions\_Destroy](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hms_hiaisingleopoptions_destroy) ([HiAI\_SingleOpOptions](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleopoptions) \*\*options) | 释放[HiAI\_SingleOpOptions](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleopoptions)对象。 |
| [HiAI\_SingleOpDescriptor](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleopdescriptor) \* [HMS\_HiAISingleOpDescriptor\_CreateConvolution](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hms_hiaisingleopdescriptor_createconvolution) ([HiAISingleOpDescriptor\_ConvolutionParam](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit-sopdesc-convparam) param) | 创建卷积类（普通卷积、转置卷积、深度卷积）的描述符对象。 |
| [HiAI\_SingleOpDescriptor](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleopdescriptor) \* [HMS\_HiAISingleOpDescriptor\_CreateActivation](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hms_hiaisingleopdescriptor_createactivation) ([HiAI\_SingleOpActivationType](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleopactivationtype) activationType, float coef) | 创建激活函数类的描述符对象。 |
| void [HMS\_HiAISingleOpDescriptor\_Destroy](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hms_hiaisingleopdescriptor_destroy) ([HiAI\_SingleOpDescriptor](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleopdescriptor) \*\*opDesc) | 释放[HiAI\_SingleOpDescriptor](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleopdescriptor)对象。 |
| [HiAI\_SingleOpSupportStatus](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleopsupportstatus) [HMS\_HiAISingleOpExecutor\_PreCheckConvolution](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hms_hiaisingleopexecutor_precheckconvolution) ([HiAI\_SingleOpExecutorConvolutionParam](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit-sopexec-convparam) param) | 预查询卷积算子的支持状态。 |
| [HiAI\_SingleOpSupportStatus](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleopsupportstatus) [HMS\_HiAISingleOpExecutor\_PreCheckFusedConvolutionActivation](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hms_hiaisingleopexecutor_precheckfusedconvolutionactivation) ([HiAI\_SingleOpExecutorFusedConvolutionActivationParam](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit-sopexec-fusedconv-actparam) param) | 预查询卷积和激活融合算子的支持状态。 |
| [HiAI\_SingleOpExecutor](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleopexecutor) \* [HMS\_HiAISingleOpExecutor\_CreateConvolution](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hms_hiaisingleopexecutor_createconvolution) ([HiAI\_SingleOpExecutorConvolutionParam](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit-sopexec-convparam) param) | 创建卷积类算子对应的[HiAI\_SingleOpExecutor](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleopexecutor)对象。 |
| [HiAI\_SingleOpExecutor](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleopexecutor) \* [HMS\_HiAISingleOpExecutor\_CreateFusedConvolutionActivation](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hms_hiaisingleopexecutor_createfusedconvolutionactivation) ([HiAI\_SingleOpExecutorFusedConvolutionActivationParam](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit-sopexec-fusedconv-actparam) param) | 创建卷积和激活融合算子对应的[HiAI\_SingleOpExecutor](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleopexecutor)对象。 |
| OH\_NN\_ReturnCode [HMS\_HiAISingleOpExecutor\_UpdateOutputTensorDesc](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hms_hiaisingleopexecutor_updateoutputtensordesc) (const [HiAI\_SingleOpExecutor](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleopexecutor) \*executor, uint32\_t index, [HiAI\_SingleOpTensorDesc](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleoptensordesc) \*output) | 更新[HiAI\_SingleOpExecutor](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleopexecutor)的输出tensor描述。 |
| size\_t [HMS\_HiAISingleOpExecutor\_GetWorkspaceSize](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hms_hiaisingleopexecutor_getworkspacesize) (const [HiAI\_SingleOpExecutor](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleopexecutor) \*executor) | 查询[HiAI\_SingleOpExecutor](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleopexecutor)所需的ION内存工作空间的字节大小。 |
| OH\_NN\_ReturnCode [HMS\_HiAISingleOpExecutor\_Init](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hms_hiaisingleopexecutor_init) ([HiAI\_SingleOpExecutor](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleopexecutor) \*executor, void \*workspace, size\_t workspaceSize) | 加载[HiAI\_SingleOpExecutor](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleopexecutor)。 |
| OH\_NN\_ReturnCode [HMS\_HiAISingleOpExecutor\_Execute](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hms_hiaisingleopexecutor_execute) ([HiAI\_SingleOpExecutor](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleopexecutor) \*executor, [HiAI\_SingleOpTensor](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleoptensor) \*input[], int32\_t inputNum, [HiAI\_SingleOpTensor](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleoptensor) \*output[], int32\_t outputNum) | 执行同步运算推理。 |
| OH\_NN\_ReturnCode [HMS\_HiAISingleOpExecutor\_Destroy](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hms_hiaisingleopexecutor_destroy) ([HiAI\_SingleOpExecutor](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleopexecutor) \*\*executor) | 销毁[HiAI\_SingleOpExecutor](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/cannkit#hiai_singleopexecutor)对象，释放执行器占用的内存。 |