[OpenMP][OMPT] Map `ompt_get_num_devices` to runtime function (#200790)
Since 82e94a593433f36734e2d34898d353a2ecb65b8b, `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>
GitOrigin-RevId: c9ae1305b08161a626a9c7267350bd36b01f2393
1 file changed