函数:create_kernel
产品支持情况
产品 |
是否支持 |
---|---|
|
√ |
|
√ |
|
√ |
|
√ |
|
√ |
|
√ |
功能说明
动态Shape场景下,将算子注册到系统内部,运行算子时使用。
函数原型
- C函数原型
1 2 3 4 5 6 7
aclError aclopCreateKernel(const char *opType, const char *kernelId, const char *kernelName, void *binData, int binSize, aclopEngineType enginetype, aclDataDeallocator deallocator)
- python函数
1
ret = acl.op.create_kernel(op_type, kernel_id, kernel_name, bin_data, bin_size, enginetype, deallocator)
参数说明
参数名 |
说明 |
---|---|
op_type |
str,算子类型。 |
kernel_id |
str,算子执行时要指定的Kernel ID。 |
kernel_name |
str,算子Kernel名称,和算子二进制文件中的kernelName保持一致。 |
bin_data |
int,算子Kernel文件的内存地址。 |
bin_size |
int,算子Kernel文件的内存大小,单位为Byte。 |
enginetype |
int,表示算子执行引擎,该参数只有acl.op.update.params接口的“compile_flag”参数值为“ACL_COMPILE_SYS”时有效。
|
deallocator |
int,指定是否自动释放bin_data内存。
|
返回值说明
返回值 |
说明 |
---|---|
ret |
int,错误码,返回0表示成功,返回其它值表示失败。 |
父主题: 单算子模型执行