Function: set_kernel_args

C Prototype

aclError aclopSetKernelArgs(aclopKernelDesc *kernelDesc,

const char *kernelId,

uint32_t blockDim,

const void *args,

uint32_t argSize)

Python Function

ret = acl.op.set_kernel_args(kernel_desc, kernel_id, block_dim, args, arg_size)

Function Usage

Sets tiling arguments and number of blocks for concurrent execution in the dynamic shape scenario.

Input Description

kernel_desc: int, Kernel description buffer, pointer address of the aclopKernelDesc type.

kernel_id: str, kernel ID. It must be the same as that passed to the acl.op.create.kernel call.

block_dim: int, number of blocks for kernel concurrent execution.

bin_data: int, memory address of the operator kernel file.

bin_size: int, memory size of the operator kernel file, in bytes.

args: int, tiling parameter. Use the NumPy array tobytes to obtain the bytes object, and then call acl.utils.bytes_to_ptr() to obtain the tiling parameter pointer address.

arg_size: int, memory size of the tiling parameter, in bytes. It is the object length of bytes converted from numpy.tobytes() and can be obtained by using the len function.

Return Value

ret: int, error code.

Restrictions

None

Reference

For details about the API call sequence and example, see Single-Operator with Dynamic Shape (Operator Selector Registered).