summaryrefslogtreecommitdiffstats
path: root/openmp/runtime/src/include
Commit message (Collapse)AuthorAgeFilesLines
* [OpenMP] NFC: Fix trivial typos in commentsKazuaki Ishizaki2020-01-071-1/+1
| | | | | | | | | | | | Reviewers: jdoerfert, Jim Reviewed By: Jim Subscribers: Jim, mgorny, guansong, jfb, openmp-commits Tags: #openmp Differential Revision: https://reviews.llvm.org/D72285
* [OpenMP] Move header inclusion out of 'extern "C"'Jonas Hahnfeld2019-07-161-2/+3
| | | | | | | | | | This leads to problems when compiling C++ code with libc++ for Nvidia GPUs because Clang now uses wrappers for math functions that might include C++ templates not allowed in 'extern "C"'. Differentiel Revision: https://reviews.llvm.org/D64625 llvm-svn: 366229
* [OpenMP] Remove OMP spec versioningJonathan Peyton2019-07-1217-6003/+8
| | | | | | | | | | Remove all older OMP spec versioning from the runtime and build system. Patch by Terry Wilmarth Differential Revision: https://reviews.llvm.org/D64534 llvm-svn: 365963
* New implementation of OpenMP 5.0 detached tasks.Andrey Churbanov2019-06-194-0/+34
| | | | | | | | Patch by Alex Duran Differential Revision: https://reviews.llvm.org/D62485 llvm-svn: 363799
* Introduce new OpenMP 5.0 depend object type.Andrey Churbanov2019-05-154-0/+5
| | | | | | | | | The implementation should be done by compiler, user can only declare objects of this type and use them in OpenMP directives. Differential Revision: https://reviews.llvm.org/D61860 llvm-svn: 360774
* [OpenMP] Workaround gfortran bugzilla build bug 41755Jonathan Peyton2019-05-081-1/+1
| | | | | | | | | | | | | | | | | | | | This patch provides workaround to allow gfortran to compile the OpenMP Fortran modules. From the gfortran manual: https://gcc.gnu.org/onlinedocs/gcc-9.1.0/gfortran/BOZ-literal-constants.html "Note that initializing an INTEGER variable with a statement such as DATA i/Z'FFFFFFFF'/ will give an integer overflow error rather than the desired result of -1 when i is a 32-bit integer on a system that supports 64-bit integers. The -fno-range-check option can be used as a workaround for legacy code that initializes integers in this manner." Bug filed: https://bugs.llvm.org/show_bug.cgi?id=41755 Differential Revision: https://reviews.llvm.org/D61603 llvm-svn: 360299
* [OpenMP] Add OpenMP 5.0 nonmonotonic codeJonathan Peyton2019-04-304-5/+9
| | | | | | | | | | | | This patch adds: * New omp_sched_monotonic flag to omp_sched_t which is handled within the runtime * Parsing of monotonic/nonmonotonic in OMP_SCHEDULE * Tests for the monotonic flag and envirable parsing * Logic to force monotonic when hierarchical scheduling is used Differential Revision: https://reviews.llvm.org/D60979 llvm-svn: 359601
* [OpenMP] Implement 5.0 memory managementJonathan Peyton2019-04-084-62/+352
| | | | | | | | | | | | | | | | | | * Replace HBWMALLOC API with more general MEMKIND API, new functions and variables added. * Have libmemkind.so loaded when accessible. * Redirect memspaces to default one except for high bandwidth which is processed separately. * Ignore some allocator traits e.g., sync_hint, access, pinned, while others are processed normally e.g., alignment, pool_size, fallback, fb_data, partition. * Add tests for memory management Patch by Andrey Churbanov Differential Revision: https://reviews.llvm.org/D59783 llvm-svn: 357929
* [OpenMP 5.0] Add omp_get_supported_active_levels()Jonathan Peyton2019-02-194-0/+23
| | | | | | | | | | This patch adds the new 5.0 API function omp_get_supported_active_levels(). Patch by Terry Wilmarth Differential Revision: https://reviews.llvm.org/D58211 llvm-svn: 354368
* NFC: fixed formatting to be consistent across the fileAndrey Churbanov2019-01-211-1/+2
| | | | llvm-svn: 351748
* Fixed https://reviews.llvm.org/D55078 broken Fortran fixed form.Andrey Churbanov2019-01-211-4/+6
| | | | | | | | Long lines split in order to obey Fortran fixed form compilation. Differential Revision: https://reviews.llvm.org/D57017 llvm-svn: 351745
* Update more file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-1917-68/+51
| | | | | | | | | | | | | | | | | | to reflect the new license. These used slightly different spellings that defeated my regular expressions. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351648
* [OpenMP] Add omp_pause_resource* APIJonathan Peyton2019-01-164-0/+81
| | | | | | | | | | | | Add omp_pause_resource and omp_pause_resource_all API and enum, plus stub for internal implementation. Implemented callable helper function to do local pause, and added basic functionality for hard and soft pause. Patch by Terry Wilmarth Differential Revision: https://reviews.llvm.org/D55078 llvm-svn: 351372
* [OMPT] Second chunk of final OMPT 5.0 interface updatesJoachim Protze2019-01-152-735/+1083
| | | | | | | | | | | | | | | | | | | | | The omp-tools.h file is generated from the OpenMP spec to ensure that the interface is implemented as specified. The other changes are necessary to update the interface implementation to the final version as published in 5.0. The omp-tools.h header was previously called ompt.h, currently a copy under this name is installed for legacy tools. Patch partially perpared by @sconvent Reviewers: AndreyChurbanov, hbae, Hahnfeld Reviewed By: hbae Tags: #openmp, #ompt Differential Revision: https://reviews.llvm.org/D55579 llvm-svn: 351197
* [OpenMP] Add omp_get_device_num() and update several other device API functionsJonathan Peyton2019-01-037-6/+42
| | | | | | | | | | | | | | | | | | | | Add omp_get_device_num() function for 5.0 which returns the number of the device the current thread is running on. Currently, we are leaving it to the compiler to handle this properly if it is called inside target. Also, did some cleanup and updating of duplicate device API functions (in both libomp and libomptarget) to make them into weak functions that check for the symbol from libomptarget, and will call the version in libomptarget if it is present. If any additional device API functions are implemented also in libomptarget in the future, we should add the dlsym calls to the host functions. Also, if the omp_target_* functions are to be implemented for the host (this has been requested), they should attempt to call the libomptarget versions as well. Patch by Terry Wilmarth Differential Revision: https://reviews.llvm.org/D55578 llvm-svn: 350352
* [OMPT] First chunk of final OMPT 5.0 interface updatesJoachim Protze2018-12-181-46/+51
| | | | | | | | | | | | | This patch updates the implementation of the ompt_frame_t, ompt_wait_id_t and ompt_state_t. The final version of the OpenMP 5.0 spec added the "t" for these types. Furthermore the structure for ompt_frame_t changed and allows to specify that the reenter frame belongs to the runtime. Patch partially prepared by Simon Convent Reviewers: hbae llvm-svn: 349458
* [OpenMP] Implement OpenMP 5.0 affinity format functionalityJonathan Peyton2018-12-134-0/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds the affinity format functionality introduced in OpenMP 5.0. This patch adds: Two new environment variables: OMP_DISPLAY_AFFINITY=TRUE|FALSE OMP_AFFINITY_FORMAT=<string> and Four new API: 1) omp_set_affinity_format() 2) omp_get_affinity_format() 3) omp_display_affinity() 4) omp_capture_affinity() The affinity format functionality has two ICV's associated with it: affinity-display-var (bool) and affinity-format-var (string). The affinity-display-var enables/disables the functionality through the envirable OMP_DISPLAY_AFFINITY. The affinity-format-var is a formatted string with the special field types beginning with a '%' character similar to printf For example, the affinity-format-var could be: "OMP: host:%H pid:%P OStid:%i num_threads:%N thread_num:%n affinity:{%A}" The affinity-format-var is displayed by every thread implicitly at the beginning of a parallel region when any thread's affinity has changed (including a brand new thread being spawned), or explicitly using the omp_display_affinity() API. The omp_capture_affinity() function can capture the affinity-format-var in a char buffer. And omp_set|get_affinity_format() allow the user to set|get the affinity-format-var explicitly at runtime. omp_capture_affinity() and omp_get_affinity_format() both return the number of characters needed to hold the entire string it tried to make (not including NULL character). If not enough buffer space is available, both these functions truncate their output. Differential Revision: https://reviews.llvm.org/D55148 llvm-svn: 349089
* Revert r347799: Add omp_get_device_num() and update other device APIJonathan Peyton2018-11-297-42/+6
| | | | | | | There is a conflict between libomptarget and libomp concerning some of the standard OpenMP device API which needs further intestigation. llvm-svn: 347932
* [OpenMP] Rename ompt_mutex_impl_unknown to ompt_mutex_impl_noneJonathan Peyton2018-11-281-1/+1
| | | | | | | | | | | This change renames ompt_mutex_impl_unknown to ompt_mutex_impl_none, following the name change in the specification. Patch by Hansang Bae Differential Revision: https://reviews.llvm.org/D54347 llvm-svn: 347802
* [OpenMP] Add omp_get_device_num() and update several other device API functionsJonathan Peyton2018-11-287-6/+42
| | | | | | | | | | | | | Add omp_get_device_num() function for 5.0 which returns the number of the device the current thread is running on. Also, did some cleanup and updating of device API functions to make them into weak functions that should be replaced with libomptarget functions when libomptarget is present. Patch by Terry Wilmarth Differential Revision: https://reviews.llvm.org/D54342 llvm-svn: 347799
* Fixed workaround made in https://reviews.llvm.org/D51694.Andrey Churbanov2018-10-011-4/+4
| | | | | | | | | 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 llvm-svn: 343475
* [OMPT] Update types according to TR7Joachim Protze2018-09-101-56/+94
| | | | | | | | | | | | | | | | | | 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 llvm-svn: 341834
* [OpenMP] Synchronization hint constants added to headersJonathan Peyton2018-09-073-31/+66
| | | | | | | | | | | | | | | | 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 llvm-svn: 341693
* [OpenMP] Initial implementation of OMP 5.0 Memory Management routinesJonathan Peyton2018-09-074-0/+93
| | | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 341687
* Fix for https://bugs.llvm.org/show_bug.cgi?id=38839:Andrey Churbanov2018-09-071-57/+92
| | | | | | | | Changed style of declarations to be less than 72 char each. Differential Revision: https://reviews.llvm.org/D51694 llvm-svn: 341653
* [OpenMP] Remove deprecated/obsolete MIC attributes from headersJonathan Peyton2018-08-241-1/+3
| | | | llvm-svn: 340656
* [OMPT] Remove OMPT idle callbackJoachim Protze2018-08-151-5/+0
| | | | | | | | | | | | | 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 llvm-svn: 339771
* [OMPT] Make omp_control_tool() compliant when called from Fortran programsJonathan Peyton2018-08-132-2/+4
| | | | | | | | | | | | | | 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 llvm-svn: 339585
* [OMPT] Rename ompt_wait_id to omp_wait_idJoachim Protze2018-05-281-7/+7
| | | | | | | | Rename ompt_wait_id to omp_wait_id, as defined in the spec. Differential Revision: https://reviews.llvm.org/D46530 llvm-svn: 333368
* [OMPT] Rename ompt_frame_t to omp_frame_tJoachim Protze2018-05-281-6/+6
| | | | | | | | Rename ompt_frame_t to omp_frame_t, as defined in the spec. Differential Revision: https://reviews.llvm.org/D43568 llvm-svn: 333367
* Set the license header for all OMPT filesJoachim Protze2018-04-121-0/+9
| | | | llvm-svn: 329928
* [OMPT] Rename ompt_mutex_impl_t to kmp_mutex_implJoachim Protze2018-01-171-10/+10
| | | | | | | | | | The defintion is not part of the spec and thus should not have the prefix "ompt_" but rather a prefix that indicates that this is implementation specific. Differential Revision: https://reviews.llvm.org/D41166 llvm-svn: 322621
* [OMPT] Add missing ompt_get_num_procs functionJoachim Protze2017-12-211-0/+4
| | | | | | | | | | | | | This function is defined in OpenMP-TR6 section 4.1.5.1.6 The functions was not implemented yet. Since ompt-functions can only be called after the runtime was initialized and has loaded a tool, it can assume the runtime to be initialized. In contrast to omp_get_num_procs which needs to check whether the runtime is initialized. Differential Revision: https://reviews.llvm.org/D40949 llvm-svn: 321269
* Fix types of Fortran array elementsJonathan Peyton2017-11-296-12/+12
| | | | | | | | | | | | Fortran array elements made default integer in OMP_GET_PLACE_PROC_IDS and OMP_GET_PARTITION_PLACE_NUMS subroutines, otherwise call to them produces incorrect result. Patch by Olga Malysheva Differential Revision: https://reviews.llvm.org/D40356 llvm-svn: 319372
* Updating implementation of OMPT as specified in OpenMP 5.0 Preview 2 (TR6)Joachim Protze2017-11-051-152/+123
| | | | | | | | | | | The TR6 document is expected to be publically released around November 15. This patch does not implement OMPT for libomptarget. Patch by Simon Convent and Joachim Protze Differential Revision: https://reviews.llvm.org/D39182 llvm-svn: 317436
* Rename fields of ompt_frame_tJoachim Protze2017-11-051-3/+3
| | | | | | | | | | This is part of the renaming of data types from OpenMP TR4 to TR6 Patch by Simon Convent Differential Revision: https://reviews.llvm.org/D39326 llvm-svn: 317435
* Revert "Rename fields of ompt_frame_t"Jonas Hahnfeld2017-11-031-3/+3
| | | | | | This reverts commit r317338 which discarded some recent commits. llvm-svn: 317347
* Revert "Updating implementation of OMPT as specified in OpenMP 5.0 Preview 2 ↵Jonas Hahnfeld2017-11-031-123/+152
| | | | | | | | (TR6)" This reverts commit r317339 which discarded some recent commits. llvm-svn: 317346
* Updating implementation of OMPT as specified in OpenMP 5.0 Preview 2 (TR6)Joachim Protze2017-11-031-152/+123
| | | | | | | | | | | The TR6 document is expected to be publically released around November 15. This patch does not implement OMPT for libomptarget. Patch by Simon Convent and Joachim Protze Differential Revision: https://reviews.llvm.org/D39182 llvm-svn: 317339
* Rename fields of ompt_frame_tJoachim Protze2017-11-031-3/+3
| | | | | | | | | | This is part of the renaming of data types from OpenMP TR4 to TR6 Patch by Simon Convent Differential Revision: https://reviews.llvm.org/D39326 llvm-svn: 317338
* Update implementation of OMPT to the specification OpenMP 5.0 Preview 1 (TR4).Joachim Protze2017-11-015-226/+492
| | | | | | | | | | | | | | The code is tested to work with latest clang, GNU and Intel compiler. The implementation is optimized for low overhead when no tool is attached shifting the cost to execution with tool attached. This patch does not implement OMPT for libomptarget. Patch by Simon Convent and Joachim Protze Differential Revision: https://reviews.llvm.org/D38185 llvm-svn: 317085
* Restrict OMPT to OpenMP version 5.0 and remove old header filesJonathan Peyton2017-10-203-1518/+0
| | | | | | | | Patch by Simon Convent Differential Revision: https://reviews.llvm.org/D38876 llvm-svn: 316234
* OpenMP version 5.0 addedJonathan Peyton2017-03-065-0/+2736
| | | | | | | | | | | | Add build option LIBOMP_OMP_VERSION=50, 5.0 headers, and add the year/month associated with OpenMP 5.0 in relevant source locations. Also, remove the deprecated LIBOMP_OMP_VERSION=41 option. Patch by Olga Malysheva Differential Revision: https://reviews.llvm.org/D30450 llvm-svn: 297083
* cleanup: fixed names of dummy arguments of Fortran interfaces declarations, ↵Andrey Churbanov2016-08-174-138/+158
| | | | | | no functional changes done llvm-svn: 278951
* Fix typos in Fortran headersJonathan Peyton2016-06-212-6/+6
| | | | | | | | Fix typos in Fortran headers to match spec. Patch by Andrey Churbanov. Differential Revision: http://reviews.llvm.org/D21531 llvm-svn: 273272
* Renaming change: 41 -> 45 and 4.1 -> 4.5Jonathan Peyton2016-06-145-5/+5
| | | | | | | | OpenMP 4.1 is now OpenMP 4.5. Any mention of 41 or 4.1 is replaced with 45 or 4.5. Also, if the CMake option LIBOMP_OMP_VERSION is 41, CMake warns that 41 is deprecated and to use 45 instead. llvm-svn: 272687
* Offer API for setting number of loop dispatch buffersJonathan Peyton2016-05-313-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem is the lack of dispatch buffers when thousands of loops with nowait, about 10 iterations each, are executed by hundreds of threads. We only have built-in 7 dispatch buffers, but there is a need in dozens or hundreds of buffers. The problem can be fixed by setting KMP_MAX_DISP_BUF to bigger value. In order to give users same possibility I changed build-time control into run-time one, adding API just in case. This change adds an environment variable KMP_DISP_NUM_BUFFERS and a new API function kmp_set_disp_num_buffers(int num_buffers). The KMP_DISP_NUM_BUFFERS envirable works only before serial initialization, because during the serial initialization we already allocate buffers for the hot team, so it is too late to change the number of buffers later (or we need to reallocate buffers for all teams which sounds too complicated). The kmp_set_defaults() routine does not work for this envirable, because it calls serial initialization before reading the parameter string. So a new routine, kmp_set_disp_num_buffers(), is created so that it can set our internal global variable before the library initialization. If both the envirable and API used the envirable wins. Differential Revision: http://reviews.llvm.org/D20697 llvm-svn: 271318
* Changed parameter names in Fortran modules to correspond with OpenMP 4.5 ↵Jonathan Peyton2016-05-232-76/+76
| | | | | | specification llvm-svn: 270447
* Remove trailing whitespace in src/ directoryJonathan Peyton2016-05-203-3/+3
| | | | | | This patch doesn't affect D19878's context. So D19878 still cleanly applies. llvm-svn: 270252
* Adding new kmp_aligned_malloc() entry pointJonathan Peyton2016-05-1212-0/+86
| | | | | | | | | | | | | This change adds a new entry point, kmp_aligned_malloc(size_t size, size_t alignment), an entry point corresponding to kmp_malloc() but with the capability to return aligned memory as well. Other allocator routines have been adjusted so that kmp_free() can be used for freeing memory blocks allocated by any kmp_*alloc() routine, including the new kmp_aligned_malloc() routine. Differential Revision: http://reviews.llvm.org/D19814 llvm-svn: 269365
OpenPOWER on IntegriCloud