Function rcudnn_sys::cudaIpcOpenMemHandle[][src]

pub unsafe extern "C" fn cudaIpcOpenMemHandle(
    devPtr: *mut *mut c_void,
    handle: cudaIpcMemHandle_t,
    flags: c_uint
) -> cudaError_t
Expand description

\brief Opens an interprocess memory handle exported from another process and returns a device pointer usable in the local process.

Maps memory exported from another process with ::cudaIpcGetMemHandle into the current device address space. For contexts on different devices ::cudaIpcOpenMemHandle can attempt to enable peer access between the devices as if the user called ::cudaDeviceEnablePeerAccess. This behavior is controlled by the ::cudaIpcMemLazyEnablePeerAccess flag. ::cudaDeviceCanAccessPeer can determine if a mapping is possible.

::cudaIpcOpenMemHandle can open handles to devices that may not be visible in the process calling the API.

Contexts that may open ::cudaIpcMemHandles are restricted in the following way. ::cudaIpcMemHandles from each device in a given process may only be opened by one context per device per other process.

If the memory handle has already been opened by the current context, the reference count on the handle is incremented by 1 and the existing device pointer is returned.

Memory returned from ::cudaIpcOpenMemHandle must be freed with ::cudaIpcCloseMemHandle.

Calling ::cudaFree on an exported memory region before calling ::cudaIpcCloseMemHandle in the importing context will result in undefined behavior.

IPC functionality is restricted to devices with support for unified addressing on Linux operating systems. IPC functionality is not supported on Tegra platforms.

\param devPtr - Returned device pointer \param handle - ::cudaIpcMemHandle to open \param flags - Flags for this operation. Must be specified as ::cudaIpcMemLazyEnablePeerAccess

\returns ::cudaSuccess, ::cudaErrorMapBufferObjectFailed, ::cudaErrorInvalidResourceHandle, ::cudaErrorDeviceUninitialized, ::cudaErrorTooManyPeers, ::cudaErrorNotSupported, ::cudaErrorInvalidValue \note_init_rt \note_callback

\note No guarantees are made about the address returned in \p *devPtr. In particular, multiple processes may not receive the same address for the same \p handle.

\sa ::cudaMalloc, ::cudaFree, ::cudaIpcGetEventHandle, ::cudaIpcOpenEventHandle, ::cudaIpcGetMemHandle, ::cudaIpcCloseMemHandle, ::cudaDeviceEnablePeerAccess, ::cudaDeviceCanAccessPeer, ::cuIpcOpenMemHandle