pub unsafe extern "C" fn cuMemMap(
ptr: CUdeviceptr,
size: usize,
offset: usize,
handle: CUmemGenericAllocationHandle,
flags: c_ulonglong,
) -> CUresult
Expand description
\brief Maps an allocation handle to a reserved virtual address range.
Maps bytes of memory represented by \p handle starting from byte \p offset to \p size to address range [\p addr, \p addr + \p size]. This range must be an address reservation previously reserved with ::cuMemAddressReserve, and \p offset + \p size must be less than the size of the memory allocation. Both \p ptr, \p size, and \p offset must be a multiple of the value given via ::cuMemGetAllocationGranularity with the ::CU_MEM_ALLOC_GRANULARITY_MINIMUM flag. If \p handle represents a multicast object, \p ptr, \p size and \p offset must be aligned to the value returned by ::cuMulticastGetGranularity with the flag ::CU_MULTICAST_MINIMUM_GRANULARITY. For best performance however, it is recommended that \p ptr, \p size and \p offset be aligned to the value returned by ::cuMulticastGetGranularity with the flag ::CU_MULTICAST_RECOMMENDED_GRANULARITY.
Please note calling ::cuMemMap does not make the address accessible, the caller needs to update accessibility of a contiguous mapped VA range by calling ::cuMemSetAccess.
Once a recipient process obtains a shareable memory handle from ::cuMemImportFromShareableHandle, the process must use ::cuMemMap to map the memory into its address ranges before setting accessibility with ::cuMemSetAccess.
::cuMemMap can only create mappings on VA range reservations that are not currently mapped.
\param[in] ptr - Address where memory will be mapped. \param[in] size - Size of the memory mapping. \param[in] offset - Offset into the memory represented by - \p handle from which to start mapping - Note: currently must be zero. \param[in] handle - Handle to a shareable memory \param[in] flags - flags for future use, must be zero now. \return ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_DEVICE, ::CUDA_ERROR_OUT_OF_MEMORY, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_PERMITTED, ::CUDA_ERROR_NOT_SUPPORTED \notefnerr
\sa ::cuMemUnmap, ::cuMemSetAccess, ::cuMemCreate, ::cuMemAddressReserve, ::cuMemImportFromShareableHandle