Function: launch_kernel_with_config

Applicable Products

Product

Supported (√/x)

Ascend 950PR/Ascend 950DT

√

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

√

Description

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

If you use this API to deliver a compute task of an AI Core operator, you need to use the acl.rt.binary_load_from_file API to load and parse the operator binary file.

Prototype

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

Parameters

Parameter

Description

func_handle

Int, kernel function handle.

num_blocks

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 Values

Return Value

Description

ret

Int, 0 on success; else, failure.