aclrtSetMemcpyDesc

Applicable Products

Product

Supported

Ascend 950PR/Ascend 950DT

√

Atlas A3 training products/Atlas A3 inference products

√

Atlas A2 training products/Atlas A2 inference products

√

Atlas 200I/500 A2 inference products

√

Atlas inference products

☓

Atlas training products

☓

Function

Sets the memory copy descriptor. After this API is called, the source address, destination address, and memory copy length are recorded in the memory copy descriptor.

This API must be used with other key APIs to implement memory copy. For details, see aclrtMemcpyAsyncWithDesc.

Prototype

1
aclError aclrtSetMemcpyDesc(void *desc, aclrtMemcpyKind kind, void *srcAddr, void *dstAddr, size_t count, void *config)

Parameters

Parameter

Input/Output

Description

desc

Output

Pointer to the memory copy descriptor.

Call aclrtGetMemcpyDescSize to obtain the memory size required by the memory descriptor, allocate device memory (for example, by calling aclrtMalloc), and pass the device memory address as an input of this parameter.

kind

Input

Memory copy kind. For details about the type definition, see aclrtMemcpyKind.

Currently, only ACL_MEMCPY_INNER_DEVICE_TO_DEVICE is supported, indicating memory copy within a device.

srcAddr

Input

Pointer to the source memory address.

The memory is allocated and managed by users.

dstAddr

Input

Pointer to the destination memory address.

The memory is allocated and managed by users.

count

Input

Size in bytes to copy.

config

Input

Reserved. The value is fixed at NULL.

Returns

0 on success; otherwise, failure. For details, see aclError.