Function rcudnn::cudaMallocArray[][src]

pub unsafe extern "C" fn cudaMallocArray(
    array: *mut *mut cudaArray,
    desc: *const cudaChannelFormatDesc,
    width: usize,
    height: usize,
    flags: u32
) -> cudaError
Expand description

\brief Allocate an array on the device

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

The ::cudaChannelFormatDesc is defined as: \code struct cudaChannelFormatDesc { int x, y, z, w; enum cudaChannelFormatKind f; }; \endcode where ::cudaChannelFormatKind is one of ::cudaChannelFormatKindSigned, ::cudaChannelFormatKindUnsigned, or ::cudaChannelFormatKindFloat.

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

  • ::cudaArrayDefault: This flag’s value is defined to be 0 and provides default array allocation
  • ::cudaArraySurfaceLoadStore: Allocates an array that can be read from or written to using a surface reference
  • ::cudaArrayTextureGather: This flag indicates that texture gather operations will be performed on the array.
  • ::cudaArraySparse: Allocates a CUDA array without physical backing memory. The subregions within this sparse array can later be mapped to physical memory by calling ::cuMemMapArrayAsync. The physical backing memory must be allocated via ::cuMemCreate.

\p width and \p height must meet certain size requirements. See ::cudaMalloc3DArray() for more details.

\param array - Pointer to allocated array in device memory \param desc - Requested channel format \param width - Requested array allocation width \param height - Requested array allocation height \param flags - Requested properties of allocated array

\return ::cudaSuccess, ::cudaErrorInvalidValue, ::cudaErrorMemoryAllocation \notefnerr \note_init_rt \note_callback

\sa ::cudaMalloc, ::cudaMallocPitch, ::cudaFree, ::cudaFreeArray, \ref ::cudaMallocHost(void**, size_t) “cudaMallocHost (C API)”, ::cudaFreeHost, ::cudaMalloc3D, ::cudaMalloc3DArray, ::cudaHostAlloc, ::cuArrayCreate