cuda.bindings._v2.driver.array_3d_create_v2#
- cuda.bindings._v2.driver.array_3d_create_v2(p_allocate_array) intptr_t#
Creates a 3D CUDA array.
Creates a CUDA array according to the
CUDA_ARRAY3D_DESCRIPTORstructurep_allocate_arrayand returns a handle to the new CUDA array in*p_handle. 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 array is allocated if
HeightandDepthextents are both zero.A 2D array is allocated if only
Depthextent is zero.A 3D array is allocated if all three extents are non-zero.
A 1D layered CUDA 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 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 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 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 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 the CUDA array. If this flag is not set,cuSurfRefSetArraywill fail when attempting to bind the CUDA array to a surface reference.CUDA_ARRAY3D_CUBEMAPto enable creation of 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 array will be used for texture gather. Texture gather can only be performed on 2D CUDA 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_WIDTH refers to the device attributeCU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_WIDTH. Note that 2D CUDA arrays have different size requirements if theCUDA_ARRAY3D_TEXTURE_GATHERflag is set.WidthandHeightmust not be greater thanCU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_WIDTHandCU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_HEIGHTrespectively, in that case. **View CUDA Toolkit Documentation for a table example**. Here are examples of CUDA array descriptions:. Description for a CUDA array of 2048 floats:. **View CUDA Toolkit Documentation for a C++ code example**. Description for a 64 x 64 CUDA array of floats:. **View CUDA Toolkit Documentation for a C++ code example**. Description for awidthxheightxdepthCUDA array of 64-bit, 4x16-bit float16’s:. **View CUDA Toolkit Documentation for a C++ code example**.- Parameters:
p_allocate_array (intptr_t) – 3D array descriptor.
- Returns:
Returned array.
- Return type:
intptr_t
See also
cuArray3DCreate_v2