Main Content

mxGPUSetDimensions (C)

Modify number of dimensions and size of each dimension

C Syntax

#include "gpu/mxGPUArray.h"
void mxGPUSetDimensions(mxGPUArray * const mgp, mwSize const * const dims, mwSize const ndims);



Pointer to an mxGPUArray


Dimensions array. Each element in the dimensions array contains the size of the array in that dimension. For example, in C, setting dims[0] to 5 and dims[1] to 7 establishes a 5-by-7 mxGPUArray.

The dims array must not increase the overall size of the mxGPUArray. This array must contain at least ndims elements.


Number of dimensions.


Call mxGPUSetDimensions to reshape an existing mxGPUArray. mxGPUSetDimensions does not reallocate memory.

Introduced in R2018b