Function: launch_kernel_with_config

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

Specifies the configuration to be delivered by a task and starts the compute task of the corresponding operator. This API is asynchronous.

When calling this API to deliver the compute task of an AI Core operator, call acl.rt.binary_load_from_file to load and parse the operator binary file.

Prototype

  • C Prototype
    1
    aclError aclrtLaunchKernelWithConfig(aclrtFuncHandle funcHandle, uint32_t blockDim, aclrtStream stream, aclrtLaunchKernelCfg *cfg, aclrtArgsHandle argsHandle, void *reserve)
    
  • Python Function
    1
    ret = acl.rt.launch_kernel_with_config(func_handle, block_dim, stream, cfg, args_handle, reserve)
    

Parameter Description

Parameter

Description

func_handle

Int, kernel function handle.

block_dim

Int, number of cores on which the kernel function will be executed.

stream

Int, stream for executing the task.

cfg

List, configuration to be delivered by the task. If no configuration is specified, an empty list is allowed. The data type of each element in the list is dictionary. For details, see aclrtLaunchKernelCfg.

args_handle

Int, handle of the parameter list.

reserve

Int, reserved parameter. Currently, the value is fixed at 0.

Return Value Description

Return Value

Description

ret

Int, 0 on success; else, failure.