Function cuCtxEnablePeerAccess

Source
pub unsafe extern "C" fn cuCtxEnablePeerAccess(
    peerContext: CUcontext,
    Flags: c_uint,
) -> CUresult
Expand description

\brief Enables direct access to memory allocations in a peer context.

If both the current context and \p peerContext are on devices which support unified addressing (as may be queried using ::CU_DEVICE_ATTRIBUTE_UNIFIED_ADDRESSING) and same major compute capability, then on success all allocations from \p peerContext will immediately be accessible by the current context. See \ref CUDA_UNIFIED for additional details.

Note that access granted by this call is unidirectional and that in order to access memory from the current context in \p peerContext, a separate symmetric call to ::cuCtxEnablePeerAccess() 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”.

Returns ::CUDA_ERROR_PEER_ACCESS_UNSUPPORTED if ::cuDeviceCanAccessPeer() indicates that the ::CUdevice of the current context cannot directly access memory from the ::CUdevice of \p peerContext.

Returns ::CUDA_ERROR_PEER_ACCESS_ALREADY_ENABLED if direct access of \p peerContext from the current context has already been enabled.

Returns ::CUDA_ERROR_TOO_MANY_PEERS if direct peer access is not possible because hardware resources required for peer access have been exhausted.

Returns ::CUDA_ERROR_INVALID_CONTEXT if there is no current context, \p peerContext is not a valid context, or if the current context is \p peerContext.

Returns ::CUDA_ERROR_INVALID_VALUE if \p Flags is not 0.

\param peerContext - Peer context to enable direct access to from the current context \param Flags - Reserved for future use and must be set to 0

\return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_PEER_ACCESS_ALREADY_ENABLED, ::CUDA_ERROR_TOO_MANY_PEERS, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_PEER_ACCESS_UNSUPPORTED, ::CUDA_ERROR_INVALID_VALUE \notefnerr

\sa ::cuDeviceCanAccessPeer, ::cuCtxDisablePeerAccess, ::cudaDeviceEnablePeerAccess