aboutsummaryrefslogtreecommitdiff
path: root/openmp
AgeCommit message (Collapse)AuthorFilesLines
4 hours[OpenMP] Don't hardcode _WIN32_WINNT for MinGW targets (#115708)Martin Storsjö1-1/+6
Instead respect what the toolchain default is (or what the user sets via CMAKE_CXX_FLAGS). This fixes builds with libcxx, with mingw toolchains targeting msvcrt.dll, after 5d8be4c036aa5ce4a94f1f37a9155d5c877e23db; after that commit, the libcxx public headers reference symbols such as iswspace_l, which are unavailable when targeting msvcrt.dll on older versions of Windows (it's only available in msvcrt.dll since Windows Vista).
9 days[Offload] Provide a CMake cache file to easily build offloading (#115074)Joseph Huber1-1/+17
Summary: This patch adds a cache file that will automatically enable openpm, offload, and all the fancy GPU libraries.
12 days[OpenMP] Using `SimpleVLA` to handle vla usage in ompt-general.cpp. (#114583)Daniel Chen1-2/+3
The `openmp` runtime failed to build on LoP with LLVM18 on LoP due to the addition of `-Wvla-cxx-extension` as ``` llvm-project/openmp/runtime/src/ompt-general.cpp:711:15: error: variable length arrays in C++ are a Clang extension [-Werror,-Wvla-cxx-extension] 711 | int tmp_ids[ids_size]; | ^~~~~~~~ llvm-project/openmp/runtime/src/ompt-general.cpp:711:15: note: function parameter 'ids_size' with unknown value cannot be used in a constant expression llvm-project/openmp/runtime/src/ompt-general.cpp:704:65: note: declared here 704 | OMPT_API_ROUTINE int ompt_get_place_proc_ids(int place_num, int ids_size, | ^ 1 error generated. ``` This patch is to ignore the checking against this usage.
2024-11-02[NFC] Simple typo correction. (#114548)c8ef1-1/+1
2024-10-25[OpenMP] Create versioned libgomp softlinks (#112973)Ye Luo1-1/+17
Add libgomp.1.dylib for MacOS and libgomp.so.1 for Linux Linkers on Mac and Linux pick up versioned libgomp dynamic library files. The existing softlinks (libgomp.dylib for MacOS and libgomp.so for Linux) are insufficient. This helps alleviate the issue of mixing libgomp and libomp at runtime.
2024-10-24[OpenMP] Fix the test issue when `libomp` is built as a static library (#113522)Shilei Tian1-1/+1
2024-10-18Revert "Renormalize line endings whitespace only after dccebddb3b80"Luke Drummond1-1822/+1822
This reverts commit 9d98acb196a40fee5229afeb08f95fd36d41c10a.
2024-10-17[OpenMP] Fix missing gtid argument in __kmp_print_tdg_dot function (#111986)Josep Pinot1-2/+3
This patch modifies the signature of the `__kmp_print_tdg_dot` function in `kmp_tasking.cpp` to include the global thread ID (gtid) as an argument. The gtid is now correctly passed to the function. - Updated the function declaration to accept the gtid parameter. - Modified all calls to `__kmp_print_tdg_dot` to pass the correct gtid value. This change addresses issues encountered when compiling with `OMPX_TASKGRAPH` enabled. No functional changes are expected beyond successful compilation.
2024-10-17Renormalize line endings whitespace only after dccebddb3b80Luke Drummond1-1822/+1822
Line ending policies were changed in the parent, dccebddb3b80. To make it easier to resolve downstream merge conflicts after line-ending policies are adjusted this is a separate whitespace-only commit. If you have merge conflicts as a result, you can simply `git add --renormalize -u && git merge --continue` or `git add --renormalize -u && git rebase --continue` - depending on your workflow.
2024-10-14[openmp] Use core_siblings_list if physical_package_id not available (#111831)Nikita Popov2-30/+72
On powerpc, physical_package_id may not be available. Currently, this causes openmp to fall back to flat topology and various affinity tests fail. Fix this by parsing core_siblings_list to deterimine which cpus belong to the same socket. This matches what the testing code does. The code to parse the CPU list format thankfully already exists. Fixes https://github.com/llvm/llvm-project/issues/111809.
2024-10-10[flang][driver] rename flang-new to flang (#110023)Brad Richardson1-2/+2
This does a global rename from `flang-new` to `flang`. I also removed/changed any TODOs that I found related to making this change. --------- Co-authored-by: H. Vetinari <h.vetinari@gmx.com> Co-authored-by: Andrzej Warzynski <andrzej.warzynski@arm.com>
2024-10-09[openmp] Add option to disable tsan tests (#111548)Nikita Popov3-2/+5
This adds a OPENMP_TEST_ENABLE_TSAN option that allows to override whether tests using tsan will be enabled. The option defaults to the existing auto-detection. The background here is https://github.com/llvm/llvm-project/issues/111492, where we have some systems where tsan doesn't work, but we do still want to build it and run tests that don't use tsan.
2024-10-08[libomp][AIX] Use SO version "1" for AIX libomp (#111384)Xing Xue1-5/+10
For `libomp` on AIX, we build shared object `libomp.so` first and then archive it into libomp.a. This patch changes to use SO version `1` and name the shared object `libomp.so.1` so that it is consistent with the naming of other shared objects in AIX libraries, e.g., `libc++.so.1` in `libc++.a`. With this change, the change made in commit bde51d9b0d473447ea12fb14924f14ea167eec85 to ensure only `libomp.a` is published on AIX is no longer necessary and is removed.
2024-10-02[Offload][Doc] Add 'offload' in OpenMP target doc (#110141)Baodi Shan1-1/+1
Fix #106399
2024-09-18[libomp][AIX] Ensure only libomp.a is published on AIX (#109016)Xing Xue1-1/+5
For `libomp` on AIX, we build shared object `libomp.so` first and then archive it into `libomp.a`. Due to a CMake for AIX problem, the install step also tries to publish `libomp.so`. While we use a script to build `libomp.a` out-of-tree for Clang and avoided the problem, this chokes the in-tree build for Flang. The issue will be reported to CMake but before a fixed CMake is available, this patch ensures only `libomp.a` is published.
2024-09-05[OpenMP] LIBOMPTARGET_DEVICE_ARCHITECTURES requires semicolons (#107454)Joel E. Denny1-4/+4
If I use commas to delimit architectures in `LIBOMPTARGET_DEVICE_ARCHITECTURES`, cmake for the runtimes complains: ``` Unknown GPU architecture 'sm_70,sm_80,sm_90' ``` Semicolons are required instead.
2024-08-31[OpenMP] Support setting POSIX thread name on *BSD's and Solaris (#106489)Brad Smith3-7/+15
2024-08-15[OpenMP] Add support for pause with omp_pause_stop_tool (#97100)Hansang Bae7-3/+55
This patch adds support for pause resource with a new enumerator omp_pause_stop_tool. The expected behavior of this enumerator is * omp_pause_resource: not allowed * omp_pause_resource_all: equivalent to omp_pause_hard
2024-08-15[OpenMP] Miscellaneous small code improvements (#95603)Hansang Bae9-20/+32
Removes a few uninitialized variables, possible resource leaks, and redundant code.
2024-08-14[OpenMP] Implement 'omp_alloc' on the device (#102526)Joseph Huber1-0/+8
Summary: The 'omp_alloc' function should be callable from a target region. This patch implemets it by simply calling `malloc` for every non-default trait value allocator. All the special access modifiers are unimplemented and return null. The null allocator returns null as the spec states it should not be usable from the target.
2024-08-13[OpenMP] Rename worker threads for improved debuggability (#102065)HighW4y2H3ll3-0/+14
Rename the worker threads "openmp_worker" --------- Co-authored-by: h2h <h2h@meta.com> Co-authored-by: Matthias Braun <matze@braunis.de>
2024-08-13[OpenMP][AArch64] Fix branch protection in microtasks (#102317)Tulio Magno Quites Machado Filho1-0/+53
Start __kmp_invoke_microtask with PACBTI in order to identify the function as a valid branch target. Before returning, SP is authenticated. Also add the BTI and PAC markers to z_Linux_asm.S. With this patch, libomp.so can now be generated with DT_AARCH64_BTI_PLT when built with -mbranch-protection=standard. The implementation is based on the code available in compiler-rt.
2024-08-11[openmp][runtime] Silence warningsAlexandre Ganea1-1/+2
This fixes several of those when building with MSVC on Windows: ``` [3625/7617] Building CXX object projects\openmp\runtime\src\CMakeFiles\omp.dir\kmp_affinity.cpp.obj C:\src\git\llvm-project\openmp\runtime\src\kmp_affinity.cpp(2637): warning C4062: enumerator 'KMP_HW_UNKNOWN' in switch of enum 'kmp_hw_t' is not handled C:\src\git\llvm-project\openmp\runtime\src\kmp.h(628): note: see declaration of 'kmp_hw_t' ```
2024-08-07[openmp][WebAssembly] Allow openmp to compile and run under emscripten ↵arsnyder163-23/+9
toolchain (#95169) * Separate wasi and emscripten as they have different constraints and abilities * Emscripten mimics Linux/POSIX by statically linking the musl runtime. This allow nearly all KMP_OS_LINUX code paths to work correctly. There are only a few places that need to be adjusted related to dynamic linking (dl_open) * Internally link openmp globals * With CommonLinkage it is needed to emit them in an assembly file, now they are defined and used within each compilation unit * With ExternalLinkage they suffer from duplicate symbols during linking for unnamed globals like reduction/critical * Interestingly this aligns with the TODO comment above this code
2024-07-31[Offload] Allow to record kernel launch stack traces (#100472)Johannes Doerfert1-0/+7
Similar to (de)allocation traces, we can record kernel launch stack traces and display them in case of an error. However, the AMD GPU plugin signal handler, which is invoked on memroy faults, cannot pinpoint the offending kernel. Insteade print `<NUM>`, set via `OFFLOAD_TRACK_NUM_KERNEL_LAUNCH_TRACES=<NUM>`, many traces. The recoding/record uses a ring buffer of fixed size (for now 8). For `trap` errors, we print the actual kernel name, and trace if recorded.
2024-07-30[Offload] Implement double free (and other allocation error) reporting (#100261)Johannes Doerfert1-0/+7
As a first step towards a GPU sanitizer we now can track allocations and deallocations in order to report double frees, and other problems during deallocation.
2024-07-29[OpenMP] Assign thread ids in the cpuinfo topology method (#91013)Jonathan Peyton1-0/+26
On non-hyperthreaded machines, the thread id is not always explicit in the /proc/cpuinfo file. This patch adds a check to ensure the thread ids are put in.
2024-07-29[OpenMP] Add topology and affinity changes for Meteor Lake (#91012)Jonathan Peyton2-115/+383
These are Intel-specific changes for the CPUID leaf 31 method for detecting machine topology. * Cleanup known levels usage in x2apicid topology algorithm Change to be a constant mask of all Intel topology type values. * Take unknown ids into account when sorting them If a hardware id is unknown, then put further down the hardware thread list so it will take last priority when assigning to threads. * Have sub ids printed out for hardware thread dump * Add caches to topology New` kmp_cache_ids_t` class helps create cache ids which are then put into the topology table after regular topology type ids have been put in. * Allow empty masks in place list creation Have enumeration information and place list generation take into account that certain hardware threads may be lacking certain layers * Allow different procs to have different number of topology levels Accommodates possible situation where CPUID.1F has different depth for different hardware threads. Each hardware thread has a topology description which is just a small set of its topology levels. These descriptions are tracked to see if the topology is uniform or not. * Change regular ids with logical ids Instead of keeping the original sub ids that the x2apicid topology detection algorithm gives, change each id to its logical id which is a number: [0, num_items - 1]. This makes inserting new layers into the topology significantly simpler. * Insert caches into topology This change takes into account that most topologies are uniform and therefore can use the quicker method of inserting caches as equivalent layers into the topology.
2024-07-24[OpenMP][libomp] Fix tasking debug assert (#95823)Jonathan Peyton3-1/+118
The debug assert is meant to check that the index is a valid which means the runtime needs to check against the size of the array instead of the number of threads. A free()-ed thread put back in the thread pool may index into anywhere inside the task team's available array from 0 to tt_max_threads potentially. Fixes: #94260
2024-07-23Clear release notes for upcoming LLVM 20 dev cyclellvmorg-20-initTobias Hieta1-1/+1
2024-07-19[Clang][OpenMP] Add interchange directive (#93022)Michael Kruse5-0/+922
Add the interchange directive which will be introduced in the upcoming OpenMP 6.0 specification. A preview has been published in [Technical Report 12](https://www.openmp.org/wp-content/uploads/openmp-TR12.pdf).
2024-07-18[Clang][OpenMP] Add reverse directive (#92916)Michael Kruse5-0/+687
Add the reverse directive which will be introduced in the upcoming OpenMP 6.0 specification. A preview has been published in [Technical Report 12](https://www.openmp.org/wp-content/uploads/openmp-TR12.pdf). --------- Co-authored-by: Alexey Bataev <a.bataev@outlook.com>
2024-07-16[OpenMP] Use new OMPT state and sync kinds for barrier events (#95602)Hansang Bae26-539/+507
This change makes the runtime use new OMPT state and sync kinds introduced in OpenMP 5.1 in place of the deprecated implicit state and sync kinds. Events from implicit barriers use different enumerators for workshare, parallel, and teams.
2024-07-16[OpenMP] Fix comparison to None in openmp/**.py (#94020)Eisuke Kawashima1-1/+1
from PEP8 (https://peps.python.org/pep-0008/#programming-recommendations): > Comparisons to singletons like None should always be done with is or is not, never the equality operators. Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2024-07-16[OpenMP] Fix comparison to True/False in openmp/**.py (#94041)Eisuke Kawashima2-2/+2
from PEP8 (https://peps.python.org/pep-0008/#programming-recommendations): > Comparisons to singletons like None should always be done with is or is not, never the equality operators. Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2024-07-05[openmp] Silence warning when building the x64 Windows LLVM release packageAlexandre Ganea1-1/+3
This fixes: ``` MASM : warning A4018:invalid command-line option : -U_GLIBCXX_ASSERTIONS ```
2024-07-05[openmp] Add ompdModule dependency to check-ompd (#97736)Nikita Popov1-1/+1
ompdModule is required by the gdb plugin. Ran into this when trying to run check-ompd without explicitly building openmp first.
2024-07-05[ompd] Fix strict aliasing violation in TargetValue::getValue() (#97739)Nikita Popov1-16/+21
For the case where baseTypeSize does not match the size of T, read the value into a separate char buffer first. This avoids accessing buf using two different types. Fixes https://github.com/llvm/llvm-project/issues/94616.
2024-07-03[OpenMP] Fix use of ompt_start_tool in ompd test. (#97616)Hansang Bae1-2/+2
2024-07-03[OpenMP] Add ompt_start_tool declaration in omp-tools.h (#97099)Hansang Bae1-0/+8
The function ompt_start_tool is a globally-visible C function according to the specification.
2024-07-03[OpenMP][OMPT] Indicate loop schedule for worksharing-loop events (#97429)Joachim23-215/+199
Use more specific values from `ompt_work_t` to allow the tool identify the schedule of a worksharing-loop. With this patch, the runtime will report the schedule chosen by the runtime rather than necessarily the schedule literally requested by the clause. E.g., for guided + just one iteration per thread, the runtime would choose and report static. Fixes issue #63904
2024-07-02[OpenMP] Add missing export for dynamic tracking patch (#97419)Gheorghe-Teodor Bercea1-0/+1
Add missing export for OpenMP non-offloading builds.
2024-07-01[OpenMP] [OMPT] Callback registration should not depend on the device init ↵dhruvachak1-16/+10
callback. (#96371) Even if the device init callback is not registered, a tool should be allowed to register other callbacks.
2024-07-01[OpenMP][offload] Fix dynamic schedule tracking (#97065)Gheorghe-Teodor Bercea2-0/+7
This patch fixes the dynamic schedule tracking.
2024-06-28[OpenMP] Fix test omp_parallel_num_threads_list.c to require fewer threads. ↵Terry Wilmarth1-14/+14
(#96916) Original test case used too many threads for some environments. This update reduces to a max of 36 threads.
2024-06-24[OpenMP] Add num_threads clause list format and strict modifier support (#85466)Terry Wilmarth6-20/+520
Add support to the runtime for 6.0 spec features that allow num_threads clause to take a list, and also make use of the strict modifier. Provides new compiler interface functions for these features.
2024-06-20[OpenMP][libomp] Remove Perl in favor of Python (#95307)Jonathan Peyton20-5618/+987
* Removes all Perl scripts and modules * Adds Python3 scripts which mimic the behavior of the Perl scripts * Removes Perl from CMake; Adds Python3 requirement to CMake * The check-instruction-set.pl script is Knights Corner specific. The script is removed and not replicated with a corresponding Python3 script. Relevant Discourse: https://discourse.llvm.org/t/error-compiling-clang-with-offloading-support/79223/4 Fixes: https://github.com/llvm/llvm-project/issues/62289
2024-06-14[OpenMP] Add Environment Variable to disable Reuse of Blocks for High Loop ↵Tim Gymnich1-0/+7
Trip Counts (#89239) Sometimes it might be beneficial to spawn more thread blocks instead of reusing existing for multiple loop iterations. **Alternatives considered:** Make `DefaultNumBlocks` settable via an environment variable. --------- Co-authored-by: Joseph Huber <huberjn@outlook.com>
2024-06-13[llvm-project] Fix typo "seperate" (#95373)Jay Foad1-1/+1
2024-06-07[OpenMP][Offload] - Ensure OPENMP_STANDALONE_BUILD is defined (#94801)estewart081-0/+2
Without a value set conditional checks like if(NOT ${OPENMP_STANDALONE_BUILD}) will not be able to evaluate to true. Fixes issue introduced from PR #93463, which did not allow the OMPT variable to be propogated up to offload during a runtimes build.