Skip to main content

cuGraphicsSubResourceGetMappedArray

Function cuGraphicsSubResourceGetMappedArray 

Source
pub unsafe extern "C" fn cuGraphicsSubResourceGetMappedArray(
    pArray: *mut CUarray,
    resource: CUgraphicsResource,
    arrayIndex: c_uint,
    mipLevel: c_uint,
) -> CUresult
Expand description

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

Returns in *pArray 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 *pArray may change every time that resource is mapped.

If resource is not a texture then it cannot be accessed via an array and cudaError_enum::CUDA_ERROR_NOT_MAPPED_AS_ARRAY is returned. If arrayIndex is not a valid array index for resource then cudaError_enum::CUDA_ERROR_INVALID_VALUE is returned. If mipLevel is not a valid mipmap level for resource then cudaError_enum::CUDA_ERROR_INVALID_VALUE is returned. If resource is not mapped then cudaError_enum::CUDA_ERROR_NOT_MAPPED is returned.

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

§Parameters

  • pArray: 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 CUarray_cubemap_face for cubemap textures for the subresource to access.
  • mipLevel: Mipmap level for the subresource to access.

§Return value

See also: cuGraphicsResourceGetMappedPointer, cudaGraphicsSubResourceGetMappedArray.