Skip to main content

cudaGraphicsResourceGetMappedPointer

Function cudaGraphicsResourceGetMappedPointer 

Source
pub unsafe extern "C" fn cudaGraphicsResourceGetMappedPointer(
    devPtr: *mut *mut c_void,
    size: *mut size_t,
    resource: cudaGraphicsResource_t,
) -> cudaError_t
Expand description

Get an device pointer through which to access a mapped graphics resource.

Returns in *devPtr a pointer through which the mapped graphics resource resource may be accessed. Returns in *size the size of the memory in bytes which may be accessed from that pointer. The value set in devPtr may change every time that resource is mapped.

If resource is not a buffer then it cannot be accessed via a pointer and cudaError_t::CUDA_ERROR_UNKNOWN is returned. If resource is not mapped then cudaError_t::CUDA_ERROR_UNKNOWN is returned.

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

  • devPtr: Returned pointer through which resource may be accessed.
  • size: Returned size of the buffer accessible starting at *devPtr.
  • resource: Mapped resource to access.

§Return value