Enables registering memory on peerDevice
for direct access from the current device. On success, allocations on peerDevice
may be registered for access from the current device using cudaPeerRegister(). Registering peer memory will be possible until it is explicitly disabled using cudaDeviceDisablePeerAccess(), or either the current device or peerDevice
is reset using cudaDeviceReset().
If both the current device and peerDevice
support unified addressing then all allocations from peerDevice
will immediately be accessible by the current device upon success. In this case, explicitly sharing allocations using cudaPeerRegister() is not necessary.
Note that access granted by this call is unidirectional and that in order to access memory on the current device from peerDevice
, a separate symmetric call to cudaDeviceEnablePeerAccess() is required.
Returns cudaErrorInvalidDevice if cudaDeviceCanAccessPeer() indicates that the current device cannot directly access memory from peerDevice
.
Returns cudaErrorPeerAccessAlreadyEnabled if direct access of peerDevice
from the current device has already been enabled.
Returns cudaErrorInvalidValue if flags
is not 0.
- Parameters:
-
| peerDevice | - Peer device to enable direct access to from the current device |
| flags | - Reserved for future use and must be set to 0 |
- Returns:
- cudaSuccess, cudaErrorInvalidDevice cudaErrorPeerAccessAlreadyEnabled, cudaErrorInvalidValue
- Note:
- Note that this function may also return error codes from previous, asynchronous launches.
- See also:
- cudaDeviceCanAccessPeer, cudaDeviceDisablePeerAccess