mirror-llvm-project/openmp
Jan André Reuter c9ae1305b0
[OpenMP][OMPT] Map ompt_get_num_devices to runtime function (#200790)
Since 82e94a5934, `ompt_get_num_devices`
was hard coded to always provide a return value of `1`, regardless of
the actual number of devices. Tools relying on this return value were
henced forced to use other approaches to estimate the number of
available devices.

To improve the situtation, map the returned value to the one provided by
`omp_get_num_devices()`. This does not resolve the issue completely
though. When OMPT is initialized through `libomptarget.so`, the
PluginManager, providing the number of devices, is not initialized until
after OMPT has been fully set up. This means that tools, trying to
retrieve the number of devices during the _initialize_ callback, will
still receive the incorrect number of devices.

Still, this is a significant improvement compared to the prior state
which provided an incorrect result for most of the program runtime.

Closes #196829

---------

Signed-off-by: Jan André Reuter <j.reuter@fz-juelich.de>
2026-07-01 16:20:49 +02:00
..
cmake [Flang] Move builtin .mod generation into runtimes (Reapply #137828) (#171515) 2026-05-29 10:50:52 +02:00
device [offload][OpenMP] Fix partial warp reduction (#205861) 2026-06-25 21:06:47 +02:00
docs [flang][OpenMP] add Flang OpenMP Support page (NFC) (#205833) 2026-06-30 10:50:16 -05:00
libompd [OpenMP] Fix missing install-openmp component (#197603) 2026-05-15 07:37:18 -05:00
module [flang-rt][CMake] Avoid 'use, intrinsic ::' (#205634) 2026-06-25 16:50:13 +02:00
runtime [OpenMP][OMPT] Map ompt_get_num_devices to runtime function (#200790) 2026-07-01 16:20:49 +02:00
tools [openmp][omptest] Include cstdlib for malloc() (#202021) 2026-06-06 10:46:45 +01:00
.gitignore
CMakeLists.txt [CMake] Warn when the version of CMake is older than 3.31.0 (#204203) 2026-06-29 11:16:27 -07:00
CREDITS.txt
LICENSE.TXT
Maintainers.md Nominate Michael Klemm as lead maintainer of OpenMP (#175964) 2026-01-14 15:17:26 +00:00