cuda.bindings._v2.driver.array_create_v2#
- cuda.bindings._v2.driver.array_create_v2(p_allocate_array) intptr_t#
Creates a 1D or 2D CUDA array.
Creates a CUDA array according to the
CUDA_ARRAY_DESCRIPTORstructurep_allocate_arrayand returns a handle to the new CUDA array in*p_handle. TheCUDA_ARRAY_DESCRIPTORis defined as:. **View CUDA Toolkit Documentation for a C++ code example**. where:.Width, andHeightare the width, and height of the CUDA array (in elements); the CUDA array is one-dimensional if height is 0, two-dimensional otherwise;.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;.
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 a
widthxheightCUDA array of 64-bit, 4x16-bit float16’s:. **View CUDA Toolkit Documentation for a C++ code example**. Description for awidthxheightCUDA array of 16-bit elements, each of which is two 8-bit unsigned chars:. **View CUDA Toolkit Documentation for a C++ code example**.- Parameters:
p_allocate_array (intptr_t) – Array descriptor.
- Returns:
Returned array.
- Return type:
intptr_t
See also
cuArrayCreate_v2