Function cuExternalMemoryGetMappedMipmappedArray

Source
pub unsafe extern "C" fn cuExternalMemoryGetMappedMipmappedArray(
    mipmap: *mut CUmipmappedArray,
    extMem: CUexternalMemory,
    mipmapDesc: *const CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC,
) -> CUresult
Expand description

\brief 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 \p mipmap.

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

\code typedef struct CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st { unsigned long long offset; CUDA_ARRAY3D_DESCRIPTOR arrayDesc; unsigned int numLevels; } CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC; \endcode

where ::CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC::offset is the offset in the memory object where the base level of the mipmap chain is. ::CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC::arrayDesc describes the format, dimensions and type of the base level of the mipmap chain. For further details on these parameters, please refer to the documentation for ::cuMipmappedArrayCreate. Note that if the mipmapped array is bound as a color target in the graphics API, then the flag ::CUDA_ARRAY3D_COLOR_ATTACHMENT must be specified in ::CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC::arrayDesc::Flags. ::CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC::numLevels specifies the total number of levels in the mipmap chain.

If \p extMem was imported from a handle of type ::CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF, then ::CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC::numLevels must be equal to 1.

The returned CUDA mipmapped array must be freed using ::cuMipmappedArrayDestroy.

\param mipmap - Returned CUDA mipmapped array \param extMem - Handle to external memory object \param mipmapDesc - CUDA array descriptor

\return ::CUDA_SUCCESS, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_HANDLE \notefnerr

\sa ::cuImportExternalMemory, ::cuDestroyExternalMemory, ::cuExternalMemoryGetMappedBuffer