pub unsafe extern "C" fn cuMemGetHandleForAddressRange(
handle: *mut c_void,
dptr: CUdeviceptr,
size: usize,
handleType: CUmemRangeHandleType,
flags: c_ulonglong,
) -> CUresult
Expand description
\brief Retrieve handle for an address range
Get a handle of the specified type to an address range. The address range must have been obtained by a prior call to either ::cuMemAlloc or ::cuMemAddressReserve. If the address range was obtained via ::cuMemAddressReserve, it must also be fully mapped via ::cuMemMap. The address range must have been obtained by a prior call to either ::cuMemAllocHost or ::cuMemHostAlloc on Tegra.
Users must ensure the \p dptr and \p size are aligned to the host page size.
When requesting CUmemRangeHandleType::CU_MEM_RANGE_HANDLE_TYPE_DMA_BUF_FD, users are expected to query for dma_buf support for the platform by using ::CU_DEVICE_ATTRIBUTE_DMA_BUF_SUPPORTED device attribute before calling this API. The \p handle will be interpreted as a pointer to an integer to store the dma_buf file descriptor. Users must ensure the entire address range is backed and mapped when the address range is allocated by ::cuMemAddressReserve. All the physical allocations backing the address range must be resident on the same device and have identical allocation properties. Users are also expected to retrieve a new handle every time the underlying physical allocation(s) corresponding to a previously queried VA range are changed.
\param[out] handle - Pointer to the location where the returned handle will be stored. \param[in] dptr - Pointer to a valid CUDA device allocation. Must be aligned to host page size. \param[in] size - Length of the address range. Must be aligned to host page size. \param[in] handleType - Type of handle requested (defines type and size of the \p handle output parameter) \param[in] flags - Reserved, must be zero
\return CUDA_SUCCESS CUDA_ERROR_INVALID_VALUE CUDA_ERROR_NOT_SUPPORTED