Function: launch_kernel_with_config

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

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 Value

Return Value

Description

ret

Int, 0 on success; else, failure.