User`s guide

gpuDevice
11-131
gpuDevice
Query or select GPU device
Syntax
D = gpuDevice
D = gpuDevice()
D = gpuDevice(IDX)
gpuDevice([ ])
Description
D = gpuDevice or D = gpuDevice(), if no device is already selected, selects the
default GPU device and returns a GPUDevice object representing that device. If a
GPU device is already selected, this returns an object representing that device without
clearing it.
D = gpuDevice(IDX) selects the GPU device specified by index IDX. IDX must be
in the range of 1 to gpuDeviceCount. A warning or error might occur if the specified
GPU device is not supported. This form of the command with a specified index resets the
device and clears its memory (even if this device is already currently selected, equivalent
to reset); so all workspace variables representing gpuArray or CUDAKernel variables
are now invalid, and you should clear them from the workspace or redefine them.
gpuDevice([ ]), with an empty argument (as opposed to no argument), deselects the
GPU device and clears its memory of gpuArray and CUDAKernel variables. This leaves
no GPU device selected as the current device.
Examples
Create an object representing the default GPU device.
g = gpuDevice;
Query the compute capabilities of all available GPU devices.