Documentation

mxGPUCreateGPUArray (C)

Create mxGPUArray object, allocating memory on GPU

C Syntax

#include "gpu/mxGPUArray.h" mxGPUArray* mxGPUCreateGPUArray(mwSize const ndims, mwSize const * const dims, mxClassID const cid, mxComplexity const ccx, mxGPUInitialize const init0)

Arguments

ndims

mwSizetype specifying the number of dimensions in the createdmxGPUArray.

dims

Pointer to anmwSizevector specifying the sizes of each dimension in the createdmxGPUArray.

cid

mxClassIDtype specifying the element class of the createdmxGPUArray.

ccx

mxComplexitytype specifying the complexity of the createdmxGPUArray.

init0

mxGPUInitializetype specifying whether to initialize elements values to 0 in the createdmxGPUArray.

  • A value ofMX_GPU_INITIALIZE_VALUESspecifies that elements are to be initialized to 0.

  • A value ofMX_GPU_DO_NOT_INITIALIZEspecifies that elements are not to be initialized.

Returns

Pointer to anmxGPUArray.

Description

mxGPUCreateGPUArraycreates a newmxGPUArrayobject with the specified size, type, and complexity. It also allocates the required memory on the GPU, and initializes the memory if requested.

This function allocates a newmxGPUArrayobject on the CPU. UsemxGPUDestroyGPUArrayto delete the object when you are done with it.

Introduced in R2013a

Was this topic helpful?