cubecl_hip_sys

Function hipPointerGetAttributes

Source
pub unsafe extern "C" fn hipPointerGetAttributes(
    attributes: *mut hipPointerAttribute_t,
    ptr: *const c_void,
) -> hipError_t
Expand description

@brief Returns attributes for the specified pointer

@param [out] attributes attributes for the specified pointer @param [in] ptr pointer to get attributes for

The output parameter ‘attributes’ has a member named ‘type’ that describes what memory the pointer is associated with, such as device memory, host memory, managed memory, and others. Otherwise, the API cannot handle the pointer and returns #hipErrorInvalidValue.

@note The unrecognized memory type is unsupported to keep the HIP functionality backward compatibility due to #hipMemoryType enum values.

@return #hipSuccess, #hipErrorInvalidDevice, #hipErrorInvalidValue

@note The current behavior of this HIP API corresponds to the CUDA API before version 11.0.

@see hipPointerGetAttribute