pub unsafe extern "C" fn hipIpcOpenMemHandle(
devPtr: *mut *mut c_void,
handle: hipIpcMemHandle_t,
flags: c_uint,
) -> hipError_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 hipIpcGetMemHandle into the current device address space. For contexts on different devices hipIpcOpenMemHandle can attempt to enable peer access between the devices as if the user called hipDeviceEnablePeerAccess. This behavior is controlled by the hipIpcMemLazyEnablePeerAccess flag. hipDeviceCanAccessPeer can determine if a mapping is possible.
Contexts that may open hipIpcMemHandles are restricted in the following way. hipIpcMemHandles from each device in a given process may only be opened by one context per device per other process.
Memory returned from hipIpcOpenMemHandle must be freed with hipIpcCloseMemHandle.
Calling hipFree on an exported memory region before calling hipIpcCloseMemHandle in the importing context will result in undefined behavior.
@param devPtr - Returned device pointer @param handle - hipIpcMemHandle to open @param flags - Flags for this operation. Must be specified as hipIpcMemLazyEnablePeerAccess
@returns #hipSuccess, #hipErrorInvalidValue, #hipErrorInvalidContext, #hipErrorInvalidDevicePointer
@note During multiple processes, using the same memory handle opened by the current context, there is no guarantee that the same device poiter will be returned in @p *devPtr. This is diffrent from CUDA. @note This IPC memory related feature API on Windows may behave differently from Linux.