Function: set_kernel_args

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product / Atlas A3 inference product

Atlas A2 training product / Atlas A2 inference product

Atlas training product

Atlas inference product

Atlas 200I/500 A2 inference product

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)
    

Parameters

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.

Returns

Return Value

Description

ret

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