aclrtMemcpyAsync
Applicability
|
Product |
Supported |
|---|---|
|
|
√ |
|
|
√ |
|
|
√ |
|
|
√ |
|
|
√ |
Description
Copies memory.
The host memory in this API can be page-locked memory (for example, the memory allocated by the aclrtMallocHost API) or non-page-locked memory (allocated by the malloc API). If the host memory is page-locked memory, this API is asynchronous. A successful API call indicates that the task is delivered, not executed. After this API is called, call the synchronization API (for example, aclrtSynchronizeStream) to ensure that the memory copy task is complete. If the host memory is non-page-locked memory, this API returns only after the memory copy task is complete.
Prototype
aclError aclrtMemcpyAsync(void *dst, size_t destMax, const void *src, size_t count, aclrtMemcpyKind kind, aclrtStream stream)
Parameters
|
Parameter |
Input/Output |
Description |
|---|---|---|
|
dst |
Input |
Pointer to the destination memory address. |
|
destMax |
Input |
Memory size in bytes in the destination address. |
|
src |
Input |
Pointer to the source memory address. |
|
count |
Input |
Size in bytes to copy. |
|
kind |
Input |
Memory copy kind. |
|
stream |
Input |
Stream for executing the memory copy task. |
Returns
0 on success; else, failure. For details, see aclError.
Restrictions
|
Model |
Restrictions |
|---|---|
|
|
|
|
|
|
|
|
This API does not support asynchronous memory copy within the host. If the input kind is ACL_MEMCPY_HOST_TO_HOST, the API returns the error message "ACL_ERROR_RT_FEATURE_NOT_SUPPORT". |