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_DESCRIPTOR structure p_allocate_array and returns a handle to the new CUDA array in *p_handle. The CUDA_ARRAY_DESCRIPTOR is defined as:. **View CUDA Toolkit Documentation for a C++ code example**. where:.

  • Width, and Height are the width, and height of the CUDA array (in elements); the CUDA array is one-dimensional if height is 0, two-dimensional otherwise;.

  • Format specifies the format of the elements; CUarray_format is defined as:.

  • **View CUDA Toolkit Documentation for a C++ code example**.

  • NumChannels specifies 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 width x height CUDA array of 64-bit, 4x16-bit float16’s:. **View CUDA Toolkit Documentation for a C++ code example**. Description for a width x height CUDA 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