summaryrefslogtreecommitdiffstats
path: root/openmp
Commit message (Collapse)AuthorAgeFilesLines
* [OpenMP][OMPT] fix reduction test for 32-bit x86protze@itc.rwth-aachen.de2020-02-051-3/+7
| | | | | | | | | | | | | | Fixes [[ https://bugs.llvm.org/show_bug.cgi?id=44733 | TEST 'libomp :: ompt/synchronization/reduction/tree_reduce.c' FAILED on 32-bit x86 ]] For 32-bit we need at least 3 variables to avoid atomic reduction to be choosen by runtime function `__kmp_determine_reduction_method`. This patch adds reduction variables to the testcase. Reviewers: mgorny, Hahnfeld Differential Revision: https://reviews.llvm.org/D73850 (cherry picked from commit 90e4ebdce55fd3c1f8877f19784a5339b9890f98)
* [openmp] Disable archer if LIBOMP_OMPT_SUPPORT is offMichał Górny2020-01-241-7/+9
| | | | | | | | | | This fixed build failures due to missing ompt headers. See https://bugs.gentoo.org/700762. Differential Revision: https://reviews.llvm.org/D73249 (cherry picked from commit 3c545e4b7318c337bed43d5bc76aad040565f1ef)
* [OpenMP][Tool] Fix memory leak and double-allocationJoachim Protze2020-01-171-6/+3
| | | | | | | | | | | Fix the memory leak pointed out in https://reviews.llvm.org/D70412. And a second one due to double-allocation. Reviewed by: Hahnfeld Differential revision: https://reviews.llvm.org/D72779 (cherry picked from commit 39f746d8def66ef8f5c4d3f1eb4c4cee4baac988)
* [LIBOMPTARGET] Do not increment/decrement the refcount for "declare target" ↵George Rokos2020-01-144-43/+95
| | | | | | | | objects The reference counter for global objects marked with declare target is INF. This patch prevents the runtime from incrementing /decrementing INF refcounts. Without it, the map(delete: global_object) directive actually deallocates the global on the device. With this patch, such a directive becomes a no-op. Differential Revision: https://reviews.llvm.org/D72525
* [OpenMP][Tool] Runtime warning for missing TSan-optionJoachim Protze2020-01-142-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | TSan spuriously reports for any OpenMP application a race on the initialization of a runtime internal mutex: ``` Atomic read of size 1 at 0x7b6800005940 by thread T4: #0 pthread_mutex_lock <null> (a.out+0x43f39e) #1 __kmp_resume_64 <null> (libomp.so.5+0x84db4) Previous write of size 1 at 0x7b6800005940 by thread T7: #0 pthread_mutex_init <null> (a.out+0x424793) #1 __kmp_suspend_initialize_thread <null> (libomp.so.5+0x8422e) ``` According to @AndreyChurbanov this is a false positive report, as the control flow of the runtime guarantees the ordering of the mutex initialization and the lock: https://software.intel.com/en-us/forums/intel-open-source-openmp-runtime-library/topic/530363 To suppress this report, I suggest the use of TSAN_OPTIONS='ignore_uninstrumented_modules=1'. With this patch, a runtime warning is provided in case an OpenMP application is built with Tsan and executed without this Tsan-option. Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D70412
* [nfc][libomptarget] Refactor nvptx/target_impl.cuJon Chesterfield2020-01-141-8/+3
| | | | | | | | | | | | | | | | | | | | | | | | Summary: [nfc][libomptarget] Refactor nxptx/target_impl.cu Use __kmpc_impl_atomic_add instead of atomicAdd to match the rest of the file. Alternatively, target_impl.cu could use the cuda functions directly. Using a mixture in this file was an oversight, happy to resolve in either direction. Removed some comments that look outdated. Call __kmpc_impl_unset_lock directly to avoid a redundant diagnostic and remove an implict dependency on interface.h. Reviewers: ABataev, grokos, jdoerfert Reviewed By: jdoerfert Subscribers: jfb, openmp-commits Tags: #openmp Differential Revision: https://reviews.llvm.org/D72719
* [nfc][libomptarget] Refactor amdgcn target_implJon Chesterfield2020-01-143-60/+57
| | | | | | | | | | | | | | | | | | | | | | | | Summary: [nfc][libomptarget] Refactor amdgcn target_impl Removes references to internal libraries from the header Standardises on C++ mangling for all the target_impl functions Update comment block clang-format Move some functions into a new target_impl.hip source file This lays the groundwork for implementing the remaining unresolved symbols in the target_impl.hip source. Reviewers: jdoerfert, grokos, ABataev, ronlieb Reviewed By: jdoerfert Subscribers: jvesely, mgorny, jfb, openmp-commits Tags: #openmp Differential Revision: https://reviews.llvm.org/D72712
* [OpenMP][Tool] Improving stack trace for ArcherJoachim Protze2020-01-131-2/+18
| | | | | | | | | | | | The OpenMP runtime is not instrumented, so entering the runtime leaves no hint on the source line of the pragma on ThreadSanitizer's function stack. This patch adds function entry/exit annotations for OpenMP parallel regions, and synchronization regions (barrier, taskwait, taskgroup). Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D70408
* [OpenMP][Tool] Make tests for archer dependent on TSanJoachim Protze2020-01-1313-26/+33
| | | | | | | | | | | | | If the openmp project is built standalone, the test compiler is feature tested for an available -fsanitize=thread flag. If the openmp project is built as part of llvm, the target tsan is needed to test archer. An additional line (requires tsan) was introduced to the tests, this patch updates the line numbers for the race. Follow-up for 77ad98c Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D71914
* [LIBOMPTARGET]Ignore empty target descriptors.Alexey Bataev2020-01-102-0/+21
| | | | | | | | | | | | | | | | | | Summary: If the dynamically loaded module has been compiled with -fopenmp-targets and has no target regions, it has empty target descriptor. It leads to a crash at the runtime if another module has at least one target region and at least one entry in its descriptor. The runtime library is unable to load the empty binary descriptor and terminates the execution. Caused by a clang-offload-wrapper. Reviewers: grokos, jdoerfert Subscribers: caomhin, kkwli0, openmp-commits Tags: #openmp Differential Revision: https://reviews.llvm.org/D72472
* [OpenMP] NFC: Fix trivial typos in commentsKazuaki Ishizaki2020-01-0739-72/+73
| | | | | | | | | | | | Reviewers: jdoerfert, Jim Reviewed By: Jim Subscribers: Jim, mgorny, guansong, jfb, openmp-commits Tags: #openmp Differential Revision: https://reviews.llvm.org/D72285
* [OpenMP] Fix incorrect property of __has_attribute() macroKelvin Li2020-01-061-1/+1
| | | | | | | | __has_attribute(fallthough) -> __has_attribute(fallthrough) Submitted by: kiszk (Kazuaki Ishizaki <ishizaki@jp.ibm.com>) Differential Revision: https://reviews.llvm.org/D72287
* [OpenMP] NFC: Fix trivial typos in commentsKelvin Li2020-01-0325-36/+36
| | | | | | Submitted by: kiszk Differential Revision: https://reviews.llvm.org/D72171
* [libomptarget][nfc] Change unintentional target_impl prefix to kmpc_implJon Chesterfield2019-12-303-7/+7
|
* [OpenMP] Implementation of OMPT reduction callbacksprotze@itc.rwth-aachen.de2019-12-277-6/+181
| | | | | | | | | Including two tests These callbacks were added late to the 5.0 specification, an implementation is missing. Reviewed By: jdoerfert Differential Review: https://reviews.llvm.org/D70395
* [libomptarget][nfc] Provide target_impl malloc/freeJon Chesterfield2019-12-195-3/+13
| | | | | | | | | | | | | | | | | Summary: [libomptarget][nfc] Provide target_impl malloc/free Sufficient to build support.cu for amdgcn Reviewers: jdoerfert, ABataev, grokos Reviewed By: jdoerfert Subscribers: jvesely, mgorny, openmp-commits Tags: #openmp Differential Revision: https://reviews.llvm.org/D71685
* [libomptarget][nvptx] Fix build, second symbol reorderingJonChesterfield2019-12-192-11/+11
|
* [libomptarget][nvptx] Fix build, symbol ordering in target_impl.hJon Chesterfield2019-12-192-11/+11
|
* [libomptarget][amdgcn] Correct return type of extern __clock64 to unsignedJonChesterfield2019-12-191-1/+1
|
* [libomptarget][nfc] Introduce atomic wrapper functionJon Chesterfield2019-12-188-25/+71
| | | | | | | | | | | | | | | | | | | Summary: [libomptarget][nfc] Introduce atomic wrapper function Wraps atomic functions in a template prefixed __kmpc_atomic that dispatches to cuda or hip atomic functions. Intended to be easily extended to dispatch to OpenCL or C++ atomics for a third target. Reviewers: ABataev, jdoerfert, grokos Reviewed By: jdoerfert Subscribers: Anastasia, jvesely, mgrang, dexonsmith, llvm-commits, mgorny, jfb, openmp-commits Tags: #openmp, #llvm Differential Revision: https://reviews.llvm.org/D71404
* [libomptarget][nfc] Extract function from data_sharing, move to commonJonChesterfield2019-12-185-17/+21
| | | | | | | | | | | | | | | | | | Summary: [libomptarget][nfc] Extract function from data_sharing, move to common Finding the first active thread in the warp is different on nvptx and amdgcn, mostly due to warp size and the desire for efficiency. Reviewers: ABataev, jdoerfert, grokos Reviewed By: jdoerfert Subscribers: jvesely, mgorny, openmp-commits Tags: #openmp Differential Revision: https://reviews.llvm.org/D71643
* [LIBOPENMP][NVPTX]Fix the build error in the runtime.Alexey Bataev2019-12-171-1/+1
|
* [libomptarget][nfc] Move three files under common, build them for amdgcnJonChesterfield2019-12-175-10/+9
| | | | | | | | | | | | | | | | | Summary: [libomptarget][nfc] Move three files under common, build them for amdgcn Change to reduction.cu to remove two dead includes, otherwise no code change. Reviewers: jdoerfert, ABataev, grokos Reviewed By: jdoerfert Subscribers: jvesely, mgorny, openmp-commits Tags: #openmp Differential Revision: https://reviews.llvm.org/D71601
* [libomptarget][nfc] Move omp locks under target_implJonChesterfield2019-12-178-31/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: [libomptarget][nfc] Move omp locks under target_impl These are likely to be target specific, even down to the lock_t which is correspondingly moved out of interface.h. The alternative is to include interface.h in target_impl which substantiatially increases the scope of those symbols. The current nvptx implementation deadlocks on amdgcn. The preferred implementation for that arch is still under discussion - this change leaves declarations in target_impl. The functions could be inline for nvptx. I'd prefer to keep the internals hidden in the target_impl translation unit, but will add the (possibly renamed) macros to target_impl.h if preferred. Reviewers: ABataev, jdoerfert, grokos Reviewed By: jdoerfert Subscribers: jvesely, mgorny, jfb, openmp-commits Tags: #openmp Differential Revision: https://reviews.llvm.org/D71574
* [libomptarget][nfc] Move timer functions behind target_implJon Chesterfield2019-12-173-8/+23
| | | | | | | | | | | | | | Summary: [libomptarget][nfc] Move timer functions behind target_impl Reviewers: jdoerfert, ABataev, grokos Reviewed By: jdoerfert Subscribers: jvesely, openmp-commits Tags: #openmp Differential Revision: https://reviews.llvm.org/D71584
* [libomptarget][nfc] Wrap cuda min() in target_implJon Chesterfield2019-12-175-5/+14
| | | | | | | | | | | | | | | | | | | | | | | | Summary: [libomptarget][nfc] Wrap cuda min() in target_impl nvptx forwards to cuda min, amdgcn implements directly. Sufficient to build parallel.cu for amdgcn, added to CMakeLists. All call sites are homogenous except one that passes a uint32_t and an int32_t. This could be smoothed over by taking two type parameters and some care over the return type, but overall I think the inline <uint32_t> calling attention to what was an implicit sign conversion is cleaner. Reviewers: ABataev, jdoerfert Reviewed By: jdoerfert Subscribers: jvesely, mgorny, openmp-commits Tags: #openmp Differential Revision: https://reviews.llvm.org/D71580
* Revert "Revert "[libomptarget] Move resource id functions into target ↵JonChesterfield2019-12-164-13/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | specific code, implement for amdgcn"" Summary: This reverts commit dd8a7fcdd73dd63529b81bf9f72c7529dfe99ec3. Alexey reports undefined symbols for the new inline functions defined in target_impl.h This does not reproduce for me for nvptx, or amdgcn, under release or debug builds. I believe the patch is fine, based on: - the semantics of an inline function in C++ (the cuda INLINE functions end up as linkonce_odr in IR), which are only legal to drop if they have no uses - the code generated from a debug build of clang 9 does not show these undef symbols - the tests pass - the code is trivial To progress from here I either need: - A tie break - someone to play the role of CI in determining whether the patch works - Alexey to provide sufficient information about his build for me to reproduce the failure - Alexey to debug why the symbols are disappearing for him and report back Reviewers: ABataev, jdoerfert, grokos Subscribers: jvesely, openmp-commits Tags: #openmp Differential Revision: https://reviews.llvm.org/D71502
* Revert "[libomptarget] Move resource id functions into target specific code, ↵Alexey Bataev2019-12-134-15/+13
| | | | | | | implement for amdgcn" This reverts commit dbb3fec8adfc4ac3fbf31f51f294427dbabbebb2 since it breaks the NVPTX tests.
* [libomptarget] Build most of common/src for amdgcnJon Chesterfield2019-12-131-1/+7
| | | | | | | | | | | | | | | | | | Summary: [libomptarget] Build most of common/src for amdgcn Excluding parallel.cu, which uses an integer min() from cuda, Excluding support.cu, which calls malloc that is not yet available for amdgcn Reviewers: jdoerfert, ABataev, grokos Reviewed By: jdoerfert Subscribers: gregrodgers, ronlieb, jvesely, mgorny, openmp-commits Tags: #openmp Differential Revision: https://reviews.llvm.org/D71446
* [libomptarget][nfc] Add nop syncwarp function for amdgcnJon Chesterfield2019-12-131-0/+4
|
* [libomptarget][nfc] Add declarations of atomic functions for amdgcnJon Chesterfield2019-12-123-0/+42
| | | | | | | | | | | | | | | | | | Summary: [libomptarget][nfc] Add declarations of atomic functions for amdgcn This enables building more source for amdgcn. The functions are usually available in a hip runtime header, but are duplicated here to decouple the implementation Reviewers: jdoerfert, ABataev, grokos Reviewed By: jdoerfert Subscribers: jvesely, mgorny, jfb, openmp-commits Tags: #openmp Differential Revision: https://reviews.llvm.org/D71412
* [libomptarget] Move resource id functions into target specific code, ↵Jon Chesterfield2019-12-124-13/+15
| | | | | | | | | | | | | | | | implement for amdgcn Summary: [libomptarget] Move resource id functions into target specific code, implement for amdgcn Reviewers: jdoerfert, ABataev, grokos Reviewed By: jdoerfert Subscribers: jvesely, mgorny, openmp-commits Tags: #openmp Differential Revision: https://reviews.llvm.org/D71382
* [libomptarget][nfc] Add missing header for amdgcn/target_implJon Chesterfield2019-12-121-1/+3
|
* [OpenMP] Fix linkage issue on FreeBSDDavid Carlier2019-12-061-1/+1
| | | | needs kmp_set_thread_affinity_mask_initial implementation.
* [libomptarget][nfc] Move cuda threadfence functions behind kmpc_implJonChesterfield2019-12-067-13/+21
| | | | | | | | | | | | | | | | | Summary: [libomptarget][nfc] Move cuda threadfence functions behind kmpc_impl Part of building code under common/ without requiring a cuda compiler Reviewers: ABataev, jdoerfert, grokos Reviewed By: ABataev Subscribers: jvesely, jfb, openmp-commits Tags: #openmp Differential Revision: https://reviews.llvm.org/D71102
* [libomptarget][nfc] Move three more files to commonJon Chesterfield2019-12-064-6/+6
| | | | | | | | | | | | | | Summary: [libomptarget][nfc] Move three more files to common Reviewers: ABataev, jdoerfert, grokos Reviewed By: ABataev Subscribers: openmp-commits Tags: #openmp Differential Revision: https://reviews.llvm.org/D71103
* [libomptarget][nfc] Introduce SHARED, ALIGN macrosJon Chesterfield2019-12-057-40/+44
| | | | | | | | | | | | | | | | Summary: [libomptarget][nfc] Introduce SHARED, ALIGN macros Move remaining cuda attributes behind such macros Reviewers: ABataev, jdoerfert, grokos Reviewed By: ABataev Subscribers: openmp-commits, jvesely Tags: #openmp Differential Revision: https://reviews.llvm.org/D71076
* [libomptarget][nfc] Move omptarget-nvptx under commonJon Chesterfield2019-12-0513-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: [libomptarget][nfc] Move omptarget-nvptx under common Almost all files depend on require omptarget-nvptx, which no longer contains any obviously architecture dependent code. Moving it under common unblocks task/loop for amdgcn, and allows moving other code. At some point there should probably be a widespread symbol renaming to replace the nvptx string. I'd prefer to get things working first. Building this (and task.cu, loop.cu) without a cuda library requires some more refactoring, e.g. wrap threadfence(), use DEVICE macro more consistently. Patches for that are orthogonal and will be posted shortly. Reviewers: jdoerfert, ABataev, grokos Reviewed By: ABataev Subscribers: mgorny, fedor.sergeev, jfb, openmp-commits Tags: #openmp Differential Revision: https://reviews.llvm.org/D71073
* [libomptarget] Build a minimal deviceRTL for amdgcnJonChesterfield2019-12-049-20/+162
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: [libomptarget] Build a minimal deviceRTL for amdgcn Repeat of D70414, with an include path fixed. Diff for sanity checking. The CMakeLists.txt file is functionally identical to the one used in the aomp fork. Whitespace changes were made based on nvptx/CMakeLists.txt, plus the copyright notice updated to match (Greg was the original author so would like his sign off on that here). This change will build a small subset of the deviceRTL if an appropriate toolchain is available, e.g. a local install of rocm. Support.h is moved from nvptx as a dependency of debug.h. Reviewers: ABataev, jdoerfert Reviewed By: ABataev Subscribers: jvesely, mgorny, jfb, openmp-commits, jdoerfert Tags: #openmp Differential Revision: https://reviews.llvm.org/D70971
* Revert "[libomptarget] Build a minimal deviceRTL for amdgcn"Alexey Bataev2019-12-035-183/+14
| | | | | This reverts commit 877ffa716fba52251a7454ffd3727d025b617a1f because it breaks the build.
* [libomptarget] Build a minimal deviceRTL for amdgcnJon Chesterfield2019-12-035-14/+183
| | | | | | | | | | | | | | | | | | | | | | | | Summary: [libomptarget] Build a minimal deviceRTL for amdgcn The CMakeLists.txt file is functionally identical to the one used in the aomp fork. Whitespace changes were made based on nvptx/CMakeLists.txt, plus the copyright notice updated to match (Greg was the original author so would like his sign off on that here). This change will build a small subset of the deviceRTL if an appropriate toolchain is available, e.g. a local install of rocm. Support.h is moved from nvptx as a dependency of debug.h. Reviewers: jdoerfert, ABataev, grokos, ronlieb, gregrodgers Reviewed By: jdoerfert Subscribers: jfb, Hahnfeld, jvesely, mgorny, openmp-commits Tags: #openmp Differential Revision: https://reviews.llvm.org/D70414
* [OpenMP] build offload plugins before testing themBryan Chan2019-11-283-1/+8
| | | | | | | | | | | | | | | Summary: "make check-all" or "make check-libomptarget" would attempt to run offloading tests before the offload plugins are built. This patch corrects that by adding dependencies to the libomptarget CMake rules. Reviewers: jdoerfert Subscribers: mgorny, guansong, openmp-commits Tags: #openmp Differential Revision: https://reviews.llvm.org/D70803
* [openmp] Fixed nonmonotonic schedule when #threads > #chunks in a loop.AndreyChurbanov2019-11-272-7/+48
| | | | Differential Revision: https://reviews.llvm.org/D70713
* [openmp] Recognise ARMv7ve machine arch.AndreyChurbanov2019-11-261-1/+1
| | | | | | Patch by raj.khem (Khem Raj) Differential Revision: https://reviews.llvm.org/D68543
* [OpenMP][Tool] archer tests require tsanprotze@itc.rwth-aachen.de2019-11-2226-5/+25
| | | | Testing for tsan capability in the test-compiler in follow-up review
* [OpenMP][Tool] disable archer tests in standalone buildprotze@itc.rwth-aachen.de2019-11-221-0/+5
| | | | Will be enabled after Build-Bots are fixed
* [OpenMP][Tool] Fix cmake variable in lit.site.cfg.inprotze@itc.rwth-aachen.de2019-11-221-1/+1
| | | | As noted in D45890
* [nfc][libomptarget] Remove casts of string literals to char*JonChesterfield2019-11-192-5/+4
|
* [nfc][libomptarget] Write amdgcn macros in terms of compiler intrinsicsJonChesterfield2019-11-191-3/+3
|
* Fix openmp on PowerPC64-BE-ELFv2 ABI on FreeBSD.AndreyChurbanov2019-11-192-15/+15
| | | | | | Patch by adalava (Alfredo Dal'Ava J.nior) Differential Revision: https://reviews.llvm.org/D67190
OpenPOWER on IntegriCloud