summaryrefslogtreecommitdiff
path: root/openmp
AgeCommit message (Collapse)Author
2018-10-01[libomptarget-nvptx] Enable asserts in bclibJonas Hahnfeld
If the user requested LIBOMPTARGET_NVPTX_DEBUG, include asserts in the bitcode library. Everything else will have very unpleasent effects because asserts will appear when falling back to the static library libomptarget-nvptx.a. Differential Revision: https://reviews.llvm.org/D52701
2018-10-01[libomptarget-nvptx] reduction: Determine if runtime uninitializedJonas Hahnfeld
Pass in the correct value of isRuntimeUninitialized() which solves parallel reductions as reported on the mailing list. For reference: r333285 did the same for loop scheduling. Differential Revision: https://reviews.llvm.org/D52725
2018-10-01Fixed workaround made in https://reviews.llvm.org/D51694.Andrey Churbanov
Patch suggested by Kelvin Li: removed optional "kind=" part of kind-selector for variables with long names and kind names. Differential Revision: https://reviews.llvm.org/D52712
2018-09-30[libomptarget-nvptx] Align data sharing stackJonas Hahnfeld
NVPTX requires addresses of pointer locations to be 8-byte aligned or there will be an exception during runtime. This could happen without this patch as shown in the added test: getId() requires 4 byte of stack and putValueInParallel() uses 16 bytes to store the addresses of the captured variables. Differential Revision: https://reviews.llvm.org/D52655
2018-09-30[libomptarget-nvptx] Fix ancestor_thread_num and team_size (non-SPMD)Jonas Hahnfeld
According to OpenMP 4.5, p250:12-14: If the requested nest level is outside the range of 0 and the nest level of the current thread, as returned by the omp_get_level routine, the routine returns -1. The SPMD code path will need a similar fix. Differential Revision: https://reviews.llvm.org/D51787
2018-09-29[libomptarget-nvptx] Add tests for nested parallelismJonas Hahnfeld
Clang trunk will serialize nested parallel regions. Check that this is correctly reflected in various API methods. Differential Revision: https://reviews.llvm.org/D51786
2018-09-29[libomptarget-nvptx] Ignore calls to dynamic APIJonas Hahnfeld
There is no support and according to the OpenMP 4.5, p238:7-9: For implementations that do not support dynamic adjustment of the number of threads this routine has no effect: the value of dyn-var remains false. Add a test that cancellation and nested parallelism aren't supported either. Differential Revision: https://reviews.llvm.org/D51785
2018-09-29[libomptarget-nvptx] Fix number of threads in parallelJonas Hahnfeld
If there is no num_threads() clause we must consider the nthreads-var ICV. Its value is set by omp_set_num_threads() and can be queried using omp_get_max_num_threads(). The rewritten code now closely resembles the algorithm given in the OpenMP standard. Differential Revision: https://reviews.llvm.org/D51783
2018-09-28[OPENMP] Add the test to check that the libomptarget does not causeAlexey Bataev
infinite loop on removing non-mapped pointer-with-object. Added test to check that libomptarget does not cause infinite loop when trying to unmap the pointer-with-object data that was not previously mapped.
2018-09-28[libomptarget-nvptx] Add testing infrastructureJonas Hahnfeld
This patch also introduces testing for libomptarget-nvptx which has been missing until now. I propose to add tests for all bugs that are fixed in the future. The target check-libomptarget-nvptx is not run by default because - we can't determine if there is a GPU plugged into the system. - it will require the latest Clang compiler. Keeping compatibility with older releases would prevent testing newer code generation developed in trunk. Differential Revision: https://reviews.llvm.org/D51687
2018-09-26[OpenMP] Add missing __kmpc_critical_with_hint to dllexportsJonathan Peyton
This patch puts the __kmpc_critical_with_hint function in dllexports and also replaces some OMP_45_ENABLED to OMP_50_ENABLED Differential Revision: https://reviews.llvm.org/D52380
2018-09-26[OpenMP] Fix balanced affinity so thread's private affinity mask is updatedJonathan Peyton
Balanced affinity only updated the thread's affinity with the operating system. This change also has the thread's private mask reflect that change as well so that any API that probes the thread's affinity mask will report the correct mask value. Differential Revision: https://reviews.llvm.org/D52379
2018-09-26[OpenMP] Update ittnotify sourcesJonathan Peyton
This patch updates the ittnotify sources to the latest corresponding with Intel(R) VTune(TM) Amplifier 2018 Differential Revision: https://reviews.llvm.org/D52378
2018-09-26[OpenMP] Fix performance issue from 376.kdtreeJonathan Peyton
This change improves the performance of 376.kdtree by giving the compiler an opportunity to do inlining and other optimizations for the call path, __kmpc_omp_task_complete_if0()->__kmp_task_finish(), which is one of the hot paths in the program; some functions in kmp_taskdeps.cpp were moved to the new header file, kmp_taskdeps.h to achieve this. Patch by Hansang Bae Differential Revision: https://reviews.llvm.org/D51889
2018-09-26[OpenMP][OMPT] A few improvementsJonathan Peyton
This change includes miscellaneous improvements as follows: 1) Added ompt_get_proc_id() implementation for Windows 2) Added parser and print tool for omp-tool-var, just in case it needs to be printed (OMP_DISPLAY_ENV) 3) omp_control_tool is exported on Windows Patch by Hansang Bae Differential Revision: https://reviews.llvm.org/D50538
2018-09-25[OpenMP][libomptarget] Set the frame pointer then test empty slot conditionGheorghe-Teodor Bercea
Summary: NFC - just fixing a bug: the empty slot test was before the re-setting of the Stack pointer. Reviewers: ABataev, caomhin, Hahnfeld Reviewed By: ABataev Subscribers: guansong, openmp-commits Differential Revision: https://reviews.llvm.org/D52122
2018-09-25[OpenMP][libomptarget] Simplify warp master selection for data sharingGheorghe-Teodor Bercea
Summary: There is currently no supported situation where the warp master is not the first thread in the warp. This also avoids the device execution from hanging on Volta GPUs when ballot_sync is called by a number of threads that is less that the size of a warp. Reviewers: ABataev, caomhin, grokos Reviewed By: grokos Subscribers: guansong, openmp-commits Differential Revision: https://reviews.llvm.org/D50188
2018-09-21[OPENMP][NVPTX] Add support for lastprivates/reductions handling in SPMD ↵Alexey Bataev
constructs with lightweight runtime. Summary: We need the support for per-team shared variables to support codegen for lastprivates/reductions. Patch adds this support by using shared memory if the total size of the reductions/lastprivates is <= 128 bytes, then pre-allocated buffer in global memory if size is <= 4K bytes,or uses malloc/free, otherwise. Reviewers: gtbercea, kkwli0, grokos Subscribers: guansong, openmp-commits Differential Revision: https://reviews.llvm.org/D51875
2018-09-11[OPENMP]Increment iterator when the loop is continued.Alexey Bataev
Summary: Missed operation of the incrementing iterator when required just to continue execution. Reviewers: kkwli0, gtbercea, grokos Subscribers: guansong, openmp-commits Differential Revision: https://reviews.llvm.org/D51937
2018-09-10[OMPT] Update types according to TR7Joachim Protze
Some types and callback signatures have changed from TR6 to TR7. Major changes (only adding signatures and stubs): (-remove idle callback) done by D48362 -add reduction and dispatch callback -add get_task_memory and finalize_tool runtime entry points -ompt_invoker_t becomes ompt_parallel_flag_t -more types of sync_regions Patch provided by Simon Convent Reviewers: hbae, protze.joachim Differential Revision: https://reviews.llvm.org/D50774
2018-09-08[libomptarget-nvptx] Remove last mentions of __kmpc_print_*Jonas Hahnfeld
Their implementation was removed during review, delete their prototype declarations.
2018-09-07[OpenMP] Update copyright to 2018Jonathan Peyton
Better late than never
2018-09-07[OpenMP] Change hint parameter type for critical to uint32_tJonathan Peyton
Add atomic hint flags to the enum. The hint parameter type was changed to uint32_t in __kmpc_critical_with_hint() Patch by Olga Malysheva Differential Revision: https://reviews.llvm.org/D51235
2018-09-07[OpenMP] Synchronization hint constants added to headersJonathan Peyton
ident flags reserved for atomic hints. This patch adds omp_sync_hint_t to omp.h and omp_sync_hint_kind to omp_lib.h. For better maintainability the list of macros for ident flags was replaced with a enum. The new KMP_IDENT_ATOMIC_HINT_MASK was added to the enum to support possible future atomic hints. Also fix omp_lib.h.var to be under 72 chars again after 5.0 OpenMP Memory commit Patch by Olga Malysheva Differential Revision: https://reviews.llvm.org/D51233
2018-09-07[OpenMP] Initial implementation of OMP 5.0 Memory Management routinesJonathan Peyton
Implemented omp_alloc, omp_free, omp_{set,get}_default_allocator entries, and OMP_ALLOCATOR environment variable. Added support for HBW memory on Linux if libmemkind.so library is accessible (dynamic library only, no support for static libraries). Only used stable API (hbwmalloc) of the memkind library though we may consider using experimental API in future. The ICV def-allocator-var is implemented per implicit task similar to place-partition-var. In the absence of a requested allocator, the uses the default allocator. Predefined allocators (the only ones currently available) are made similar for C and Fortran, - pointers (long integers) with values 1 to 8. Patch by Andrey Churbanov Differential Revision: https://reviews.llvm.org/D51232
2018-09-07Fix for https://bugs.llvm.org/show_bug.cgi?id=38839:Andrey Churbanov
Changed style of declarations to be less than 72 char each. Differential Revision: https://reviews.llvm.org/D51694
2018-09-06[libomptarget] Remove two unneeded includes, NFCI.Jonas Hahnfeld
Follow-up to r340542 and r340767.
2018-09-05[libomptaret][test] Announce compiler featuresJonas Hahnfeld
This is a follow-up to r341371: The new test for PR38704 doesn't work with Clang 6.0. It uses an UNSUPPORTED: clang-6, but that hasn't worked because the compiler features weren't known to lit.
2018-09-04[libomptarget] Remove `Devices` from `RTLInfoTy`Sergey Dmitriev
This patch removes unused field `Devices` from `RTLInfoTy`. Differential Revision: https://reviews.llvm.org/D51653
2018-09-04[libomptarget][CUDA] Use cuDeviceGetAttribute, NFCI.Jonas Hahnfeld
cuDeviceGetProperties has apparently been deprecated since CUDA 5.0. Nvidia started using annotations only in CUDA 9.2, so nobody noticed nor cared before. The new function returns the same values, tested with a P100. Differential Revision: https://reviews.llvm.org/D51624
2018-09-04[libomptarget] PR38704: Fix erase of ShadowPtrMapJonas Hahnfeld
erase() invalidates the iterator and returns a new one pointing to the following element. The code now follows the example at https://en.cppreference.com/w/cpp/container/map/erase. (The added testcase crashes without this patch.) Reported by David Binderman (https://llvm.org/PR38704)! Differential Revision: https://reviews.llvm.org/D51623
2018-09-04[libomptarget][NVPTX] Drop dead code and data structures, NFCI.Jonas Hahnfeld
* cg and HasCancel in WorkDescr were never read and can be removed. * This eliminates the last use of priv in ThreadPrivateContext. * CounterGroup is unused afterwards. * Remove duplicate external declares in omptarget-nvptx.cu that are already in the header omptarget-nvptx.h. Differential Revision: https://reviews.llvm.org/D51622
2018-09-03[libomptarget][NVPTX] Fix __kmpc_spmd_kernel_deinitJonas Hahnfeld
If the runtime is uninitialized the master thread must Enqueue the state object, and ALL threads must return immediately. Found post-commit of https://reviews.llvm.org/D51222.
2018-08-29[OPENMP][NVPTX] Replace assert() by ASSERT0() macro, NFC.Alexey Bataev
Required to fix the buildbots.
2018-08-29[OPENMP][NVPTX] Lightweight runtime support for SPMD mode.Alexey Bataev
Summary: Implemented simple and lightweight runtime support for SPMD mode-based constructs. It adds support for L2 sequential parallelism wihtout full runtime support. Also, patch fixes some use cases for uninitialized|lightweight runtime. Reviewers: grokos, kkwli0, Hahnfeld, gtbercea Subscribers: guansong, openmp-commits Differential Revision: https://reviews.llvm.org/D51222
2018-08-27[OpenMP][Fix] Conditional compilation leaves variables unusedGheorghe-Teodor Bercea
Summary: Prevent variables from being left unused by conditional compilation. Reviewers: ABataev, grokos, Hahnfeld, caomhin, protze.joachim Reviewed By: Hahnfeld Subscribers: guansong, openmp-commits Differential Revision: https://reviews.llvm.org/D51303
2018-08-27[OpenMP][libomptarget] rework of fatal error reportingAlexandre Eichenberger
Summary: Removed the function that used a lock and varargs Used the same mechanism as for debug messages Reviewers: ABataev, gtbercea, grokos, Hahnfeld Reviewed By: gtbercea, Hahnfeld Subscribers: mikerice, ABataev, RaviNarayanaswamy, guansong, openmp-commits Differential Revision: https://reviews.llvm.org/D51226
2018-08-27[OpenMP][Fix] Ensure comparison between unsigned values.Gheorghe-Teodor Bercea
Summary: Ensure the values being compared are both unsigned. Reviewers: ABataev, Hahnfeld, caomhin, grokos, AndreyChurbanov Reviewed By: AndreyChurbanov Subscribers: AndreyChurbanov, guansong, openmp-commits Differential Revision: https://reviews.llvm.org/D51301
2018-08-24[OpenMP] Remove deprecated/obsolete MIC attributes from headersJonathan Peyton
2018-08-24[OpenMP] Fixed affinity verbose double printing for balanced type.Jonathan Peyton
2018-08-24[OpenMP] Fix tasking bug for decreasing hot team nthreadsJonathan Peyton
The __kmp_execute_tasks_template() function reads the task_team and current_task from the thread structure. There appears to be a pathological timing where the number of threads in the hot team decreases and so a thread is put in the pool via __kmp_free_thread(). It could be the case that: 1) A thread reads th_task_team into task_team local variables and is then interrupted by the OS 2) Master frees the thread and sets current task and task team to NULL 3) The thread reads current_task as NULL When this happens, current_task is dereferenced and a segfault occurs. This patch just checks for current_task to not be NULL as well. Differential Revision: https://reviews.llvm.org/D50651
2018-08-24[OpenMP] Add check for hot_teams arrayJonathan Peyton
If hot teams are not being used, this code could seg fault without the added check, and does so when composability is used in conjunction with nesting. The fix prevents the segfault. Differential Revision: https://reviews.llvm.org/D50649
2018-08-24[OpenMP] Fix incorrect barrier imbalance reporting in ITTNOTIFYJonathan Peyton
Exclude nested explicit tasks from timing, only outer level explicit task counted and its time added to barrier arrive time for the thread. Differential Revision: https://reviews.llvm.org/D50584
2018-08-23[OpenMP][libomptarget] Bringing up to spec with respect to ↵Alexandre Eichenberger
OMP_TARGET_OFFLOAD env var Summary: Right now, only the OMP_TARGET_OFFLOAD=DISABLED was implemented. Added support for the other MANDATORY and DEFAULT values. Reviewers: gtbercea, ABataev, grokos, caomhin, Hahnfeld Reviewed By: Hahnfeld Subscribers: protze.joachim, gtbercea, AlexEichenberger, RaviNarayanaswamy, Hahnfeld, guansong, openmp-commits Differential Revision: https://reviews.llvm.org/D50522
2018-08-15[OMPT] Remove OMPT idle callbackJoachim Protze
The idle callback was removed from the spec as of TR7. This removes it from the implementation. Patch provided by Simon Convent Reviewers: hbae, protze.joachim Differential Revision: https://reviews.llvm.org/D48362
2018-08-13[OMPT] Make omp_control_tool() compliant when called from Fortran programsJonathan Peyton
This change fixes an incorrect behavior of the omp_control_tool function when called from Fortran applications. A tool callback function for this event is supposed to get NULL for the third argument according to the specification, but the current implementation just passes a garbage value. A possible fix is to use the OPTIONAL attribute for the third argument. Patch by Hansang Bae Differential Revision: https://reviews.llvm.org/D50565
2018-08-09[OpenMP] Cleanup codeJonathan Peyton
This patch cleans up unused functions, variables, sign compare issues, and addresses some -Warning flags which are now enabled including -Wcast-qual. Not all the warning flags in LibompHandleFlags.cmake are enabled, but some are with this patch. Some __kmp_gtid_from_* macros in kmp.h are switched to static inline functions which allows us to remove the awkward definition of KMP_DEBUG_ASSERT() and KMP_ASSERT() macros which used the comma operator. This had to be done for the innumerable -Wunused-value warnings related to KMP_DEBUG_ASSERT() Differential Revision: https://reviews.llvm.org/D49105
2018-08-02[OpenMP] Fix doacross testing for gccJonathan Peyton
This patch adds a test using the doacross clauses in OpenMP and removes gcc from testing kmp_doacross_check.c which is only testing the kmp rather than the gomp interface. Differential Revision: https://reviews.llvm.org/D50014
2018-08-02[OMPT] Disable by default on WindowsJonas Hahnfeld
This is broken per PR36561 and PR36574, so disable it for now until somebody interested can take a look. OMPT can still be activated manually by passing -DLIBOMP_OMPT_SUPPORT=ON during configuration. Differential Revision: https://reviews.llvm.org/D50086
2018-08-02[tests] Add annotations for taskloop featuresJonas Hahnfeld
Only supported since GCC 6 and Intel 17.0. However GCC 6.3.0 is crashing on two of the tests, so disable them as well... Differential Revision: https://reviews.llvm.org/D50085