aclrtMemcpy2d
Applicable Products
|
Product |
Supported |
|---|---|
|
|
√ |
|
|
√ |
|
|
√ |
|
|
√ |
|
|
√ |
|
|
√ |
Function
Implements synchronous memory copy, which is mainly used for matrix data replication.
Prototype
1
|
aclError aclrtMemcpy2d(void *dst, size_t dpitch, const void *src, size_t spitch, size_t width, size_t height, aclrtMemcpyKind kind) |
Parameters
|
Parameter |
Input/Output |
Description |
|---|---|---|
|
dst |
Input |
Pointer to the destination memory address. |
|
dpitch |
Input |
Address distance between two adjacent columns of vectors in the destination memory. |
|
src |
Input |
Pointer to the source memory address. |
|
spitch |
Input |
Address distance between two adjacent columns of vectors in the source memory. |
|
width |
Input |
Width of the data to be copied. |
|
height |
Input |
Height of the data to be copied. |
|
kind |
Input |
Memory copy kind. For details about the type definition, see aclrtMemcpyKind. |
Returns
0 on success; otherwise, failure. For details, see aclError.
Restrictions
- Currently, only memory copy of the ACL_MEMCPY_HOST_TO_DEVICE and ACL_MEMCPY_DEVICE_TO_HOST types is supported.
Atlas inference products in Open Ctrl CPU form: This API is not supported.Atlas inference accelerator module : This API is not supported.Atlas 200I/500 A2 inference products in Ascend RC form: This API is not supported.
Reference
The following figure shows the memory copy of this API.
