aclrtLaunchKernelV2

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product

Atlas 200I/500 A2 inference product

Atlas inference product

Atlas training product

Function

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

Prototype

1
aclError aclrtLaunchKernelV2(aclrtFuncHandle funcHandle, uint32_t numBlocks, const void *argsData, size_t argsSize, aclrtLaunchKernelCfg *cfg, aclrtStream stream)

Parameters

Parameter

Input/Output

Description

funcHandle

Input

Kernel function handle. For the type definition, see aclrtFuncHandle.

numBlocks

Input

Number of cores on which the kernel function will be executed.

argsData

Input

Pointer to the device memory address that stores all input arguments of the kernel function.

For the memory allocation API, see Memory Management.

The device that executes the task dispatched by this API must be the same as the device that contains the memory used by argsData.

argsSize

Input

Size of the argsData parameter's value, in bytes.

cfg

Input

Configuration to be delivered by the task. For the type definition, see aclrtLaunchKernelCfg.

If it is not specified, NULL can be passed.

stream

Input

Stream for executing the task. For the type definition, see aclrtStream.

Returns

0 on success; otherwise, failure. For details, see aclError.

Reference

All the APIs listed in the following table enable the compute tasks of the corresponding operators. However, their functions and usage modes are different.

API

How Kernel Function Parameter Values Are Passed

Where Kernel Function Parameter Values Are Stored

Configuration Customizable to Deliver

aclrtLaunchKernel

Specify the device memory address pointer for storing all input arguments of the kernel function.

Device memory

No

aclrtLaunchKernelV2

Specify the device memory address pointer for storing all input arguments of the kernel function.

Device memory

Yes

aclrtLaunchKernelWithConfig

Specify the parameter list handle aclrtArgsHandle.

Host memory

Yes

aclrtLaunchKernelWithHostArgs

Specify the host memory address pointer for storing all input arguments of the kernel function.

Host memory

Yes