| Contents | Index |
gpuArray converts an array in the MATLAB workspace into a GPUArray with data stored on the GPU device.
Also, the following static methods create GPUArray data:
| parallel.gpu.GPUArray.colon | parallel.gpu.GPUArray.ones |
| parallel.gpu.GPUArray.eye | parallel.gpu.GPUArray.rand |
| parallel.gpu.GPUArray.false | parallel.gpu.GPUArray.randi |
| parallel.gpu.GPUArray.inf | parallel.gpu.GPUArray.randn |
| parallel.gpu.GPUArray.linspace | parallel.gpu.GPUArray.true |
| parallel.gpu.GPUArray.logspace | parallel.gpu.GPUArray.zeros |
| parallel.gpu.GPUArray.nan |
You can get help on any of these methods with the command
help parallel.gpu.GPUArray.methodname
where methodname is the name of the method. For example, to get help on rand, type
help parallel.gpu.GPUArray.rand
The following methods control the random number stream on the GPU:
| parallel.gpu.RandStream |
| parallel.gpu.rng |
A GPUArray object represents an array of data stored on the GPU. You can use the data for direct calculations, or in CUDA kernels that execute on the GPU. You can return data to the MATLAB workspace with the gather function.
| arrayfun | Apply function to each element of array on GPU |
| bsxfun | Binary singleton expansion function for GPUArray |
| existsOnGPU | Determine if GPUArray or CUDAKernel is available on GPU |
Other overloaded methods for a GPUArray object are too numerous to list here. Most resemble and behave the same as built-in MATLAB functions. See Using GPUArray. For the complete list of those supported, use the methods function on the GPUArray class:
methods('parallel.gpu.GPUArray')Among the GPUArray methods there are several for examining the characteristics of a GPUArray object. Most behave like the MATLAB functions of the same name:
| Function | Description |
|---|---|
| classUnderlying | Class of the underlying data in the array |
| existsOnGPU | Indication if array exists on the GPU and is accessible |
| isreal | Indication if array data is real |
| length | Length of vector or largest array dimension |
| ndims | Number of dimensions in the array |
| size | Size of array dimensions |

See how to solve large problems with minimal effort and reduce simulation time.
Get free kit| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |