Function cuMemSetAccess

Source
pub unsafe extern "C" fn cuMemSetAccess(
    ptr: CUdeviceptr,
    size: usize,
    desc: *const CUmemAccessDesc,
    count: usize,
) -> CUresult
Expand description

\brief Set the access flags for each location specified in \p desc for the given virtual address range

Given the virtual address range via \p ptr and \p size, and the locations in the array given by \p desc and \p count, set the access flags for the target locations. The range must be a fully mapped address range containing all allocations created by ::cuMemMap / ::cuMemCreate. Users cannot specify ::CU_MEM_LOCATION_TYPE_HOST_NUMA accessibility for allocations created on with other location types. Note: When ::CUmemAccessDesc::CUmemLocation::type is ::CU_MEM_LOCATION_TYPE_HOST_NUMA, ::CUmemAccessDesc::CUmemLocation::id is ignored. When setting the access flags for a virtual address range mapping a multicast object, \p ptr and \p size 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 and \p size be aligned to the value returned by ::cuMulticastGetGranularity with the flag ::CU_MULTICAST_RECOMMENDED_GRANULARITY.

\param[in] ptr - Starting address for the virtual address range \param[in] size - Length of the virtual address range \param[in] desc - Array of ::CUmemAccessDesc that describe how to change the - mapping for each location specified \param[in] count - Number of ::CUmemAccessDesc in \p desc \returns ::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_DEVICE, ::CUDA_ERROR_NOT_SUPPORTED \notefnerr \note_sync

\sa ::cuMemSetAccess, ::cuMemCreate, :cuMemMap