This section describes the peer device memory access functions of the CUDA runtime application programming interface.
Returns in*canAccessPeer a value of 1 if devicedevice is capable of directly accessing memory frompeerDevice and 0 otherwise. If direct access ofpeerDevice fromdevice is possible, then access may be enabled by callingcudaDeviceEnablePeerAccess().
Note that this function may also return error codes from previous, asynchronous launches.
Note that this function may also returncudaErrorInitializationError,cudaErrorInsufficientDriver orcudaErrorNoDevice if this call tries to initialize internal CUDA RT state.
Note that as specified bycudaStreamAddCallback no CUDA function may be called from callback.cudaErrorNotPermitted may, but is not guaranteed to, be returned as a diagnostic in such case.
See also:
cudaDeviceEnablePeerAccess,cudaDeviceDisablePeerAccess,cuDeviceCanAccessPeer
ReturnscudaErrorPeerAccessNotEnabled if direct access to memory onpeerDevice has not yet been enabled from the current device.
Note that this function may also return error codes from previous, asynchronous launches.
Note that this function may also returncudaErrorInitializationError,cudaErrorInsufficientDriver orcudaErrorNoDevice if this call tries to initialize internal CUDA RT state.
Note that as specified bycudaStreamAddCallback no CUDA function may be called from callback.cudaErrorNotPermitted may, but is not guaranteed to, be returned as a diagnostic in such case.
See also:
cudaDeviceCanAccessPeer,cudaDeviceEnablePeerAccess,cuCtxDisablePeerAccess
On success, all allocations frompeerDevice will immediately be accessible by the current device. They will remain accessible until access is explicitly disabled usingcudaDeviceDisablePeerAccess() or either device is reset usingcudaDeviceReset().
Note that access granted by this call is unidirectional and that in order to access memory on the current device frompeerDevice, a separate symmetric call tocudaDeviceEnablePeerAccess() is required.
Note that there are both device-wide and system-wide limitations per system configuration, as noted in the CUDA Programming Guide under the section "Peer-to-Peer Memory Access".
ReturnscudaErrorInvalidDevice ifcudaDeviceCanAccessPeer() indicates that the current device cannot directly access memory frompeerDevice.
ReturnscudaErrorPeerAccessAlreadyEnabled if direct access ofpeerDevice from the current device has already been enabled.
ReturnscudaErrorInvalidValue ifflags is not 0.
Note that this function may also return error codes from previous, asynchronous launches.
Note that this function may also returncudaErrorInitializationError,cudaErrorInsufficientDriver orcudaErrorNoDevice if this call tries to initialize internal CUDA RT state.
Note that as specified bycudaStreamAddCallback no CUDA function may be called from callback.cudaErrorNotPermitted may, but is not guaranteed to, be returned as a diagnostic in such case.
See also:
cudaDeviceCanAccessPeer,cudaDeviceDisablePeerAccess,cuCtxEnablePeerAccess