aclrtMemcpy
Applicability
|
Product |
Supported |
|---|---|
|
|
√ |
|
|
√ |
|
|
√ |
|
|
√ |
|
|
√ |
Description
Copies memory.
Prototype
aclError aclrtMemcpy(void *dst, size_t destMax, const void *src, size_t count, aclrtMemcpyKind kind)
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, reserved. If the configured enum value is invalid, the system determines whether to copy data from the source address to the destination address based on the source and destination memory address pointers. If no, the system returns an error message. |
Returns
0 on success; else, failure. For details, see aclError.
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 aclrtDeviceCanAccessPeer to query whether inter-device data exchange is supported, call aclrtDeviceEnablePeerAccess to enable inter-device data exchange, and then call this API to perform memory copy.
This restriction applies to the following models:
Atlas A2 training products /Atlas A2 inference products Atlas inference products Atlas training products