Device memory currently in use, in bytes (total - free).
DEVICE-WIDE: includes this process’s CUDA context (~300-500 MB)
and every other process on a shared device — see the module
header’s structural offsets. Returns -1 when no OpenACC
runtime is present.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer(kind=int64), | private | :: | free_b | ||||
| integer(kind=int64), | private | :: | total_b |
function mem_device_used_bytes() result(bytes) !! Device memory currently in use, in bytes (`total - free`). !! DEVICE-WIDE: includes this process's CUDA context (~300-500 MB) !! and every other process on a shared device — see the module !! header's structural offsets. Returns `-1` when no OpenACC !! runtime is present. integer(int64) :: bytes integer(int64) :: free_b, total_b bytes = -1_int64 free_b = mem_device_free_bytes() total_b = mem_device_total_bytes() if (free_b < 0_int64 .or. total_b < 0_int64) return bytes = total_b - free_b end function mem_device_used_bytes