0001 function info = gpuinfo()
0002
0003
0004
0005
0006
0007
0008
0009
0010 if parallel.gpu.GPUDevice.isAvailable()
0011 gpu = gpuDevice();
0012 info = struct( ...
0013 'Name', gpu.Name, ...
0014 'Clock', sprintf( '%u MHz', gpu.ClockRateKHz/1e3 ), ...
0015 'NumProcessors', gpu.MultiprocessorCount, ...
0016 'ComputeCapability', gpu.ComputeCapability, ...
0017 'TotalMemory', sprintf( '%1.2f GB', gpu.TotalMemory/2^30 ), ...
0018 'CUDAVersion', gpu.DriverVersion, ...
0019 'DriverVersion', parallel.internal.gpu.CUDADriverVersion );
0020 else
0021
0022 info = struct( ...
0023 'Name', '<no GPU available>', ...
0024 'Clock', '', ...
0025 'NumProcessors', 0, ...
0026 'ComputeCapability', '', ...
0027 'TotalMemory', 0, ...
0028 'CUDAVersion', '', ...
0029 'DriverVersion', '' );
0030 end
0031