aboutsummaryrefslogtreecommitdiff
path: root/openmp
AgeCommit message (Collapse)AuthorFilesLines
4 hours[OpenMP] Add IBM Z as supported architecture in the runtime READMEUlrich Weigand1-0/+1
This architecture has been supported since 1111ef025762d9b7ecc3cafc576083987ae63fe6, but the README file had not been updated.
2 days[OpenMP][omptest] Enable missing callback (#161650)Jan Patrick Lehr1-1/+1
The registration of this callback handler was disabled for some reason. Local testing did not bring up any issues when I enabled it. Side effect is: Silences current warning about unused function.
2 days[OpenMP] Clean-up Fortran testsMichael Kruse4-7/+10
* Use "do" for DO loops, there is no "for" in Fortran and it is always integer * Add -cpp to not rely on file name case * Add "implicit none" safety
5 days[OpenMP][test] .f90 -> .F90Michael Kruse1-0/+1
The test makes use of the preprocessor, which requires a .F90 suffix
5 days[Flang] Add standalone tile support (#160298)Michael Kruse3-0/+144
Add support for the standalone OpenMP tile construct: ```f90 !$omp tile sizes(...) DO i = 1, 100 ... ``` This is complementary to #143715 which added support for the tile construct as part of another loop-associated construct such as worksharing-loop, distribute, etc.
9 days[OpenMP] Fix 'libc' configuration when building OpenMPJoseph Huber1-1/+1
Summary: Forgot to port this option's old handling from offload. It's not way easier since they're built in the same CMake project. Also delete the leftover directory that's not used anymore, don't know how that was still there.
10 days[Clang][OpenMP][LoopTransformations] Implement "#pragma omp fuse" loop ↵Walter J.T.V5-0/+687
transformation directive and "looprange" clause (#139293) This change implements the fuse directive, `#pragma omp fuse`, as specified in the OpenMP 6.0, along with the `looprange` clause in clang. This change also adds minimal stubs so flang keeps compiling (a full implementation in flang of this directive is still pending). --------- Co-authored-by: Roger Ferrer Ibanez <roger.ferrer@bsc.es>
12 days[Flang][OpenMP] Enable no-loop kernels (#155818)Dominik Adamski1-13/+0
Enable the generation of no-loop kernels for Fortran OpenMP code. target teams distribute parallel do pragmas can be promoted to no-loop kernels if the user adds the -fopenmp-assume-teams-oversubscription and -fopenmp-assume-threads-oversubscription flags. If the OpenMP kernel contains reduction or num_teams clauses, it is not promoted to no-loop mode. The global OpenMP device RTL oversubscription flags no longer force no-loop code generation for Fortran.
2025-09-20[openmp][test] Don't use random Flang by defaultMichael Kruse1-2/+2
Only enable Fortran tests when either the test compiler is set explicitly, or in a runtimes bootstrapping build. A system-installed Flang either may not exist, or too old to compiler our tests. Fixes buildbot failure after landing #150722 https://lab.llvm.org/buildbot/#/builders/10/builds/13905
2025-09-20[OpenMP] Allow Fortran tests (#150722)Michael Kruse7-9/+63
In addition to existing C/C++ tests, add Fortran-based tests. Fortran tests will only run if a Fortran compiler is found. The first test is for the unroll construct added in #144785.
2025-09-19[OpenMP][NFC] Clean up a bunch of warnings and clang-tidy messages (#159831)Joseph Huber4-6/+4
Summary: I made the GPU flags accept more of the default LLVM warnings, which triggered some new cases. Clean those up and fix some other ones while I'm at it.
2025-09-19[LLVM] Simplify GPU runtimes flag handling (#159802)Joseph Huber1-8/+0
Summary: The AMDGPU hack can be removed, and we no longer need to skip 90% of the `HandleLLVMOptions` if we work around NVPTX earlier. Simplifies the interface by removing duplicated logic and keeps the GPU targets from being weirdly divergent on some flags.
2025-09-16[OpenMP] Document how to specify flags to device libraries (#159053)Tulio Magno Quites Machado Filho1-2/+4
Add an explanation on how to use RUNTIMES_<triple>_CMAKE_CXX_FLAGS in order to specify different compiler flags for OpenMP device libraries.
2025-09-15[OpenMP] [Tests] Update test broken by #157364 (#158751)Sirraide1-1/+6
Fix another test impacted by #157364. On Windows, `GetComputerNameA()`, which is what this ends up calling, takes an `LPDWORD`, but we were handing it an `int*`; fix this by declaring it as a `DWORD` instead.
2025-09-11[offload][OpenMP] Remove device code for num_threads strict (#157893)Robert Imschweiler2-90/+18
Due to potential performance issues, this commit temporarily removes support for the num_threads 'strict' modifier and its corresponding message and severity clauses on the device.
2025-09-08[OpenMP] Fix incorrect CUDA bc path after library change (#157547)Joseph Huber1-2/+2
2025-09-08[OpenMP] Change build of OpenMP device runtime to be a separate runtime ↵Joseph Huber32-26/+5990
(#136729) Summary: Currently we build the OpenMP device runtime as part of the `offload/` project. This is problematic because it has several restrictions when compared to the normal offloading runtime. It can only be built with an up-to-date clang and we need to set the target appropriately. Currently we hack around this by creating the compiler invocation manually, but this patch moves it into a separate runtimes build. This follows the same build we use for libc, libc++, compiler-rt, and flang-rt. This also moves it from `offload/` into `openmp/` because it is still the `openmp/` runtime and I feel it is more appropriate. We do want a generic `offload/` library at some point, but it would be trivial to then add that as a separate library now that we have the infrastructure that makes adding these new libraries trivial. This most importantly will require that users update their build configs, mostly adding the following lines at a minimum. I was debating whether or not I should 'auto-upgrade' this, but I just went with a warning. ``` -DLLVM_RUNTIME_TARGETS='default;amdgcn-amd-amdhsa;nvptx64-nvidia-cuda' \ -DRUNTIMES_nvptx64-nvidia-cuda_LLVM_ENABLE_RUNTIMES=openmp \ -DRUNTIMES_amdgcn-amd-amdhsa_LLVM_ENABLE_RUNTIMES=openmp \ ``` This also changed where the `.bc` version of the library lives, but it's still created.
2025-08-31[openmp] Fix missing include directory in omptest tool (#156194)Michał Górny1-0/+2
Add missing `LIBOMP_INCLUDE_DIR` include directory to fix build failures in omptest, as reported in https://github.com/llvm/llvm-project/pull/154786#issuecomment-3223481804. Thanks fo @jprotze for the suggested fix. Signed-off-by: Michał Górny <mgorny@gentoo.org>
2025-08-30[OpenMP] Use Clang resource dir only in bootstrapping build (#156018)Michael Kruse1-4/+5
In an LLVM_ENABLE_PROJECTS=openmp build, the LLVM build tree in which just-built Clang is available, but in contrast to an LLVM_ENABLE_RUNTIMES=openmp build, is not the compiler that openmp is built with (CMAKE_CXX_COMPILER). The latter compiler (which might also be gcc) will not look into the resource directory of just-built Clang, where the OpenMP headers are installed. There may not even be a just-built Clang without LLVM_ENABLE_PROJECTS=clang. We cannot add the OpenMP header output directory to the search path which also include's Clang's internal headers that will conflict with CMAKE_CXX_COMPILER's internal headers. The only choice left is to use what the OpenMP standalone build does: Use CMAKE_CURRENT_BINARY_DIR which is added unconditionally to the header search path to compile openmp itself.
2025-08-28Revert "[OpenMP][clang] 6.0: num_threads strict (part 3: codegen)" (#155809)Robert Imschweiler1-1/+0
Reverts llvm/llvm-project#146405
2025-08-28[OpenMP][clang] 6.0: num_threads strict (part 3: codegen) (#146405)Robert Imschweiler1-0/+1
OpenMP 6.0 12.1.2 specifies the behavior of the strict modifier for the num_threads clause on parallel directives, along with the message and severity clauses. This commit implements necessary codegen changes.
2025-08-27[OpenMP][ompTest] Guard installation of all components (#155433)Michael Halkenhäuser1-25/+33
Make installation of ompTest optional via: -DLIBOMPTEST_INSTALL_COMPONENTS=ON (default: OFF)
2025-08-27[Flang-RT][OpenMP] Define _GLIBCXX_NO_ASSERTIONS (#155440)Michael Kruse1-0/+1
Since GCC 15.1, libstdc++ enabled assertions/hardening by default in non-optimized (-O0) builds [1]. That is, _GLIBCXX_ASSERTIONS is defined in the libstdc++ headers itself so defining/undefining it on the compiler command line no longer has an effect in non-optimized builds. As the commit message[2] suggests, define _GLIBCXX_NO_ASSERTIONS instead. For libstdc++ headers before 15.1, -U_GLIBCXX_ASSERTIONS still has to be on the command line as well. Defining _GLIBCXX_NO_ASSERTIONS was previously proposed in #152223 [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112808 [2] https://github.com/gcc-mirror/gcc/commit/361d230fd7800a7e749aba8ed020f54f5c26d504
2025-08-22[OpenMP][omptest] Skip omptest build if LLVM_INCLUDE_TESTS=OFF (#155020)Michael Halkenhäuser1-8/+3
Add / expand early exit in CMakeLists.txt if LLVM_INCLUDE_TESTS is 'OFF'
2025-08-22[OpenMP][omptest] Enforce test case order for 'standalone' build (#154977)Michael Halkenhäuser3-11/+25
Note: this only applies to 'standalone' builds, i.e. when: LIBOMPTEST_BUILD_STANDALONE evaluates to 'ON'. Use std::vector<std::pair<std::string, TestSuite>> instead of a std::map. Background: In some cases it could happen that the test execution order would change vs. the order of appearance. This can lead to suite failures when e.g. testing for device initialization because it is performed by the first executed test case. By storing the test suites and cases in order of appearance this issue is avoided. (So far GoogleTest has behaved in the same way.)
2025-08-22Reland: [OpenMP] Add ompTest library to OpenMP (#154786)Michael Halkenhäuser32-0/+6741
Reland of https://github.com/llvm/llvm-project/pull/147381 Added changes to fix observed BuildBot failures: * CMake version (reduced minimum to `3.20`, was: `3.22`) * GoogleTest linking (missing `./build/lib/libllvm_gtest.a`) * Related header issue (missing `#include "llvm/Support/raw_os_ostream.h"`) Original message Description =========== OpenMP Tooling Interface Testing Library (ompTest) ompTest is a unit testing framework for testing OpenMP implementations. It offers a simple-to-use framework that allows a tester to check for OMPT events in addition to regular unit testing code, supported by linking against GoogleTest by default. It also facilitates writing concise tests while bridging the semantic gap between the unit under test and the OMPT-event testing. Background ========== This library has been developed to provide the means of testing OMPT implementations with reasonable effort. Especially, asynchronous or unordered events are supported and can be verified with ease, which may prove to be challenging with LIT-based tests. Additionally, since the assertions are part of the code being tested, ompTest can reference all corresponding variables during assertion. Basic Usage =========== OMPT event assertions are placed before the code, which shall be tested. These assertion can either be provided as one block or interleaved with the test code. There are two types of asserters: (1) sequenced "order-sensitive" and (2) set "unordered" assserters. Once the test is being run, the corresponding events are triggered by the OpenMP runtime and can be observed. Each of these observed events notifies asserters, which then determine if the test should pass or fail. Example (partial, interleaved) ============================== ```c++ int N = 100000; int a[N]; int b[N]; OMPT_ASSERT_SEQUENCE(Target, TARGET, BEGIN, 0); OMPT_ASSERT_SEQUENCE(TargetDataOp, ALLOC, N * sizeof(int)); // a ? OMPT_ASSERT_SEQUENCE(TargetDataOp, H2D, N * sizeof(int), &a); OMPT_ASSERT_SEQUENCE(TargetDataOp, ALLOC, N * sizeof(int)); // b ? OMPT_ASSERT_SEQUENCE(TargetDataOp, H2D, N * sizeof(int), &b); OMPT_ASSERT_SEQUENCE(TargetSubmit, 1); OMPT_ASSERT_SEQUENCE(TargetDataOp, D2H, N * sizeof(int), nullptr, &b); OMPT_ASSERT_SEQUENCE(TargetDataOp, D2H, N * sizeof(int), nullptr, &a); OMPT_ASSERT_SEQUENCE(TargetDataOp, DELETE); OMPT_ASSERT_SEQUENCE(TargetDataOp, DELETE); OMPT_ASSERT_SEQUENCE(Target, TARGET, END, 0); #pragma omp target parallel for { for (int j = 0; j < N; j++) a[j] = b[j]; } ``` References ========== This work has been presented at SC'24 workshops, see: https://ieeexplore.ieee.org/document/10820689 Current State and Future Work ============================= ompTest's development was mostly device-centric and aimed at OMPT device callbacks and device-side tracing. Consequentially, a substantial part of host-related events or features may not be supported in its current state. However, we are confident that the related functionality can be added and ompTest provides a general foundation for future OpenMP and especially OMPT testing. This PR will allow us to upstream the corresponding features, like OMPT device-side tracing in the future with significantly reduced risk of introducing regressions in the process. Build ===== ompTest is linked against LLVM's GoogleTest by default, but can also be built 'standalone'. Additionally, it comes with a set of unit tests, which in turn require GoogleTest (overriding a standalone build). The unit tests are added to the `check-openmp` target. Use the following parameters to perform the corresponding build: `LIBOMPTEST_BUILD_STANDALONE` (Default: ${OPENMP_STANDALONE_BUILD}) `LIBOMPTEST_BUILD_UNITTESTS` (Default: OFF) --------- Co-authored-by: Jan-Patrick Lehr <JanPatrick.Lehr@amd.com> Co-authored-by: Joachim <protze@rz.rwth-aachen.de> Co-authored-by: Joachim Jenke <jenke@itc.rwth-aachen.de>
2025-08-21Revert "Fix Debug Build Using GCC 15" (#154877)dpalermo1-1/+1
Reverts llvm/llvm-project#152223
2025-08-21Fix Debug Build Using GCC 15 (#152223)Patrick Simmons1-1/+1
Flang currently doesn't build in debug mode on GCC 15 due to missing dynamic libraries in some CMakeLists.txt files, and OpenMP doesn't link in debug mode due to the atomic library pulling in libstdc++ despite an incomplete attempt in the CMakeLists.txt to disable glibcxx assertions. This PR fixes these issues and allows Flang and the OpenMP runtime to build and link on GCC 15 in debug mode. --------- Co-authored-by: ronlieb <ron.lieberman@amd.com>
2025-08-21Revert "[OpenMP] Add ompTest library to OpenMP" (#154742)Jan Patrick Lehr31-6709/+0
Reverts llvm/llvm-project#147381 A few buildbot failures for different reasons.
2025-08-21[OpenMP] Add ompTest library to OpenMP (#147381)Michael Halkenhäuser31-0/+6709
Description =========== OpenMP Tooling Interface Testing Library (ompTest) ompTest is a unit testing framework for testing OpenMP implementations. It offers a simple-to-use framework that allows a tester to check for OMPT events in addition to regular unit testing code, supported by linking against GoogleTest by default. It also facilitates writing concise tests while bridging the semantic gap between the unit under test and the OMPT-event testing. Background ========== This library has been developed to provide the means of testing OMPT implementations with reasonable effort. Especially, asynchronous or unordered events are supported and can be verified with ease, which may prove to be challenging with LIT-based tests. Additionally, since the assertions are part of the code being tested, ompTest can reference all corresponding variables during assertion. Basic Usage =========== OMPT event assertions are placed before the code, which shall be tested. These assertion can either be provided as one block or interleaved with the test code. There are two types of asserters: (1) sequenced "order-sensitive" and (2) set "unordered" assserters. Once the test is being run, the corresponding events are triggered by the OpenMP runtime and can be observed. Each of these observed events notifies asserters, which then determine if the test should pass or fail. Example (partial, interleaved) ============================== ```c++ int N = 100000; int a[N]; int b[N]; OMPT_ASSERT_SEQUENCE(Target, TARGET, BEGIN, 0); OMPT_ASSERT_SEQUENCE(TargetDataOp, ALLOC, N * sizeof(int)); // a ? OMPT_ASSERT_SEQUENCE(TargetDataOp, H2D, N * sizeof(int), &a); OMPT_ASSERT_SEQUENCE(TargetDataOp, ALLOC, N * sizeof(int)); // b ? OMPT_ASSERT_SEQUENCE(TargetDataOp, H2D, N * sizeof(int), &b); OMPT_ASSERT_SEQUENCE(TargetSubmit, 1); OMPT_ASSERT_SEQUENCE(TargetDataOp, D2H, N * sizeof(int), nullptr, &b); OMPT_ASSERT_SEQUENCE(TargetDataOp, D2H, N * sizeof(int), nullptr, &a); OMPT_ASSERT_SEQUENCE(TargetDataOp, DELETE); OMPT_ASSERT_SEQUENCE(TargetDataOp, DELETE); OMPT_ASSERT_SEQUENCE(Target, TARGET, END, 0); #pragma omp target parallel for { for (int j = 0; j < N; j++) a[j] = b[j]; } ``` References ========== This work has been presented at SC'24 workshops, see: https://ieeexplore.ieee.org/document/10820689 Current State and Future Work ============================= ompTest's development was mostly device-centric and aimed at OMPT device callbacks and device-side tracing. Consequentially, a substantial part of host-related events or features may not be supported in its current state. However, we are confident that the related functionality can be added and ompTest provides a general foundation for future OpenMP and especially OMPT testing. This PR will allow us to upstream the corresponding features, like OMPT device-side tracing in the future with significantly reduced risk of introducing regressions in the process. Build ===== ompTest is linked against LLVM's GoogleTest by default, but can also be built 'standalone'. Additionally, it comes with a set of unit tests, which in turn require GoogleTest (overriding a standalone build). The unit tests are added to the `check-openmp` target. Use the following parameters to perform the corresponding build: `LIBOMPTEST_BUILD_STANDALONE` (Default: ${OPENMP_STANDALONE_BUILD}) `LIBOMPTEST_BUILD_UNITTESTS` (Default: OFF) --------- Co-authored-by: Jan-Patrick Lehr <JanPatrick.Lehr@amd.com> Co-authored-by: Joachim <protze@rz.rwth-aachen.de>
2025-08-20[NFC][CMake] quote ${CMAKE_SYSTEM_NAME} consistently (#154537)David Tenty6-9/+9
A CMake change included in CMake 4.0 makes `AIX` into a variable (similar to `APPLE`, etc.) https://gitlab.kitware.com/cmake/cmake/-/commit/ff03db6657c38c8cf992877ea66174c33d0bcb0b However, `${CMAKE_SYSTEM_NAME}` unfortunately also expands exactly to `AIX` and `if` auto-expands variable names in CMake. That means you get a double expansion if you write: `if (${CMAKE_SYSTEM_NAME} MATCHES "AIX")` which becomes: `if (AIX MATCHES "AIX")` which is as if you wrote: `if (ON MATCHES "AIX")` You can prevent this by quoting the expansion of "${CMAKE_SYSTEM_NAME}", due to policy [CMP0054](https://cmake.org/cmake/help/latest/policy/CMP0054.html#policy:CMP0054) which is on by default in 4.0+. Most of the LLVM CMake already does this, but this PR fixes the remaining cases where we do not.
2025-08-20[OpenMP][OMPD] Fix GDB plugin to work correctly when installed (#153956)Michał Górny1-1/+1
Fix the `sys.path` logic in the GDB plugin to insert the intended self-path in the first position rather than appending it to the end. The latter implied that if `sys.path` (naturally) contained the GDB's `gdb-plugin` directory, `import ompd` would return the top-level `ompd/__init__.py` module rather than the `ompd/ompd.py` submodule, as intended by adding the `ompd/` directory to `sys.path`. This is intended to be a minimal change necessary to fix the issue. Alternatively, the code could be modified to import `ompd.ompd` and stop modifying `sys.path` entirely. However, I do not know why this option was chosen in the first place, so I can't tell if this won't break something. Fixes #153954 Signed-off-by: Michał Górny <mgorny@gentoo.org>
2025-08-18[OpenMP][Test][NFC] output tool data as hex to improve readibility (#152757)Joachim111-1659/+1865
Using hex format allows to better interpret IDs: the first digits represent the thread number, the last digits represent the ID within a thread The main change is in callback.h: PRIu64 -> PRIx64 The patch also guards RUN/CHECK lines in openmp/runtime/tests/ompt with clang-format on/off comments and clang-formats the directory. --------- Co-authored-by: Kaloyan Ignatov <kaloyan.ignatov@rwth-aachen.de>
2025-08-15[OpenMP] Update ompdModule.c printf to match argument type (#152785)CatherineMoore1-3/+4
Update printf format string to match argument list --------- Co-authored-by: Joachim <protze@rz.rwth-aachen.de> Co-authored-by: Joachim Jenke <jenke@itc.rwth-aachen.de>
2025-08-15[OpenMP] Update printf statement with missing argument. (#153704)CatherineMoore1-2/+3
2025-08-14[OpenMP] Update printf stmt in kmp_settings.cpp (#152800)CatherineMoore1-2/+2
Remove extraneous argument from printf statement --------- Co-authored-by: Joachim <protze@rz.rwth-aachen.de>
2025-08-06[OFFLOAD][OPENMP] 6.0 compatible interop interface (#143491)Alex Duran4-0/+59
The following patch introduces a new interop interface implementation with the following characteristics: * It supports the new 6.0 prefer_type specification * It supports both explicit objects (from interop constructs) and implicit objects (from variant calls). * Implements a per-thread reuse mechanism for implicit objects to reduce overheads. * It provides a plugin interface that allows selecting the supported interop types, and managing all the backend related interop operations (init, sync, ...). * It enables cooperation with the OpenMP runtime to allow progress on OpenMP synchronizations. * It cleanups some vendor/fr_id mismatchs from the current query routines. * It supports extension to define interop callbacks for library cleanup.
2025-08-05[OpenMP] Fix LLVM_ENABLE_PROJECTS=openmp build (#151117)Michael Kruse1-0/+11
Set LLVM_TREE_AVAILABLE when not defined after #149871. In particular, the LLVM build tree is obviously available with `add_subdirectory(openmp)` from the LLVM build tree itself. Note that this build mode is deprecated since #136314.
2025-07-26[OpenMP] Update %preload-tool definition on DarwinAiden Grossman1-1/+1
This was updated in some earlier commits but was never updated on Darwin because I was testing locally on Linux and it does not seem like there are any buildbots testing this configuration. Update it since it should be trivial and will definitely be broken otherwise.
2025-07-26[OpenMP] Remove %preload-tool definition from archer tests (#150779)Aiden Grossman1-7/+0
This was added in 2b8115b10b03013b9f8ae0aa56b0cd6a6a6dd4fd and it looks like this wass essentially a copy paste from one of the other lit config files. This substitution is unused within the tests however and contains a deprecated %T directive, so remove it.
2025-07-26[OpenMP] Move tool tests out of individual folders (#150780)Aiden Grossman3-0/+0
I did not realize that these were originally in separate folders to allow for the use of %T. Now that we have switched over to creating dirs using %t, we can move these into a common folder and make things a little bit more clean.
2025-07-26[OpenMP] Fix tool tests 9475ed84909463ad594602dd76583f4ff12efcd0Aiden Grossman1-1/+1
These were still passing because I did not clear all the test artifacts in between so the old ones were still present after updating the test. I forgot to update a lit substitution which failed on clean builds.
2025-07-25[OpenMP] Remove uses of %T from lit tests (#150723)Aiden Grossman3-24/+29
This patch removes all uses of %T from lit tests in OpenMP. %T has been deprecated for years and is not reccomended given it does not create a unique dir per test, allowing for race conditions. Remove uses of %T in OpenMP so we can eventually remove support for it in llvm-lit.
2025-07-26[OpenMP] Fix runtimes default build (#149871)Michael Kruse2-2/+2
The default build of openmp (`cmake -S <llvm-project>/runtimes -DLLVM_ENABLE_RUNTIMES=openmp`) current fails with ``` CMake Error at /home/meinersbur/src/llvm/flangrt/_src/cmake/Modules/GetClangResourceDir.cmake:17 (string): string sub-command REGEX, mode MATCH needs at least 5 arguments total to command. Call Stack (most recent call first): /home/meinersbur/src/llvm/flangrt/_src/openmp/CMakeLists.txt:126 (get_clang_resource_dir) ``` The reason is that because it is not a bootstrapping-build, the clang resource dir that it intends to write files such as `omp-tools.h` into, is unavailable. Using the Clang resource dir for writing files is conceptually broken, as that dir might be located in `/usr/lib/clang/<version>/`. Writing to it is only intended in bootstrapping builds where Clang is built alongside openmp. This patch unifies the identification of being in a bootstrapping built. The same `LLVM_TREE_AVAILABLE` definition is going to be used in #137828. No reason for each runtime to define its own.
2025-07-21[OpenMP] Fixup bugs found during fuzz testing (#143455)Jonathan Peyton13-77/+210
A lot of these only trip when using sanitizers with the library. * Insert forgotten free()s * Change (-1) << amount to 0xffffffffu as left shifting a negative is UB * Fixup integer parser to return INT_MAX when parsing huge string of digits. e.g., 452523423423423423 returns INT_MAX * Fixup range parsing for affinity mask so integer overflow does not occur * Don't assert when branch bits are 0, instead warn user that is invalid and use the default value. * Fixup kmp_set_defaults() so the C version only uses null terminated strings and the Fortran version uses the string + size version. * Make sure the KMP_ALIGN_ALLOC is power of two, otherwise use CACHE_LINE. * Disallow ability to set KMP_TASKING=1 (task barrier) this doesn't work and hasn't worked for a long time. * Limit KMP_HOT_TEAMS_MAX_LEVEL to 1024, an array is allocated based on this value. * Remove integer values for OMP_PROC_BIND. The specification only allows strings and CSV of strings. * Fix setting KMP_AFFINITY=disabled + OMP_DISPLAY_AFFINITY=TRUE
2025-07-21[OpenMP] [NFC] Remove KMP_NESTED_HOT_TEAMS macro (#143584)Jonathan Peyton5-126/+52
The feature was introduced back in 2014 and has been on ever since. Leave the feature in place. Removing only the macro.
2025-07-21[OpenMP] Improve performance of ticket lock (x86) (#143557)Jonathan Peyton1-7/+0
Ticket lock has a yield operation (shown below) which degrades performance on larger server machines due to an unconditional pause operation. ``` #define KMP_YIELD(cond) \ { \ KMP_CPU_PAUSE(); \ if ((cond) && (KMP_TRY_YIELD)) \ __kmp_yield(); \ } ```
2025-07-18[OpenMP] [NFC] Remove dead code: building task stack (#143589)Jonathan Peyton2-281/+1
This code hasn't been enabled since the first code changes were introduced. Remove the dead code.
2025-07-08Reland: [OpenMP][clang] 6.0: num_threads strict (part 1: host runtime) (#147532)Robert Imschweiler1-0/+6
OpenMP 6.0 12.1.2 specifies the behavior of the strict modifier for the num_threads clause on parallel directives, along with the message and severity clauses. This commit implements necessary host runtime changes. Reland https://github.com/llvm/llvm-project/pull/146403. After manual testing on a gfx90a machine, I could not reproduce the failing test, which makes it even more likely that the test has just been flaky. (Or at least that it's not an issue related to this patch.)
2025-07-08[OpenMP] OpenMP ThreadSet clause - basic runtime (#144409)Ritanya-B-Bharadwaj1-6/+9
Initial runtime support for threadset clause in task and taskloop directives [Section 14.8 in in OpenMP 6.0 spec] Frontend PR- https://github.com/llvm/llvm-project/pull/135807