mirror-llvm-project/openmp/runtime
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 [OpenMP] Control KMP_CANCEL_THREADS via CMake and detect pthread_cancel (#193681) 2026-06-19 00:04:01 +08:00
doc [OpenMP][docs] Revise building manual (#176175) 2026-01-28 14:13:41 +01:00
src [OpenMP][OMPT] Map ompt_get_num_devices to runtime function (#200790) 2026-07-01 16:20:49 +02:00
test [OpenMP] Ignore teams ICV setters in restricted contexts (#194428) 2026-06-09 11:31:17 -05:00
tools Drop timestamp in generated source code (#146822) 2025-07-03 18:18:47 +02:00
unittests [libomp] Add kmp_vector (ADT 2/2) (#176163) 2026-06-18 08:11:35 +02:00
.clang-format
.clang-tidy
CMakeLists.txt [libomp][AIX] Rename libatomic to libcompiler_rt (#203594) 2026-06-30 07:00:44 -04:00
README.txt [OpenMP][docs] Revise building manual (#176175) 2026-01-28 14:13:41 +01:00

               README for the LLVM* OpenMP* Runtime Library
               ============================================

How to Build Documentation
==========================

The main documentation is in Doxygen* format, and this distribution
should come with pre-built PDF documentation in doc/Reference.pdf.
However, an HTML version can be built by executing:

% doxygen doc/doxygen/config

in the runtime directory.

That will produce HTML documentation in the doc/doxygen/generated
directory, which can be accessed by pointing a web browser at the
index.html file there.

If you don't have Doxygen installed, you can download it from
www.doxygen.org.


How to Build the LLVM* OpenMP* Runtime Library
==============================================

For build instructions, please see https://openmp.llvm.org/Building.html.


Architectures Supported
=======================
* IA-32 architecture
* Intel(R) 64 architecture
* Intel(R) Many Integrated Core Architecture
* ARM* architecture
* Aarch64 (64-bit ARM) architecture
* IBM(R) Power architecture (big endian)
* IBM(R) Power architecture (little endian)
* IBM(R) Z (s390x) architecture
* MIPS and MIPS64 architecture
* RISCV64 architecture
* LoongArch64 architecture

Supported RTL Build Configurations
==================================

Supported Architectures: IA-32 architecture, Intel(R) 64, and
Intel(R) Many Integrated Core Architecture

              ----------------------------------------------
              |   icc/icl     |    gcc      |   clang      |
--------------|---------------|----------------------------|
| Linux* OS   |   Yes(1,5)    |  Yes(2,4)   | Yes(4,6,7)   |
| FreeBSD*    |   No          |  No         | Yes(4,6,7,8) |
| OS X*       |   Yes(1,3,4)  |  No         | Yes(4,6,7)   |
| Windows* OS |   Yes(1,4)    |  No         | No           |
------------------------------------------------------------

(1) On IA-32 architecture and Intel(R) 64, icc/icl versions 12.x are
    supported (12.1 is recommended).
(2) GCC* version 4.7 is supported.
(3) For icc on OS X*, OS X* version 10.5.8 is supported.
(4) Intel(R) Many Integrated Core Architecture not supported.
(5) On Intel(R) Many Integrated Core Architecture, icc/icl versions 13.0
    or later are required.
(6) Clang* version 3.3 is supported.
(7) Clang* currently does not offer a software-implemented 128 bit extended
    precision type.  Thus, all entry points reliant on this type are removed
    from the library and cannot be called in the user program.  The following
    functions are not available:
    __kmpc_atomic_cmplx16_*
    __kmpc_atomic_float16_*
    __kmpc_atomic_*_fp
(8) Community contribution provided AS IS, not tested by Intel.

Supported Architectures: IBM(R) Power 7 and Power 8

              -----------------------------
              |   gcc      |   clang      |
--------------|------------|--------------|
| Linux* OS   |  Yes(1,2)  | Yes(3,4)     |
-------------------------------------------

(1) On Power 7, gcc version 4.8.2 is supported.
(2) On Power 8, gcc version 4.8.2 is supported.
(3) On Power 7, clang version 3.7 is supported.
(4) On Power 8, clang version 3.7 is supported.


Front-end Compilers that work with this RTL
===========================================

The following compilers are known to do compatible code generation for
this RTL: clang (from the OpenMP development branch at
http://clang-omp.github.io/ ), Intel compilers, GCC.  See the documentation
for more details.

-----------------------------------------------------------------------

Notices
=======

*Other names and brands may be claimed as the property of others.