Skip to main content

cudaExternalMemoryGetMappedMipmappedArray

Function cudaExternalMemoryGetMappedMipmappedArray 

Source
pub unsafe extern "C" fn cudaExternalMemoryGetMappedMipmappedArray(
    mipmap: *mut cudaMipmappedArray_t,
    extMem: cudaExternalMemory_t,
    mipmapDesc: *const cudaExternalMemoryMipmappedArrayDesc,
) -> cudaError_t
Expand description

Maps a CUDA mipmapped array onto an external memory object.

Maps a CUDA mipmapped array onto an external object and returns a handle to it in mipmap.

The properties of the CUDA mipmapped array being mapped must be described in mipmapDesc. The structure cudaExternalMemoryMipmappedArrayDesc is defined as follows:

typedef struct cudaExternalMemoryMipmappedArrayDesc_st {
unsigned long long offset;
cudaChannelFormatDesc formatDesc;
cudaExtent extent;
unsigned int flags;
unsigned int numLevels;
} cudaExternalMemoryMipmappedArrayDesc;

where cudaExternalMemoryMipmappedArrayDesc::offset is the offset in the memory object where the base level of the mipmap chain is. cudaExternalMemoryMipmappedArrayDesc::formatDesc describes the format of the data. cudaExternalMemoryMipmappedArrayDesc::extent specifies the dimensions of the base level of the mipmap chain. cudaExternalMemoryMipmappedArrayDesc::flags are flags associated with CUDA mipmapped arrays. For further details, please refer to the documentation for cudaMalloc3DArray. Note that if the mipmapped array is bound as a color target in the graphics API, then the flag cudaArrayColorAttachment must be specified in cudaExternalMemoryMipmappedArrayDesc::flags. cudaExternalMemoryMipmappedArrayDesc::numLevels specifies the total number of levels in the mipmap chain.

The returned CUDA mipmapped array must be freed using cudaFreeMipmappedArray.

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.

Note: If cudaExternalMemoryHandleDesc::type is cudaExternalMemoryHandleType::cudaExternalMemoryHandleTypeNvSciBuf, then cudaExternalMemoryMipmappedArrayDesc::numLevels must not be greater than 1.

§Parameters

  • mipmap: Returned CUDA mipmapped array.
  • extMem: Handle to external memory object.
  • mipmapDesc: CUDA array descriptor.

§Return value

See also: cudaImportExternalMemory, cudaDestroyExternalMemory, cudaExternalMemoryGetMappedBuffer.