cubecl_hip_sys

Function hipMallocManaged

Source
pub unsafe extern "C" fn hipMallocManaged(
    dev_ptr: *mut *mut c_void,
    size: usize,
    flags: c_uint,
) -> hipError_t
Expand description


@defgroup MemoryM Managed Memory

@ingroup Memory @{ This section describes the managed memory management functions of HIP runtime API.

@note The managed memory management APIs are implemented on Linux, under developement on Windows.

/ /** @brief Allocates memory that will be automatically managed by HIP.

This API is used for managed memory, allows data be shared and accessible to both CPU and GPU using a single pointer.

The API returns the allocation pointer, managed by HMM, can be used further to execute kernels on device and fetch data between the host and device as needed.

@note It is recommend to do the capability check before call this API.

@param [out] dev_ptr - pointer to allocated device memory @param [in] size - requested allocation size in bytes, it should be granularity of 4KB @param [in] flags - must be either hipMemAttachGlobal or hipMemAttachHost (defaults to hipMemAttachGlobal)

@returns #hipSuccess, #hipErrorMemoryAllocation, #hipErrorNotSupported, #hipErrorInvalidValue