Skip to main content

cudaMemRangeGetAttributes

Function cudaMemRangeGetAttributes 

Source
pub unsafe extern "C" fn cudaMemRangeGetAttributes(
    data: *mut *mut c_void,
    dataSizes: *mut size_t,
    attributes: *mut cudaMemRangeAttribute,
    numAttributes: size_t,
    devPtr: *const c_void,
    count: size_t,
) -> cudaError_t
Expand description

Query attributes of a given memory range.

Query attributes of the memory range starting at devPtr with a size of count bytes. The memory range must refer to managed memory allocated via cudaMallocManaged or declared via managed variables. The attributes array will be interpreted to have numAttributes entries. The dataSizes array will also be interpreted to have numAttributes entries. The results of the query will be stored in data.

The list of supported attributes are given below. Please refer to cudaMemRangeGetAttribute for attribute descriptions and restrictions.

Note that this function may also return error codes from previous, asynchronous launches.

Note that this function may also return cudaError_t::CUDA_ERROR_NOT_INITIALIZED, cudaErrorInsufficientDriver or cudaError_t::CUDA_ERROR_NO_DEVICE if this call tries to initialize internal CUDA RT state.

Note that as specified by cudaStreamAddCallback no CUDA function may be called from callback. cudaError_t::CUDA_ERROR_NOT_PERMITTED may, but is not guaranteed to, be returned as a diagnostic in such case.

§Parameters

  • data: A two-dimensional array containing pointers to memory locations where the result of each attribute query will be written to.
  • dataSizes: Array containing the sizes of each result.
  • attributes: An array of attributes to query (numAttributes and the number of attributes in this array should match).
  • numAttributes: Number of attributes to query.
  • devPtr: Start of the range to query.
  • count: Size of the range to query.

§Return value

See also: cudaMemRangeGetAttribute, cudaMemAdvise, cudaMemPrefetchAsync, cuMemRangeGetAttributes.