GPU Computing in MATLAB

Accelerate your code using basic GPU computing

Functions

gpuArrayCreate array on GPU
gatherTransfer distributed array or gpuArray to local workspace
existsOnGPUDetermine if gpuArray or CUDAKernel is available on GPU
gpuDeviceQuery or select GPU device
gpuDeviceCountNumber of GPU devices present
gputimeitTime required to run function on GPU
resetReset GPU device and clear its memory
wait (GPUDevice)Wait for GPU calculation to complete
arrayfunApply function to each element of array on GPU
bsxfunBinary singleton expansion function for gpuArray
pagefunApply function to each page of array on GPU

Classes

gpuArrayArray stored on GPU
GPUDeviceGraphics processing unit (GPU)
GPUDeviceManagerManager for GPU Devices

Topics

Identify and Select a GPU Device

Use gpuDevice to identify and select which device you want to use.

Establish Arrays on a GPU

A gpuArray in MATLAB® represents an array that is stored on the GPU.

Run Built-In Functions on a GPU

Many MATLAB built-in functions support gpuArray input arguments.

Run Element-wise MATLAB Code on GPU

Use examples to learn about running MATLAB code on a GPU

Improve Performance of Small Matrix Problems on the GPU using PAGEFUN

This example shows how to use pagefun to improve the performance of applying a large number of independent rotations and translations to objects in a 3-D environment.

Measure and Improve GPU Performance

You can use various benchmark tests in MATLAB to measure the performance of your GPU:

Control Random Number Streams

By default, each worker in a cluster working on the same job has a unique random number stream.

Was this topic helpful?