Function: memcpy
Applicability
Product |
Supported |
|---|---|
Atlas 350 Accelerator Card |
√ |
√ |
|
√ |
|
√ |
|
√ |
|
√ |
Description
Copies memory.
Prototype
- C Prototype
1aclError aclrtMemcpy(void *dst, size_t destMax, const void *src, size_t count, aclrtMemcpyKind kind)
- Python Function
1ret = acl.rt.memcpy(dst, dest_max, src, count, kind)
Parameters
Parameter |
Description |
|---|---|
dst |
Int, pointer address of the destination memory address. |
destMax |
Int, memory size in bytes in the destination address |
src |
Int, pointer address of the source memory address. |
count |
Int, size in bytes to copy. |
kind |
Int, memory copy type, reserved. The enumerated values are invalid. The system determines whether the data from the source address can be copied to the destination address based on the pointer addresses of the source and destination memory addresses. If the data cannot be copied to the destination address, the system returns an error.
|
Return Value
Return Value |
Description |
|---|---|
ret |
Int, error code. 0 on success; else, failure. |
Restrictions
- This API copies the memory immediately. No implicit device synchronization or stream synchronization is performed within the function.
- To perform memory copy between two devices, call the acl.rt.device_can_access_peer API to query whether data exchange is supported between the two devices, call the acl.rt.device_enable_peer_access API to enable data exchange between the two devices, and then call this API to perform memory copy.
This restriction applies to the following models:
Atlas 350 Accelerator Card
Atlas A2 training product /Atlas A2 inference product Atlas inference product Atlas training product