aclrtMemcpyAsyncWithDesc
Applicability
Product |
Supported |
|---|---|
√ |
|
√ |
|
√ |
|
☓ |
|
☓ |
Description
Copies memory using a memory copy descriptor (level-2 pointer mode). This API is asynchronous.
This API must be used together with the following APIs to implement memory copy:
- Call aclrtGetMemcpyDescSize to obtain the memory size required by the memory descriptor.
- Allocate the device memory for storing the memory descriptor.
- Allocate the source and destination memory for storing the data before and after the copy.
- Call aclrtSetMemcpyDesc to set the source and destination memory addresses in the memory descriptor.
- Call aclrtMemcpyAsyncWithDesc to implement memory copy.
Prototype
aclError aclrtMemcpyAsyncWithDesc(void *desc, aclrtMemcpyKind kind, aclrtStream stream)
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
desc |
Input |
Pointer to the memory copy descriptor address on the device. Call aclrtSetMemcpyDesc to set the memory copy descriptor, and then pass the pointer of the memory copy descriptor address as an input parameter. |
kind |
Input |
Memory copy type. Currently, only ACL_MEMCPY_INNER_DEVICE_TO_DEVICE is supported, indicating memory copy within a device. |
stream |
Input |
Stream for executing the memory copy task. |
Returns
0 on success; else, failure. For details, see aclError.