Skip to main content

cudaGraphicsSubResourceGetMappedArray

Function cudaGraphicsSubResourceGetMappedArray 

Source
pub unsafe extern "C" fn cudaGraphicsSubResourceGetMappedArray(
    array: *mut cudaArray_t,
    resource: cudaGraphicsResource_t,
    arrayIndex: c_uint,
    mipLevel: c_uint,
) -> cudaError_t
Expand description

Get an array through which to access a subresource of a mapped graphics resource.

Returns in *array an array through which the subresource of the mapped graphics resource resource which corresponds to array index arrayIndex and mipmap level mipLevel may be accessed. The value set in array may change every time that resource is mapped.

If resource is not a texture then it cannot be accessed via an array and cudaError_t::CUDA_ERROR_UNKNOWN is returned. If arrayIndex is not a valid array index for resource then cudaError_t::CUDA_ERROR_INVALID_VALUE is returned. If mipLevel is not a valid mipmap level for resource then cudaError_t::CUDA_ERROR_INVALID_VALUE 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

  • array: Returned array through which a subresource of resource may be accessed.
  • resource: Mapped resource to access.
  • arrayIndex: Array index for array textures or cubemap face index as defined by cudaGraphicsCubeFace for cubemap textures for the subresource to access.
  • mipLevel: Mipmap level for the subresource to access.

§Return value

See also: cudaGraphicsResourceGetMappedPointer, cuGraphicsSubResourceGetMappedArray.