CUDART_PEER (3)
NAME
Peer Device Memory Access -Functions
cudaError_t cudaDeviceCanAccessPeer (int *canAccessPeer, int device, int peerDevice)
Queries if a device may directly access a peer device's memory.
cudaError_t cudaDeviceDisablePeerAccess (int peerDevice)
Disables direct access to memory allocations on a peer device.
cudaError_t cudaDeviceEnablePeerAccess (int peerDevice, unsigned int flags)
Enables direct access to memory allocations on a peer device.
Detailed Description
\brief peer device memory access functions of the CUDA runtime API (cuda_runtime_api.h)
This section describes the peer device memory access functions of the CUDA runtime application programming interface.
Function Documentation
cudaError_t cudaDeviceCanAccessPeer (int * canAccessPeer, int device, int peerDevice)
Returns in *canAccessPeer a value of 1 if device device is capable of directly accessing memory from peerDevice and 0 otherwise. If direct access of peerDevice from device is possible, then access may be enabled by calling cudaDeviceEnablePeerAccess().
Parameters:
-
canAccessPeer - Returned access capability
device - Device from which allocations on peerDevice are to be directly accessed.
peerDevice - Device on which the allocations to be directly accessed by device reside.
Returns:
- cudaSuccess, cudaErrorInvalidDevice
Note:
- Note that this function may also return error codes from previous, asynchronous launches.
See also:
- cudaDeviceEnablePeerAccess, cudaDeviceDisablePeerAccess
cudaError_t cudaDeviceDisablePeerAccess (int peerDevice)
Returns cudaErrorPeerAccessNotEnabled if direct access to memory on peerDevice has not yet been enabled from the current device.
Parameters:
- peerDevice - Peer device to disable direct access to
Returns:
- cudaSuccess, cudaErrorPeerAccessNotEnabled, cudaErrorInvalidDevice
Note:
- Note that this function may also return error codes from previous, asynchronous launches.
See also:
- cudaDeviceCanAccessPeer, cudaDeviceEnablePeerAccess
cudaError_t cudaDeviceEnablePeerAccess (int peerDevice, unsigned int flags)
On success, all allocations from peerDevice will immediately be accessible by the current device. They will remain accessible until access is explicitly disabled using cudaDeviceDisablePeerAccess() or either device is reset using cudaDeviceReset().
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.
Each device can support a system-wide maximum of eight peer connections.
Peer access is not supported in 32 bit applications.
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
Author
Generated automatically by Doxygen from the source code.