aclrtDeviceEnablePeerAccess

Description

Enables memory copy between the current device and a specified device. This API is synchronous. This API enables device-level memory copy.

The Ascend 310 AI Processor does not support this API in the current version.

Restrictions

Call aclrtDeviceCanAccessPeer in advance to check whether memory copy is supported between the current device and the specified device. To disable memory copy between the devices, call aclrtDeviceDisablePeerAccess.

For the Ascend 310P AI Processor, when your app runs on device-side Ctrl CPU in open Ctrl CPU form, this API does not support memory copy between devices.

Prototype

aclError aclrtDeviceEnablePeerAccess(int32_t peerDeviceId, uint32_t flags)

Parameters

Parameter

Input/Output

Description

peerDeviceId

Input

Device ID, which must be different from the current device ID.

Must be in the range of [0, Device count – 1]. Call aclrtGetDeviceCount to obtain the device count.

flags

Input

This parameter is reserved and must be set to 0.

Returns

0 on success; else, failure.

See Also

For the API call example, see Inter-Device Data Transfer.