cuda.bindings._v2.driver.mipmapped_array_create#
- cuda.bindings._v2.driver.mipmapped_array_create(
- p_mipmapped_array_desc,
- unsigned int num_mipmap_levels,
Creates a CUDA mipmapped array.
Creates a CUDA mipmapped array according to the
CUDA_ARRAY3D_DESCRIPTORstructurep_mipmapped_array_descand returns a handle to the new CUDA mipmapped array in*p_handle.num_mipmap_levelsspecifies the number of mipmap levels to be allocated. This value is clamped to the range [1, 1 + floor(log2(max(width, height, depth)))]. TheCUDA_ARRAY3D_DESCRIPTORis defined as:. **View CUDA Toolkit Documentation for a C++ code example**. where:.Width,Height, andDepthare the width, height, and depth of the CUDA array (in elements); the following types of CUDA arrays can be allocated:.A 1D mipmapped array is allocated if
HeightandDepthextents are both zero.A 2D mipmapped array is allocated if only
Depthextent is zero.A 3D mipmapped array is allocated if all three extents are non-zero.
A 1D layered CUDA mipmapped array is allocated if only
Heightis zero and theCUDA_ARRAY3D_LAYEREDflag is set. Each layer is a 1D array. The number of layers is determined by the depth extent.A 2D layered CUDA mipmapped array is allocated if all three extents are non-zero and the
CUDA_ARRAY3D_LAYEREDflag is set. Each layer is a 2D array. The number of layers is determined by the depth extent.A cubemap CUDA mipmapped array is allocated if all three extents are non- zero and the
CUDA_ARRAY3D_CUBEMAPflag is set.Widthmust be equal toHeight, andDepthmust be six. A cubemap is a special type of 2D layered CUDA array, where the six layers represent the six faces of a cube. The order of the six layers in memory is the same as that listed inCUarray_cubemap_face.A cubemap layered CUDA mipmapped array is allocated if all three extents are non-zero, and both,
CUDA_ARRAY3D_CUBEMAPandCUDA_ARRAY3D_LAYEREDflags are set.Widthmust be equal toHeight, andDepthmust be a multiple of six. A cubemap layered CUDA array is a special type of 2D layered CUDA array that consists of a collection of cubemaps. The first six layers represent the first cubemap, the next six layers form the second cubemap, and so on.Formatspecifies the format of the elements;CUarray_formatis defined as:.**View CUDA Toolkit Documentation for a C++ code example**.
NumChannelsspecifies the number of packed components per CUDA array element; it may be 1, 2, or 4;.Flagsmay be set to.CUDA_ARRAY3D_LAYEREDto enable creation of layered CUDA mipmapped arrays. If this flag is set,Depthspecifies the number of layers, not the depth of a 3D array.CUDA_ARRAY3D_SURFACE_LDSTto enable surface references to be bound to individual mipmap levels of the CUDA mipmapped array. If this flag is not set,cuSurfRefSetArraywill fail when attempting to bind a mipmap level of the CUDA mipmapped array to a surface reference.CUDA_ARRAY3D_CUBEMAPto enable creation of mipmapped cubemaps. If this flag is set,Widthmust be equal toHeight, andDepthmust be six. If theCUDA_ARRAY3D_LAYEREDflag is also set, thenDepthmust be a multiple of six.CUDA_ARRAY3D_TEXTURE_GATHERto indicate that the CUDA mipmapped array will be used for texture gather. Texture gather can only be performed on 2D CUDA mipmapped arrays.
Width,HeightandDepthmust meet certain size requirements as listed in the following table. All values are specified in elements. Note that for brevity’s sake, the full name of the device attribute is not specified. For ex., TEXTURE1D_MIPMAPPED_WIDTH refers to the device attributeCU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_MIPMAPPED_WIDTH. **View CUDA Toolkit Documentation for a table example**.- Parameters:
p_mipmapped_array_desc (intptr_t) – mipmapped array descriptor.
num_mipmap_levels (unsigned int) – Number of mipmap levels.
- Returns:
Returned mipmapped array.
- Return type:
intptr_t
See also
cuMipmappedArrayCreate