aclrtLaunchKernelWithHostArgs
Applicability
|
Product |
Supported |
|---|---|
|
Atlas 350 Accelerator Card |
√ |
|
|
√ |
|
|
√ |
|
|
√ |
|
|
√ |
|
|
√ |
Description
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 aclrtLaunchKernelWithHostArgs(aclrtFuncHandle funcHandle, uint32_t numBlocks, aclrtStream stream, aclrtLaunchKernelCfg *cfg, void *hostArgs, size_t argsSize, aclrtPlaceHolderInfo *placeHolderArray, size_t placeHolderNum) |
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 |
Configuration to be delivered by the task. For details about the type definition, see aclrtLaunchKernelCfg. If no configuration is specified, NULL can be passed. |
|
hostArgs |
Input |
Pointer to the host memory address that stores all input parameters of the kernel function. |
|
argsSize |
Input |
Size of the hostArgs parameter's value, in bytes. |
|
placeHolderArray |
Input |
placeholder parameter array. aclrtPlaceHolderInfo is defined as follows: typedef struct {
uint32_t addrOffset;
uint32_t dataOffset;
} aclrtPlaceHolderInfo;
The member variables are described as follows:
|
|
placeHolderNum |
Input |
Size of the placeholder parameter array. |
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 |
|---|---|---|---|
|
Specify the device memory address pointer for storing all input arguments of the kernel function. |
Device memory |
No |
|
|
Specify the device memory address pointer for storing all input arguments of the kernel function. |
Device memory |
Yes |
|
|
Specify the parameter list handle aclrtArgsHandle. |
Host memory |
Yes |
|
|
Specify the host memory address pointer for storing all input arguments of the kernel function. |
Host memory |
Yes |