---
title: aclopCreateKernel
description: "动态Shape场景下，将算子注册到系统内部，运行算子时使用。"
url: https://www.hiascend.com/document/detail/zh/Atlas200IDKA2DeveloperKit/latest/Application%20Development%20Guide/aadgc/aclcppdevg_03_0619.html
sourcePath: /source/zh/Atlas200IDKA2DeveloperKit/23.0.RC2/Application Development Guide/aadgc/aclcppdevg_03_0619.html
indexId: 88981363e91906df505dbcb07a78f4a7df924f9ea585bd0d3b56edc3e6d414d6105
---
# aclopCreateKernel

#### 函数功能

动态Shape场景下，将算子注册到系统内部，运行算子时使用。


#### 函数原型

aclError aclopCreateKernel(const char *opType,

const char *kernelId,

const char *kernelName,

void *binData,

int binSize,

aclopEngineType enginetype,

aclDataDeallocator deallocator)


#### 参数说明

| 参数名 | 输入/输出 | 说明 |
| --- | --- | --- |
| opType | 输入 | 算子类型的指针。 |
| kernelId | 输入 | 算子执行时要指定的Kernel ID的指针。 |
| kernelName | 输入 | 算子Kernel名称的指针，和算子二进制文件中的kernelName保持一致。 |
| binData | 输入 | 算子Kernel文件的内存地址指针。 |
| binSize | 输入 | 算子Kernel文件的内存大小，单位为Byte。 |
| enginetype | 输入 | 表示算子执行引擎。 typedef enum aclEngineType { ACL\_ENGINE\_SYS, //不关心具体执行引擎时填写 ACL\_ENGINE\_AICORE, //将算子编译成AI Core算子 ACL\_ENGINE\_VECTOR, //将算子编译成Vector Core算子 } aclopEngineType; |
| deallocator | 输入 | 释放binData内存的回调函数，调用者根据binData的构造方法设置对应的释放函数。如果数据由调用者释放则设置为空。 函数签名为： typedef void (\*aclDataDeallocator)(void \*data, size\_t length); |


#### 返回值说明

返回0表示成功，返回其它值表示失败。
