This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

mxGPUCopyFromMxArray (C)

Copy mxArray to mxGPUArray

C Syntax

#include "gpu/mxGPUArray.h"
mxGPUArray* mxGPUCopyFromMxArray(mxArray const * const mp)



Pointer to an mxArray that contains either GPU or CPU data.


Pointer to an mxGPUArray.


mxGPUCopyFromMxArray produces a new mxGPUArray object with the same characteristics as the input mxArray.

  • If the input mxArray contains a gpuArray, the output is a new copy of the data on the GPU.

  • If the input mxArray contains numeric or logical CPU data, the output is copied to the GPU.

Either way, this function always allocates memory on the GPU and allocates a new mxGPUArray object on the CPU. Use mxGPUDestroyGPUArray to delete the result when you are done with it.

Was this topic helpful?