m_omptgt_device_info Module

Peak memory clock and bus width of an OpenMP target device, read from the vendor runtime.

OpenMP offers no query for either, so this asks the CUDA driver on NVIDIA hardware and HIP on AMD hardware, the same attributes the CUDA backend reads. The vendor library is opened at run time with dlopen instead of being linked: no compiler's offload runtime links it for us, the backend builds with NVHPC, Flang and Cray alike, and a machine without the library reports the figures as unavailable rather than failing to link or start.

The OpenMP device number is passed as the vendor device ordinal. Both enumerate the devices visible to the process in the same order.


Uses

  • module~~m_omptgt_device_info~~UsesGraph module~m_omptgt_device_info m_omptgt_device_info iso_c_binding iso_c_binding module~m_omptgt_device_info->iso_c_binding

Used by

  • module~~m_omptgt_device_info~~UsedByGraph module~m_omptgt_device_info m_omptgt_device_info module~m_omptgt_backend m_omptgt_backend module~m_omptgt_backend->module~m_omptgt_device_info module~m_backend_setup m_backend_setup module~m_backend_setup->module~m_omptgt_backend program~x3d2_poisson_solver x3d2_poisson_solver program~x3d2_poisson_solver->module~m_backend_setup program~xcompact xcompact program~xcompact->module~m_backend_setup

Subroutines

public subroutine query_device_memory(device, mem_clock_khz, bus_width_bits, available)

Memory clock (kHz) and bus width (bits) of OpenMP device device. The vendor this build targets is tried first, then the other one, as the build only guesses the vendor for some compilers.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: device
integer, intent(out) :: mem_clock_khz
integer, intent(out) :: bus_width_bits
logical, intent(out) :: available