aclrtDeviceEnablePeerAccess
Applicability
|
Product |
Supported |
|---|---|
|
Atlas 350 Accelerator Card |
√ |
|
|
√ |
|
|
√ |
|
|
☓ |
|
|
√ |
|
|
√ |
Description
Enables data exchange between the current device and a specified device. This API enables device-level data exchange.
Calling this API to enable data exchange between devices is unidirectional. For example, if the current device ID is 0 and aclrtDeviceEnablePeerAccess is called to specify device ID 1, only data exchange from device 0 to device 1 is feasible. To enable data exchange from device 1 to device 0, you need to switch the current device to device 1 and call aclrtDeviceEnablePeerAccess again to specify device ID 0. In this case, data exchange from device 1 to device 0 can be implemented.
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
1
|
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; otherwise, failure. For details, see aclError.
Restrictions
When your app runs on the Ctrl CPU on the device of the