aclrtLaunchKernelWithConfig
Applicable Products
Product |
Supported |
|---|---|
√ |
|
√ |
|
√ |
|
√ |
|
√ |
|
√ |
Function
Configures the compute task of an operator and starts the task. This is an asynchronous API.
When calling this API to deliver the compute task of an AI Core operator, call aclrtBinaryLoadFromFile to load and parse the operator binary file.
Prototype
1 | aclError aclrtLaunchKernelWithConfig(aclrtFuncHandle funcHandle, uint32_t numBlocks, aclrtStream stream, aclrtLaunchKernelCfg *cfg, aclrtArgsHandle argsHandle, void *reserve) |
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
funcHandle |
Input |
Kernel function handle. For details about the type definition, see aclrtFuncHandle. |
numBlocks |
Input |
Number of cores on which the kernel function will be executed. |
stream |
Input |
Stream for executing the task. For details about the type definition, see aclrtStream. |
cfg |
Input |
Task configuration. For details about the type definition, see aclrtLaunchKernelCfg. If no configuration is specified, NULL can be passed. |
argsHandle |
Input |
Handle to the parameter list. For details about the type definition, see aclrtArgsHandle. |
reserve |
Input |
Reserved. Currently, the value is fixed at NULL. |
Returns
0 on success; otherwise, failure. For details, see aclError.
Reference
All the APIs listed in the table below can start the compute task of an operator. However, their functions and usage methods are different.
API |
How Kernel Function Parameter Values Are Passed |
Where Kernel Function Parameter Values Are Stored |
Task Configurable |
|---|---|---|---|
Specify the pointer to the device memory address that stores all input parameters of the kernel function. |
Device memory |
No |
|
Specify the pointer to the device memory address that stores all input parameters of the kernel function. |
Device memory |
Yes |
|
Specify the parameter list handle aclrtArgsHandle. |
Host memory |
Yes |
|
Specify the pointer to the host memory address that stores all input parameters of the kernel function. |
Host memory |
Yes |
|
Specify the parameter array that stores all input parameters of the kernel function. Each element in the array points to the data of a kernel function parameter. |
Host memory |
Yes |