cubecl_hip_sys

Function hipMemPoolExportToShareableHandle

Source
pub unsafe extern "C" fn hipMemPoolExportToShareableHandle(
    shared_handle: *mut c_void,
    mem_pool: hipMemPool_t,
    handle_type: hipMemAllocationHandleType,
    flags: c_uint,
) -> hipError_t
Expand description

@brief Exports a memory pool to the requested handle type.

Given an IPC capable mempool, create an OS handle to share the pool with another process. A recipient process can convert the shareable handle into a mempool with @p hipMemPoolImportFromShareableHandle. Individual pointers can then be shared with the @p hipMemPoolExportPointer and @p hipMemPoolImportPointer APIs. The implementation of what the shareable handle is and how it can be transferred is defined by the requested handle type.

@note: To create an IPC capable mempool, create a mempool with a @p hipMemAllocationHandleType other than @p hipMemHandleTypeNone.

@param [out] shared_handle Pointer to the location in which to store the requested handle @param [in] mem_pool Pool to export @param [in] handle_type The type of handle to create @param [in] flags Must be 0

@returns #hipSuccess, #hipErrorInvalidValue, #hipErrorOutOfMemory

@see hipMemPoolImportFromShareableHandle

@warning : This API is marked as beta, meaning, while this is feature complete, it is still open to changes and may have outstanding issues.

@note This API is implemented on Linux, under development on Windows.