aclrtDeviceEnablePeerAccess

Applicability

Product

Supported

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

Description

Enables data exchange between the current device and a specified device. This API enables device-level data exchange.

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

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. For details, see aclError.

See Also

For the API call example, see Data Transfer Between Devices.