Skip to main content

cudaMalloc3DArray

Function cudaMalloc3DArray 

Source
pub unsafe extern "C" fn cudaMalloc3DArray(
    array: *mut cudaArray_t,
    desc: *const cudaChannelFormatDesc,
    extent: cudaExtent,
    flags: c_uint,
) -> cudaError_t
Expand description

Allocate an array on the device.

Allocates a CUDA array according to the cudaChannelFormatDesc structure desc and returns a handle to the new CUDA array in *array.

The cudaChannelFormatDesc is defined as:

cudaMalloc3DArray can allocate the following:

The flags parameter enables different options to be specified that affect the allocation, as follows.

The width, height and depth extents must meet certain size requirements as listed in the following table. All values are specified in elements.

Note that 2D CUDA arrays have different size requirements if the cudaArrayTextureGather flag is set. In that case, the valid range for (width, height, depth) is ((1,maxTexture2DGather[0]), (1,maxTexture2DGather[1]), 0).

ยงParameters

  • array: Pointer to allocated array in device memory.
  • desc: Requested channel format.
  • extent: Requested allocation size (width field in elements).
  • flags: Flags for extensions.