Function: set_kernel_args

Applicability

Product

Supported (√/x)

Atlas A3 training products / Atlas A3 inference products

Atlas A2 training products / Atlas A2 inference products

Atlas training products

Atlas inference products

Atlas 200I/500 A2 inference products

Function Usage

Sets tiling arguments and number of concurrency times of a dynamic-shape operator.

Prototype

  • C Prototype
    1
    2
    3
    4
    5
    aclError aclopSetKernelArgs(aclopKernelDesc *kernelDesc,
    const char *kernelId,
    uint32_t blockDim,
    const void *args,
    uint32_t argSize)
    
  • Python Function
    1
    ret = acl.op.set_kernel_args(kernel_desc, kernel_id, block_dim, args, arg_size)
    

Parameter Description

Parameter

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.

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 Description

Return Value

Description

ret

Int, error code: 0 on success; else, failure.

Reference

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