Create mxGPUArray object, allocating memory on GPU
#include "gpu/mxGPUArray.h" mxGPUArray* mxGPUCreateGPUArray(mwSize const ndims, mwSize const * const dims, mxClassID const cid, mxComplexity const ccx, mxGPUInitialize const init0)
ndims
mwSize
type specifying the number of dimensions in the createdmxGPUArray
.
dims
Pointer to anmwSize
vector specifying the sizes of each dimension in the createdmxGPUArray
.
cid
mxClassID
type specifying the element class of the createdmxGPUArray
.
ccx
mxComplexity
type specifying the complexity of the createdmxGPUArray
.
init0
mxGPUInitialize
type specifying whether to initialize elements values to 0 in the createdmxGPUArray
.
A value ofMX_GPU_INITIALIZE_VALUES
specifies that elements are to be initialized to 0.
A value ofMX_GPU_DO_NOT_INITIALIZE
specifies that elements are not to be initialized.
Pointer to anmxGPUArray
.
mxGPUCreateGPUArray
creates a newmxGPUArray
object 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 newmxGPUArray
object on the CPU. UsemxGPUDestroyGPUArray
to delete the object when you are done with it.