Get information about GPU
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | devID |
subroutine device_info(devID) !> Get information about GPU implicit none integer, intent(in) :: devID ! Work variables integer :: stat, val stat = device_Get_Count(val); write(stdout,fmt='(a36,i12)') "Number of GPU capable devices:", val if (val.ne.0) then stat = device_Get_Attribute(val, 13, devID); write(stdout,fmt='(a36,i12)') "Clock rate in kHz:", val stat = device_Get_Attribute(val, 16, devID); write(stdout,fmt='(a36,i12)') "SM count:", val stat = device_Get_Attribute(val, 81, devID); write(stdout,fmt='(a36,i12)') "Shared memory per SM in bytes:", val stat = device_Get_Attribute(val, 82, devID); write(stdout,fmt='(a36,i12)') "Number of 32-bit Registers per SM:", val stat = device_Get_Attribute(val, 39, devID); write(stdout,fmt='(a36,i12)') "Max threads per SM:", val stat = device_Get_Attribute(val, 38, devID); write(stdout,fmt='(a36,i12)') "L2 Cache Size in bytes:", val stat = device_Get_Attribute(val, 36, devID); write(stdout,fmt='(a36,i12)') "Memory Clock Rate in kHz: ", val stat = device_Get_Attribute(val, 75, devID); write(stdout,fmt='(a36,i12)') "Compute Capability, major:", val stat = device_Get_Attribute(val, 76, devID); write(stdout,fmt='(a36,i12)') "Compute Capability, minor:", val end if return end subroutine device_info