hipipcopenmemhandle Interface Reference

hipipcopenmemhandle Interface Reference#

HIPFORT API Reference: hipfort::hipipcopenmemhandle Interface Reference
hipfort::hipipcopenmemhandle Interface Reference

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

Public Member Functions

integer(kind(hipsuccess)) function hipipcopenmemhandle_ (devPtr, handle, flags)
 

Detailed Description

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.

Parameters
devPtr- Returned device pointer
handle- hipIpcMemHandle to open
flags- Flags for this operation. Must be specified as hipIpcMemLazyEnablePeerAccess
Returns
hipSuccess, hipErrorMapFailed, hipErrorInvalidHandle, hipErrorTooManyPeers
Note
No guarantees are made about the address returned in *devPtr. In particular, multiple processes may not receive the same address for the same handle.

Member Function/Subroutine Documentation

◆ hipipcopenmemhandle_()

integer(kind(hipsuccess)) function hipfort::hipipcopenmemhandle::hipipcopenmemhandle_ ( type(c_ptr)  devPtr,
type(c_ptr), value  handle,
integer(c_int), value  flags 
)

The documentation for this interface was generated from the following file: