Skip to Main Content Skip to Search
Product Documentation

GPUDevice - Graphics Processing Unit (GPU)

Constructor

gpuDevice

Description

A GPUDevice object represents a graphic processing unit (GPU) in your computer. You can use the GPU to execute CUDA kernels or MATLAB code.

Methods

The following convenience functions let you identify and select a GPU device:

gpuDeviceQuery or select GPU device
gpuDeviceCountNumber of GPU devices present
resetReset GPU device and clear its memory

Methods of the class include the following:

Method NameDescription
parallel.gpu.GPUDevice.isAvailable(idx)True if the GPU specified by index idx is supported and capable of being selected. idx can be an integer or a vector of integers; the default index is the current device.
parallel.gpu.GPUDevice.getDevice(idx)Returns a GPUDevice object without selecting it.
wait(dev)Blocks MATLAB until GPU calculations are complete on specified device.

For the complete list, use the methods function on the GPUDevice class:

methods('parallel.gpu.GPUDevice')

You can get help on any of the class methods with the command

help parallel.gpu.GPUDevice.methodname

where methodname is the name of the method. For example, to get help on isAvailable, type

help parallel.gpu.GPUDevice.isAvailable

Properties

A GPUDevice object has the following read-only properties:

Property NameDescription
NameName of the CUDA device.
IndexIndex by which you can select the device.
ComputeCapabilityComputational capability of the CUDA device. Must meet required specification.
SupportsDoubleIndicates if this device can support double precision operations.
DriverVersionThe CUDA device driver version currently in use. Must meet required specification.
MaxThreadsPerBlockMaximum supported number of threads per block during CUDAKernel execution.
MaxShmemPerBlockMaximum supported amount of shared memory that can be used by a thread block during CUDAKernel execution.
MaxThreadBlockSizeMaximum size in each dimension for thread block. Each dimension of a thread block must not exceed these dimensions. Also, the product of the thread block size must not exceed MaxThreadsPerBlock.
MaxGridSizeMaximum size of grid of thread blocks.
SIMDWidthNumber of simultaneously executing threads.
TotalMemoryTotal available memory (in bytes) on the device.
FreeMemoryFree memory (in bytes) on the device. This property is available only for the currently selected device, and has the value NaN for unselected devices.
MultiprocessorCountThe number of vector processors present on the device. The total core count of the device is 8 times this property.
ClockRateKHzPeak clock rate of the GPU in kHz.
ComputeModeThe compute mode of the device, according to the following values:
'Default' — The device is not restricted and can support multiple CUDA sessions simultaneously. That is, MATLAB can share the GPU with other applications.
'Exclusive thread' or 'Exclusive process' — The device can be used by only one CUDA session. MATLAB can use this device only when no other application is already using it.
'Prohibited' — The device cannot be used.
GPUOverlapsTransfersIndicates if the device supports overlapped transfers.
KernelExecutionTimeoutIndicates if the device can abort long-running kernels. If true, the operating system places an upper bound on the time allowed for the CUDA kernel to execute, after which the CUDA driver times out the kernel and returns an error.
CanMapHostMemoryIndicates if the device supports mapping host memory into the CUDA address space.
DeviceSupportedIndicates if toolbox can use this this device. Not all devices are supported; for example, if their ComputeCapability is insufficient, the toolbox cannot use them.
DeviceSelectedIndicates if this is the currently selected device.

See Also

CUDAKernel, GPUArray

  


Free Parallel Computing Interactive Kit

See how to solve large problems with minimal effort and reduce simulation time.

Get free kit

Trials Available

Try the latest versions of parallel computing products.

Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS