This example shows how to identify and select a GPU for your computations.
To determine how many GPU devices are available in your computer, use the
When there are multiple devices, the first is the default. You can examine its
properties with the
gpuDevice function to determine if that
is the one you want to use.
d = gpuDevice
d = CUDADevice with properties: Name: 'GeForce GTX 1080' Index: 1 ComputeCapability: '6.1' SupportsDouble: 1 DriverVersion: 9.2000 ToolkitVersion: 9 MaxThreadsPerBlock: 1024 MaxShmemPerBlock: 49152 MaxThreadBlockSize: [1024 1024 64] MaxGridSize: [2.1475e+09 65535 65535] SIMDWidth: 32 TotalMemory: 8.5899e+09 AvailableMemory: 7.0053e+09 MultiprocessorCount: 20 ClockRateKHz: 1733500 ComputeMode: 'Default' GPUOverlapsTransfers: 1 KernelExecutionTimeout: 1 CanMapHostMemory: 1 DeviceSupported: 1 DeviceSelected: 1
To use another device, call
gpuDevice with the index of the