aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2019-08-20 20:52:04 +0000
committerDimitry Andric <dim@FreeBSD.org>2019-08-20 20:52:04 +0000
commit1756886afc900127720de68088f9adff3108ef61 (patch)
treed4c46dc43cbf2f632d3c575a6d01716370a7b45b
parent4254a3821b2072ba01f8f7e3347ac862d324babc (diff)
downloadsrc-vendor/llvm-openmp-90.tar.gz
src-vendor/llvm-openmp-90.zip
Notes
Notes: svn path=/vendor/llvm-openmp/dist/; revision=351292 svn path=/vendor/llvm-openmp/openmp-release_900-r372316/; revision=352532; tag=vendor/llvm-openmp/openmp-release_900-r372316
-rw-r--r--LICENSE.txt287
-rw-r--r--runtime/src/dllexports98
-rw-r--r--runtime/src/exports_so.txt11
-rw-r--r--runtime/src/extractExternal.cpp7
-rw-r--r--runtime/src/i18n/en_US.txt10
-rw-r--r--runtime/src/include/30/omp.h.var165
-rw-r--r--runtime/src/include/30/omp_lib.f.var644
-rw-r--r--runtime/src/include/30/omp_lib.f90.var365
-rw-r--r--runtime/src/include/30/omp_lib.h.var649
-rw-r--r--runtime/src/include/40/omp.h.var161
-rw-r--r--runtime/src/include/40/omp_lib.f.var774
-rw-r--r--runtime/src/include/40/omp_lib.f90.var455
-rw-r--r--runtime/src/include/40/omp_lib.h.var567
-rw-r--r--runtime/src/include/45/omp.h.var197
-rw-r--r--runtime/src/include/45/omp_lib.f.var861
-rw-r--r--runtime/src/include/45/omp_lib.f90.var524
-rw-r--r--runtime/src/include/45/omp_lib.h.var645
-rw-r--r--runtime/src/include/omp-tools.h.var (renamed from runtime/src/include/50/omp-tools.h.var)15
-rw-r--r--runtime/src/include/omp.h.var (renamed from runtime/src/include/50/omp.h.var)168
-rw-r--r--runtime/src/include/omp_lib.f.var (renamed from runtime/src/include/50/omp_lib.f.var)145
-rw-r--r--runtime/src/include/omp_lib.f90.var (renamed from runtime/src/include/50/omp_lib.f90.var)124
-rw-r--r--runtime/src/include/omp_lib.h.var (renamed from runtime/src/include/50/omp_lib.h.var)176
-rw-r--r--runtime/src/kmp.h839
-rw-r--r--runtime/src/kmp_affinity.cpp77
-rw-r--r--runtime/src/kmp_affinity.h7
-rw-r--r--runtime/src/kmp_alloc.cpp397
-rw-r--r--runtime/src/kmp_atomic.cpp95
-rw-r--r--runtime/src/kmp_atomic.h21
-rw-r--r--runtime/src/kmp_barrier.cpp312
-rw-r--r--runtime/src/kmp_cancel.cpp13
-rw-r--r--runtime/src/kmp_config.h.cmake12
-rw-r--r--runtime/src/kmp_csupport.cpp269
-rw-r--r--runtime/src/kmp_debug.cpp7
-rw-r--r--runtime/src/kmp_debug.h7
-rw-r--r--runtime/src/kmp_debugger.cpp13
-rw-r--r--runtime/src/kmp_debugger.h7
-rw-r--r--runtime/src/kmp_dispatch.cpp152
-rw-r--r--runtime/src/kmp_dispatch.h30
-rw-r--r--runtime/src/kmp_dispatch_hier.h52
-rw-r--r--runtime/src/kmp_environment.cpp7
-rw-r--r--runtime/src/kmp_environment.h7
-rw-r--r--runtime/src/kmp_error.cpp38
-rw-r--r--runtime/src/kmp_error.h7
-rw-r--r--runtime/src/kmp_ftn_cdecl.cpp7
-rw-r--r--runtime/src/kmp_ftn_entry.h141
-rw-r--r--runtime/src/kmp_ftn_extra.cpp7
-rw-r--r--runtime/src/kmp_ftn_os.h85
-rw-r--r--runtime/src/kmp_ftn_stdcall.cpp7
-rw-r--r--runtime/src/kmp_global.cpp101
-rw-r--r--runtime/src/kmp_gsupport.cpp100
-rw-r--r--runtime/src/kmp_i18n.cpp7
-rw-r--r--runtime/src/kmp_i18n.h7
-rw-r--r--runtime/src/kmp_import.cpp7
-rw-r--r--runtime/src/kmp_io.cpp7
-rw-r--r--runtime/src/kmp_io.h7
-rw-r--r--runtime/src/kmp_itt.cpp7
-rw-r--r--runtime/src/kmp_itt.h9
-rw-r--r--runtime/src/kmp_itt.inl7
-rw-r--r--runtime/src/kmp_lock.cpp69
-rw-r--r--runtime/src/kmp_lock.h46
-rw-r--r--runtime/src/kmp_omp.h15
-rw-r--r--runtime/src/kmp_os.h111
-rw-r--r--runtime/src/kmp_platform.h7
-rw-r--r--runtime/src/kmp_runtime.cpp741
-rw-r--r--runtime/src/kmp_safe_c_api.h7
-rw-r--r--runtime/src/kmp_sched.cpp79
-rw-r--r--runtime/src/kmp_settings.cpp508
-rw-r--r--runtime/src/kmp_settings.h9
-rw-r--r--runtime/src/kmp_stats.cpp16
-rw-r--r--runtime/src/kmp_stats.h44
-rw-r--r--runtime/src/kmp_stats_timing.cpp7
-rw-r--r--runtime/src/kmp_stats_timing.h7
-rw-r--r--runtime/src/kmp_str.cpp7
-rw-r--r--runtime/src/kmp_str.h7
-rw-r--r--runtime/src/kmp_stub.cpp69
-rw-r--r--runtime/src/kmp_stub.h10
-rw-r--r--runtime/src/kmp_taskdeps.cpp15
-rw-r--r--runtime/src/kmp_taskdeps.h11
-rw-r--r--runtime/src/kmp_tasking.cpp675
-rw-r--r--runtime/src/kmp_taskq.cpp2029
-rw-r--r--runtime/src/kmp_threadprivate.cpp7
-rw-r--r--runtime/src/kmp_utility.cpp7
-rw-r--r--runtime/src/kmp_version.cpp24
-rw-r--r--runtime/src/kmp_version.h7
-rw-r--r--runtime/src/kmp_wait_release.cpp7
-rw-r--r--runtime/src/kmp_wait_release.h119
-rw-r--r--runtime/src/kmp_wrapper_getpid.h10
-rw-r--r--runtime/src/kmp_wrapper_malloc.h7
-rw-r--r--runtime/src/libomp.rc.var7
-rw-r--r--runtime/src/ompt-event-specific.h12
-rw-r--r--runtime/src/ompt-general.cpp23
-rw-r--r--runtime/src/ompt-internal.h13
-rw-r--r--runtime/src/ompt-specific.cpp64
-rw-r--r--runtime/src/ompt-specific.h9
-rw-r--r--runtime/src/test-touch.c7
-rw-r--r--runtime/src/thirdparty/ittnotify/disable_warnings.h7
-rw-r--r--runtime/src/thirdparty/ittnotify/ittnotify.h7
-rw-r--r--runtime/src/thirdparty/ittnotify/ittnotify_config.h7
-rw-r--r--runtime/src/thirdparty/ittnotify/ittnotify_static.c7
-rw-r--r--runtime/src/thirdparty/ittnotify/ittnotify_static.h7
-rw-r--r--runtime/src/thirdparty/ittnotify/ittnotify_types.h7
-rw-r--r--runtime/src/thirdparty/ittnotify/legacy/ittnotify.h7
-rw-r--r--runtime/src/tsan_annotations.cpp7
-rw-r--r--runtime/src/tsan_annotations.h7
-rw-r--r--runtime/src/z_Linux_asm.S183
-rw-r--r--runtime/src/z_Linux_util.cpp113
-rw-r--r--runtime/src/z_Windows_NT-586_asm.asm7
-rw-r--r--runtime/src/z_Windows_NT-586_util.cpp7
-rw-r--r--runtime/src/z_Windows_NT_util.cpp132
109 files changed, 4048 insertions, 11192 deletions
diff --git a/LICENSE.txt b/LICENSE.txt
index 0021792a1b85..990756638292 100644
--- a/LICENSE.txt
+++ b/LICENSE.txt
@@ -1,4 +1,241 @@
==============================================================================
+The LLVM Project is under the Apache License v2.0 with LLVM Exceptions:
+==============================================================================
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+
+---- LLVM Exceptions to the Apache 2.0 License ----
+
+As an exception, if, as a result of your compiling your source code, portions
+of this Software are embedded into an Object form of such source code, you
+may redistribute such embedded portions in such Object form without complying
+with the conditions of Sections 4(a), 4(b) and 4(d) of the License.
+
+In addition, if you combine or link compiled forms of this Software with
+software that is licensed under the GPLv2 ("Combined Software") and if a
+court of competent jurisdiction determines that the patent provision (Section
+3), the indemnity provision (Section 9) or other Section of the License
+conflicts with the conditions of the GPLv2, you may retroactively and
+prospectively choose to deem waived or otherwise exclude such Section(s) of
+the License, but only in their entirety and only with respect to the Combined
+Software.
+
+==============================================================================
+Software from third parties included in the LLVM Project:
+==============================================================================
+The LLVM Project contains third party software which is under different license
+terms. All such code will be identified clearly using at least one of two
+mechanisms:
+1) It will be in a separate directory tree with its own `LICENSE.txt` or
+ `LICENSE` file at the top containing the specific license and restrictions
+ which apply to that software, or
+2) It will contain specific license and restriction terms at the top of every
+ file.
+
+==============================================================================
+Legacy LLVM License (https://llvm.org/docs/DeveloperPolicy.html#legacy):
+==============================================================================
The software contained in this directory tree is dual licensed under both the
University of Illinois "BSD-Like" license and the MIT license. As a user of
@@ -122,53 +359,3 @@ conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE.
==============================================================================
-
-ARM Limited
-
-Software Grant License Agreement ("Agreement")
-
-Except for the license granted herein to you, ARM Limited ("ARM") reserves all
-right, title, and interest in and to the Software (defined below).
-
-Definition
-
-"Software" means the code and documentation as well as any original work of
-authorship, including any modifications or additions to an existing work, that
-is intentionally submitted by ARM to llvm.org (http://llvm.org) ("LLVM") for
-inclusion in, or documentation of, any of the products owned or managed by LLVM
-(the "Work"). For the purposes of this definition, "submitted" means any form of
-electronic, verbal, or written communication sent to LLVM or its
-representatives, including but not limited to communication on electronic
-mailing lists, source code control systems, and issue tracking systems that are
-managed by, or on behalf of, LLVM for the purpose of discussing and improving
-the Work, but excluding communication that is conspicuously marked otherwise.
-
-1. Grant of Copyright License. Subject to the terms and conditions of this
- Agreement, ARM hereby grants to you and to recipients of the Software
- distributed by LLVM a perpetual, worldwide, non-exclusive, no-charge,
- royalty-free, irrevocable copyright license to reproduce, prepare derivative
- works of, publicly display, publicly perform, sublicense, and distribute the
- Software and such derivative works.
-
-2. Grant of Patent License. Subject to the terms and conditions of this
- Agreement, ARM hereby grants you and to recipients of the Software
- distributed by LLVM a perpetual, worldwide, non-exclusive, no-charge,
- royalty-free, irrevocable (except as stated in this section) patent license
- to make, have made, use, offer to sell, sell, import, and otherwise transfer
- the Work, where such license applies only to those patent claims licensable
- by ARM that are necessarily infringed by ARM's Software alone or by
- combination of the Software with the Work to which such Software was
- submitted. If any entity institutes patent litigation against ARM or any
- other entity (including a cross-claim or counterclaim in a lawsuit) alleging
- that ARM's Software, or the Work to which ARM has contributed constitutes
- direct or contributory patent infringement, then any patent licenses granted
- to that entity under this Agreement for the Software or Work shall terminate
- as of the date such litigation is filed.
-
-Unless required by applicable law or agreed to in writing, the software is
-provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
-either express or implied, including, without limitation, any warranties or
-conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-PARTICULAR PURPOSE.
-
-==============================================================================
diff --git a/runtime/src/dllexports b/runtime/src/dllexports
index 9885f87bf484..f76619ec0e3c 100644
--- a/runtime/src/dllexports
+++ b/runtime/src/dllexports
@@ -1,10 +1,9 @@
#
#//===----------------------------------------------------------------------===//
#//
-#// The LLVM Compiler Infrastructure
-#//
-#// This file is dual licensed under the MIT and the University of Illinois Open
-#// Source Licenses. See LICENSE.txt for details.
+#// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+#// See https://llvm.org/LICENSE.txt for license information.
+#// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#//
#//===----------------------------------------------------------------------===//
#
@@ -159,7 +158,7 @@
#
# Regular entry points
- __kmp_wait_yield_4
+ __kmp_wait_4
__kmp_fork_call
__kmp_invoke_microtask
%ifdef KMP_USE_MONITOR
@@ -182,7 +181,6 @@
__kmp_printf
%endif
-
%ifdef USE_DEBUGGER
__kmp_debugging DATA
__kmp_omp_debug_struct_info DATA
@@ -191,14 +189,9 @@
# Symbols for MS mutual detection:
_You_must_link_with_exactly_one_OpenMP_library DATA
_You_must_link_with_Intel_OpenMP_library DATA
- %ifdef msvc_compat
- _You_must_link_with_Microsoft_OpenMP_library DATA
- %endif
-
__kmp_wait_64
__kmp_release_64
-
# VT_getthid 1
# vtgthid 2
@@ -228,8 +221,8 @@
__kmpc_end_ordered 125
__kmpc_end_serialized_parallel 126
__kmpc_end_single 127
- __kmpc_end_taskq 128
- __kmpc_end_taskq_task 129
+# __kmpc_end_taskq 128
+# __kmpc_end_taskq_task 129
__kmpc_flush 130
__kmpc_for_static_fini 135
__kmpc_for_static_init_4 136
@@ -246,10 +239,10 @@
__kmpc_push_num_threads 148
__kmpc_serialized_parallel 150
__kmpc_single 151
- __kmpc_task 152
- __kmpc_task_buffer 153
- __kmpc_taskq 154
- __kmpc_taskq_task 155
+# __kmpc_task 152
+# __kmpc_task_buffer 153
+# __kmpc_taskq 154
+# __kmpc_taskq_task 155
__kmpc_threadprivate 156
__kmpc_threadprivate_cached 157
__kmpc_threadprivate_register 158
@@ -286,16 +279,12 @@
__kmpc_reduce 189
__kmpc_end_reduce 190
-# OpenMP 3.0
-
-%ifdef OMP_30
__kmpc_omp_task_alloc 191
__kmpc_omp_task 192
__kmpc_omp_taskwait 193
__kmpc_omp_task_begin_if0 196
__kmpc_omp_task_complete_if0 197
__kmpc_omp_task_parts 198
-%endif # OMP_30
# __omp_collector_api 199
@@ -327,9 +316,7 @@ kmpc_set_stacksize_s 222
# kmpc_set_stats 217
kmpc_set_defaults 224
-# OMP 3.0 entry points for unsigned loop iteration variables
%ifndef stub
- %ifdef OMP_30
__kmpc_for_static_init_8u 225
__kmpc_dispatch_init_8u 226
__kmpc_dispatch_next_8u 227
@@ -338,7 +325,6 @@ kmpc_set_defaults 224
__kmpc_dispatch_init_4u 230
__kmpc_dispatch_next_4u 231
__kmpc_dispatch_fini_4u 232
- %endif # OMP_30
%endif
%ifndef stub
@@ -346,17 +332,12 @@ kmpc_set_defaults 224
__kmpc_get_parent_taskid 234
%endif
-# OpenMP 3.1 entry points
%ifndef stub
- %ifdef OMP_30
__kmpc_omp_taskyield 235
- %endif # OMP_30
# __kmpc_place_threads 236
%endif
-# OpenMP 4.0 entry points
%ifndef stub
- %ifdef OMP_40
__kmpc_push_proc_bind 237
__kmpc_taskgroup 238
__kmpc_end_taskgroup 239
@@ -379,12 +360,9 @@ kmpc_set_defaults 224
__kmpc_team_static_init_4u 256
__kmpc_team_static_init_8 257
__kmpc_team_static_init_8u 258
- %endif # OMP_40
%endif
-# OpenMP 4.5 entry points
%ifndef stub
- %ifdef OMP_45
__kmpc_proxy_task_completed 259
__kmpc_proxy_task_completed_ooo 260
__kmpc_doacross_init 261
@@ -393,20 +371,22 @@ kmpc_set_defaults 224
__kmpc_doacross_fini 264
__kmpc_taskloop 266
__kmpc_critical_with_hint 270
- %endif
%endif
kmpc_aligned_malloc 265
kmpc_set_disp_num_buffers 267
-# OpenMP 5.0 entry points
%ifndef stub
- %ifdef OMP_50
__kmpc_task_reduction_init 268
__kmpc_task_reduction_get_th_data 269
-# USED FOR 4.5 __kmpc_critical_with_hint 270
+# USED ABOVE __kmpc_critical_with_hint 270
__kmpc_get_target_offload 271
- __kmpc_omp_reg_task_with_affinity 272
- %endif
+ __kmpc_omp_reg_task_with_affinity 272
+ __kmpc_pause_resource 273
+ __kmpc_task_reduction_modifier_init 274
+ __kmpc_task_reduction_modifier_fini 275
+ __kmpc_task_allow_completion_event 276
+ __kmpc_taskred_init 277
+ __kmpc_taskred_modifier_init 278
%endif
# User API entry points that have both lower- and upper- case versions for Fortran.
@@ -464,7 +444,6 @@ kmp_aligned_malloc 747
kmp_set_warnings_on 779
kmp_set_warnings_off 780
-%ifdef OMP_30
omp_get_active_level 789
omp_get_level 790
omp_get_ancestor_thread_num 791
@@ -489,17 +468,9 @@ kmp_set_warnings_off 780
kmpc_unset_affinity_mask_proc 858
kmp_get_affinity_mask_proc 859
kmpc_get_affinity_mask_proc 860
-%endif # OMP_30
-# OpenMP 3.1
-
-%ifdef OMP_30
omp_in_final 861
-%endif # OMP_30
-
-# OpenMP 40
-%ifdef OMP_40
omp_get_proc_bind 862
#omp_set_proc_bind 863
#omp_curr_proc_bind 864
@@ -511,11 +482,7 @@ kmp_set_warnings_off 780
omp_set_default_device 879
omp_get_default_device 880
omp_get_num_devices 881
-%endif # OMP_40
-# OpenMP 45
-
-%ifdef OMP_45
omp_init_lock_with_hint 870
omp_init_nest_lock_with_hint 871
omp_get_max_task_priority 872
@@ -535,17 +502,25 @@ kmp_set_warnings_off 780
omp_target_associate_ptr 888
omp_target_disassociate_ptr 889
%endif
-%endif # OMP_45
kmp_set_disp_num_buffers 890
-%ifdef OMP_50
omp_control_tool 891
omp_set_default_allocator 892
omp_get_default_allocator 893
omp_alloc 894
omp_free 895
omp_get_device_num 896
+ omp_init_allocator 897
+ omp_destroy_allocator 898
+ %ifndef stub
+ __kmpc_set_default_allocator
+ __kmpc_get_default_allocator
+ __kmpc_alloc
+ __kmpc_free
+ __kmpc_init_allocator
+ __kmpc_destroy_allocator
+ %endif
omp_set_affinity_format 748
omp_get_affinity_format 749
omp_display_affinity 750
@@ -554,8 +529,12 @@ kmp_set_disp_num_buffers 890
ompc_get_affinity_format 753
ompc_display_affinity 754
ompc_capture_affinity 755
+ omp_pause_resource 756
+ omp_pause_resource_all 757
+ omp_get_supported_active_levels 758
+ omp_fulfill_event 759
- OMP_NULL_ALLOCATOR DATA
+ omp_null_allocator DATA
omp_default_mem_alloc DATA
omp_large_cap_mem_alloc DATA
omp_const_mem_alloc DATA
@@ -564,7 +543,12 @@ kmp_set_disp_num_buffers 890
omp_cgroup_mem_alloc DATA
omp_pteam_mem_alloc DATA
omp_thread_mem_alloc DATA
-%endif # OMP_50
+
+ omp_default_mem_space DATA
+ omp_large_cap_mem_space DATA
+ omp_const_mem_space DATA
+ omp_high_bw_mem_space DATA
+ omp_low_lat_mem_space DATA
%ifndef stub
# Ordinals between 900 and 999 are reserved
@@ -1014,8 +998,6 @@ kmp_set_disp_num_buffers 890
__kmpc_atomic_float10_div_cpt_fp
%endif
- %ifdef OMP_40
-
# ATOMIC extensions for OpenMP 4.0 spec (x86 and x64 only)
__kmpc_atomic_fixed1_swp 2412
@@ -1190,8 +1172,6 @@ kmp_set_disp_num_buffers 890
__kmpc_atomic_float10_sub_cpt_rev_fp
__kmpc_atomic_float10_div_cpt_rev_fp
%endif
- %endif # OMP_40
-
%endif # arch_64
diff --git a/runtime/src/exports_so.txt b/runtime/src/exports_so.txt
index dc9effe9f62b..f7de5fd6474f 100644
--- a/runtime/src/exports_so.txt
+++ b/runtime/src/exports_so.txt
@@ -3,10 +3,9 @@
#
#//===----------------------------------------------------------------------===//
#//
-#// The LLVM Compiler Infrastructure
-#//
-#// This file is dual licensed under the MIT and the University of Illinois Open
-#// Source Licenses. See LICENSE.txt for details.
+#// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+#// See https://llvm.org/LICENSE.txt for license information.
+#// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#//
#//===----------------------------------------------------------------------===//
#
@@ -39,7 +38,6 @@ VERSION {
_You_must_link_with_*; # Mutual detection/MS compatibility symbols.
-
#
# Debugger support.
#
@@ -55,7 +53,6 @@ VERSION {
___kmp_allocate;
___kmp_free;
__kmp_thread_pool;
- __kmp_thread_pool_nth;
__kmp_reset_stats;
@@ -84,7 +81,7 @@ VERSION {
__kmp_reap_worker;
__kmp_release_64;
__kmp_wait_64;
- __kmp_wait_yield_4;
+ __kmp_wait_4;
# ittnotify symbols to be used by debugger
__kmp_itt_fini_ittlib;
diff --git a/runtime/src/extractExternal.cpp b/runtime/src/extractExternal.cpp
index ba20373a6a41..b3e55b555d28 100644
--- a/runtime/src/extractExternal.cpp
+++ b/runtime/src/extractExternal.cpp
@@ -4,10 +4,9 @@
//===----------------------------------------------------------------------===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.txt for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/runtime/src/i18n/en_US.txt b/runtime/src/i18n/en_US.txt
index 3e5283ed38f7..822f73c0ef1d 100644
--- a/runtime/src/i18n/en_US.txt
+++ b/runtime/src/i18n/en_US.txt
@@ -3,10 +3,9 @@
#
#//===----------------------------------------------------------------------===//
#//
-#// The LLVM Compiler Infrastructure
-#//
-#// This file is dual licensed under the MIT and the University of Illinois Open
-#// Source Licenses. See LICENSE.txt for details.
+#// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+#// See https://llvm.org/LICENSE.txt for license information.
+#// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#//
#//===----------------------------------------------------------------------===//
#
@@ -426,7 +425,7 @@ AffHWSubsetManyTiles "KMP_HW_SUBSET ignored: too many L2 Caches requeste
AffHWSubsetManyProcs "KMP_HW_SUBSET ignored: too many Procs requested."
HierSchedInvalid "Hierarchy ignored: unsupported level: %1$s."
AffFormatDefault "OMP: pid %1$s tid %2$s thread %3$s bound to OS proc set {%4$s}"
-
+APIDeprecated "%1$s routine deprecated, please use %2$s instead."
# --------------------------------------------------------------------------------------------------
-*- HINTS -*-
@@ -490,4 +489,3 @@ SystemLimitOnThreads "System-related limit on the number of threads."
# --------------------------------------------------------------------------------------------------
# end of file #
# --------------------------------------------------------------------------------------------------
-
diff --git a/runtime/src/include/30/omp.h.var b/runtime/src/include/30/omp.h.var
deleted file mode 100644
index 10bd890cab01..000000000000
--- a/runtime/src/include/30/omp.h.var
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * include/30/omp.h.var
- */
-
-
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.txt for details.
-//
-//===----------------------------------------------------------------------===//
-
-
-#ifndef __OMP_H
-# define __OMP_H
-
-# define KMP_VERSION_MAJOR @LIBOMP_VERSION_MAJOR@
-# define KMP_VERSION_MINOR @LIBOMP_VERSION_MINOR@
-# define KMP_VERSION_BUILD @LIBOMP_VERSION_BUILD@
-# define KMP_BUILD_DATE "@LIBOMP_BUILD_DATE@"
-
-# ifdef __cplusplus
- extern "C" {
-# endif
-
-# define omp_set_num_threads ompc_set_num_threads
-# define omp_set_dynamic ompc_set_dynamic
-# define omp_set_nested ompc_set_nested
-# define omp_set_max_active_levels ompc_set_max_active_levels
-# define omp_set_schedule ompc_set_schedule
-# define omp_get_ancestor_thread_num ompc_get_ancestor_thread_num
-# define omp_get_team_size ompc_get_team_size
-
-
-# define kmp_set_stacksize kmpc_set_stacksize
-# define kmp_set_stacksize_s kmpc_set_stacksize_s
-# define kmp_set_blocktime kmpc_set_blocktime
-# define kmp_set_library kmpc_set_library
-# define kmp_set_defaults kmpc_set_defaults
-# define kmp_set_affinity_mask_proc kmpc_set_affinity_mask_proc
-# define kmp_unset_affinity_mask_proc kmpc_unset_affinity_mask_proc
-# define kmp_get_affinity_mask_proc kmpc_get_affinity_mask_proc
-
-# define kmp_malloc kmpc_malloc
-# define kmp_calloc kmpc_calloc
-# define kmp_realloc kmpc_realloc
-# define kmp_free kmpc_free
-
-
-# if defined(_WIN32)
-# define __KAI_KMPC_CONVENTION __cdecl
-# else
-# define __KAI_KMPC_CONVENTION
-# endif
-
- /* schedule kind constants */
- typedef enum omp_sched_t {
- omp_sched_static = 1,
- omp_sched_dynamic = 2,
- omp_sched_guided = 3,
- omp_sched_auto = 4
- } omp_sched_t;
-
- /* set API functions */
- extern void __KAI_KMPC_CONVENTION omp_set_num_threads (int);
- extern void __KAI_KMPC_CONVENTION omp_set_dynamic (int);
- extern void __KAI_KMPC_CONVENTION omp_set_nested (int);
- extern void __KAI_KMPC_CONVENTION omp_set_max_active_levels (int);
- extern void __KAI_KMPC_CONVENTION omp_set_schedule (omp_sched_t, int);
-
- /* query API functions */
- extern int __KAI_KMPC_CONVENTION omp_get_num_threads (void);
- extern int __KAI_KMPC_CONVENTION omp_get_dynamic (void);
- extern int __KAI_KMPC_CONVENTION omp_get_nested (void);
- extern int __KAI_KMPC_CONVENTION omp_get_max_threads (void);
- extern int __KAI_KMPC_CONVENTION omp_get_thread_num (void);
- extern int __KAI_KMPC_CONVENTION omp_get_num_procs (void);
- extern int __KAI_KMPC_CONVENTION omp_in_parallel (void);
- extern int __KAI_KMPC_CONVENTION omp_in_final (void);
- extern int __KAI_KMPC_CONVENTION omp_get_active_level (void);
- extern int __KAI_KMPC_CONVENTION omp_get_level (void);
- extern int __KAI_KMPC_CONVENTION omp_get_ancestor_thread_num (int);
- extern int __KAI_KMPC_CONVENTION omp_get_team_size (int);
- extern int __KAI_KMPC_CONVENTION omp_get_thread_limit (void);
- extern int __KAI_KMPC_CONVENTION omp_get_max_active_levels (void);
- extern void __KAI_KMPC_CONVENTION omp_get_schedule (omp_sched_t *, int *);
-
- /* lock API functions */
- typedef struct omp_lock_t {
- void * _lk;
- } omp_lock_t;
-
- extern void __KAI_KMPC_CONVENTION omp_init_lock (omp_lock_t *);
- extern void __KAI_KMPC_CONVENTION omp_set_lock (omp_lock_t *);
- extern void __KAI_KMPC_CONVENTION omp_unset_lock (omp_lock_t *);
- extern void __KAI_KMPC_CONVENTION omp_destroy_lock (omp_lock_t *);
- extern int __KAI_KMPC_CONVENTION omp_test_lock (omp_lock_t *);
-
- /* nested lock API functions */
- typedef struct omp_nest_lock_t {
- void * _lk;
- } omp_nest_lock_t;
-
- extern void __KAI_KMPC_CONVENTION omp_init_nest_lock (omp_nest_lock_t *);
- extern void __KAI_KMPC_CONVENTION omp_set_nest_lock (omp_nest_lock_t *);
- extern void __KAI_KMPC_CONVENTION omp_unset_nest_lock (omp_nest_lock_t *);
- extern void __KAI_KMPC_CONVENTION omp_destroy_nest_lock (omp_nest_lock_t *);
- extern int __KAI_KMPC_CONVENTION omp_test_nest_lock (omp_nest_lock_t *);
-
- /* time API functions */
- extern double __KAI_KMPC_CONVENTION omp_get_wtime (void);
- extern double __KAI_KMPC_CONVENTION omp_get_wtick (void);
-
-# include <stdlib.h>
- /* kmp API functions */
- extern int __KAI_KMPC_CONVENTION kmp_get_stacksize (void);
- extern void __KAI_KMPC_CONVENTION kmp_set_stacksize (int);
- extern size_t __KAI_KMPC_CONVENTION kmp_get_stacksize_s (void);
- extern void __KAI_KMPC_CONVENTION kmp_set_stacksize_s (size_t);
- extern int __KAI_KMPC_CONVENTION kmp_get_blocktime (void);
- extern int __KAI_KMPC_CONVENTION kmp_get_library (void);
- extern void __KAI_KMPC_CONVENTION kmp_set_blocktime (int);
- extern void __KAI_KMPC_CONVENTION kmp_set_library (int);
- extern void __KAI_KMPC_CONVENTION kmp_set_library_serial (void);
- extern void __KAI_KMPC_CONVENTION kmp_set_library_turnaround (void);
- extern void __KAI_KMPC_CONVENTION kmp_set_library_throughput (void);
- extern void __KAI_KMPC_CONVENTION kmp_set_defaults (char const *);
-
- /* affinity API functions */
- typedef void * kmp_affinity_mask_t;
-
- extern int __KAI_KMPC_CONVENTION kmp_set_affinity (kmp_affinity_mask_t *);
- extern int __KAI_KMPC_CONVENTION kmp_get_affinity (kmp_affinity_mask_t *);
- extern int __KAI_KMPC_CONVENTION kmp_get_affinity_max_proc (void);
- extern void __KAI_KMPC_CONVENTION kmp_create_affinity_mask (kmp_affinity_mask_t *);
- extern void __KAI_KMPC_CONVENTION kmp_destroy_affinity_mask (kmp_affinity_mask_t *);
- extern int __KAI_KMPC_CONVENTION kmp_set_affinity_mask_proc (int, kmp_affinity_mask_t *);
- extern int __KAI_KMPC_CONVENTION kmp_unset_affinity_mask_proc (int, kmp_affinity_mask_t *);
- extern int __KAI_KMPC_CONVENTION kmp_get_affinity_mask_proc (int, kmp_affinity_mask_t *);
-
- extern void * __KAI_KMPC_CONVENTION kmp_malloc (size_t);
- extern void * __KAI_KMPC_CONVENTION kmp_aligned_malloc (size_t, size_t);
- extern void * __KAI_KMPC_CONVENTION kmp_calloc (size_t, size_t);
- extern void * __KAI_KMPC_CONVENTION kmp_realloc (void *, size_t);
- extern void __KAI_KMPC_CONVENTION kmp_free (void *);
-
- extern void __KAI_KMPC_CONVENTION kmp_set_warnings_on(void);
- extern void __KAI_KMPC_CONVENTION kmp_set_warnings_off(void);
-
-# undef __KAI_KMPC_CONVENTION
-
- /* Warning:
- The following typedefs are not standard, deprecated and will be removed in a future release.
- */
- typedef int omp_int_t;
- typedef double omp_wtime_t;
-
-# ifdef __cplusplus
- }
-# endif
-
-#endif /* __OMP_H */
-
diff --git a/runtime/src/include/30/omp_lib.f.var b/runtime/src/include/30/omp_lib.f.var
deleted file mode 100644
index 298df8d299bc..000000000000
--- a/runtime/src/include/30/omp_lib.f.var
+++ /dev/null
@@ -1,644 +0,0 @@
-! include/30/omp_lib.f.var
-
-!
-!//===----------------------------------------------------------------------===//
-!//
-!// The LLVM Compiler Infrastructure
-!//
-!// This file is dual licensed under the MIT and the University of Illinois Open
-!// Source Licenses. See LICENSE.txt for details.
-!//
-!//===----------------------------------------------------------------------===//
-!
-
-!***
-!*** Some of the directives for the following routine extend past column 72,
-!*** so process this file in 132-column mode.
-!***
-
-!dec$ fixedformlinesize:132
-
- module omp_lib_kinds
-
- integer, parameter :: omp_integer_kind = 4
- integer, parameter :: omp_logical_kind = 4
- integer, parameter :: omp_real_kind = 4
- integer, parameter :: omp_lock_kind = int_ptr_kind()
- integer, parameter :: omp_nest_lock_kind = int_ptr_kind()
- integer, parameter :: omp_sched_kind = omp_integer_kind
- integer, parameter :: kmp_pointer_kind = int_ptr_kind()
- integer, parameter :: kmp_size_t_kind = int_ptr_kind()
- integer, parameter :: kmp_affinity_mask_kind = int_ptr_kind()
-
- end module omp_lib_kinds
-
- module omp_lib
-
- use omp_lib_kinds
-
- integer (kind=omp_integer_kind), parameter :: kmp_version_major = @LIBOMP_VERSION_MAJOR@
- integer (kind=omp_integer_kind), parameter :: kmp_version_minor = @LIBOMP_VERSION_MINOR@
- integer (kind=omp_integer_kind), parameter :: kmp_version_build = @LIBOMP_VERSION_BUILD@
- character(*), parameter :: kmp_build_date = '@LIBOMP_BUILD_DATE@'
- integer (kind=omp_integer_kind), parameter :: openmp_version = @LIBOMP_OMP_YEAR_MONTH@
-
- integer(kind=omp_sched_kind), parameter :: omp_sched_static = 1
- integer(kind=omp_sched_kind), parameter :: omp_sched_dynamic = 2
- integer(kind=omp_sched_kind), parameter :: omp_sched_guided = 3
- integer(kind=omp_sched_kind), parameter :: omp_sched_auto = 4
-
- interface
-
-! ***
-! *** omp_* entry points
-! ***
-
- subroutine omp_set_num_threads(nthreads)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) nthreads
- end subroutine omp_set_num_threads
-
- subroutine omp_set_dynamic(enable)
- use omp_lib_kinds
- logical (kind=omp_logical_kind) enable
- end subroutine omp_set_dynamic
-
- subroutine omp_set_nested(enable)
- use omp_lib_kinds
- logical (kind=omp_logical_kind) enable
- end subroutine omp_set_nested
-
- function omp_get_num_threads()
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_num_threads
- end function omp_get_num_threads
-
- function omp_get_max_threads()
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_max_threads
- end function omp_get_max_threads
-
- function omp_get_thread_num()
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_thread_num
- end function omp_get_thread_num
-
- function omp_get_num_procs()
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_num_procs
- end function omp_get_num_procs
-
- function omp_in_parallel()
- use omp_lib_kinds
- logical (kind=omp_logical_kind) omp_in_parallel
- end function omp_in_parallel
-
- function omp_get_dynamic()
- use omp_lib_kinds
- logical (kind=omp_logical_kind) omp_get_dynamic
- end function omp_get_dynamic
-
- function omp_get_nested()
- use omp_lib_kinds
- logical (kind=omp_logical_kind) omp_get_nested
- end function omp_get_nested
-
- function omp_get_thread_limit()
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_thread_limit
- end function omp_get_thread_limit
-
- subroutine omp_set_max_active_levels(max_levels)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) max_levels
- end subroutine omp_set_max_active_levels
-
- function omp_get_max_active_levels()
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_max_active_levels
- end function omp_get_max_active_levels
-
- function omp_get_level()
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_level
- end function omp_get_level
-
- function omp_get_active_level()
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_active_level
- end function omp_get_active_level
-
- function omp_get_ancestor_thread_num(level)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) level
- integer (kind=omp_integer_kind) omp_get_ancestor_thread_num
- end function omp_get_ancestor_thread_num
-
- function omp_get_team_size(level)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) level
- integer (kind=omp_integer_kind) omp_get_team_size
- end function omp_get_team_size
-
- subroutine omp_set_schedule(kind, modifier)
- use omp_lib_kinds
- integer (kind=omp_sched_kind) kind
- integer (kind=omp_integer_kind) modifier
- end subroutine omp_set_schedule
-
- subroutine omp_get_schedule(kind, modifier)
- use omp_lib_kinds
- integer (kind=omp_sched_kind) kind
- integer (kind=omp_integer_kind) modifier
- end subroutine omp_get_schedule
-
- function omp_get_wtime()
- double precision omp_get_wtime
- end function omp_get_wtime
-
- function omp_get_wtick ()
- double precision omp_get_wtick
- end function omp_get_wtick
-
- subroutine omp_init_lock(lockvar)
- use omp_lib_kinds
- integer (kind=omp_lock_kind) lockvar
- end subroutine omp_init_lock
-
- subroutine omp_destroy_lock(lockvar)
- use omp_lib_kinds
- integer (kind=omp_lock_kind) lockvar
- end subroutine omp_destroy_lock
-
- subroutine omp_set_lock(lockvar)
- use omp_lib_kinds
- integer (kind=omp_lock_kind) lockvar
- end subroutine omp_set_lock
-
- subroutine omp_unset_lock(lockvar)
- use omp_lib_kinds
- integer (kind=omp_lock_kind) lockvar
- end subroutine omp_unset_lock
-
- function omp_test_lock(lockvar)
- use omp_lib_kinds
- logical (kind=omp_logical_kind) omp_test_lock
- integer (kind=omp_lock_kind) lockvar
- end function omp_test_lock
-
- subroutine omp_init_nest_lock(lockvar)
- use omp_lib_kinds
- integer (kind=omp_nest_lock_kind) lockvar
- end subroutine omp_init_nest_lock
-
- subroutine omp_destroy_nest_lock(lockvar)
- use omp_lib_kinds
- integer (kind=omp_nest_lock_kind) lockvar
- end subroutine omp_destroy_nest_lock
-
- subroutine omp_set_nest_lock(lockvar)
- use omp_lib_kinds
- integer (kind=omp_nest_lock_kind) lockvar
- end subroutine omp_set_nest_lock
-
- subroutine omp_unset_nest_lock(lockvar)
- use omp_lib_kinds
- integer (kind=omp_nest_lock_kind) lockvar
- end subroutine omp_unset_nest_lock
-
- function omp_test_nest_lock(lockvar)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_test_nest_lock
- integer (kind=omp_nest_lock_kind) lockvar
- end function omp_test_nest_lock
-
-! ***
-! *** kmp_* entry points
-! ***
-
- subroutine kmp_set_stacksize(size)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) size
- end subroutine kmp_set_stacksize
-
- subroutine kmp_set_stacksize_s(size)
- use omp_lib_kinds
- integer (kind=kmp_size_t_kind) size
- end subroutine kmp_set_stacksize_s
-
- subroutine kmp_set_blocktime(msec)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) msec
- end subroutine kmp_set_blocktime
-
- subroutine kmp_set_library_serial()
- end subroutine kmp_set_library_serial
-
- subroutine kmp_set_library_turnaround()
- end subroutine kmp_set_library_turnaround
-
- subroutine kmp_set_library_throughput()
- end subroutine kmp_set_library_throughput
-
- subroutine kmp_set_library(libnum)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) libnum
- end subroutine kmp_set_library
-
- subroutine kmp_set_defaults(string)
- character*(*) string
- end subroutine kmp_set_defaults
-
- function kmp_get_stacksize()
- use omp_lib_kinds
- integer (kind=omp_integer_kind) kmp_get_stacksize
- end function kmp_get_stacksize
-
- function kmp_get_stacksize_s()
- use omp_lib_kinds
- integer (kind=kmp_size_t_kind) kmp_get_stacksize_s
- end function kmp_get_stacksize_s
-
- function kmp_get_blocktime()
- use omp_lib_kinds
- integer (kind=omp_integer_kind) kmp_get_blocktime
- end function kmp_get_blocktime
-
- function kmp_get_library()
- use omp_lib_kinds
- integer (kind=omp_integer_kind) kmp_get_library
- end function kmp_get_library
-
- function kmp_set_affinity(mask)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) kmp_set_affinity
- integer (kind=kmp_affinity_mask_kind) mask
- end function kmp_set_affinity
-
- function kmp_get_affinity(mask)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) kmp_get_affinity
- integer (kind=kmp_affinity_mask_kind) mask
- end function kmp_get_affinity
-
- function kmp_get_affinity_max_proc()
- use omp_lib_kinds
- integer (kind=omp_integer_kind) kmp_get_affinity_max_proc
- end function kmp_get_affinity_max_proc
-
- subroutine kmp_create_affinity_mask(mask)
- use omp_lib_kinds
- integer (kind=kmp_affinity_mask_kind) mask
- end subroutine kmp_create_affinity_mask
-
- subroutine kmp_destroy_affinity_mask(mask)
- use omp_lib_kinds
- integer (kind=kmp_affinity_mask_kind) mask
- end subroutine kmp_destroy_affinity_mask
-
- function kmp_set_affinity_mask_proc(proc, mask)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) kmp_set_affinity_mask_proc
- integer (kind=omp_integer_kind) proc
- integer (kind=kmp_affinity_mask_kind) mask
- end function kmp_set_affinity_mask_proc
-
- function kmp_unset_affinity_mask_proc(proc, mask)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) kmp_unset_affinity_mask_proc
- integer (kind=omp_integer_kind) proc
- integer (kind=kmp_affinity_mask_kind) mask
- end function kmp_unset_affinity_mask_proc
-
- function kmp_get_affinity_mask_proc(proc, mask)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) kmp_get_affinity_mask_proc
- integer (kind=omp_integer_kind) proc
- integer (kind=kmp_affinity_mask_kind) mask
- end function kmp_get_affinity_mask_proc
-
- function kmp_malloc(size)
- use omp_lib_kinds
- integer (kind=kmp_pointer_kind) kmp_malloc
- integer (kind=kmp_size_t_kind) size
- end function kmp_malloc
-
- function kmp_aligned_malloc(size, alignment)
- use omp_lib_kinds
- integer (kind=kmp_pointer_kind) kmp_aligned_malloc
- integer (kind=kmp_size_t_kind) size
- integer (kind=kmp_size_t_kind) alignment
- end function kmp_aligned_malloc
-
- function kmp_calloc(nelem, elsize)
- use omp_lib_kinds
- integer (kind=kmp_pointer_kind) kmp_calloc
- integer (kind=kmp_size_t_kind) nelem
- integer (kind=kmp_size_t_kind) elsize
- end function kmp_calloc
-
- function kmp_realloc(ptr, size)
- use omp_lib_kinds
- integer (kind=kmp_pointer_kind) kmp_realloc
- integer (kind=kmp_pointer_kind) ptr
- integer (kind=kmp_size_t_kind) size
- end function kmp_realloc
-
- subroutine kmp_free(ptr)
- use omp_lib_kinds
- integer (kind=kmp_pointer_kind) ptr
- end subroutine kmp_free
-
- subroutine kmp_set_warnings_on()
- end subroutine kmp_set_warnings_on
-
- subroutine kmp_set_warnings_off()
- end subroutine kmp_set_warnings_off
-
- end interface
-
-!dec$ if defined(_WIN32)
-!dec$ if defined(_WIN64) .or. defined(_M_AMD64)
-
-!***
-!*** The Fortran entry points must be in uppercase, even if the /Qlowercase
-!*** option is specified. The alias attribute ensures that the specified
-!*** string is used as the entry point.
-!***
-!*** On the Windows* OS IA-32 architecture, the Fortran entry points have an
-!*** underscore prepended. On the Windows* OS Intel(R) 64
-!*** architecture, no underscore is prepended.
-!***
-
-!dec$ attributes alias:'OMP_SET_NUM_THREADS' :: omp_set_num_threads
-!dec$ attributes alias:'OMP_SET_DYNAMIC' :: omp_set_dynamic
-!dec$ attributes alias:'OMP_SET_NESTED' :: omp_set_nested
-!dec$ attributes alias:'OMP_GET_NUM_THREADS' :: omp_get_num_threads
-!dec$ attributes alias:'OMP_GET_MAX_THREADS' :: omp_get_max_threads
-!dec$ attributes alias:'OMP_GET_THREAD_NUM' :: omp_get_thread_num
-!dec$ attributes alias:'OMP_GET_NUM_PROCS' :: omp_get_num_procs
-!dec$ attributes alias:'OMP_IN_PARALLEL' :: omp_in_parallel
-!dec$ attributes alias:'OMP_GET_DYNAMIC' :: omp_get_dynamic
-!dec$ attributes alias:'OMP_GET_NESTED' :: omp_get_nested
-!dec$ attributes alias:'OMP_GET_THREAD_LIMIT' :: omp_get_thread_limit
-!dec$ attributes alias:'OMP_SET_MAX_ACTIVE_LEVELS' :: omp_set_max_active_levels
-!dec$ attributes alias:'OMP_GET_MAX_ACTIVE_LEVELS' :: omp_get_max_active_levels
-!dec$ attributes alias:'OMP_GET_LEVEL' :: omp_get_level
-!dec$ attributes alias:'OMP_GET_ACTIVE_LEVEL' :: omp_get_active_level
-!dec$ attributes alias:'OMP_GET_ANCESTOR_THREAD_NUM' :: omp_get_ancestor_thread_num
-!dec$ attributes alias:'OMP_GET_TEAM_SIZE' :: omp_get_team_size
-!dec$ attributes alias:'OMP_SET_SCHEDULE' :: omp_set_schedule
-!dec$ attributes alias:'OMP_GET_SCHEDULE' :: omp_get_schedule
-!dec$ attributes alias:'OMP_GET_WTIME' :: omp_get_wtime
-!dec$ attributes alias:'OMP_GET_WTICK' :: omp_get_wtick
-
-!dec$ attributes alias:'omp_init_lock' :: omp_init_lock
-!dec$ attributes alias:'omp_destroy_lock' :: omp_destroy_lock
-!dec$ attributes alias:'omp_set_lock' :: omp_set_lock
-!dec$ attributes alias:'omp_unset_lock' :: omp_unset_lock
-!dec$ attributes alias:'omp_test_lock' :: omp_test_lock
-!dec$ attributes alias:'omp_init_nest_lock' :: omp_init_nest_lock
-!dec$ attributes alias:'omp_destroy_nest_lock' :: omp_destroy_nest_lock
-!dec$ attributes alias:'omp_set_nest_lock' :: omp_set_nest_lock
-!dec$ attributes alias:'omp_unset_nest_lock' :: omp_unset_nest_lock
-!dec$ attributes alias:'omp_test_nest_lock' :: omp_test_nest_lock
-
-!dec$ attributes alias:'KMP_SET_STACKSIZE'::kmp_set_stacksize
-!dec$ attributes alias:'KMP_SET_STACKSIZE_S'::kmp_set_stacksize_s
-!dec$ attributes alias:'KMP_SET_BLOCKTIME'::kmp_set_blocktime
-!dec$ attributes alias:'KMP_SET_LIBRARY_SERIAL'::kmp_set_library_serial
-!dec$ attributes alias:'KMP_SET_LIBRARY_TURNAROUND'::kmp_set_library_turnaround
-!dec$ attributes alias:'KMP_SET_LIBRARY_THROUGHPUT'::kmp_set_library_throughput
-!dec$ attributes alias:'KMP_SET_LIBRARY'::kmp_set_library
-!dec$ attributes alias:'KMP_GET_STACKSIZE'::kmp_get_stacksize
-!dec$ attributes alias:'KMP_GET_STACKSIZE_S'::kmp_get_stacksize_s
-!dec$ attributes alias:'KMP_GET_BLOCKTIME'::kmp_get_blocktime
-!dec$ attributes alias:'KMP_GET_LIBRARY'::kmp_get_library
-!dec$ attributes alias:'KMP_SET_AFFINITY'::kmp_set_affinity
-!dec$ attributes alias:'KMP_GET_AFFINITY'::kmp_get_affinity
-!dec$ attributes alias:'KMP_GET_AFFINITY_MAX_PROC'::kmp_get_affinity_max_proc
-!dec$ attributes alias:'KMP_CREATE_AFFINITY_MASK'::kmp_create_affinity_mask
-!dec$ attributes alias:'KMP_DESTROY_AFFINITY_MASK'::kmp_destroy_affinity_mask
-!dec$ attributes alias:'KMP_SET_AFFINITY_MASK_PROC'::kmp_set_affinity_mask_proc
-!dec$ attributes alias:'KMP_UNSET_AFFINITY_MASK_PROC'::kmp_unset_affinity_mask_proc
-!dec$ attributes alias:'KMP_GET_AFFINITY_MASK_PROC'::kmp_get_affinity_mask_proc
-!dec$ attributes alias:'KMP_MALLOC'::kmp_malloc
-!dec$ attributes alias:'KMP_ALIGNED_MALLOC'::kmp_aligned_malloc
-!dec$ attributes alias:'KMP_CALLOC'::kmp_calloc
-!dec$ attributes alias:'KMP_REALLOC'::kmp_realloc
-!dec$ attributes alias:'KMP_FREE'::kmp_free
-
-!dec$ attributes alias:'KMP_SET_WARNINGS_ON'::kmp_set_warnings_on
-!dec$ attributes alias:'KMP_SET_WARNINGS_OFF'::kmp_set_warnings_off
-
-!dec$ else
-
-!***
-!*** On Windows* OS IA-32 architecture, the Fortran entry points have an underscore prepended.
-!***
-
-!dec$ attributes alias:'_OMP_SET_NUM_THREADS' :: omp_set_num_threads
-!dec$ attributes alias:'_OMP_SET_DYNAMIC' :: omp_set_dynamic
-!dec$ attributes alias:'_OMP_SET_NESTED' :: omp_set_nested
-!dec$ attributes alias:'_OMP_GET_NUM_THREADS' :: omp_get_num_threads
-!dec$ attributes alias:'_OMP_GET_MAX_THREADS' :: omp_get_max_threads
-!dec$ attributes alias:'_OMP_GET_THREAD_NUM' :: omp_get_thread_num
-!dec$ attributes alias:'_OMP_GET_NUM_PROCS' :: omp_get_num_procs
-!dec$ attributes alias:'_OMP_IN_PARALLEL' :: omp_in_parallel
-!dec$ attributes alias:'_OMP_GET_DYNAMIC' :: omp_get_dynamic
-!dec$ attributes alias:'_OMP_GET_NESTED' :: omp_get_nested
-!dec$ attributes alias:'_OMP_GET_THREAD_LIMIT' :: omp_get_thread_limit
-!dec$ attributes alias:'_OMP_SET_MAX_ACTIVE_LEVELS' :: omp_set_max_active_levels
-!dec$ attributes alias:'_OMP_GET_MAX_ACTIVE_LEVELS' :: omp_get_max_active_levels
-!dec$ attributes alias:'_OMP_GET_LEVEL' :: omp_get_level
-!dec$ attributes alias:'_OMP_GET_ACTIVE_LEVEL' :: omp_get_active_level
-!dec$ attributes alias:'_OMP_GET_ANCESTOR_THREAD_NUM' :: omp_get_ancestor_thread_num
-!dec$ attributes alias:'_OMP_GET_TEAM_SIZE' :: omp_get_team_size
-!dec$ attributes alias:'_OMP_SET_SCHEDULE' :: omp_set_schedule
-!dec$ attributes alias:'_OMP_GET_SCHEDULE' :: omp_get_schedule
-!dec$ attributes alias:'_OMP_GET_WTIME' :: omp_get_wtime
-!dec$ attributes alias:'_OMP_GET_WTICK' :: omp_get_wtick
-
-!dec$ attributes alias:'_omp_init_lock' :: omp_init_lock
-!dec$ attributes alias:'_omp_destroy_lock' :: omp_destroy_lock
-!dec$ attributes alias:'_omp_set_lock' :: omp_set_lock
-!dec$ attributes alias:'_omp_unset_lock' :: omp_unset_lock
-!dec$ attributes alias:'_omp_test_lock' :: omp_test_lock
-!dec$ attributes alias:'_omp_init_nest_lock' :: omp_init_nest_lock
-!dec$ attributes alias:'_omp_destroy_nest_lock' :: omp_destroy_nest_lock
-!dec$ attributes alias:'_omp_set_nest_lock' :: omp_set_nest_lock
-!dec$ attributes alias:'_omp_unset_nest_lock' :: omp_unset_nest_lock
-!dec$ attributes alias:'_omp_test_nest_lock' :: omp_test_nest_lock
-
-!dec$ attributes alias:'_KMP_SET_STACKSIZE'::kmp_set_stacksize
-!dec$ attributes alias:'_KMP_SET_STACKSIZE_S'::kmp_set_stacksize_s
-!dec$ attributes alias:'_KMP_SET_BLOCKTIME'::kmp_set_blocktime
-!dec$ attributes alias:'_KMP_SET_LIBRARY_SERIAL'::kmp_set_library_serial
-!dec$ attributes alias:'_KMP_SET_LIBRARY_TURNAROUND'::kmp_set_library_turnaround
-!dec$ attributes alias:'_KMP_SET_LIBRARY_THROUGHPUT'::kmp_set_library_throughput
-!dec$ attributes alias:'_KMP_SET_LIBRARY'::kmp_set_library
-!dec$ attributes alias:'_KMP_GET_STACKSIZE'::kmp_get_stacksize
-!dec$ attributes alias:'_KMP_GET_STACKSIZE_S'::kmp_get_stacksize_s
-!dec$ attributes alias:'_KMP_GET_BLOCKTIME'::kmp_get_blocktime
-!dec$ attributes alias:'_KMP_GET_LIBRARY'::kmp_get_library
-!dec$ attributes alias:'_KMP_SET_AFFINITY'::kmp_set_affinity
-!dec$ attributes alias:'_KMP_GET_AFFINITY'::kmp_get_affinity
-!dec$ attributes alias:'_KMP_GET_AFFINITY_MAX_PROC'::kmp_get_affinity_max_proc
-!dec$ attributes alias:'_KMP_CREATE_AFFINITY_MASK'::kmp_create_affinity_mask
-!dec$ attributes alias:'_KMP_DESTROY_AFFINITY_MASK'::kmp_destroy_affinity_mask
-!dec$ attributes alias:'_KMP_SET_AFFINITY_MASK_PROC'::kmp_set_affinity_mask_proc
-!dec$ attributes alias:'_KMP_UNSET_AFFINITY_MASK_PROC'::kmp_unset_affinity_mask_proc
-!dec$ attributes alias:'_KMP_GET_AFFINITY_MASK_PROC'::kmp_get_affinity_mask_proc
-!dec$ attributes alias:'_KMP_MALLOC'::kmp_malloc
-!dec$ attributes alias:'_KMP_ALIGNED_MALLOC'::kmp_aligned_malloc
-!dec$ attributes alias:'_KMP_CALLOC'::kmp_calloc
-!dec$ attributes alias:'_KMP_REALLOC'::kmp_realloc
-!dec$ attributes alias:'_KMP_FREE'::kmp_free
-
-!dec$ attributes alias:'_KMP_SET_WARNINGS_ON'::kmp_set_warnings_on
-!dec$ attributes alias:'_KMP_SET_WARNINGS_OFF'::kmp_set_warnings_off
-
-!dec$ endif
-!dec$ endif
-
-!dec$ if defined(__linux)
-
-!***
-!*** The Linux* OS entry points are in lowercase, with an underscore appended.
-!***
-
-!dec$ attributes alias:'omp_set_num_threads_'::omp_set_num_threads
-!dec$ attributes alias:'omp_set_dynamic_'::omp_set_dynamic
-!dec$ attributes alias:'omp_set_nested_'::omp_set_nested
-!dec$ attributes alias:'omp_get_num_threads_'::omp_get_num_threads
-!dec$ attributes alias:'omp_get_max_threads_'::omp_get_max_threads
-!dec$ attributes alias:'omp_get_thread_num_'::omp_get_thread_num
-!dec$ attributes alias:'omp_get_num_procs_'::omp_get_num_procs
-!dec$ attributes alias:'omp_in_parallel_'::omp_in_parallel
-!dec$ attributes alias:'omp_get_dynamic_'::omp_get_dynamic
-!dec$ attributes alias:'omp_get_nested_'::omp_get_nested
-!dec$ attributes alias:'omp_get_thread_limit_'::omp_get_thread_limit
-!dec$ attributes alias:'omp_set_max_active_levels_'::omp_set_max_active_levels
-!dec$ attributes alias:'omp_get_max_active_levels_'::omp_get_max_active_levels
-!dec$ attributes alias:'omp_get_level_'::omp_get_level
-!dec$ attributes alias:'omp_get_active_level_'::omp_get_active_level
-!dec$ attributes alias:'omp_get_ancestor_thread_num_'::omp_get_ancestor_thread_num
-!dec$ attributes alias:'omp_get_team_size_'::omp_get_team_size
-!dec$ attributes alias:'omp_set_schedule_'::omp_set_schedule
-!dec$ attributes alias:'omp_get_schedule_'::omp_get_schedule
-!dec$ attributes alias:'omp_get_wtime_'::omp_get_wtime
-!dec$ attributes alias:'omp_get_wtick_'::omp_get_wtick
-
-!dec$ attributes alias:'omp_init_lock_'::omp_init_lock
-!dec$ attributes alias:'omp_destroy_lock_'::omp_destroy_lock
-!dec$ attributes alias:'omp_set_lock_'::omp_set_lock
-!dec$ attributes alias:'omp_unset_lock_'::omp_unset_lock
-!dec$ attributes alias:'omp_test_lock_'::omp_test_lock
-!dec$ attributes alias:'omp_init_nest_lock_'::omp_init_nest_lock
-!dec$ attributes alias:'omp_destroy_nest_lock_'::omp_destroy_nest_lock
-!dec$ attributes alias:'omp_set_nest_lock_'::omp_set_nest_lock
-!dec$ attributes alias:'omp_unset_nest_lock_'::omp_unset_nest_lock
-!dec$ attributes alias:'omp_test_nest_lock_'::omp_test_nest_lock
-
-!dec$ attributes alias:'kmp_set_stacksize_'::kmp_set_stacksize
-!dec$ attributes alias:'kmp_set_stacksize_s_'::kmp_set_stacksize_s
-!dec$ attributes alias:'kmp_set_blocktime_'::kmp_set_blocktime
-!dec$ attributes alias:'kmp_set_library_serial_'::kmp_set_library_serial
-!dec$ attributes alias:'kmp_set_library_turnaround_'::kmp_set_library_turnaround
-!dec$ attributes alias:'kmp_set_library_throughput_'::kmp_set_library_throughput
-!dec$ attributes alias:'kmp_set_library_'::kmp_set_library
-!dec$ attributes alias:'kmp_get_stacksize_'::kmp_get_stacksize
-!dec$ attributes alias:'kmp_get_stacksize_s_'::kmp_get_stacksize_s
-!dec$ attributes alias:'kmp_get_blocktime_'::kmp_get_blocktime
-!dec$ attributes alias:'kmp_get_library_'::kmp_get_library
-!dec$ attributes alias:'kmp_set_affinity_'::kmp_set_affinity
-!dec$ attributes alias:'kmp_get_affinity_'::kmp_get_affinity
-!dec$ attributes alias:'kmp_get_affinity_max_proc_'::kmp_get_affinity_max_proc
-!dec$ attributes alias:'kmp_create_affinity_mask_'::kmp_create_affinity_mask
-!dec$ attributes alias:'kmp_destroy_affinity_mask_'::kmp_destroy_affinity_mask
-!dec$ attributes alias:'kmp_set_affinity_mask_proc_'::kmp_set_affinity_mask_proc
-!dec$ attributes alias:'kmp_unset_affinity_mask_proc_'::kmp_unset_affinity_mask_proc
-!dec$ attributes alias:'kmp_get_affinity_mask_proc_'::kmp_get_affinity_mask_proc
-!dec$ attributes alias:'kmp_malloc_'::kmp_malloc
-!dec$ attributes alias:'kmp_aligned_malloc_'::kmp_aligned_malloc
-!dec$ attributes alias:'kmp_calloc_'::kmp_calloc
-!dec$ attributes alias:'kmp_realloc_'::kmp_realloc
-!dec$ attributes alias:'kmp_free_'::kmp_free
-
-!dec$ attributes alias:'kmp_set_warnings_on_'::kmp_set_warnings_on
-!dec$ attributes alias:'kmp_set_warnings_off_'::kmp_set_warnings_off
-
-!dec$ endif
-
-!dec$ if defined(__APPLE__)
-
-!***
-!*** The Mac entry points are in lowercase, with an both an underscore
-!*** appended and an underscore prepended.
-!***
-
-!dec$ attributes alias:'_omp_set_num_threads_'::omp_set_num_threads
-!dec$ attributes alias:'_omp_set_dynamic_'::omp_set_dynamic
-!dec$ attributes alias:'_omp_set_nested_'::omp_set_nested
-!dec$ attributes alias:'_omp_get_num_threads_'::omp_get_num_threads
-!dec$ attributes alias:'_omp_get_max_threads_'::omp_get_max_threads
-!dec$ attributes alias:'_omp_get_thread_num_'::omp_get_thread_num
-!dec$ attributes alias:'_omp_get_num_procs_'::omp_get_num_procs
-!dec$ attributes alias:'_omp_in_parallel_'::omp_in_parallel
-!dec$ attributes alias:'_omp_get_dynamic_'::omp_get_dynamic
-!dec$ attributes alias:'_omp_get_nested_'::omp_get_nested
-!dec$ attributes alias:'_omp_get_thread_limit_'::omp_get_thread_limit
-!dec$ attributes alias:'_omp_set_max_active_levels_'::omp_set_max_active_levels
-!dec$ attributes alias:'_omp_get_max_active_levels_'::omp_get_max_active_levels
-!dec$ attributes alias:'_omp_get_level_'::omp_get_level
-!dec$ attributes alias:'_omp_get_active_level_'::omp_get_active_level
-!dec$ attributes alias:'_omp_get_ancestor_thread_num_'::omp_get_ancestor_thread_num
-!dec$ attributes alias:'_omp_get_team_size_'::omp_get_team_size
-!dec$ attributes alias:'_omp_set_schedule_'::omp_set_schedule
-!dec$ attributes alias:'_omp_get_schedule_'::omp_get_schedule
-!dec$ attributes alias:'_omp_get_wtime_'::omp_get_wtime
-!dec$ attributes alias:'_omp_get_wtick_'::omp_get_wtick
-
-!dec$ attributes alias:'_omp_init_lock_'::omp_init_lock
-!dec$ attributes alias:'_omp_destroy_lock_'::omp_destroy_lock
-!dec$ attributes alias:'_omp_set_lock_'::omp_set_lock
-!dec$ attributes alias:'_omp_unset_lock_'::omp_unset_lock
-!dec$ attributes alias:'_omp_test_lock_'::omp_test_lock
-!dec$ attributes alias:'_omp_init_nest_lock_'::omp_init_nest_lock
-!dec$ attributes alias:'_omp_destroy_nest_lock_'::omp_destroy_nest_lock
-!dec$ attributes alias:'_omp_set_nest_lock_'::omp_set_nest_lock
-!dec$ attributes alias:'_omp_unset_nest_lock_'::omp_unset_nest_lock
-!dec$ attributes alias:'_omp_test_nest_lock_'::omp_test_nest_lock
-
-!dec$ attributes alias:'_kmp_set_stacksize_'::kmp_set_stacksize
-!dec$ attributes alias:'_kmp_set_stacksize_s_'::kmp_set_stacksize_s
-!dec$ attributes alias:'_kmp_set_blocktime_'::kmp_set_blocktime
-!dec$ attributes alias:'_kmp_set_library_serial_'::kmp_set_library_serial
-!dec$ attributes alias:'_kmp_set_library_turnaround_'::kmp_set_library_turnaround
-!dec$ attributes alias:'_kmp_set_library_throughput_'::kmp_set_library_throughput
-!dec$ attributes alias:'_kmp_set_library_'::kmp_set_library
-!dec$ attributes alias:'_kmp_get_stacksize_'::kmp_get_stacksize
-!dec$ attributes alias:'_kmp_get_stacksize_s_'::kmp_get_stacksize_s
-!dec$ attributes alias:'_kmp_get_blocktime_'::kmp_get_blocktime
-!dec$ attributes alias:'_kmp_get_library_'::kmp_get_library
-!dec$ attributes alias:'_kmp_set_affinity_'::kmp_set_affinity
-!dec$ attributes alias:'_kmp_get_affinity_'::kmp_get_affinity
-!dec$ attributes alias:'_kmp_get_affinity_max_proc_'::kmp_get_affinity_max_proc
-!dec$ attributes alias:'_kmp_create_affinity_mask_'::kmp_create_affinity_mask
-!dec$ attributes alias:'_kmp_destroy_affinity_mask_'::kmp_destroy_affinity_mask
-!dec$ attributes alias:'_kmp_set_affinity_mask_proc_'::kmp_set_affinity_mask_proc
-!dec$ attributes alias:'_kmp_unset_affinity_mask_proc_'::kmp_unset_affinity_mask_proc
-!dec$ attributes alias:'_kmp_get_affinity_mask_proc_'::kmp_get_affinity_mask_proc
-!dec$ attributes alias:'_kmp_malloc_'::kmp_malloc
-!dec$ attributes alias:'_kmp_aligned_malloc_'::kmp_aligned_malloc
-!dec$ attributes alias:'_kmp_calloc_'::kmp_calloc
-!dec$ attributes alias:'_kmp_realloc_'::kmp_realloc
-!dec$ attributes alias:'_kmp_free_'::kmp_free
-
-!dec$ attributes alias:'_kmp_set_warnings_on_'::kmp_set_warnings_on
-!dec$ attributes alias:'_kmp_set_warnings_off_'::kmp_set_warnings_off
-
-!dec$ endif
-
- end module omp_lib
-
diff --git a/runtime/src/include/30/omp_lib.f90.var b/runtime/src/include/30/omp_lib.f90.var
deleted file mode 100644
index 63539a1ef69d..000000000000
--- a/runtime/src/include/30/omp_lib.f90.var
+++ /dev/null
@@ -1,365 +0,0 @@
-! include/30/omp_lib.f90.var
-
-!
-!//===----------------------------------------------------------------------===//
-!//
-!// The LLVM Compiler Infrastructure
-!//
-!// This file is dual licensed under the MIT and the University of Illinois Open
-!// Source Licenses. See LICENSE.txt for details.
-!//
-!//===----------------------------------------------------------------------===//
-!
-
- module omp_lib_kinds
-
- use, intrinsic :: iso_c_binding
-
- integer, parameter :: omp_integer_kind = c_int
- integer, parameter :: omp_logical_kind = 4
- integer, parameter :: omp_real_kind = c_float
- integer, parameter :: kmp_double_kind = c_double
- integer, parameter :: omp_lock_kind = c_intptr_t
- integer, parameter :: omp_nest_lock_kind = c_intptr_t
- integer, parameter :: omp_sched_kind = omp_integer_kind
- integer, parameter :: kmp_pointer_kind = c_intptr_t
- integer, parameter :: kmp_size_t_kind = c_size_t
- integer, parameter :: kmp_affinity_mask_kind = c_intptr_t
-
- end module omp_lib_kinds
-
- module omp_lib
-
- use omp_lib_kinds
-
- integer (kind=omp_integer_kind), parameter :: openmp_version = @LIBOMP_OMP_YEAR_MONTH@
- integer (kind=omp_integer_kind), parameter :: kmp_version_major = @LIBOMP_VERSION_MAJOR@
- integer (kind=omp_integer_kind), parameter :: kmp_version_minor = @LIBOMP_VERSION_MINOR@
- integer (kind=omp_integer_kind), parameter :: kmp_version_build = @LIBOMP_VERSION_BUILD@
- character(*) kmp_build_date
- parameter( kmp_build_date = '@LIBOMP_BUILD_DATE@' )
-
- integer(kind=omp_sched_kind), parameter :: omp_sched_static = 1
- integer(kind=omp_sched_kind), parameter :: omp_sched_dynamic = 2
- integer(kind=omp_sched_kind), parameter :: omp_sched_guided = 3
- integer(kind=omp_sched_kind), parameter :: omp_sched_auto = 4
-
- interface
-
-! ***
-! *** omp_* entry points
-! ***
-
- subroutine omp_set_num_threads(nthreads) bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind), value :: nthreads
- end subroutine omp_set_num_threads
-
- subroutine omp_set_dynamic(enable) bind(c)
- use omp_lib_kinds
- logical (kind=omp_logical_kind), value :: enable
- end subroutine omp_set_dynamic
-
- subroutine omp_set_nested(enable) bind(c)
- use omp_lib_kinds
- logical (kind=omp_logical_kind), value :: enable
- end subroutine omp_set_nested
-
- function omp_get_num_threads() bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_num_threads
- end function omp_get_num_threads
-
- function omp_get_max_threads() bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_max_threads
- end function omp_get_max_threads
-
- function omp_get_thread_num() bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_thread_num
- end function omp_get_thread_num
-
- function omp_get_num_procs() bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_num_procs
- end function omp_get_num_procs
-
- function omp_in_parallel() bind(c)
- use omp_lib_kinds
- logical (kind=omp_logical_kind) omp_in_parallel
- end function omp_in_parallel
-
- function omp_in_final() bind(c)
- use omp_lib_kinds
- logical (kind=omp_logical_kind) omp_in_final
- end function omp_in_final
-
- function omp_get_dynamic() bind(c)
- use omp_lib_kinds
- logical (kind=omp_logical_kind) omp_get_dynamic
- end function omp_get_dynamic
-
- function omp_get_nested() bind(c)
- use omp_lib_kinds
- logical (kind=omp_logical_kind) omp_get_nested
- end function omp_get_nested
-
- function omp_get_thread_limit() bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_thread_limit
- end function omp_get_thread_limit
-
- subroutine omp_set_max_active_levels(max_levels) bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind), value :: max_levels
- end subroutine omp_set_max_active_levels
-
- function omp_get_max_active_levels() bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_max_active_levels
- end function omp_get_max_active_levels
-
- function omp_get_level() bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) :: omp_get_level
- end function omp_get_level
-
- function omp_get_active_level() bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) :: omp_get_active_level
- end function omp_get_active_level
-
- function omp_get_ancestor_thread_num(level) bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_ancestor_thread_num
- integer (kind=omp_integer_kind), value :: level
- end function omp_get_ancestor_thread_num
-
- function omp_get_team_size(level) bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_team_size
- integer (kind=omp_integer_kind), value :: level
- end function omp_get_team_size
-
- subroutine omp_set_schedule(kind, modifier) bind(c)
- use omp_lib_kinds
- integer (kind=omp_sched_kind), value :: kind
- integer (kind=omp_integer_kind), value :: modifier
- end subroutine omp_set_schedule
-
- subroutine omp_get_schedule(kind, modifier) bind(c)
- use omp_lib_kinds
- integer (kind=omp_sched_kind) :: kind
- integer (kind=omp_integer_kind) :: modifier
- end subroutine omp_get_schedule
-
- function omp_get_wtime() bind(c)
- use omp_lib_kinds
- real (kind=kmp_double_kind) omp_get_wtime
- end function omp_get_wtime
-
- function omp_get_wtick() bind(c)
- use omp_lib_kinds
- real (kind=kmp_double_kind) omp_get_wtick
- end function omp_get_wtick
-
- subroutine omp_init_lock(lockvar) bind(c)
- use omp_lib_kinds
- integer (kind=omp_lock_kind) lockvar
- end subroutine omp_init_lock
-
- subroutine omp_destroy_lock(lockvar) bind(c)
- use omp_lib_kinds
- integer (kind=omp_lock_kind) lockvar
- end subroutine omp_destroy_lock
-
- subroutine omp_set_lock(lockvar) bind(c)
- use omp_lib_kinds
- integer (kind=omp_lock_kind) lockvar
- end subroutine omp_set_lock
-
- subroutine omp_unset_lock(lockvar) bind(c)
- use omp_lib_kinds
- integer (kind=omp_lock_kind) lockvar
- end subroutine omp_unset_lock
-
- function omp_test_lock(lockvar) bind(c)
- use omp_lib_kinds
- logical (kind=omp_logical_kind) omp_test_lock
- integer (kind=omp_lock_kind) lockvar
- end function omp_test_lock
-
- subroutine omp_init_nest_lock(lockvar) bind(c)
- use omp_lib_kinds
- integer (kind=omp_nest_lock_kind) lockvar
- end subroutine omp_init_nest_lock
-
- subroutine omp_destroy_nest_lock(lockvar) bind(c)
- use omp_lib_kinds
- integer (kind=omp_nest_lock_kind) lockvar
- end subroutine omp_destroy_nest_lock
-
- subroutine omp_set_nest_lock(lockvar) bind(c)
- use omp_lib_kinds
- integer (kind=omp_nest_lock_kind) lockvar
- end subroutine omp_set_nest_lock
-
- subroutine omp_unset_nest_lock(lockvar) bind(c)
- use omp_lib_kinds
- integer (kind=omp_nest_lock_kind) lockvar
- end subroutine omp_unset_nest_lock
-
- function omp_test_nest_lock(lockvar) bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_test_nest_lock
- integer (kind=omp_nest_lock_kind) lockvar
- end function omp_test_nest_lock
-
-! ***
-! *** kmp_* entry points
-! ***
-
- subroutine kmp_set_stacksize(size) bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind), value :: size
- end subroutine kmp_set_stacksize
-
- subroutine kmp_set_stacksize_s(size) bind(c)
- use omp_lib_kinds
- integer (kind=kmp_size_t_kind), value :: size
- end subroutine kmp_set_stacksize_s
-
- subroutine kmp_set_blocktime(msec) bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind), value :: msec
- end subroutine kmp_set_blocktime
-
- subroutine kmp_set_library_serial() bind(c)
- end subroutine kmp_set_library_serial
-
- subroutine kmp_set_library_turnaround() bind(c)
- end subroutine kmp_set_library_turnaround
-
- subroutine kmp_set_library_throughput() bind(c)
- end subroutine kmp_set_library_throughput
-
- subroutine kmp_set_library(libnum) bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind), value :: libnum
- end subroutine kmp_set_library
-
- subroutine kmp_set_defaults(string) bind(c)
- use, intrinsic :: iso_c_binding
- character (kind=c_char) :: string(*)
- end subroutine kmp_set_defaults
-
- function kmp_get_stacksize() bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) kmp_get_stacksize
- end function kmp_get_stacksize
-
- function kmp_get_stacksize_s() bind(c)
- use omp_lib_kinds
- integer (kind=kmp_size_t_kind) kmp_get_stacksize_s
- end function kmp_get_stacksize_s
-
- function kmp_get_blocktime() bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) kmp_get_blocktime
- end function kmp_get_blocktime
-
- function kmp_get_library() bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) kmp_get_library
- end function kmp_get_library
-
- function kmp_set_affinity(mask) bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) kmp_set_affinity
- integer (kind=kmp_affinity_mask_kind) mask
- end function kmp_set_affinity
-
- function kmp_get_affinity(mask) bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) kmp_get_affinity
- integer (kind=kmp_affinity_mask_kind) mask
- end function kmp_get_affinity
-
- function kmp_get_affinity_max_proc() bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) kmp_get_affinity_max_proc
- end function kmp_get_affinity_max_proc
-
- subroutine kmp_create_affinity_mask(mask) bind(c)
- use omp_lib_kinds
- integer (kind=kmp_affinity_mask_kind) mask
- end subroutine kmp_create_affinity_mask
-
- subroutine kmp_destroy_affinity_mask(mask) bind(c)
- use omp_lib_kinds
- integer (kind=kmp_affinity_mask_kind) mask
- end subroutine kmp_destroy_affinity_mask
-
- function kmp_set_affinity_mask_proc(proc, mask) bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) kmp_set_affinity_mask_proc
- integer (kind=omp_integer_kind), value :: proc
- integer (kind=kmp_affinity_mask_kind) mask
- end function kmp_set_affinity_mask_proc
-
- function kmp_unset_affinity_mask_proc(proc, mask) bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) kmp_unset_affinity_mask_proc
- integer (kind=omp_integer_kind), value :: proc
- integer (kind=kmp_affinity_mask_kind) mask
- end function kmp_unset_affinity_mask_proc
-
- function kmp_get_affinity_mask_proc(proc, mask) bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) kmp_get_affinity_mask_proc
- integer (kind=omp_integer_kind), value :: proc
- integer (kind=kmp_affinity_mask_kind) mask
- end function kmp_get_affinity_mask_proc
-
- function kmp_malloc(size) bind(c)
- use omp_lib_kinds
- integer (kind=kmp_pointer_kind) kmp_malloc
- integer (kind=kmp_size_t_kind), value :: size
- end function kmp_malloc
-
- function kmp_aligned_malloc(size, alignment) bind(c)
- use omp_lib_kinds
- integer (kind=kmp_pointer_kind) kmp_aligned_malloc
- integer (kind=kmp_size_t_kind), value :: size
- integer (kind=kmp_size_t_kind), value :: alignment
- end function kmp_aligned_malloc
-
- function kmp_calloc(nelem, elsize) bind(c)
- use omp_lib_kinds
- integer (kind=kmp_pointer_kind) kmp_calloc
- integer (kind=kmp_size_t_kind), value :: nelem
- integer (kind=kmp_size_t_kind), value :: elsize
- end function kmp_calloc
-
- function kmp_realloc(ptr, size) bind(c)
- use omp_lib_kinds
- integer (kind=kmp_pointer_kind) kmp_realloc
- integer (kind=kmp_pointer_kind), value :: ptr
- integer (kind=kmp_size_t_kind), value :: size
- end function kmp_realloc
-
- subroutine kmp_free(ptr) bind(c)
- use omp_lib_kinds
- integer (kind=kmp_pointer_kind), value :: ptr
- end subroutine kmp_free
-
- subroutine kmp_set_warnings_on() bind(c)
- end subroutine kmp_set_warnings_on
-
- subroutine kmp_set_warnings_off() bind(c)
- end subroutine kmp_set_warnings_off
-
- end interface
-
- end module omp_lib
diff --git a/runtime/src/include/30/omp_lib.h.var b/runtime/src/include/30/omp_lib.h.var
deleted file mode 100644
index 3800602339b1..000000000000
--- a/runtime/src/include/30/omp_lib.h.var
+++ /dev/null
@@ -1,649 +0,0 @@
-! include/30/omp_lib.h.var
-
-!
-!//===----------------------------------------------------------------------===//
-!//
-!// The LLVM Compiler Infrastructure
-!//
-!// This file is dual licensed under the MIT and the University of Illinois Open
-!// Source Licenses. See LICENSE.txt for details.
-!//
-!//===----------------------------------------------------------------------===//
-!
-
-!***
-!*** Some of the directives for the following routine extend past column 72,
-!*** so process this file in 132-column mode.
-!***
-
-!dec$ fixedformlinesize:132
-
- integer, parameter :: omp_integer_kind = 4
- integer, parameter :: omp_logical_kind = 4
- integer, parameter :: omp_real_kind = 4
- integer, parameter :: omp_lock_kind = int_ptr_kind()
- integer, parameter :: omp_nest_lock_kind = int_ptr_kind()
- integer, parameter :: omp_sched_kind = omp_integer_kind
- integer, parameter :: kmp_pointer_kind = int_ptr_kind()
- integer, parameter :: kmp_size_t_kind = int_ptr_kind()
- integer, parameter :: kmp_affinity_mask_kind = int_ptr_kind()
-
- integer(kind=omp_sched_kind), parameter :: omp_sched_static = 1
- integer(kind=omp_sched_kind), parameter :: omp_sched_dynamic = 2
- integer(kind=omp_sched_kind), parameter :: omp_sched_guided = 3
- integer(kind=omp_sched_kind), parameter :: omp_sched_auto = 4
-
- integer (kind=omp_integer_kind), parameter :: kmp_version_major = @LIBOMP_VERSION_MAJOR@
- integer (kind=omp_integer_kind), parameter :: kmp_version_minor = @LIBOMP_VERSION_MINOR@
- integer (kind=omp_integer_kind), parameter :: kmp_version_build = @LIBOMP_VERSION_BUILD@
- character(*) kmp_build_date
- parameter( kmp_build_date = '@LIBOMP_BUILD_DATE@' )
- integer (kind=omp_integer_kind), parameter :: openmp_version = @LIBOMP_OMP_YEAR_MONTH@
-
- interface
-
-! ***
-! *** omp_* entry points
-! ***
-
- subroutine omp_set_num_threads(nthreads)
- import
- integer (kind=omp_integer_kind) nthreads
- end subroutine omp_set_num_threads
-
- subroutine omp_set_dynamic(enable)
- import
- logical (kind=omp_logical_kind) enable
- end subroutine omp_set_dynamic
-
- subroutine omp_set_nested(enable)
- import
- logical (kind=omp_logical_kind) enable
- end subroutine omp_set_nested
-
- function omp_get_num_threads()
- import
- integer (kind=omp_integer_kind) omp_get_num_threads
- end function omp_get_num_threads
-
- function omp_get_max_threads()
- import
- integer (kind=omp_integer_kind) omp_get_max_threads
- end function omp_get_max_threads
-
- function omp_get_thread_num()
- import
- integer (kind=omp_integer_kind) omp_get_thread_num
- end function omp_get_thread_num
-
- function omp_get_num_procs()
- import
- integer (kind=omp_integer_kind) omp_get_num_procs
- end function omp_get_num_procs
-
- function omp_in_parallel()
- import
- logical (kind=omp_logical_kind) omp_in_parallel
- end function omp_in_parallel
-
- function omp_in_final()
- import
- logical (kind=omp_logical_kind) omp_in_final
- end function omp_in_final
-
- function omp_get_dynamic()
- import
- logical (kind=omp_logical_kind) omp_get_dynamic
- end function omp_get_dynamic
-
- function omp_get_nested()
- import
- logical (kind=omp_logical_kind) omp_get_nested
- end function omp_get_nested
-
- function omp_get_thread_limit()
- import
- integer (kind=omp_integer_kind) omp_get_thread_limit
- end function omp_get_thread_limit
-
- subroutine omp_set_max_active_levels(max_levels)
- import
- integer (kind=omp_integer_kind) max_levels
- end subroutine omp_set_max_active_levels
-
- function omp_get_max_active_levels()
- import
- integer (kind=omp_integer_kind) omp_get_max_active_levels
- end function omp_get_max_active_levels
-
- function omp_get_level()
- import
- integer (kind=omp_integer_kind) omp_get_level
- end function omp_get_level
-
- function omp_get_active_level()
- import
- integer (kind=omp_integer_kind) omp_get_active_level
- end function omp_get_active_level
-
- function omp_get_ancestor_thread_num(level)
- import
- integer (kind=omp_integer_kind) level
- integer (kind=omp_integer_kind) omp_get_ancestor_thread_num
- end function omp_get_ancestor_thread_num
-
- function omp_get_team_size(level)
- import
- integer (kind=omp_integer_kind) level
- integer (kind=omp_integer_kind) omp_get_team_size
- end function omp_get_team_size
-
- subroutine omp_set_schedule(kind, modifier)
- import
- integer (kind=omp_sched_kind) kind
- integer (kind=omp_integer_kind) modifier
- end subroutine omp_set_schedule
-
- subroutine omp_get_schedule(kind, modifier)
- import
- integer (kind=omp_sched_kind) kind
- integer (kind=omp_integer_kind) modifier
- end subroutine omp_get_schedule
-
- function omp_get_wtime()
- double precision omp_get_wtime
- end function omp_get_wtime
-
- function omp_get_wtick ()
- double precision omp_get_wtick
- end function omp_get_wtick
-
- subroutine omp_init_lock(lockvar)
- import
- integer (kind=omp_lock_kind) lockvar
- end subroutine omp_init_lock
-
- subroutine omp_destroy_lock(lockvar)
- import
- integer (kind=omp_lock_kind) lockvar
- end subroutine omp_destroy_lock
-
- subroutine omp_set_lock(lockvar)
- import
- integer (kind=omp_lock_kind) lockvar
- end subroutine omp_set_lock
-
- subroutine omp_unset_lock(lockvar)
- import
- integer (kind=omp_lock_kind) lockvar
- end subroutine omp_unset_lock
-
- function omp_test_lock(lockvar)
- import
- logical (kind=omp_logical_kind) omp_test_lock
- integer (kind=omp_lock_kind) lockvar
- end function omp_test_lock
-
- subroutine omp_init_nest_lock(lockvar)
- import
- integer (kind=omp_nest_lock_kind) lockvar
- end subroutine omp_init_nest_lock
-
- subroutine omp_destroy_nest_lock(lockvar)
- import
- integer (kind=omp_nest_lock_kind) lockvar
- end subroutine omp_destroy_nest_lock
-
- subroutine omp_set_nest_lock(lockvar)
- import
- integer (kind=omp_nest_lock_kind) lockvar
- end subroutine omp_set_nest_lock
-
- subroutine omp_unset_nest_lock(lockvar)
- import
- integer (kind=omp_nest_lock_kind) lockvar
- end subroutine omp_unset_nest_lock
-
- function omp_test_nest_lock(lockvar)
- import
- integer (kind=omp_integer_kind) omp_test_nest_lock
- integer (kind=omp_nest_lock_kind) lockvar
- end function omp_test_nest_lock
-
-! ***
-! *** kmp_* entry points
-! ***
-
- subroutine kmp_set_stacksize(size)
- import
- integer (kind=omp_integer_kind) size
- end subroutine kmp_set_stacksize
-
- subroutine kmp_set_stacksize_s(size)
- import
- integer (kind=kmp_size_t_kind) size
- end subroutine kmp_set_stacksize_s
-
- subroutine kmp_set_blocktime(msec)
- import
- integer (kind=omp_integer_kind) msec
- end subroutine kmp_set_blocktime
-
- subroutine kmp_set_library_serial()
- end subroutine kmp_set_library_serial
-
- subroutine kmp_set_library_turnaround()
- end subroutine kmp_set_library_turnaround
-
- subroutine kmp_set_library_throughput()
- end subroutine kmp_set_library_throughput
-
- subroutine kmp_set_library(libnum)
- import
- integer (kind=omp_integer_kind) libnum
- end subroutine kmp_set_library
-
- subroutine kmp_set_defaults(string)
- character*(*) string
- end subroutine kmp_set_defaults
-
- function kmp_get_stacksize()
- import
- integer (kind=omp_integer_kind) kmp_get_stacksize
- end function kmp_get_stacksize
-
- function kmp_get_stacksize_s()
- import
- integer (kind=kmp_size_t_kind) kmp_get_stacksize_s
- end function kmp_get_stacksize_s
-
- function kmp_get_blocktime()
- import
- integer (kind=omp_integer_kind) kmp_get_blocktime
- end function kmp_get_blocktime
-
- function kmp_get_library()
- import
- integer (kind=omp_integer_kind) kmp_get_library
- end function kmp_get_library
-
- function kmp_set_affinity(mask)
- import
- integer (kind=omp_integer_kind) kmp_set_affinity
- integer (kind=kmp_affinity_mask_kind) mask
- end function kmp_set_affinity
-
- function kmp_get_affinity(mask)
- import
- integer (kind=omp_integer_kind) kmp_get_affinity
- integer (kind=kmp_affinity_mask_kind) mask
- end function kmp_get_affinity
-
- function kmp_get_affinity_max_proc()
- import
- integer (kind=omp_integer_kind) kmp_get_affinity_max_proc
- end function kmp_get_affinity_max_proc
-
- subroutine kmp_create_affinity_mask(mask)
- import
- integer (kind=kmp_affinity_mask_kind) mask
- end subroutine kmp_create_affinity_mask
-
- subroutine kmp_destroy_affinity_mask(mask)
- import
- integer (kind=kmp_affinity_mask_kind) mask
- end subroutine kmp_destroy_affinity_mask
-
- function kmp_set_affinity_mask_proc(proc, mask)
- import
- integer (kind=omp_integer_kind) kmp_set_affinity_mask_proc
- integer (kind=omp_integer_kind) proc
- integer (kind=kmp_affinity_mask_kind) mask
- end function kmp_set_affinity_mask_proc
-
- function kmp_unset_affinity_mask_proc(proc, mask)
- import
- integer (kind=omp_integer_kind) kmp_unset_affinity_mask_proc
- integer (kind=omp_integer_kind) proc
- integer (kind=kmp_affinity_mask_kind) mask
- end function kmp_unset_affinity_mask_proc
-
- function kmp_get_affinity_mask_proc(proc, mask)
- import
- integer (kind=omp_integer_kind) kmp_get_affinity_mask_proc
- integer (kind=omp_integer_kind) proc
- integer (kind=kmp_affinity_mask_kind) mask
- end function kmp_get_affinity_mask_proc
-
- function kmp_malloc(size)
- import
- integer (kind=kmp_pointer_kind) kmp_malloc
- integer (kind=kmp_size_t_kind) size
- end function kmp_malloc
-
- function kmp_aligned_malloc(size, alignment)
- import
- integer (kind=kmp_pointer_kind) kmp_aligned_malloc
- integer (kind=kmp_size_t_kind) size
- integer (kind=kmp_size_t_kind) alignment
- end function kmp_aligned_malloc
-
- function kmp_calloc(nelem, elsize)
- import
- integer (kind=kmp_pointer_kind) kmp_calloc
- integer (kind=kmp_size_t_kind) nelem
- integer (kind=kmp_size_t_kind) elsize
- end function kmp_calloc
-
- function kmp_realloc(ptr, size)
- import
- integer (kind=kmp_pointer_kind) kmp_realloc
- integer (kind=kmp_pointer_kind) ptr
- integer (kind=kmp_size_t_kind) size
- end function kmp_realloc
-
- subroutine kmp_free(ptr)
- import
- integer (kind=kmp_pointer_kind) ptr
- end subroutine kmp_free
-
- subroutine kmp_set_warnings_on()
- end subroutine kmp_set_warnings_on
-
- subroutine kmp_set_warnings_off()
- end subroutine kmp_set_warnings_off
-
- end interface
-
-!dec$ if defined(_WIN32)
-!dec$ if defined(_WIN64) .or. defined(_M_AMD64)
-
-!***
-!*** The Fortran entry points must be in uppercase, even if the /Qlowercase
-!*** option is specified. The alias attribute ensures that the specified
-!*** string is used as the entry point.
-!***
-!*** On the Windows* OS IA-32 architecture, the Fortran entry points have an
-!*** underscore prepended. On the Windows* OS Intel(R) 64
-!*** architecture, no underscore is prepended.
-!***
-
-!dec$ attributes alias:'OMP_SET_NUM_THREADS'::omp_set_num_threads
-!dec$ attributes alias:'OMP_SET_DYNAMIC'::omp_set_dynamic
-!dec$ attributes alias:'OMP_SET_NESTED'::omp_set_nested
-!dec$ attributes alias:'OMP_GET_NUM_THREADS'::omp_get_num_threads
-!dec$ attributes alias:'OMP_GET_MAX_THREADS'::omp_get_max_threads
-!dec$ attributes alias:'OMP_GET_THREAD_NUM'::omp_get_thread_num
-!dec$ attributes alias:'OMP_GET_NUM_PROCS'::omp_get_num_procs
-!dec$ attributes alias:'OMP_IN_PARALLEL'::omp_in_parallel
-!dec$ attributes alias:'OMP_IN_FINAL'::omp_in_final
-!dec$ attributes alias:'OMP_GET_DYNAMIC'::omp_get_dynamic
-!dec$ attributes alias:'OMP_GET_NESTED'::omp_get_nested
-!dec$ attributes alias:'OMP_GET_THREAD_LIMIT'::omp_get_thread_limit
-!dec$ attributes alias:'OMP_SET_MAX_ACTIVE_LEVELS'::omp_set_max_active_levels
-!dec$ attributes alias:'OMP_GET_MAX_ACTIVE_LEVELS'::omp_get_max_active_levels
-!dec$ attributes alias:'OMP_GET_LEVEL'::omp_get_level
-!dec$ attributes alias:'OMP_GET_ACTIVE_LEVEL'::omp_get_active_level
-!dec$ attributes alias:'OMP_GET_ANCESTOR_THREAD_NUM'::omp_get_ancestor_thread_num
-!dec$ attributes alias:'OMP_GET_TEAM_SIZE'::omp_get_team_size
-!dec$ attributes alias:'OMP_SET_SCHEDULE'::omp_set_schedule
-!dec$ attributes alias:'OMP_GET_SCHEDULE'::omp_get_schedule
-!dec$ attributes alias:'OMP_GET_WTIME'::omp_get_wtime
-!dec$ attributes alias:'OMP_GET_WTICK'::omp_get_wtick
-
-!dec$ attributes alias:'omp_init_lock'::omp_init_lock
-!dec$ attributes alias:'omp_destroy_lock'::omp_destroy_lock
-!dec$ attributes alias:'omp_set_lock'::omp_set_lock
-!dec$ attributes alias:'omp_unset_lock'::omp_unset_lock
-!dec$ attributes alias:'omp_test_lock'::omp_test_lock
-!dec$ attributes alias:'omp_init_nest_lock'::omp_init_nest_lock
-!dec$ attributes alias:'omp_destroy_nest_lock'::omp_destroy_nest_lock
-!dec$ attributes alias:'omp_set_nest_lock'::omp_set_nest_lock
-!dec$ attributes alias:'omp_unset_nest_lock'::omp_unset_nest_lock
-!dec$ attributes alias:'omp_test_nest_lock'::omp_test_nest_lock
-
-!dec$ attributes alias:'KMP_SET_STACKSIZE'::kmp_set_stacksize
-!dec$ attributes alias:'KMP_SET_STACKSIZE_S'::kmp_set_stacksize_s
-!dec$ attributes alias:'KMP_SET_BLOCKTIME'::kmp_set_blocktime
-!dec$ attributes alias:'KMP_SET_LIBRARY_SERIAL'::kmp_set_library_serial
-!dec$ attributes alias:'KMP_SET_LIBRARY_TURNAROUND'::kmp_set_library_turnaround
-!dec$ attributes alias:'KMP_SET_LIBRARY_THROUGHPUT'::kmp_set_library_throughput
-!dec$ attributes alias:'KMP_SET_LIBRARY'::kmp_set_library
-!dec$ attributes alias:'KMP_SET_DEFAULTS'::kmp_set_defaults
-!dec$ attributes alias:'KMP_GET_STACKSIZE'::kmp_get_stacksize
-!dec$ attributes alias:'KMP_GET_STACKSIZE_S'::kmp_get_stacksize_s
-!dec$ attributes alias:'KMP_GET_BLOCKTIME'::kmp_get_blocktime
-!dec$ attributes alias:'KMP_GET_LIBRARY'::kmp_get_library
-!dec$ attributes alias:'KMP_SET_AFFINITY'::kmp_set_affinity
-!dec$ attributes alias:'KMP_GET_AFFINITY'::kmp_get_affinity
-!dec$ attributes alias:'KMP_GET_AFFINITY_MAX_PROC'::kmp_get_affinity_max_proc
-!dec$ attributes alias:'KMP_CREATE_AFFINITY_MASK'::kmp_create_affinity_mask
-!dec$ attributes alias:'KMP_DESTROY_AFFINITY_MASK'::kmp_destroy_affinity_mask
-!dec$ attributes alias:'KMP_SET_AFFINITY_MASK_PROC'::kmp_set_affinity_mask_proc
-!dec$ attributes alias:'KMP_UNSET_AFFINITY_MASK_PROC'::kmp_unset_affinity_mask_proc
-!dec$ attributes alias:'KMP_GET_AFFINITY_MASK_PROC'::kmp_get_affinity_mask_proc
-!dec$ attributes alias:'KMP_MALLOC'::kmp_malloc
-!dec$ attributes alias:'KMP_ALIGNED_MALLOC'::kmp_aligned_malloc
-!dec$ attributes alias:'KMP_CALLOC'::kmp_calloc
-!dec$ attributes alias:'KMP_REALLOC'::kmp_realloc
-!dec$ attributes alias:'KMP_FREE'::kmp_free
-
-!dec$ attributes alias:'KMP_SET_WARNINGS_ON'::kmp_set_warnings_on
-!dec$ attributes alias:'KMP_SET_WARNINGS_OFF'::kmp_set_warnings_off
-
-!dec$ else
-
-!***
-!*** On Windows* OS IA-32 architecture, the Fortran entry points have an underscore prepended.
-!***
-
-!dec$ attributes alias:'_OMP_SET_NUM_THREADS'::omp_set_num_threads
-!dec$ attributes alias:'_OMP_SET_DYNAMIC'::omp_set_dynamic
-!dec$ attributes alias:'_OMP_SET_NESTED'::omp_set_nested
-!dec$ attributes alias:'_OMP_GET_NUM_THREADS'::omp_get_num_threads
-!dec$ attributes alias:'_OMP_GET_MAX_THREADS'::omp_get_max_threads
-!dec$ attributes alias:'_OMP_GET_THREAD_NUM'::omp_get_thread_num
-!dec$ attributes alias:'_OMP_GET_NUM_PROCS'::omp_get_num_procs
-!dec$ attributes alias:'_OMP_IN_PARALLEL'::omp_in_parallel
-!dec$ attributes alias:'_OMP_IN_FINAL'::omp_in_final
-!dec$ attributes alias:'_OMP_GET_DYNAMIC'::omp_get_dynamic
-!dec$ attributes alias:'_OMP_GET_NESTED'::omp_get_nested
-!dec$ attributes alias:'_OMP_GET_THREAD_LIMIT'::omp_get_thread_limit
-!dec$ attributes alias:'_OMP_SET_MAX_ACTIVE_LEVELS'::omp_set_max_active_levels
-!dec$ attributes alias:'_OMP_GET_MAX_ACTIVE_LEVELS'::omp_get_max_active_levels
-!dec$ attributes alias:'_OMP_GET_LEVEL'::omp_get_level
-!dec$ attributes alias:'_OMP_GET_ACTIVE_LEVEL'::omp_get_active_level
-!dec$ attributes alias:'_OMP_GET_ANCESTOR_THREAD_NUM'::omp_get_ancestor_thread_num
-!dec$ attributes alias:'_OMP_GET_TEAM_SIZE'::omp_get_team_size
-!dec$ attributes alias:'_OMP_SET_SCHEDULE'::omp_set_schedule
-!dec$ attributes alias:'_OMP_GET_SCHEDULE'::omp_get_schedule
-!dec$ attributes alias:'_OMP_GET_WTIME'::omp_get_wtime
-!dec$ attributes alias:'_OMP_GET_WTICK'::omp_get_wtick
-
-!dec$ attributes alias:'_omp_init_lock'::omp_init_lock
-!dec$ attributes alias:'_omp_destroy_lock'::omp_destroy_lock
-!dec$ attributes alias:'_omp_set_lock'::omp_set_lock
-!dec$ attributes alias:'_omp_unset_lock'::omp_unset_lock
-!dec$ attributes alias:'_omp_test_lock'::omp_test_lock
-!dec$ attributes alias:'_omp_init_nest_lock'::omp_init_nest_lock
-!dec$ attributes alias:'_omp_destroy_nest_lock'::omp_destroy_nest_lock
-!dec$ attributes alias:'_omp_set_nest_lock'::omp_set_nest_lock
-!dec$ attributes alias:'_omp_unset_nest_lock'::omp_unset_nest_lock
-!dec$ attributes alias:'_omp_test_nest_lock'::omp_test_nest_lock
-
-!dec$ attributes alias:'_KMP_SET_STACKSIZE'::kmp_set_stacksize
-!dec$ attributes alias:'_KMP_SET_STACKSIZE_S'::kmp_set_stacksize_s
-!dec$ attributes alias:'_KMP_SET_BLOCKTIME'::kmp_set_blocktime
-!dec$ attributes alias:'_KMP_SET_LIBRARY_SERIAL'::kmp_set_library_serial
-!dec$ attributes alias:'_KMP_SET_LIBRARY_TURNAROUND'::kmp_set_library_turnaround
-!dec$ attributes alias:'_KMP_SET_LIBRARY_THROUGHPUT'::kmp_set_library_throughput
-!dec$ attributes alias:'_KMP_SET_LIBRARY'::kmp_set_library
-!dec$ attributes alias:'_KMP_SET_DEFAULTS'::kmp_set_defaults
-!dec$ attributes alias:'_KMP_GET_STACKSIZE'::kmp_get_stacksize
-!dec$ attributes alias:'_KMP_GET_STACKSIZE_S'::kmp_get_stacksize_s
-!dec$ attributes alias:'_KMP_GET_BLOCKTIME'::kmp_get_blocktime
-!dec$ attributes alias:'_KMP_GET_LIBRARY'::kmp_get_library
-!dec$ attributes alias:'_KMP_SET_AFFINITY'::kmp_set_affinity
-!dec$ attributes alias:'_KMP_GET_AFFINITY'::kmp_get_affinity
-!dec$ attributes alias:'_KMP_GET_AFFINITY_MAX_PROC'::kmp_get_affinity_max_proc
-!dec$ attributes alias:'_KMP_CREATE_AFFINITY_MASK'::kmp_create_affinity_mask
-!dec$ attributes alias:'_KMP_DESTROY_AFFINITY_MASK'::kmp_destroy_affinity_mask
-!dec$ attributes alias:'_KMP_SET_AFFINITY_MASK_PROC'::kmp_set_affinity_mask_proc
-!dec$ attributes alias:'_KMP_UNSET_AFFINITY_MASK_PROC'::kmp_unset_affinity_mask_proc
-!dec$ attributes alias:'_KMP_GET_AFFINITY_MASK_PROC'::kmp_get_affinity_mask_proc
-!dec$ attributes alias:'_KMP_MALLOC'::kmp_malloc
-!dec$ attributes alias:'_KMP_ALIGNED_MALLOC'::kmp_aligned_malloc
-!dec$ attributes alias:'_KMP_CALLOC'::kmp_calloc
-!dec$ attributes alias:'_KMP_REALLOC'::kmp_realloc
-!dec$ attributes alias:'_KMP_FREE'::kmp_free
-
-!dec$ attributes alias:'_KMP_SET_WARNINGS_ON'::kmp_set_warnings_on
-!dec$ attributes alias:'_KMP_SET_WARNINGS_OFF'::kmp_set_warnings_off
-
-!dec$ endif
-!dec$ endif
-
-!dec$ if defined(__linux)
-
-!***
-!*** The Linux* OS entry points are in lowercase, with an underscore appended.
-!***
-
-!dec$ attributes alias:'omp_set_num_threads_'::omp_set_num_threads
-!dec$ attributes alias:'omp_set_dynamic_'::omp_set_dynamic
-!dec$ attributes alias:'omp_set_nested_'::omp_set_nested
-!dec$ attributes alias:'omp_get_num_threads_'::omp_get_num_threads
-!dec$ attributes alias:'omp_get_max_threads_'::omp_get_max_threads
-!dec$ attributes alias:'omp_get_thread_num_'::omp_get_thread_num
-!dec$ attributes alias:'omp_get_num_procs_'::omp_get_num_procs
-!dec$ attributes alias:'omp_in_parallel_'::omp_in_parallel
-!dec$ attributes alias:'omp_in_final_'::omp_in_final
-!dec$ attributes alias:'omp_get_dynamic_'::omp_get_dynamic
-!dec$ attributes alias:'omp_get_nested_'::omp_get_nested
-!dec$ attributes alias:'omp_get_thread_limit_'::omp_get_thread_limit
-!dec$ attributes alias:'omp_set_max_active_levels_'::omp_set_max_active_levels
-!dec$ attributes alias:'omp_get_max_active_levels_'::omp_get_max_active_levels
-!dec$ attributes alias:'omp_get_level_'::omp_get_level
-!dec$ attributes alias:'omp_get_active_level_'::omp_get_active_level
-!dec$ attributes alias:'omp_get_ancestor_thread_num_'::omp_get_ancestor_thread_num
-!dec$ attributes alias:'omp_get_team_size_'::omp_get_team_size
-!dec$ attributes alias:'omp_set_schedule_'::omp_set_schedule
-!dec$ attributes alias:'omp_get_schedule_'::omp_get_schedule
-!dec$ attributes alias:'omp_get_wtime_'::omp_get_wtime
-!dec$ attributes alias:'omp_get_wtick_'::omp_get_wtick
-
-!dec$ attributes alias:'omp_init_lock_'::omp_init_lock
-!dec$ attributes alias:'omp_destroy_lock_'::omp_destroy_lock
-!dec$ attributes alias:'omp_set_lock_'::omp_set_lock
-!dec$ attributes alias:'omp_unset_lock_'::omp_unset_lock
-!dec$ attributes alias:'omp_test_lock_'::omp_test_lock
-!dec$ attributes alias:'omp_init_nest_lock_'::omp_init_nest_lock
-!dec$ attributes alias:'omp_destroy_nest_lock_'::omp_destroy_nest_lock
-!dec$ attributes alias:'omp_set_nest_lock_'::omp_set_nest_lock
-!dec$ attributes alias:'omp_unset_nest_lock_'::omp_unset_nest_lock
-!dec$ attributes alias:'omp_test_nest_lock_'::omp_test_nest_lock
-
-!dec$ attributes alias:'kmp_set_stacksize_'::kmp_set_stacksize
-!dec$ attributes alias:'kmp_set_stacksize_s_'::kmp_set_stacksize_s
-!dec$ attributes alias:'kmp_set_blocktime_'::kmp_set_blocktime
-!dec$ attributes alias:'kmp_set_library_serial_'::kmp_set_library_serial
-!dec$ attributes alias:'kmp_set_library_turnaround_'::kmp_set_library_turnaround
-!dec$ attributes alias:'kmp_set_library_throughput_'::kmp_set_library_throughput
-!dec$ attributes alias:'kmp_set_library_'::kmp_set_library
-!dec$ attributes alias:'kmp_set_defaults_'::kmp_set_defaults
-!dec$ attributes alias:'kmp_get_stacksize_'::kmp_get_stacksize
-!dec$ attributes alias:'kmp_get_stacksize_s_'::kmp_get_stacksize_s
-!dec$ attributes alias:'kmp_get_blocktime_'::kmp_get_blocktime
-!dec$ attributes alias:'kmp_get_library_'::kmp_get_library
-!dec$ attributes alias:'kmp_set_affinity_'::kmp_set_affinity
-!dec$ attributes alias:'kmp_get_affinity_'::kmp_get_affinity
-!dec$ attributes alias:'kmp_get_affinity_max_proc_'::kmp_get_affinity_max_proc
-!dec$ attributes alias:'kmp_create_affinity_mask_'::kmp_create_affinity_mask
-!dec$ attributes alias:'kmp_destroy_affinity_mask_'::kmp_destroy_affinity_mask
-!dec$ attributes alias:'kmp_set_affinity_mask_proc_'::kmp_set_affinity_mask_proc
-!dec$ attributes alias:'kmp_unset_affinity_mask_proc_'::kmp_unset_affinity_mask_proc
-!dec$ attributes alias:'kmp_get_affinity_mask_proc_'::kmp_get_affinity_mask_proc
-!dec$ attributes alias:'kmp_malloc_'::kmp_malloc
-!dec$ attributes alias:'kmp_aligned_malloc_'::kmp_aligned_malloc
-!dec$ attributes alias:'kmp_calloc_'::kmp_calloc
-!dec$ attributes alias:'kmp_realloc_'::kmp_realloc
-!dec$ attributes alias:'kmp_free_'::kmp_free
-
-!dec$ attributes alias:'kmp_set_warnings_on_'::kmp_set_warnings_on
-!dec$ attributes alias:'kmp_set_warnings_off_'::kmp_set_warnings_off
-
-!dec$ endif
-
-!dec$ if defined(__APPLE__)
-
-!***
-!*** The Mac entry points are in lowercase, with an both an underscore
-!*** appended and an underscore prepended.
-!***
-
-!dec$ attributes alias:'_omp_set_num_threads_'::omp_set_num_threads
-!dec$ attributes alias:'_omp_set_dynamic_'::omp_set_dynamic
-!dec$ attributes alias:'_omp_set_nested_'::omp_set_nested
-!dec$ attributes alias:'_omp_get_num_threads_'::omp_get_num_threads
-!dec$ attributes alias:'_omp_get_max_threads_'::omp_get_max_threads
-!dec$ attributes alias:'_omp_get_thread_num_'::omp_get_thread_num
-!dec$ attributes alias:'_omp_get_num_procs_'::omp_get_num_procs
-!dec$ attributes alias:'_omp_in_parallel_'::omp_in_parallel
-!dec$ attributes alias:'_omp_in_final_'::omp_in_final
-!dec$ attributes alias:'_omp_get_dynamic_'::omp_get_dynamic
-!dec$ attributes alias:'_omp_get_nested_'::omp_get_nested
-!dec$ attributes alias:'_omp_get_thread_limit_'::omp_get_thread_limit
-!dec$ attributes alias:'_omp_set_max_active_levels_'::omp_set_max_active_levels
-!dec$ attributes alias:'_omp_get_max_active_levels_'::omp_get_max_active_levels
-!dec$ attributes alias:'_omp_get_level_'::omp_get_level
-!dec$ attributes alias:'_omp_get_active_level_'::omp_get_active_level
-!dec$ attributes alias:'_omp_get_ancestor_thread_num_'::omp_get_ancestor_thread_num
-!dec$ attributes alias:'_omp_get_team_size_'::omp_get_team_size
-!dec$ attributes alias:'_omp_set_schedule_'::omp_set_schedule
-!dec$ attributes alias:'_omp_get_schedule_'::omp_get_schedule
-!dec$ attributes alias:'_omp_get_wtime_'::omp_get_wtime
-!dec$ attributes alias:'_omp_get_wtick_'::omp_get_wtick
-
-!dec$ attributes alias:'_omp_init_lock_'::omp_init_lock
-!dec$ attributes alias:'_omp_destroy_lock_'::omp_destroy_lock
-!dec$ attributes alias:'_omp_set_lock_'::omp_set_lock
-!dec$ attributes alias:'_omp_unset_lock_'::omp_unset_lock
-!dec$ attributes alias:'_omp_test_lock_'::omp_test_lock
-!dec$ attributes alias:'_omp_init_nest_lock_'::omp_init_nest_lock
-!dec$ attributes alias:'_omp_destroy_nest_lock_'::omp_destroy_nest_lock
-!dec$ attributes alias:'_omp_set_nest_lock_'::omp_set_nest_lock
-!dec$ attributes alias:'_omp_unset_nest_lock_'::omp_unset_nest_lock
-!dec$ attributes alias:'_omp_test_nest_lock_'::omp_test_nest_lock
-
-!dec$ attributes alias:'_kmp_set_stacksize_'::kmp_set_stacksize
-!dec$ attributes alias:'_kmp_set_stacksize_s_'::kmp_set_stacksize_s
-!dec$ attributes alias:'_kmp_set_blocktime_'::kmp_set_blocktime
-!dec$ attributes alias:'_kmp_set_library_serial_'::kmp_set_library_serial
-!dec$ attributes alias:'_kmp_set_library_turnaround_'::kmp_set_library_turnaround
-!dec$ attributes alias:'_kmp_set_library_throughput_'::kmp_set_library_throughput
-!dec$ attributes alias:'_kmp_set_library_'::kmp_set_library
-!dec$ attributes alias:'_kmp_set_defaults_'::kmp_set_defaults
-!dec$ attributes alias:'_kmp_get_stacksize_'::kmp_get_stacksize
-!dec$ attributes alias:'_kmp_get_stacksize_s_'::kmp_get_stacksize_s
-!dec$ attributes alias:'_kmp_get_blocktime_'::kmp_get_blocktime
-!dec$ attributes alias:'_kmp_get_library_'::kmp_get_library
-!dec$ attributes alias:'_kmp_set_affinity_'::kmp_set_affinity
-!dec$ attributes alias:'_kmp_get_affinity_'::kmp_get_affinity
-!dec$ attributes alias:'_kmp_get_affinity_max_proc_'::kmp_get_affinity_max_proc
-!dec$ attributes alias:'_kmp_create_affinity_mask_'::kmp_create_affinity_mask
-!dec$ attributes alias:'_kmp_destroy_affinity_mask_'::kmp_destroy_affinity_mask
-!dec$ attributes alias:'_kmp_set_affinity_mask_proc_'::kmp_set_affinity_mask_proc
-!dec$ attributes alias:'_kmp_unset_affinity_mask_proc_'::kmp_unset_affinity_mask_proc
-!dec$ attributes alias:'_kmp_get_affinity_mask_proc_'::kmp_get_affinity_mask_proc
-!dec$ attributes alias:'_kmp_malloc_'::kmp_malloc
-!dec$ attributes alias:'_kmp_aligned_malloc_'::kmp_aligned_malloc
-!dec$ attributes alias:'_kmp_calloc_'::kmp_calloc
-!dec$ attributes alias:'_kmp_realloc_'::kmp_realloc
-!dec$ attributes alias:'_kmp_free_'::kmp_free
-
-!dec$ attributes alias:'_kmp_set_warnings_on_'::kmp_set_warnings_on
-!dec$ attributes alias:'_kmp_set_warnings_off_'::kmp_set_warnings_off
-
-!dec$ endif
-
-
diff --git a/runtime/src/include/40/omp.h.var b/runtime/src/include/40/omp.h.var
deleted file mode 100644
index b030dbec654b..000000000000
--- a/runtime/src/include/40/omp.h.var
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * include/40/omp.h.var
- */
-
-
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.txt for details.
-//
-//===----------------------------------------------------------------------===//
-
-
-#ifndef __OMP_H
-# define __OMP_H
-
-# define KMP_VERSION_MAJOR @LIBOMP_VERSION_MAJOR@
-# define KMP_VERSION_MINOR @LIBOMP_VERSION_MINOR@
-# define KMP_VERSION_BUILD @LIBOMP_VERSION_BUILD@
-# define KMP_BUILD_DATE "@LIBOMP_BUILD_DATE@"
-
-# ifdef __cplusplus
- extern "C" {
-# endif
-
-# if defined(_WIN32)
-# define __KAI_KMPC_CONVENTION __cdecl
-# else
-# define __KAI_KMPC_CONVENTION
-# endif
-
- /* schedule kind constants */
- typedef enum omp_sched_t {
- omp_sched_static = 1,
- omp_sched_dynamic = 2,
- omp_sched_guided = 3,
- omp_sched_auto = 4
- } omp_sched_t;
-
- /* set API functions */
- extern void __KAI_KMPC_CONVENTION omp_set_num_threads (int);
- extern void __KAI_KMPC_CONVENTION omp_set_dynamic (int);
- extern void __KAI_KMPC_CONVENTION omp_set_nested (int);
- extern void __KAI_KMPC_CONVENTION omp_set_max_active_levels (int);
- extern void __KAI_KMPC_CONVENTION omp_set_schedule (omp_sched_t, int);
-
- /* query API functions */
- extern int __KAI_KMPC_CONVENTION omp_get_num_threads (void);
- extern int __KAI_KMPC_CONVENTION omp_get_dynamic (void);
- extern int __KAI_KMPC_CONVENTION omp_get_nested (void);
- extern int __KAI_KMPC_CONVENTION omp_get_max_threads (void);
- extern int __KAI_KMPC_CONVENTION omp_get_thread_num (void);
- extern int __KAI_KMPC_CONVENTION omp_get_num_procs (void);
- extern int __KAI_KMPC_CONVENTION omp_in_parallel (void);
- extern int __KAI_KMPC_CONVENTION omp_in_final (void);
- extern int __KAI_KMPC_CONVENTION omp_get_active_level (void);
- extern int __KAI_KMPC_CONVENTION omp_get_level (void);
- extern int __KAI_KMPC_CONVENTION omp_get_ancestor_thread_num (int);
- extern int __KAI_KMPC_CONVENTION omp_get_team_size (int);
- extern int __KAI_KMPC_CONVENTION omp_get_thread_limit (void);
- extern int __KAI_KMPC_CONVENTION omp_get_max_active_levels (void);
- extern void __KAI_KMPC_CONVENTION omp_get_schedule (omp_sched_t *, int *);
-
- /* lock API functions */
- typedef struct omp_lock_t {
- void * _lk;
- } omp_lock_t;
-
- extern void __KAI_KMPC_CONVENTION omp_init_lock (omp_lock_t *);
- extern void __KAI_KMPC_CONVENTION omp_set_lock (omp_lock_t *);
- extern void __KAI_KMPC_CONVENTION omp_unset_lock (omp_lock_t *);
- extern void __KAI_KMPC_CONVENTION omp_destroy_lock (omp_lock_t *);
- extern int __KAI_KMPC_CONVENTION omp_test_lock (omp_lock_t *);
-
- /* nested lock API functions */
- typedef struct omp_nest_lock_t {
- void * _lk;
- } omp_nest_lock_t;
-
- extern void __KAI_KMPC_CONVENTION omp_init_nest_lock (omp_nest_lock_t *);
- extern void __KAI_KMPC_CONVENTION omp_set_nest_lock (omp_nest_lock_t *);
- extern void __KAI_KMPC_CONVENTION omp_unset_nest_lock (omp_nest_lock_t *);
- extern void __KAI_KMPC_CONVENTION omp_destroy_nest_lock (omp_nest_lock_t *);
- extern int __KAI_KMPC_CONVENTION omp_test_nest_lock (omp_nest_lock_t *);
-
- /* time API functions */
- extern double __KAI_KMPC_CONVENTION omp_get_wtime (void);
- extern double __KAI_KMPC_CONVENTION omp_get_wtick (void);
-
- /* OpenMP 4.0 */
- extern int __KAI_KMPC_CONVENTION omp_get_default_device (void);
- extern void __KAI_KMPC_CONVENTION omp_set_default_device (int);
- extern int __KAI_KMPC_CONVENTION omp_is_initial_device (void);
- extern int __KAI_KMPC_CONVENTION omp_get_num_devices (void);
- extern int __KAI_KMPC_CONVENTION omp_get_num_teams (void);
- extern int __KAI_KMPC_CONVENTION omp_get_team_num (void);
- extern int __KAI_KMPC_CONVENTION omp_get_cancellation (void);
-
-# include <stdlib.h>
- /* kmp API functions */
- extern int __KAI_KMPC_CONVENTION kmp_get_stacksize (void);
- extern void __KAI_KMPC_CONVENTION kmp_set_stacksize (int);
- extern size_t __KAI_KMPC_CONVENTION kmp_get_stacksize_s (void);
- extern void __KAI_KMPC_CONVENTION kmp_set_stacksize_s (size_t);
- extern int __KAI_KMPC_CONVENTION kmp_get_blocktime (void);
- extern int __KAI_KMPC_CONVENTION kmp_get_library (void);
- extern void __KAI_KMPC_CONVENTION kmp_set_blocktime (int);
- extern void __KAI_KMPC_CONVENTION kmp_set_library (int);
- extern void __KAI_KMPC_CONVENTION kmp_set_library_serial (void);
- extern void __KAI_KMPC_CONVENTION kmp_set_library_turnaround (void);
- extern void __KAI_KMPC_CONVENTION kmp_set_library_throughput (void);
- extern void __KAI_KMPC_CONVENTION kmp_set_defaults (char const *);
-
- /* Intel affinity API */
- typedef void * kmp_affinity_mask_t;
-
- extern int __KAI_KMPC_CONVENTION kmp_set_affinity (kmp_affinity_mask_t *);
- extern int __KAI_KMPC_CONVENTION kmp_get_affinity (kmp_affinity_mask_t *);
- extern int __KAI_KMPC_CONVENTION kmp_get_affinity_max_proc (void);
- extern void __KAI_KMPC_CONVENTION kmp_create_affinity_mask (kmp_affinity_mask_t *);
- extern void __KAI_KMPC_CONVENTION kmp_destroy_affinity_mask (kmp_affinity_mask_t *);
- extern int __KAI_KMPC_CONVENTION kmp_set_affinity_mask_proc (int, kmp_affinity_mask_t *);
- extern int __KAI_KMPC_CONVENTION kmp_unset_affinity_mask_proc (int, kmp_affinity_mask_t *);
- extern int __KAI_KMPC_CONVENTION kmp_get_affinity_mask_proc (int, kmp_affinity_mask_t *);
-
- /* OpenMP 4.0 affinity API */
- typedef enum omp_proc_bind_t {
- omp_proc_bind_false = 0,
- omp_proc_bind_true = 1,
- omp_proc_bind_master = 2,
- omp_proc_bind_close = 3,
- omp_proc_bind_spread = 4
- } omp_proc_bind_t;
-
- extern omp_proc_bind_t __KAI_KMPC_CONVENTION omp_get_proc_bind (void);
-
- extern void * __KAI_KMPC_CONVENTION kmp_malloc (size_t);
- extern void * __KAI_KMPC_CONVENTION kmp_aligned_malloc (size_t, size_t);
- extern void * __KAI_KMPC_CONVENTION kmp_calloc (size_t, size_t);
- extern void * __KAI_KMPC_CONVENTION kmp_realloc (void *, size_t);
- extern void __KAI_KMPC_CONVENTION kmp_free (void *);
-
- extern void __KAI_KMPC_CONVENTION kmp_set_warnings_on(void);
- extern void __KAI_KMPC_CONVENTION kmp_set_warnings_off(void);
-
-# undef __KAI_KMPC_CONVENTION
-
- /* Warning:
- The following typedefs are not standard, deprecated and will be removed in a future release.
- */
- typedef int omp_int_t;
- typedef double omp_wtime_t;
-
-# ifdef __cplusplus
- }
-# endif
-
-#endif /* __OMP_H */
-
diff --git a/runtime/src/include/40/omp_lib.f.var b/runtime/src/include/40/omp_lib.f.var
deleted file mode 100644
index 63371d857bfa..000000000000
--- a/runtime/src/include/40/omp_lib.f.var
+++ /dev/null
@@ -1,774 +0,0 @@
-! include/40/omp_lib.f.var
-
-!
-!//===----------------------------------------------------------------------===//
-!//
-!// The LLVM Compiler Infrastructure
-!//
-!// This file is dual licensed under the MIT and the University of Illinois Open
-!// Source Licenses. See LICENSE.txt for details.
-!//
-!//===----------------------------------------------------------------------===//
-!
-
-!***
-!*** Some of the directives for the following routine extend past column 72,
-!*** so process this file in 132-column mode.
-!***
-
-!dec$ fixedformlinesize:132
-
- module omp_lib_kinds
-
- integer, parameter :: omp_integer_kind = 4
- integer, parameter :: omp_logical_kind = 4
- integer, parameter :: omp_real_kind = 4
- integer, parameter :: omp_lock_kind = int_ptr_kind()
- integer, parameter :: omp_nest_lock_kind = int_ptr_kind()
- integer, parameter :: omp_sched_kind = omp_integer_kind
- integer, parameter :: omp_proc_bind_kind = omp_integer_kind
- integer, parameter :: kmp_pointer_kind = int_ptr_kind()
- integer, parameter :: kmp_size_t_kind = int_ptr_kind()
- integer, parameter :: kmp_affinity_mask_kind = int_ptr_kind()
- integer, parameter :: kmp_cancel_kind = omp_integer_kind
-
- end module omp_lib_kinds
-
- module omp_lib
-
- use omp_lib_kinds
-
- integer (kind=omp_integer_kind), parameter :: kmp_version_major = @LIBOMP_VERSION_MAJOR@
- integer (kind=omp_integer_kind), parameter :: kmp_version_minor = @LIBOMP_VERSION_MINOR@
- integer (kind=omp_integer_kind), parameter :: kmp_version_build = @LIBOMP_VERSION_BUILD@
- character(*), parameter :: kmp_build_date = '@LIBOMP_BUILD_DATE@'
- integer (kind=omp_integer_kind), parameter :: openmp_version = @LIBOMP_OMP_YEAR_MONTH@
-
- integer(kind=omp_sched_kind), parameter :: omp_sched_static = 1
- integer(kind=omp_sched_kind), parameter :: omp_sched_dynamic = 2
- integer(kind=omp_sched_kind), parameter :: omp_sched_guided = 3
- integer(kind=omp_sched_kind), parameter :: omp_sched_auto = 4
-
- integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_false = 0
- integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_true = 1
- integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_master = 2
- integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_close = 3
- integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_spread = 4
-
- integer (kind=kmp_cancel_kind), parameter :: kmp_cancel_parallel = 1
- integer (kind=kmp_cancel_kind), parameter :: kmp_cancel_loop = 2
- integer (kind=kmp_cancel_kind), parameter :: kmp_cancel_sections = 3
- integer (kind=kmp_cancel_kind), parameter :: kmp_cancel_taskgroup = 4
-
- interface
-
-! ***
-! *** omp_* entry points
-! ***
-
- subroutine omp_set_num_threads(num_threads)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) num_threads
- end subroutine omp_set_num_threads
-
- subroutine omp_set_dynamic(dynamic_threads)
- use omp_lib_kinds
- logical (kind=omp_logical_kind) dynamic_threads
- end subroutine omp_set_dynamic
-
- subroutine omp_set_nested(nested)
- use omp_lib_kinds
- logical (kind=omp_logical_kind) nested
- end subroutine omp_set_nested
-
- function omp_get_num_threads()
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_num_threads
- end function omp_get_num_threads
-
- function omp_get_max_threads()
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_max_threads
- end function omp_get_max_threads
-
- function omp_get_thread_num()
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_thread_num
- end function omp_get_thread_num
-
- function omp_get_num_procs()
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_num_procs
- end function omp_get_num_procs
-
- function omp_in_parallel()
- use omp_lib_kinds
- logical (kind=omp_logical_kind) omp_in_parallel
- end function omp_in_parallel
-
- function omp_in_final()
- use omp_lib_kinds
- logical (kind=omp_logical_kind) omp_in_final
- end function omp_in_final
-
- function omp_get_dynamic()
- use omp_lib_kinds
- logical (kind=omp_logical_kind) omp_get_dynamic
- end function omp_get_dynamic
-
- function omp_get_nested()
- use omp_lib_kinds
- logical (kind=omp_logical_kind) omp_get_nested
- end function omp_get_nested
-
- function omp_get_thread_limit()
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_thread_limit
- end function omp_get_thread_limit
-
- subroutine omp_set_max_active_levels(max_levels)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) max_levels
- end subroutine omp_set_max_active_levels
-
- function omp_get_max_active_levels()
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_max_active_levels
- end function omp_get_max_active_levels
-
- function omp_get_level()
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_level
- end function omp_get_level
-
- function omp_get_active_level()
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_active_level
- end function omp_get_active_level
-
- function omp_get_ancestor_thread_num(level)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) level
- integer (kind=omp_integer_kind) omp_get_ancestor_thread_num
- end function omp_get_ancestor_thread_num
-
- function omp_get_team_size(level)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) level
- integer (kind=omp_integer_kind) omp_get_team_size
- end function omp_get_team_size
-
- subroutine omp_set_schedule(kind, chunk_size)
- use omp_lib_kinds
- integer (kind=omp_sched_kind) kind
- integer (kind=omp_integer_kind) chunk_size
- end subroutine omp_set_schedule
-
- subroutine omp_get_schedule(kind, chunk_size)
- use omp_lib_kinds
- integer (kind=omp_sched_kind) kind
- integer (kind=omp_integer_kind) chunk_size
- end subroutine omp_get_schedule
-
- function omp_get_proc_bind()
- use omp_lib_kinds
- integer (kind=omp_proc_bind_kind) omp_get_proc_bind
- end function omp_get_proc_bind
-
- function omp_get_wtime()
- double precision omp_get_wtime
- end function omp_get_wtime
-
- function omp_get_wtick ()
- double precision omp_get_wtick
- end function omp_get_wtick
-
- function omp_get_default_device()
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_default_device
- end function omp_get_default_device
-
- subroutine omp_set_default_device(device_num)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) device_num
- end subroutine omp_set_default_device
-
- function omp_get_num_devices()
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_num_devices
- end function omp_get_num_devices
-
- function omp_get_num_teams()
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_num_teams
- end function omp_get_num_teams
-
- function omp_get_team_num()
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_team_num
- end function omp_get_team_num
-
- function omp_get_cancellation()
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_cancellation
- end function omp_get_cancellation
-
- function omp_is_initial_device()
- use omp_lib_kinds
- logical (kind=omp_logical_kind) omp_is_initial_device
- end function omp_is_initial_device
-
- subroutine omp_init_lock(svar)
-!DIR$ IF(__INTEL_COMPILER.GE.1400)
-!DIR$ attributes known_intrinsic :: omp_init_lock
-!DIR$ ENDIF
- use omp_lib_kinds
- integer (kind=omp_lock_kind) svar
- end subroutine omp_init_lock
-
- subroutine omp_destroy_lock(svar)
-!DIR$ IF(__INTEL_COMPILER.GE.1400)
-!DIR$ attributes known_intrinsic :: omp_destroy_lock
-!DIR$ ENDIF
- use omp_lib_kinds
- integer (kind=omp_lock_kind) svar
- end subroutine omp_destroy_lock
-
- subroutine omp_set_lock(svar)
-!DIR$ IF(__INTEL_COMPILER.GE.1400)
-!DIR$ attributes known_intrinsic :: omp_set_lock
-!DIR$ ENDIF
- use omp_lib_kinds
- integer (kind=omp_lock_kind) svar
- end subroutine omp_set_lock
-
- subroutine omp_unset_lock(svar)
-!DIR$ IF(__INTEL_COMPILER.GE.1400)
-!DIR$ attributes known_intrinsic :: omp_unset_lock
-!DIR$ ENDIF
- use omp_lib_kinds
- integer (kind=omp_lock_kind) svar
- end subroutine omp_unset_lock
-
- function omp_test_lock(svar)
-!DIR$ IF(__INTEL_COMPILER.GE.1400)
-!DIR$ attributes known_intrinsic :: omp_test_lock
-!DIR$ ENDIF
- use omp_lib_kinds
- logical (kind=omp_logical_kind) omp_test_lock
- integer (kind=omp_lock_kind) svar
- end function omp_test_lock
-
- subroutine omp_init_nest_lock(nvar)
-!DIR$ IF(__INTEL_COMPILER.GE.1400)
-!DIR$ attributes known_intrinsic :: omp_init_nest_lock
-!DIR$ ENDIF
- use omp_lib_kinds
- integer (kind=omp_nest_lock_kind) nvar
- end subroutine omp_init_nest_lock
-
- subroutine omp_destroy_nest_lock(nvar)
-!DIR$ IF(__INTEL_COMPILER.GE.1400)
-!DIR$ attributes known_intrinsic :: omp_destroy_nest_lock
-!DIR$ ENDIF
- use omp_lib_kinds
- integer (kind=omp_nest_lock_kind) nvar
- end subroutine omp_destroy_nest_lock
-
- subroutine omp_set_nest_lock(nvar)
-!DIR$ IF(__INTEL_COMPILER.GE.1400)
-!DIR$ attributes known_intrinsic :: omp_set_nest_lock
-!DIR$ ENDIF
- use omp_lib_kinds
- integer (kind=omp_nest_lock_kind) nvar
- end subroutine omp_set_nest_lock
-
- subroutine omp_unset_nest_lock(nvar)
-!DIR$ IF(__INTEL_COMPILER.GE.1400)
-!DIR$ attributes known_intrinsic :: omp_unset_nest_lock
-!DIR$ ENDIF
- use omp_lib_kinds
- integer (kind=omp_nest_lock_kind) nvar
- end subroutine omp_unset_nest_lock
-
- function omp_test_nest_lock(nvar)
-!DIR$ IF(__INTEL_COMPILER.GE.1400)
-!DIR$ attributes known_intrinsic :: omp_test_nest_lock
-!DIR$ ENDIF
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_test_nest_lock
- integer (kind=omp_nest_lock_kind) nvar
- end function omp_test_nest_lock
-
-! ***
-! *** kmp_* entry points
-! ***
-
- subroutine kmp_set_stacksize(size)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) size
- end subroutine kmp_set_stacksize
-
- subroutine kmp_set_stacksize_s(size)
- use omp_lib_kinds
- integer (kind=kmp_size_t_kind) size
- end subroutine kmp_set_stacksize_s
-
- subroutine kmp_set_blocktime(msec)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) msec
- end subroutine kmp_set_blocktime
-
- subroutine kmp_set_library_serial()
- end subroutine kmp_set_library_serial
-
- subroutine kmp_set_library_turnaround()
- end subroutine kmp_set_library_turnaround
-
- subroutine kmp_set_library_throughput()
- end subroutine kmp_set_library_throughput
-
- subroutine kmp_set_library(libnum)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) libnum
- end subroutine kmp_set_library
-
- subroutine kmp_set_defaults(string)
- character*(*) string
- end subroutine kmp_set_defaults
-
- function kmp_get_stacksize()
- use omp_lib_kinds
- integer (kind=omp_integer_kind) kmp_get_stacksize
- end function kmp_get_stacksize
-
- function kmp_get_stacksize_s()
- use omp_lib_kinds
- integer (kind=kmp_size_t_kind) kmp_get_stacksize_s
- end function kmp_get_stacksize_s
-
- function kmp_get_blocktime()
- use omp_lib_kinds
- integer (kind=omp_integer_kind) kmp_get_blocktime
- end function kmp_get_blocktime
-
- function kmp_get_library()
- use omp_lib_kinds
- integer (kind=omp_integer_kind) kmp_get_library
- end function kmp_get_library
-
- function kmp_set_affinity(mask)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) kmp_set_affinity
- integer (kind=kmp_affinity_mask_kind) mask
- end function kmp_set_affinity
-
- function kmp_get_affinity(mask)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) kmp_get_affinity
- integer (kind=kmp_affinity_mask_kind) mask
- end function kmp_get_affinity
-
- function kmp_get_affinity_max_proc()
- use omp_lib_kinds
- integer (kind=omp_integer_kind) kmp_get_affinity_max_proc
- end function kmp_get_affinity_max_proc
-
- subroutine kmp_create_affinity_mask(mask)
- use omp_lib_kinds
- integer (kind=kmp_affinity_mask_kind) mask
- end subroutine kmp_create_affinity_mask
-
- subroutine kmp_destroy_affinity_mask(mask)
- use omp_lib_kinds
- integer (kind=kmp_affinity_mask_kind) mask
- end subroutine kmp_destroy_affinity_mask
-
- function kmp_set_affinity_mask_proc(proc, mask)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) kmp_set_affinity_mask_proc
- integer (kind=omp_integer_kind) proc
- integer (kind=kmp_affinity_mask_kind) mask
- end function kmp_set_affinity_mask_proc
-
- function kmp_unset_affinity_mask_proc(proc, mask)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) kmp_unset_affinity_mask_proc
- integer (kind=omp_integer_kind) proc
- integer (kind=kmp_affinity_mask_kind) mask
- end function kmp_unset_affinity_mask_proc
-
- function kmp_get_affinity_mask_proc(proc, mask)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) kmp_get_affinity_mask_proc
- integer (kind=omp_integer_kind) proc
- integer (kind=kmp_affinity_mask_kind) mask
- end function kmp_get_affinity_mask_proc
-
- function kmp_malloc(size)
- use omp_lib_kinds
- integer (kind=kmp_pointer_kind) kmp_malloc
- integer (kind=kmp_size_t_kind) size
- end function kmp_malloc
-
- function kmp_aligned_malloc(size, alignment)
- use omp_lib_kinds
- integer (kind=kmp_pointer_kind) kmp_aligned_malloc
- integer (kind=kmp_size_t_kind) size
- integer (kind=kmp_size_t_kind) alignment
- end function kmp_aligned_malloc
-
- function kmp_calloc(nelem, elsize)
- use omp_lib_kinds
- integer (kind=kmp_pointer_kind) kmp_calloc
- integer (kind=kmp_size_t_kind) nelem
- integer (kind=kmp_size_t_kind) elsize
- end function kmp_calloc
-
- function kmp_realloc(ptr, size)
- use omp_lib_kinds
- integer (kind=kmp_pointer_kind) kmp_realloc
- integer (kind=kmp_pointer_kind) ptr
- integer (kind=kmp_size_t_kind) size
- end function kmp_realloc
-
- subroutine kmp_free(ptr)
- use omp_lib_kinds
- integer (kind=kmp_pointer_kind) ptr
- end subroutine kmp_free
-
- subroutine kmp_set_warnings_on()
- end subroutine kmp_set_warnings_on
-
- subroutine kmp_set_warnings_off()
- end subroutine kmp_set_warnings_off
-
- function kmp_get_cancellation_status(cancelkind)
- use omp_lib_kinds
- integer (kind=kmp_cancel_kind) cancelkind
- logical (kind=omp_logical_kind) kmp_get_cancellation_status
- end function kmp_get_cancellation_status
-
- end interface
-
-!dec$ if defined(_WIN32)
-!dec$ if defined(_WIN64) .or. defined(_M_AMD64)
-
-!***
-!*** The Fortran entry points must be in uppercase, even if the /Qlowercase
-!*** option is specified. The alias attribute ensures that the specified
-!*** string is used as the entry point.
-!***
-!*** On the Windows* OS IA-32 architecture, the Fortran entry points have an
-!*** underscore prepended. On the Windows* OS Intel(R) 64
-!*** architecture, no underscore is prepended.
-!***
-
-!dec$ attributes alias:'OMP_SET_NUM_THREADS' :: omp_set_num_threads
-!dec$ attributes alias:'OMP_SET_DYNAMIC' :: omp_set_dynamic
-!dec$ attributes alias:'OMP_SET_NESTED' :: omp_set_nested
-!dec$ attributes alias:'OMP_GET_NUM_THREADS' :: omp_get_num_threads
-!dec$ attributes alias:'OMP_GET_MAX_THREADS' :: omp_get_max_threads
-!dec$ attributes alias:'OMP_GET_THREAD_NUM' :: omp_get_thread_num
-!dec$ attributes alias:'OMP_GET_NUM_PROCS' :: omp_get_num_procs
-!dec$ attributes alias:'OMP_IN_PARALLEL' :: omp_in_parallel
-!dec$ attributes alias:'OMP_GET_DYNAMIC' :: omp_get_dynamic
-!dec$ attributes alias:'OMP_GET_NESTED' :: omp_get_nested
-!dec$ attributes alias:'OMP_GET_THREAD_LIMIT' :: omp_get_thread_limit
-!dec$ attributes alias:'OMP_SET_MAX_ACTIVE_LEVELS' :: omp_set_max_active_levels
-!dec$ attributes alias:'OMP_GET_MAX_ACTIVE_LEVELS' :: omp_get_max_active_levels
-!dec$ attributes alias:'OMP_GET_LEVEL' :: omp_get_level
-!dec$ attributes alias:'OMP_GET_ACTIVE_LEVEL' :: omp_get_active_level
-!dec$ attributes alias:'OMP_GET_ANCESTOR_THREAD_NUM' :: omp_get_ancestor_thread_num
-!dec$ attributes alias:'OMP_GET_TEAM_SIZE' :: omp_get_team_size
-!dec$ attributes alias:'OMP_SET_SCHEDULE' :: omp_set_schedule
-!dec$ attributes alias:'OMP_GET_SCHEDULE' :: omp_get_schedule
-!dec$ attributes alias:'OMP_GET_PROC_BIND' :: omp_get_proc_bind
-!dec$ attributes alias:'OMP_GET_WTIME' :: omp_get_wtime
-!dec$ attributes alias:'OMP_GET_WTICK' :: omp_get_wtick
-!dec$ attributes alias:'OMP_GET_DEFAULT_DEVICE' :: omp_get_default_device
-!dec$ attributes alias:'OMP_SET_DEFAULT_DEVICE' :: omp_set_default_device
-!dec$ attributes alias:'OMP_GET_NUM_DEVICES' :: omp_get_num_devices
-!dec$ attributes alias:'OMP_GET_NUM_TEAMS' :: omp_get_num_teams
-!dec$ attributes alias:'OMP_GET_TEAM_NUM' :: omp_get_team_num
-!dec$ attributes alias:'OMP_GET_CANCELLATION' :: omp_get_cancellation
-!dec$ attributes alias:'OMP_IS_INITIAL_DEVICE' :: omp_is_initial_device
-
-!dec$ attributes alias:'omp_init_lock' :: omp_init_lock
-!dec$ attributes alias:'omp_destroy_lock' :: omp_destroy_lock
-!dec$ attributes alias:'omp_set_lock' :: omp_set_lock
-!dec$ attributes alias:'omp_unset_lock' :: omp_unset_lock
-!dec$ attributes alias:'omp_test_lock' :: omp_test_lock
-!dec$ attributes alias:'omp_init_nest_lock' :: omp_init_nest_lock
-!dec$ attributes alias:'omp_destroy_nest_lock' :: omp_destroy_nest_lock
-!dec$ attributes alias:'omp_set_nest_lock' :: omp_set_nest_lock
-!dec$ attributes alias:'omp_unset_nest_lock' :: omp_unset_nest_lock
-!dec$ attributes alias:'omp_test_nest_lock' :: omp_test_nest_lock
-
-!dec$ attributes alias:'KMP_SET_STACKSIZE'::kmp_set_stacksize
-!dec$ attributes alias:'KMP_SET_STACKSIZE_S'::kmp_set_stacksize_s
-!dec$ attributes alias:'KMP_SET_BLOCKTIME'::kmp_set_blocktime
-!dec$ attributes alias:'KMP_SET_LIBRARY_SERIAL'::kmp_set_library_serial
-!dec$ attributes alias:'KMP_SET_LIBRARY_TURNAROUND'::kmp_set_library_turnaround
-!dec$ attributes alias:'KMP_SET_LIBRARY_THROUGHPUT'::kmp_set_library_throughput
-!dec$ attributes alias:'KMP_SET_LIBRARY'::kmp_set_library
-!dec$ attributes alias:'KMP_GET_STACKSIZE'::kmp_get_stacksize
-!dec$ attributes alias:'KMP_GET_STACKSIZE_S'::kmp_get_stacksize_s
-!dec$ attributes alias:'KMP_GET_BLOCKTIME'::kmp_get_blocktime
-!dec$ attributes alias:'KMP_GET_LIBRARY'::kmp_get_library
-!dec$ attributes alias:'KMP_SET_AFFINITY'::kmp_set_affinity
-!dec$ attributes alias:'KMP_GET_AFFINITY'::kmp_get_affinity
-!dec$ attributes alias:'KMP_GET_AFFINITY_MAX_PROC'::kmp_get_affinity_max_proc
-!dec$ attributes alias:'KMP_CREATE_AFFINITY_MASK'::kmp_create_affinity_mask
-!dec$ attributes alias:'KMP_DESTROY_AFFINITY_MASK'::kmp_destroy_affinity_mask
-!dec$ attributes alias:'KMP_SET_AFFINITY_MASK_PROC'::kmp_set_affinity_mask_proc
-!dec$ attributes alias:'KMP_UNSET_AFFINITY_MASK_PROC'::kmp_unset_affinity_mask_proc
-!dec$ attributes alias:'KMP_GET_AFFINITY_MASK_PROC'::kmp_get_affinity_mask_proc
-!dec$ attributes alias:'KMP_MALLOC'::kmp_malloc
-!dec$ attributes alias:'KMP_ALIGNED_MALLOC'::kmp_aligned_malloc
-!dec$ attributes alias:'KMP_CALLOC'::kmp_calloc
-!dec$ attributes alias:'KMP_REALLOC'::kmp_realloc
-!dec$ attributes alias:'KMP_FREE'::kmp_free
-
-!dec$ attributes alias:'KMP_SET_WARNINGS_ON'::kmp_set_warnings_on
-!dec$ attributes alias:'KMP_SET_WARNINGS_OFF'::kmp_set_warnings_off
-
-!dec$ attributes alias:'KMP_GET_CANCELLATION_STATUS' :: kmp_get_cancellation_status
-
-!dec$ else
-
-!***
-!*** On Windows* OS IA-32 architecture, the Fortran entry points have an underscore prepended.
-!***
-
-!dec$ attributes alias:'_OMP_SET_NUM_THREADS' :: omp_set_num_threads
-!dec$ attributes alias:'_OMP_SET_DYNAMIC' :: omp_set_dynamic
-!dec$ attributes alias:'_OMP_SET_NESTED' :: omp_set_nested
-!dec$ attributes alias:'_OMP_GET_NUM_THREADS' :: omp_get_num_threads
-!dec$ attributes alias:'_OMP_GET_MAX_THREADS' :: omp_get_max_threads
-!dec$ attributes alias:'_OMP_GET_THREAD_NUM' :: omp_get_thread_num
-!dec$ attributes alias:'_OMP_GET_NUM_PROCS' :: omp_get_num_procs
-!dec$ attributes alias:'_OMP_IN_PARALLEL' :: omp_in_parallel
-!dec$ attributes alias:'_OMP_GET_DYNAMIC' :: omp_get_dynamic
-!dec$ attributes alias:'_OMP_GET_NESTED' :: omp_get_nested
-!dec$ attributes alias:'_OMP_GET_THREAD_LIMIT' :: omp_get_thread_limit
-!dec$ attributes alias:'_OMP_SET_MAX_ACTIVE_LEVELS' :: omp_set_max_active_levels
-!dec$ attributes alias:'_OMP_GET_MAX_ACTIVE_LEVELS' :: omp_get_max_active_levels
-!dec$ attributes alias:'_OMP_GET_LEVEL' :: omp_get_level
-!dec$ attributes alias:'_OMP_GET_ACTIVE_LEVEL' :: omp_get_active_level
-!dec$ attributes alias:'_OMP_GET_ANCESTOR_THREAD_NUM' :: omp_get_ancestor_thread_num
-!dec$ attributes alias:'_OMP_GET_TEAM_SIZE' :: omp_get_team_size
-!dec$ attributes alias:'_OMP_SET_SCHEDULE' :: omp_set_schedule
-!dec$ attributes alias:'_OMP_GET_SCHEDULE' :: omp_get_schedule
-!dec$ attributes alias:'_OMP_GET_PROC_BIND' :: omp_get_proc_bind
-!dec$ attributes alias:'_OMP_GET_WTIME' :: omp_get_wtime
-!dec$ attributes alias:'_OMP_GET_WTICK' :: omp_get_wtick
-!dec$ attributes alias:'_OMP_GET_DEFAULT_DEVICE' :: omp_get_default_device
-!dec$ attributes alias:'_OMP_SET_DEFAULT_DEVICE' :: omp_set_default_device
-!dec$ attributes alias:'_OMP_GET_NUM_DEVICES' :: omp_get_num_devices
-!dec$ attributes alias:'_OMP_GET_NUM_TEAMS' :: omp_get_num_teams
-!dec$ attributes alias:'_OMP_GET_TEAM_NUM' :: omp_get_team_num
-!dec$ attributes alias:'_OMP_GET_CANCELLATION' :: omp_get_cancellation
-!dec$ attributes alias:'_OMP_IS_INITIAL_DEVICE' :: omp_is_initial_device
-
-!dec$ attributes alias:'_omp_init_lock' :: omp_init_lock
-!dec$ attributes alias:'_omp_destroy_lock' :: omp_destroy_lock
-!dec$ attributes alias:'_omp_set_lock' :: omp_set_lock
-!dec$ attributes alias:'_omp_unset_lock' :: omp_unset_lock
-!dec$ attributes alias:'_omp_test_lock' :: omp_test_lock
-!dec$ attributes alias:'_omp_init_nest_lock' :: omp_init_nest_lock
-!dec$ attributes alias:'_omp_destroy_nest_lock' :: omp_destroy_nest_lock
-!dec$ attributes alias:'_omp_set_nest_lock' :: omp_set_nest_lock
-!dec$ attributes alias:'_omp_unset_nest_lock' :: omp_unset_nest_lock
-!dec$ attributes alias:'_omp_test_nest_lock' :: omp_test_nest_lock
-
-!dec$ attributes alias:'_KMP_SET_STACKSIZE'::kmp_set_stacksize
-!dec$ attributes alias:'_KMP_SET_STACKSIZE_S'::kmp_set_stacksize_s
-!dec$ attributes alias:'_KMP_SET_BLOCKTIME'::kmp_set_blocktime
-!dec$ attributes alias:'_KMP_SET_LIBRARY_SERIAL'::kmp_set_library_serial
-!dec$ attributes alias:'_KMP_SET_LIBRARY_TURNAROUND'::kmp_set_library_turnaround
-!dec$ attributes alias:'_KMP_SET_LIBRARY_THROUGHPUT'::kmp_set_library_throughput
-!dec$ attributes alias:'_KMP_SET_LIBRARY'::kmp_set_library
-!dec$ attributes alias:'_KMP_GET_STACKSIZE'::kmp_get_stacksize
-!dec$ attributes alias:'_KMP_GET_STACKSIZE_S'::kmp_get_stacksize_s
-!dec$ attributes alias:'_KMP_GET_BLOCKTIME'::kmp_get_blocktime
-!dec$ attributes alias:'_KMP_GET_LIBRARY'::kmp_get_library
-!dec$ attributes alias:'_KMP_SET_AFFINITY'::kmp_set_affinity
-!dec$ attributes alias:'_KMP_GET_AFFINITY'::kmp_get_affinity
-!dec$ attributes alias:'_KMP_GET_AFFINITY_MAX_PROC'::kmp_get_affinity_max_proc
-!dec$ attributes alias:'_KMP_CREATE_AFFINITY_MASK'::kmp_create_affinity_mask
-!dec$ attributes alias:'_KMP_DESTROY_AFFINITY_MASK'::kmp_destroy_affinity_mask
-!dec$ attributes alias:'_KMP_SET_AFFINITY_MASK_PROC'::kmp_set_affinity_mask_proc
-!dec$ attributes alias:'_KMP_UNSET_AFFINITY_MASK_PROC'::kmp_unset_affinity_mask_proc
-!dec$ attributes alias:'_KMP_GET_AFFINITY_MASK_PROC'::kmp_get_affinity_mask_proc
-!dec$ attributes alias:'_KMP_MALLOC'::kmp_malloc
-!dec$ attributes alias:'_KMP_ALIGNED_MALLOC'::kmp_aligned_malloc
-!dec$ attributes alias:'_KMP_CALLOC'::kmp_calloc
-!dec$ attributes alias:'_KMP_REALLOC'::kmp_realloc
-!dec$ attributes alias:'_KMP_FREE'::kmp_free
-
-!dec$ attributes alias:'_KMP_SET_WARNINGS_ON'::kmp_set_warnings_on
-!dec$ attributes alias:'_KMP_SET_WARNINGS_OFF'::kmp_set_warnings_off
-
-!dec$ attributes alias:'_KMP_GET_CANCELLATION_STATUS' :: kmp_get_cancellation_status
-
-!dec$ endif
-!dec$ endif
-
-!dec$ if defined(__linux)
-
-!***
-!*** The Linux* OS entry points are in lowercase, with an underscore appended.
-!***
-
-!dec$ attributes alias:'omp_set_num_threads_'::omp_set_num_threads
-!dec$ attributes alias:'omp_set_dynamic_'::omp_set_dynamic
-!dec$ attributes alias:'omp_set_nested_'::omp_set_nested
-!dec$ attributes alias:'omp_get_num_threads_'::omp_get_num_threads
-!dec$ attributes alias:'omp_get_max_threads_'::omp_get_max_threads
-!dec$ attributes alias:'omp_get_thread_num_'::omp_get_thread_num
-!dec$ attributes alias:'omp_get_num_procs_'::omp_get_num_procs
-!dec$ attributes alias:'omp_in_parallel_'::omp_in_parallel
-!dec$ attributes alias:'omp_get_dynamic_'::omp_get_dynamic
-!dec$ attributes alias:'omp_get_nested_'::omp_get_nested
-!dec$ attributes alias:'omp_get_thread_limit_'::omp_get_thread_limit
-!dec$ attributes alias:'omp_set_max_active_levels_'::omp_set_max_active_levels
-!dec$ attributes alias:'omp_get_max_active_levels_'::omp_get_max_active_levels
-!dec$ attributes alias:'omp_get_level_'::omp_get_level
-!dec$ attributes alias:'omp_get_active_level_'::omp_get_active_level
-!dec$ attributes alias:'omp_get_ancestor_thread_num_'::omp_get_ancestor_thread_num
-!dec$ attributes alias:'omp_get_team_size_'::omp_get_team_size
-!dec$ attributes alias:'omp_set_schedule_'::omp_set_schedule
-!dec$ attributes alias:'omp_get_schedule_'::omp_get_schedule
-!dec$ attributes alias:'omp_get_proc_bind_' :: omp_get_proc_bind
-!dec$ attributes alias:'omp_get_wtime_'::omp_get_wtime
-!dec$ attributes alias:'omp_get_wtick_'::omp_get_wtick
-!dec$ attributes alias:'omp_get_default_device_'::omp_get_default_device
-!dec$ attributes alias:'omp_set_default_device_'::omp_set_default_device
-!dec$ attributes alias:'omp_get_num_devices_'::omp_get_num_devices
-!dec$ attributes alias:'omp_get_num_teams_'::omp_get_num_teams
-!dec$ attributes alias:'omp_get_team_num_'::omp_get_team_num
-!dec$ attributes alias:'omp_get_cancellation_'::omp_get_cancellation
-!dec$ attributes alias:'omp_is_initial_device_'::omp_is_initial_device
-
-!dec$ attributes alias:'omp_init_lock_'::omp_init_lock
-!dec$ attributes alias:'omp_destroy_lock_'::omp_destroy_lock
-!dec$ attributes alias:'omp_set_lock_'::omp_set_lock
-!dec$ attributes alias:'omp_unset_lock_'::omp_unset_lock
-!dec$ attributes alias:'omp_test_lock_'::omp_test_lock
-!dec$ attributes alias:'omp_init_nest_lock_'::omp_init_nest_lock
-!dec$ attributes alias:'omp_destroy_nest_lock_'::omp_destroy_nest_lock
-!dec$ attributes alias:'omp_set_nest_lock_'::omp_set_nest_lock
-!dec$ attributes alias:'omp_unset_nest_lock_'::omp_unset_nest_lock
-!dec$ attributes alias:'omp_test_nest_lock_'::omp_test_nest_lock
-
-!dec$ attributes alias:'kmp_set_stacksize_'::kmp_set_stacksize
-!dec$ attributes alias:'kmp_set_stacksize_s_'::kmp_set_stacksize_s
-!dec$ attributes alias:'kmp_set_blocktime_'::kmp_set_blocktime
-!dec$ attributes alias:'kmp_set_library_serial_'::kmp_set_library_serial
-!dec$ attributes alias:'kmp_set_library_turnaround_'::kmp_set_library_turnaround
-!dec$ attributes alias:'kmp_set_library_throughput_'::kmp_set_library_throughput
-!dec$ attributes alias:'kmp_set_library_'::kmp_set_library
-!dec$ attributes alias:'kmp_get_stacksize_'::kmp_get_stacksize
-!dec$ attributes alias:'kmp_get_stacksize_s_'::kmp_get_stacksize_s
-!dec$ attributes alias:'kmp_get_blocktime_'::kmp_get_blocktime
-!dec$ attributes alias:'kmp_get_library_'::kmp_get_library
-!dec$ attributes alias:'kmp_set_affinity_'::kmp_set_affinity
-!dec$ attributes alias:'kmp_get_affinity_'::kmp_get_affinity
-!dec$ attributes alias:'kmp_get_affinity_max_proc_'::kmp_get_affinity_max_proc
-!dec$ attributes alias:'kmp_create_affinity_mask_'::kmp_create_affinity_mask
-!dec$ attributes alias:'kmp_destroy_affinity_mask_'::kmp_destroy_affinity_mask
-!dec$ attributes alias:'kmp_set_affinity_mask_proc_'::kmp_set_affinity_mask_proc
-!dec$ attributes alias:'kmp_unset_affinity_mask_proc_'::kmp_unset_affinity_mask_proc
-!dec$ attributes alias:'kmp_get_affinity_mask_proc_'::kmp_get_affinity_mask_proc
-!dec$ attributes alias:'kmp_malloc_'::kmp_malloc
-!dec$ attributes alias:'kmp_aligned_malloc_'::kmp_aligned_malloc
-!dec$ attributes alias:'kmp_calloc_'::kmp_calloc
-!dec$ attributes alias:'kmp_realloc_'::kmp_realloc
-!dec$ attributes alias:'kmp_free_'::kmp_free
-
-!dec$ attributes alias:'kmp_set_warnings_on_'::kmp_set_warnings_on
-!dec$ attributes alias:'kmp_set_warnings_off_'::kmp_set_warnings_off
-!dec$ attributes alias:'kmp_get_cancellation_status_'::kmp_get_cancellation_status
-
-!dec$ endif
-
-!dec$ if defined(__APPLE__)
-
-!***
-!*** The Mac entry points are in lowercase, with an both an underscore
-!*** appended and an underscore prepended.
-!***
-
-!dec$ attributes alias:'_omp_set_num_threads_'::omp_set_num_threads
-!dec$ attributes alias:'_omp_set_dynamic_'::omp_set_dynamic
-!dec$ attributes alias:'_omp_set_nested_'::omp_set_nested
-!dec$ attributes alias:'_omp_get_num_threads_'::omp_get_num_threads
-!dec$ attributes alias:'_omp_get_max_threads_'::omp_get_max_threads
-!dec$ attributes alias:'_omp_get_thread_num_'::omp_get_thread_num
-!dec$ attributes alias:'_omp_get_num_procs_'::omp_get_num_procs
-!dec$ attributes alias:'_omp_in_parallel_'::omp_in_parallel
-!dec$ attributes alias:'_omp_get_dynamic_'::omp_get_dynamic
-!dec$ attributes alias:'_omp_get_nested_'::omp_get_nested
-!dec$ attributes alias:'_omp_get_thread_limit_'::omp_get_thread_limit
-!dec$ attributes alias:'_omp_set_max_active_levels_'::omp_set_max_active_levels
-!dec$ attributes alias:'_omp_get_max_active_levels_'::omp_get_max_active_levels
-!dec$ attributes alias:'_omp_get_level_'::omp_get_level
-!dec$ attributes alias:'_omp_get_active_level_'::omp_get_active_level
-!dec$ attributes alias:'_omp_get_ancestor_thread_num_'::omp_get_ancestor_thread_num
-!dec$ attributes alias:'_omp_get_team_size_'::omp_get_team_size
-!dec$ attributes alias:'_omp_set_schedule_'::omp_set_schedule
-!dec$ attributes alias:'_omp_get_schedule_'::omp_get_schedule
-!dec$ attributes alias:'_omp_get_proc_bind_' :: omp_get_proc_bind
-!dec$ attributes alias:'_omp_get_wtime_'::omp_get_wtime
-!dec$ attributes alias:'_omp_get_wtick_'::omp_get_wtick
-!dec$ attributes alias:'_omp_get_num_teams_'::omp_get_num_teams
-!dec$ attributes alias:'_omp_get_team_num_'::omp_get_team_num
-!dec$ attributes alias:'_omp_get_cancellation_'::omp_get_cancellation
-!dec$ attributes alias:'_omp_is_initial_device_'::omp_is_initial_device
-
-!dec$ attributes alias:'_omp_init_lock_'::omp_init_lock
-!dec$ attributes alias:'_omp_destroy_lock_'::omp_destroy_lock
-!dec$ attributes alias:'_omp_set_lock_'::omp_set_lock
-!dec$ attributes alias:'_omp_unset_lock_'::omp_unset_lock
-!dec$ attributes alias:'_omp_test_lock_'::omp_test_lock
-!dec$ attributes alias:'_omp_init_nest_lock_'::omp_init_nest_lock
-!dec$ attributes alias:'_omp_destroy_nest_lock_'::omp_destroy_nest_lock
-!dec$ attributes alias:'_omp_set_nest_lock_'::omp_set_nest_lock
-!dec$ attributes alias:'_omp_unset_nest_lock_'::omp_unset_nest_lock
-!dec$ attributes alias:'_omp_test_nest_lock_'::omp_test_nest_lock
-
-!dec$ attributes alias:'_kmp_set_stacksize_'::kmp_set_stacksize
-!dec$ attributes alias:'_kmp_set_stacksize_s_'::kmp_set_stacksize_s
-!dec$ attributes alias:'_kmp_set_blocktime_'::kmp_set_blocktime
-!dec$ attributes alias:'_kmp_set_library_serial_'::kmp_set_library_serial
-!dec$ attributes alias:'_kmp_set_library_turnaround_'::kmp_set_library_turnaround
-!dec$ attributes alias:'_kmp_set_library_throughput_'::kmp_set_library_throughput
-!dec$ attributes alias:'_kmp_set_library_'::kmp_set_library
-!dec$ attributes alias:'_kmp_get_stacksize_'::kmp_get_stacksize
-!dec$ attributes alias:'_kmp_get_stacksize_s_'::kmp_get_stacksize_s
-!dec$ attributes alias:'_kmp_get_blocktime_'::kmp_get_blocktime
-!dec$ attributes alias:'_kmp_get_library_'::kmp_get_library
-!dec$ attributes alias:'_kmp_set_affinity_'::kmp_set_affinity
-!dec$ attributes alias:'_kmp_get_affinity_'::kmp_get_affinity
-!dec$ attributes alias:'_kmp_get_affinity_max_proc_'::kmp_get_affinity_max_proc
-!dec$ attributes alias:'_kmp_create_affinity_mask_'::kmp_create_affinity_mask
-!dec$ attributes alias:'_kmp_destroy_affinity_mask_'::kmp_destroy_affinity_mask
-!dec$ attributes alias:'_kmp_set_affinity_mask_proc_'::kmp_set_affinity_mask_proc
-!dec$ attributes alias:'_kmp_unset_affinity_mask_proc_'::kmp_unset_affinity_mask_proc
-!dec$ attributes alias:'_kmp_get_affinity_mask_proc_'::kmp_get_affinity_mask_proc
-!dec$ attributes alias:'_kmp_malloc_'::kmp_malloc
-!dec$ attributes alias:'_kmp_aligned_malloc_'::kmp_aligned_malloc
-!dec$ attributes alias:'_kmp_calloc_'::kmp_calloc
-!dec$ attributes alias:'_kmp_realloc_'::kmp_realloc
-!dec$ attributes alias:'_kmp_free_'::kmp_free
-
-!dec$ attributes alias:'_kmp_set_warnings_on_'::kmp_set_warnings_on
-!dec$ attributes alias:'_kmp_set_warnings_off_'::kmp_set_warnings_off
-
-!dec$ attributes alias:'_kmp_get_cancellation_status_'::kmp_get_cancellation_status
-
-!dec$ endif
-
- end module omp_lib
-
diff --git a/runtime/src/include/40/omp_lib.f90.var b/runtime/src/include/40/omp_lib.f90.var
deleted file mode 100644
index 9e5a23a06795..000000000000
--- a/runtime/src/include/40/omp_lib.f90.var
+++ /dev/null
@@ -1,455 +0,0 @@
-! include/40/omp_lib.f90.var
-
-!
-!//===----------------------------------------------------------------------===//
-!//
-!// The LLVM Compiler Infrastructure
-!//
-!// This file is dual licensed under the MIT and the University of Illinois Open
-!// Source Licenses. See LICENSE.txt for details.
-!//
-!//===----------------------------------------------------------------------===//
-!
-
- module omp_lib_kinds
-
- use, intrinsic :: iso_c_binding
-
- integer, parameter :: omp_integer_kind = c_int
- integer, parameter :: omp_logical_kind = 4
- integer, parameter :: omp_real_kind = c_float
- integer, parameter :: kmp_double_kind = c_double
- integer, parameter :: omp_lock_kind = c_intptr_t
- integer, parameter :: omp_nest_lock_kind = c_intptr_t
- integer, parameter :: omp_sched_kind = omp_integer_kind
- integer, parameter :: omp_proc_bind_kind = omp_integer_kind
- integer, parameter :: kmp_pointer_kind = c_intptr_t
- integer, parameter :: kmp_size_t_kind = c_size_t
- integer, parameter :: kmp_affinity_mask_kind = c_intptr_t
- integer, parameter :: kmp_cancel_kind = omp_integer_kind
-
- end module omp_lib_kinds
-
- module omp_lib
-
- use omp_lib_kinds
-
- integer (kind=omp_integer_kind), parameter :: openmp_version = @LIBOMP_OMP_YEAR_MONTH@
- integer (kind=omp_integer_kind), parameter :: kmp_version_major = @LIBOMP_VERSION_MAJOR@
- integer (kind=omp_integer_kind), parameter :: kmp_version_minor = @LIBOMP_VERSION_MINOR@
- integer (kind=omp_integer_kind), parameter :: kmp_version_build = @LIBOMP_VERSION_BUILD@
- character(*) kmp_build_date
- parameter( kmp_build_date = '@LIBOMP_BUILD_DATE@' )
-
- integer(kind=omp_sched_kind), parameter :: omp_sched_static = 1
- integer(kind=omp_sched_kind), parameter :: omp_sched_dynamic = 2
- integer(kind=omp_sched_kind), parameter :: omp_sched_guided = 3
- integer(kind=omp_sched_kind), parameter :: omp_sched_auto = 4
-
-
- integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_false = 0
- integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_true = 1
- integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_master = 2
- integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_close = 3
- integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_spread = 4
-
- integer (kind=kmp_cancel_kind), parameter :: kmp_cancel_parallel = 1
- integer (kind=kmp_cancel_kind), parameter :: kmp_cancel_loop = 2
- integer (kind=kmp_cancel_kind), parameter :: kmp_cancel_sections = 3
- integer (kind=kmp_cancel_kind), parameter :: kmp_cancel_taskgroup = 4
-
- interface
-
-! ***
-! *** omp_* entry points
-! ***
-
- subroutine omp_set_num_threads(num_threads) bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind), value :: num_threads
- end subroutine omp_set_num_threads
-
- subroutine omp_set_dynamic(dynamic_threads) bind(c)
- use omp_lib_kinds
- logical (kind=omp_logical_kind), value :: dynamic_threads
- end subroutine omp_set_dynamic
-
- subroutine omp_set_nested(nested) bind(c)
- use omp_lib_kinds
- logical (kind=omp_logical_kind), value :: nested
- end subroutine omp_set_nested
-
- function omp_get_num_threads() bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_num_threads
- end function omp_get_num_threads
-
- function omp_get_max_threads() bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_max_threads
- end function omp_get_max_threads
-
- function omp_get_thread_num() bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_thread_num
- end function omp_get_thread_num
-
- function omp_get_num_procs() bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_num_procs
- end function omp_get_num_procs
-
- function omp_in_parallel() bind(c)
- use omp_lib_kinds
- logical (kind=omp_logical_kind) omp_in_parallel
- end function omp_in_parallel
-
- function omp_in_final() bind(c)
- use omp_lib_kinds
- logical (kind=omp_logical_kind) omp_in_final
- end function omp_in_final
-
- function omp_get_dynamic() bind(c)
- use omp_lib_kinds
- logical (kind=omp_logical_kind) omp_get_dynamic
- end function omp_get_dynamic
-
- function omp_get_nested() bind(c)
- use omp_lib_kinds
- logical (kind=omp_logical_kind) omp_get_nested
- end function omp_get_nested
-
- function omp_get_thread_limit() bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_thread_limit
- end function omp_get_thread_limit
-
- subroutine omp_set_max_active_levels(max_levels) bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind), value :: max_levels
- end subroutine omp_set_max_active_levels
-
- function omp_get_max_active_levels() bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_max_active_levels
- end function omp_get_max_active_levels
-
- function omp_get_level() bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_level
- end function omp_get_level
-
- function omp_get_active_level() bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_active_level
- end function omp_get_active_level
-
- function omp_get_ancestor_thread_num(level) bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_ancestor_thread_num
- integer (kind=omp_integer_kind), value :: level
- end function omp_get_ancestor_thread_num
-
- function omp_get_team_size(level) bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_team_size
- integer (kind=omp_integer_kind), value :: level
- end function omp_get_team_size
-
- subroutine omp_set_schedule(kind, chunk_size) bind(c)
- use omp_lib_kinds
- integer (kind=omp_sched_kind), value :: kind
- integer (kind=omp_integer_kind), value :: chunk_size
- end subroutine omp_set_schedule
-
- subroutine omp_get_schedule(kind, chunk_size) bind(c)
- use omp_lib_kinds
- integer (kind=omp_sched_kind) kind
- integer (kind=omp_integer_kind) chunk_size
- end subroutine omp_get_schedule
-
- function omp_get_proc_bind() bind(c)
- use omp_lib_kinds
- integer (kind=omp_proc_bind_kind) omp_get_proc_bind
- end function omp_get_proc_bind
-
- function omp_get_wtime() bind(c)
- use omp_lib_kinds
- real (kind=kmp_double_kind) omp_get_wtime
- end function omp_get_wtime
-
- function omp_get_wtick() bind(c)
- use omp_lib_kinds
- real (kind=kmp_double_kind) omp_get_wtick
- end function omp_get_wtick
-
- function omp_get_default_device() bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_default_device
- end function omp_get_default_device
-
- subroutine omp_set_default_device(device_num) bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind), value :: device_num
- end subroutine omp_set_default_device
-
- function omp_get_num_devices() bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_num_devices
- end function omp_get_num_devices
-
- function omp_get_num_teams() bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_num_teams
- end function omp_get_num_teams
-
- function omp_get_team_num() bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_team_num
- end function omp_get_team_num
-
- function omp_get_cancellation() bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_cancellation
- end function omp_get_cancellation
-
- function omp_is_initial_device() bind(c)
- use omp_lib_kinds
- logical (kind=omp_logical_kind) omp_is_initial_device
- end function omp_is_initial_device
-
- subroutine omp_init_lock(svar) bind(c)
-!DIR$ IF(__INTEL_COMPILER.GE.1400)
-!DIR$ attributes known_intrinsic :: omp_init_lock
-!DIR$ ENDIF
- use omp_lib_kinds
- integer (kind=omp_lock_kind) svar
- end subroutine omp_init_lock
-
- subroutine omp_destroy_lock(svar) bind(c)
-!DIR$ IF(__INTEL_COMPILER.GE.1400)
-!DIR$ attributes known_intrinsic :: omp_destroy_lock
-!DIR$ ENDIF
- use omp_lib_kinds
- integer (kind=omp_lock_kind) svar
- end subroutine omp_destroy_lock
-
- subroutine omp_set_lock(svar) bind(c)
-!DIR$ IF(__INTEL_COMPILER.GE.1400)
-!DIR$ attributes known_intrinsic :: omp_set_lock
-!DIR$ ENDIF
- use omp_lib_kinds
- integer (kind=omp_lock_kind) svar
- end subroutine omp_set_lock
-
- subroutine omp_unset_lock(svar) bind(c)
-!DIR$ IF(__INTEL_COMPILER.GE.1400)
-!DIR$ attributes known_intrinsic :: omp_unset_lock
-!DIR$ ENDIF
- use omp_lib_kinds
- integer (kind=omp_lock_kind) svar
- end subroutine omp_unset_lock
-
- function omp_test_lock(svar) bind(c)
-!DIR$ IF(__INTEL_COMPILER.GE.1400)
-!DIR$ attributes known_intrinsic :: omp_test_lock
-!DIR$ ENDIF
- use omp_lib_kinds
- logical (kind=omp_logical_kind) omp_test_lock
- integer (kind=omp_lock_kind) svar
- end function omp_test_lock
-
- subroutine omp_init_nest_lock(nvar) bind(c)
-!DIR$ IF(__INTEL_COMPILER.GE.1400)
-!DIR$ attributes known_intrinsic :: omp_init_nest_lock
-!DIR$ ENDIF
- use omp_lib_kinds
- integer (kind=omp_nest_lock_kind) nvar
- end subroutine omp_init_nest_lock
-
- subroutine omp_destroy_nest_lock(nvar) bind(c)
-!DIR$ IF(__INTEL_COMPILER.GE.1400)
-!DIR$ attributes known_intrinsic :: omp_destroy_nest_lock
-!DIR$ ENDIF
- use omp_lib_kinds
- integer (kind=omp_nest_lock_kind) nvar
- end subroutine omp_destroy_nest_lock
-
- subroutine omp_set_nest_lock(nvar) bind(c)
-!DIR$ IF(__INTEL_COMPILER.GE.1400)
-!DIR$ attributes known_intrinsic :: omp_set_nest_lock
-!DIR$ ENDIF
- use omp_lib_kinds
- integer (kind=omp_nest_lock_kind) nvar
- end subroutine omp_set_nest_lock
-
- subroutine omp_unset_nest_lock(nvar) bind(c)
-!DIR$ IF(__INTEL_COMPILER.GE.1400)
-!DIR$ attributes known_intrinsic :: omp_unset_nest_lock
-!DIR$ ENDIF
- use omp_lib_kinds
- integer (kind=omp_nest_lock_kind) nvar
- end subroutine omp_unset_nest_lock
-
- function omp_test_nest_lock(nvar) bind(c)
-!DIR$ IF(__INTEL_COMPILER.GE.1400)
-!DIR$ attributes known_intrinsic :: omp_test_nest_lock
-!DIR$ ENDIF
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_test_nest_lock
- integer (kind=omp_nest_lock_kind) nvar
- end function omp_test_nest_lock
-
-! ***
-! *** kmp_* entry points
-! ***
-
- subroutine kmp_set_stacksize(size) bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind), value :: size
- end subroutine kmp_set_stacksize
-
- subroutine kmp_set_stacksize_s(size) bind(c)
- use omp_lib_kinds
- integer (kind=kmp_size_t_kind), value :: size
- end subroutine kmp_set_stacksize_s
-
- subroutine kmp_set_blocktime(msec) bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind), value :: msec
- end subroutine kmp_set_blocktime
-
- subroutine kmp_set_library_serial() bind(c)
- end subroutine kmp_set_library_serial
-
- subroutine kmp_set_library_turnaround() bind(c)
- end subroutine kmp_set_library_turnaround
-
- subroutine kmp_set_library_throughput() bind(c)
- end subroutine kmp_set_library_throughput
-
- subroutine kmp_set_library(libnum) bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind), value :: libnum
- end subroutine kmp_set_library
-
- subroutine kmp_set_defaults(string) bind(c)
- use, intrinsic :: iso_c_binding
- character (kind=c_char) :: string(*)
- end subroutine kmp_set_defaults
-
- function kmp_get_stacksize() bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) kmp_get_stacksize
- end function kmp_get_stacksize
-
- function kmp_get_stacksize_s() bind(c)
- use omp_lib_kinds
- integer (kind=kmp_size_t_kind) kmp_get_stacksize_s
- end function kmp_get_stacksize_s
-
- function kmp_get_blocktime() bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) kmp_get_blocktime
- end function kmp_get_blocktime
-
- function kmp_get_library() bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) kmp_get_library
- end function kmp_get_library
-
- function kmp_set_affinity(mask) bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) kmp_set_affinity
- integer (kind=kmp_affinity_mask_kind) mask
- end function kmp_set_affinity
-
- function kmp_get_affinity(mask) bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) kmp_get_affinity
- integer (kind=kmp_affinity_mask_kind) mask
- end function kmp_get_affinity
-
- function kmp_get_affinity_max_proc() bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) kmp_get_affinity_max_proc
- end function kmp_get_affinity_max_proc
-
- subroutine kmp_create_affinity_mask(mask) bind(c)
- use omp_lib_kinds
- integer (kind=kmp_affinity_mask_kind) mask
- end subroutine kmp_create_affinity_mask
-
- subroutine kmp_destroy_affinity_mask(mask) bind(c)
- use omp_lib_kinds
- integer (kind=kmp_affinity_mask_kind) mask
- end subroutine kmp_destroy_affinity_mask
-
- function kmp_set_affinity_mask_proc(proc, mask) bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) kmp_set_affinity_mask_proc
- integer (kind=omp_integer_kind), value :: proc
- integer (kind=kmp_affinity_mask_kind) mask
- end function kmp_set_affinity_mask_proc
-
- function kmp_unset_affinity_mask_proc(proc, mask) bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) kmp_unset_affinity_mask_proc
- integer (kind=omp_integer_kind), value :: proc
- integer (kind=kmp_affinity_mask_kind) mask
- end function kmp_unset_affinity_mask_proc
-
- function kmp_get_affinity_mask_proc(proc, mask) bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) kmp_get_affinity_mask_proc
- integer (kind=omp_integer_kind), value :: proc
- integer (kind=kmp_affinity_mask_kind) mask
- end function kmp_get_affinity_mask_proc
-
- function kmp_malloc(size) bind(c)
- use omp_lib_kinds
- integer (kind=kmp_pointer_kind) kmp_malloc
- integer (kind=kmp_size_t_kind), value :: size
- end function kmp_malloc
-
- function kmp_aligned_malloc(size, alignment) bind(c)
- use omp_lib_kinds
- integer (kind=kmp_pointer_kind) kmp_aligned_malloc
- integer (kind=kmp_size_t_kind), value :: size
- integer (kind=kmp_size_t_kind), value :: alignment
- end function kmp_aligned_malloc
-
- function kmp_calloc(nelem, elsize) bind(c)
- use omp_lib_kinds
- integer (kind=kmp_pointer_kind) kmp_calloc
- integer (kind=kmp_size_t_kind), value :: nelem
- integer (kind=kmp_size_t_kind), value :: elsize
- end function kmp_calloc
-
- function kmp_realloc(ptr, size) bind(c)
- use omp_lib_kinds
- integer (kind=kmp_pointer_kind) kmp_realloc
- integer (kind=kmp_pointer_kind), value :: ptr
- integer (kind=kmp_size_t_kind), value :: size
- end function kmp_realloc
-
- subroutine kmp_free(ptr) bind(c)
- use omp_lib_kinds
- integer (kind=kmp_pointer_kind), value :: ptr
- end subroutine kmp_free
-
- subroutine kmp_set_warnings_on() bind(c)
- end subroutine kmp_set_warnings_on
-
- subroutine kmp_set_warnings_off() bind(c)
- end subroutine kmp_set_warnings_off
-
- function kmp_get_cancellation_status(cancelkind) bind(c)
- use omp_lib_kinds
- integer (kind=kmp_cancel_kind), value :: cancelkind
- logical (kind=omp_logical_kind) kmp_get_cancellation_status
- end function kmp_get_cancellation_status
-
- end interface
-
- end module omp_lib
diff --git a/runtime/src/include/40/omp_lib.h.var b/runtime/src/include/40/omp_lib.h.var
deleted file mode 100644
index 7c461a86de92..000000000000
--- a/runtime/src/include/40/omp_lib.h.var
+++ /dev/null
@@ -1,567 +0,0 @@
-! include/40/omp_lib.h.var
-
-!
-!//===----------------------------------------------------------------------===//
-!//
-!// The LLVM Compiler Infrastructure
-!//
-!// This file is dual licensed under the MIT and the University of Illinois Open
-!// Source Licenses. See LICENSE.txt for details.
-!//
-!//===----------------------------------------------------------------------===//
-!
-
-!***
-!*** Some of the directives for the following routine extend past column 72,
-!*** so process this file in 132-column mode.
-!***
-
-!DIR$ fixedformlinesize:132
-
- integer, parameter :: omp_integer_kind = 4
- integer, parameter :: omp_logical_kind = 4
- integer, parameter :: omp_real_kind = 4
- integer, parameter :: omp_lock_kind = int_ptr_kind()
- integer, parameter :: omp_nest_lock_kind = int_ptr_kind()
- integer, parameter :: omp_sched_kind = omp_integer_kind
- integer, parameter :: omp_proc_bind_kind = omp_integer_kind
- integer, parameter :: kmp_pointer_kind = int_ptr_kind()
- integer, parameter :: kmp_size_t_kind = int_ptr_kind()
- integer, parameter :: kmp_affinity_mask_kind = int_ptr_kind()
-
- integer (kind=omp_integer_kind), parameter :: openmp_version = @LIBOMP_OMP_YEAR_MONTH@
- integer (kind=omp_integer_kind), parameter :: kmp_version_major = @LIBOMP_VERSION_MAJOR@
- integer (kind=omp_integer_kind), parameter :: kmp_version_minor = @LIBOMP_VERSION_MINOR@
- integer (kind=omp_integer_kind), parameter :: kmp_version_build = @LIBOMP_VERSION_BUILD@
- character(*) kmp_build_date
- parameter( kmp_build_date = '@LIBOMP_BUILD_DATE@' )
-
- integer(kind=omp_sched_kind), parameter :: omp_sched_static = 1
- integer(kind=omp_sched_kind), parameter :: omp_sched_dynamic = 2
- integer(kind=omp_sched_kind), parameter :: omp_sched_guided = 3
- integer(kind=omp_sched_kind), parameter :: omp_sched_auto = 4
-
- integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_false = 0
- integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_true = 1
- integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_master = 2
- integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_close = 3
- integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_spread = 4
-
- interface
-
-! ***
-! *** omp_* entry points
-! ***
-
- subroutine omp_set_num_threads(num_threads) bind(c)
- import
- integer (kind=omp_integer_kind), value :: num_threads
- end subroutine omp_set_num_threads
-
- subroutine omp_set_dynamic(dynamic_threads) bind(c)
- import
- logical (kind=omp_logical_kind), value :: dynamic_threads
- end subroutine omp_set_dynamic
-
- subroutine omp_set_nested(nested) bind(c)
- import
- logical (kind=omp_logical_kind), value :: nested
- end subroutine omp_set_nested
-
- function omp_get_num_threads() bind(c)
- import
- integer (kind=omp_integer_kind) omp_get_num_threads
- end function omp_get_num_threads
-
- function omp_get_max_threads() bind(c)
- import
- integer (kind=omp_integer_kind) omp_get_max_threads
- end function omp_get_max_threads
-
- function omp_get_thread_num() bind(c)
- import
- integer (kind=omp_integer_kind) omp_get_thread_num
- end function omp_get_thread_num
-
- function omp_get_num_procs() bind(c)
- import
- integer (kind=omp_integer_kind) omp_get_num_procs
- end function omp_get_num_procs
-
- function omp_in_parallel() bind(c)
- import
- logical (kind=omp_logical_kind) omp_in_parallel
- end function omp_in_parallel
-
- function omp_in_final() bind(c)
- import
- logical (kind=omp_logical_kind) omp_in_final
- end function omp_in_final
-
- function omp_get_dynamic() bind(c)
- import
- logical (kind=omp_logical_kind) omp_get_dynamic
- end function omp_get_dynamic
-
- function omp_get_nested() bind(c)
- import
- logical (kind=omp_logical_kind) omp_get_nested
- end function omp_get_nested
-
- function omp_get_thread_limit() bind(c)
- import
- integer (kind=omp_integer_kind) omp_get_thread_limit
- end function omp_get_thread_limit
-
- subroutine omp_set_max_active_levels(max_levels) bind(c)
- import
- integer (kind=omp_integer_kind), value :: max_levels
- end subroutine omp_set_max_active_levels
-
- function omp_get_max_active_levels() bind(c)
- import
- integer (kind=omp_integer_kind) omp_get_max_active_levels
- end function omp_get_max_active_levels
-
- function omp_get_level() bind(c)
- import
- integer (kind=omp_integer_kind) omp_get_level
- end function omp_get_level
-
- function omp_get_active_level() bind(c)
- import
- integer (kind=omp_integer_kind) omp_get_active_level
- end function omp_get_active_level
-
- function omp_get_ancestor_thread_num(level) bind(c)
- import
- integer (kind=omp_integer_kind) omp_get_ancestor_thread_num
- integer (kind=omp_integer_kind), value :: level
- end function omp_get_ancestor_thread_num
-
- function omp_get_team_size(level) bind(c)
- import
- integer (kind=omp_integer_kind) omp_get_team_size
- integer (kind=omp_integer_kind), value :: level
- end function omp_get_team_size
-
- subroutine omp_set_schedule(kind, chunk_size) bind(c)
- import
- integer (kind=omp_sched_kind), value :: kind
- integer (kind=omp_integer_kind), value :: chunk_size
- end subroutine omp_set_schedule
-
- subroutine omp_get_schedule(kind, chunk_size) bind(c)
- import
- integer (kind=omp_sched_kind) kind
- integer (kind=omp_integer_kind) chunk_size
- end subroutine omp_get_schedule
-
- function omp_get_proc_bind() bind(c)
- import
- integer (kind=omp_proc_bind_kind) omp_get_proc_bind
- end function omp_get_proc_bind
-
- function omp_get_wtime() bind(c)
- double precision omp_get_wtime
- end function omp_get_wtime
-
- function omp_get_wtick() bind(c)
- double precision omp_get_wtick
- end function omp_get_wtick
-
- function omp_get_default_device() bind(c)
- import
- integer (kind=omp_integer_kind) omp_get_default_device
- end function omp_get_default_device
-
- subroutine omp_set_default_device(device_num) bind(c)
- import
- integer (kind=omp_integer_kind), value :: device_num
- end subroutine omp_set_default_device
-
- function omp_get_num_devices() bind(c)
- import
- integer (kind=omp_integer_kind) omp_get_num_devices
- end function omp_get_num_devices
-
- function omp_get_num_teams() bind(c)
- import
- integer (kind=omp_integer_kind) omp_get_num_teams
- end function omp_get_num_teams
-
- function omp_get_team_num() bind(c)
- import
- integer (kind=omp_integer_kind) omp_get_team_num
- end function omp_get_team_num
-
- function omp_is_initial_device() bind(c)
- import
- logical (kind=omp_logical_kind) omp_is_initial_device
- end function omp_is_initial_device
-
- subroutine omp_init_lock(svar) bind(c)
-!DIR$ IF(__INTEL_COMPILER.GE.1400)
-!DIR$ attributes known_intrinsic :: omp_init_lock
-!DIR$ ENDIF
- import
- integer (kind=omp_lock_kind) svar
- end subroutine omp_init_lock
-
- subroutine omp_destroy_lock(svar) bind(c)
-!DIR$ IF(__INTEL_COMPILER.GE.1400)
-!DIR$ attributes known_intrinsic :: omp_destroy_lock
-!DIR$ ENDIF
- import
- integer (kind=omp_lock_kind) svar
- end subroutine omp_destroy_lock
-
- subroutine omp_set_lock(svar) bind(c)
-!DIR$ IF(__INTEL_COMPILER.GE.1400)
-!DIR$ attributes known_intrinsic :: omp_set_lock
-!DIR$ ENDIF
- import
- integer (kind=omp_lock_kind) svar
- end subroutine omp_set_lock
-
- subroutine omp_unset_lock(svar) bind(c)
-!DIR$ IF(__INTEL_COMPILER.GE.1400)
-!DIR$ attributes known_intrinsic :: omp_unset_lock
-!DIR$ ENDIF
- import
- integer (kind=omp_lock_kind) svar
- end subroutine omp_unset_lock
-
- function omp_test_lock(svar) bind(c)
-!DIR$ IF(__INTEL_COMPILER.GE.1400)
-!DIR$ attributes known_intrinsic :: omp_test_lock
-!DIR$ ENDIF
- import
- logical (kind=omp_logical_kind) omp_test_lock
- integer (kind=omp_lock_kind) svar
- end function omp_test_lock
-
- subroutine omp_init_nest_lock(nvar) bind(c)
-!DIR$ IF(__INTEL_COMPILER.GE.1400)
-!DIR$ attributes known_intrinsic :: omp_init_nest_lock
-!DIR$ ENDIF
- import
- integer (kind=omp_nest_lock_kind) nvar
- end subroutine omp_init_nest_lock
-
- subroutine omp_destroy_nest_lock(nvar) bind(c)
-!DIR$ IF(__INTEL_COMPILER.GE.1400)
-!DIR$ attributes known_intrinsic :: omp_destroy_nest_lock
-!DIR$ ENDIF
- import
- integer (kind=omp_nest_lock_kind) nvar
- end subroutine omp_destroy_nest_lock
-
- subroutine omp_set_nest_lock(nvar) bind(c)
-!DIR$ IF(__INTEL_COMPILER.GE.1400)
-!DIR$ attributes known_intrinsic :: omp_set_nest_lock
-!DIR$ ENDIF
- import
- integer (kind=omp_nest_lock_kind) nvar
- end subroutine omp_set_nest_lock
-
- subroutine omp_unset_nest_lock(nvar) bind(c)
-!DIR$ IF(__INTEL_COMPILER.GE.1400)
-!DIR$ attributes known_intrinsic :: omp_unset_nest_lock
-!DIR$ ENDIF
- import
- integer (kind=omp_nest_lock_kind) nvar
- end subroutine omp_unset_nest_lock
-
- function omp_test_nest_lock(nvar) bind(c)
-!DIR$ IF(__INTEL_COMPILER.GE.1400)
-!DIR$ attributes known_intrinsic :: omp_test_nest_lock
-!DIR$ ENDIF
- import
- integer (kind=omp_integer_kind) omp_test_nest_lock
- integer (kind=omp_nest_lock_kind) nvar
- end function omp_test_nest_lock
-
-! ***
-! *** kmp_* entry points
-! ***
-
- subroutine kmp_set_stacksize(size) bind(c)
- import
- integer (kind=omp_integer_kind), value :: size
- end subroutine kmp_set_stacksize
-
- subroutine kmp_set_stacksize_s(size) bind(c)
- import
- integer (kind=kmp_size_t_kind), value :: size
- end subroutine kmp_set_stacksize_s
-
- subroutine kmp_set_blocktime(msec) bind(c)
- import
- integer (kind=omp_integer_kind), value :: msec
- end subroutine kmp_set_blocktime
-
- subroutine kmp_set_library_serial() bind(c)
- end subroutine kmp_set_library_serial
-
- subroutine kmp_set_library_turnaround() bind(c)
- end subroutine kmp_set_library_turnaround
-
- subroutine kmp_set_library_throughput() bind(c)
- end subroutine kmp_set_library_throughput
-
- subroutine kmp_set_library(libnum) bind(c)
- import
- integer (kind=omp_integer_kind), value :: libnum
- end subroutine kmp_set_library
-
- subroutine kmp_set_defaults(string) bind(c)
- character string(*)
- end subroutine kmp_set_defaults
-
- function kmp_get_stacksize() bind(c)
- import
- integer (kind=omp_integer_kind) kmp_get_stacksize
- end function kmp_get_stacksize
-
- function kmp_get_stacksize_s() bind(c)
- import
- integer (kind=kmp_size_t_kind) kmp_get_stacksize_s
- end function kmp_get_stacksize_s
-
- function kmp_get_blocktime() bind(c)
- import
- integer (kind=omp_integer_kind) kmp_get_blocktime
- end function kmp_get_blocktime
-
- function kmp_get_library() bind(c)
- import
- integer (kind=omp_integer_kind) kmp_get_library
- end function kmp_get_library
-
- function kmp_set_affinity(mask) bind(c)
- import
- integer (kind=omp_integer_kind) kmp_set_affinity
- integer (kind=kmp_affinity_mask_kind) mask
- end function kmp_set_affinity
-
- function kmp_get_affinity(mask) bind(c)
- import
- integer (kind=omp_integer_kind) kmp_get_affinity
- integer (kind=kmp_affinity_mask_kind) mask
- end function kmp_get_affinity
-
- function kmp_get_affinity_max_proc() bind(c)
- import
- integer (kind=omp_integer_kind) kmp_get_affinity_max_proc
- end function kmp_get_affinity_max_proc
-
- subroutine kmp_create_affinity_mask(mask) bind(c)
- import
- integer (kind=kmp_affinity_mask_kind) mask
- end subroutine kmp_create_affinity_mask
-
- subroutine kmp_destroy_affinity_mask(mask) bind(c)
- import
- integer (kind=kmp_affinity_mask_kind) mask
- end subroutine kmp_destroy_affinity_mask
-
- function kmp_set_affinity_mask_proc(proc, mask) bind(c)
- import
- integer (kind=omp_integer_kind) kmp_set_affinity_mask_proc
- integer (kind=omp_integer_kind), value :: proc
- integer (kind=kmp_affinity_mask_kind) mask
- end function kmp_set_affinity_mask_proc
-
- function kmp_unset_affinity_mask_proc(proc, mask) bind(c)
- import
- integer (kind=omp_integer_kind) kmp_unset_affinity_mask_proc
- integer (kind=omp_integer_kind), value :: proc
- integer (kind=kmp_affinity_mask_kind) mask
- end function kmp_unset_affinity_mask_proc
-
- function kmp_get_affinity_mask_proc(proc, mask) bind(c)
- import
- integer (kind=omp_integer_kind) kmp_get_affinity_mask_proc
- integer (kind=omp_integer_kind), value :: proc
- integer (kind=kmp_affinity_mask_kind) mask
- end function kmp_get_affinity_mask_proc
-
- function kmp_malloc(size) bind(c)
- import
- integer (kind=kmp_pointer_kind) kmp_malloc
- integer (kind=kmp_size_t_kind), value :: size
- end function kmp_malloc
-
- function kmp_aligned_malloc(size, alignment) bind(c)
- import
- integer (kind=kmp_pointer_kind) kmp_aligned_malloc
- integer (kind=kmp_size_t_kind), value :: size
- integer (kind=kmp_size_t_kind), value :: alignment
- end function kmp_aligned_malloc
-
- function kmp_calloc(nelem, elsize) bind(c)
- import
- integer (kind=kmp_pointer_kind) kmp_calloc
- integer (kind=kmp_size_t_kind), value :: nelem
- integer (kind=kmp_size_t_kind), value :: elsize
- end function kmp_calloc
-
- function kmp_realloc(ptr, size) bind(c)
- import
- integer (kind=kmp_pointer_kind) kmp_realloc
- integer (kind=kmp_pointer_kind), value :: ptr
- integer (kind=kmp_size_t_kind), value :: size
- end function kmp_realloc
-
- subroutine kmp_free(ptr) bind(c)
- import
- integer (kind=kmp_pointer_kind), value :: ptr
- end subroutine kmp_free
-
- subroutine kmp_set_warnings_on() bind(c)
- end subroutine kmp_set_warnings_on
-
- subroutine kmp_set_warnings_off() bind(c)
- end subroutine kmp_set_warnings_off
-
- end interface
-
-!DIR$ IF DEFINED (__INTEL_OFFLOAD)
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_set_num_threads
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_set_dynamic
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_set_nested
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_num_threads
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_max_threads
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_thread_num
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_num_procs
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_in_parallel
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_in_final
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_dynamic
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_nested
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_thread_limit
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_set_max_active_levels
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_max_active_levels
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_level
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_active_level
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_ancestor_thread_num
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_team_size
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_set_schedule
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_schedule
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_proc_bind
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_wtime
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_wtick
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_default_device
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_set_default_device
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_is_initial_device
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_num_devices
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_num_teams
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_team_num
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_init_lock
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_destroy_lock
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_set_lock
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_unset_lock
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_test_lock
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_init_nest_lock
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_destroy_nest_lock
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_set_nest_lock
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_unset_nest_lock
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_test_nest_lock
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_set_stacksize
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_set_stacksize_s
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_set_blocktime
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_set_library_serial
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_set_library_turnaround
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_set_library_throughput
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_set_library
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_set_defaults
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_get_stacksize
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_get_stacksize_s
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_get_blocktime
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_get_library
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_set_affinity
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_get_affinity
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_get_affinity_max_proc
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_create_affinity_mask
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_destroy_affinity_mask
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_set_affinity_mask_proc
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_unset_affinity_mask_proc
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_get_affinity_mask_proc
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_malloc
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_aligned_malloc
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_calloc
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_realloc
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_free
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_set_warnings_on
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_set_warnings_off
-
-!DIR$ IF(__INTEL_COMPILER.GE.1400)
-!$omp declare target(omp_set_num_threads )
-!$omp declare target(omp_set_dynamic )
-!$omp declare target(omp_set_nested )
-!$omp declare target(omp_get_num_threads )
-!$omp declare target(omp_get_max_threads )
-!$omp declare target(omp_get_thread_num )
-!$omp declare target(omp_get_num_procs )
-!$omp declare target(omp_in_parallel )
-!$omp declare target(omp_in_final )
-!$omp declare target(omp_get_dynamic )
-!$omp declare target(omp_get_nested )
-!$omp declare target(omp_get_thread_limit )
-!$omp declare target(omp_set_max_active_levels )
-!$omp declare target(omp_get_max_active_levels )
-!$omp declare target(omp_get_level )
-!$omp declare target(omp_get_active_level )
-!$omp declare target(omp_get_ancestor_thread_num )
-!$omp declare target(omp_get_team_size )
-!$omp declare target(omp_set_schedule )
-!$omp declare target(omp_get_schedule )
-!$omp declare target(omp_get_proc_bind )
-!$omp declare target(omp_get_wtime )
-!$omp declare target(omp_get_wtick )
-!$omp declare target(omp_get_default_device )
-!$omp declare target(omp_set_default_device )
-!$omp declare target(omp_is_initial_device )
-!$omp declare target(omp_get_num_devices )
-!$omp declare target(omp_get_num_teams )
-!$omp declare target(omp_get_team_num )
-!$omp declare target(omp_init_lock )
-!$omp declare target(omp_destroy_lock )
-!$omp declare target(omp_set_lock )
-!$omp declare target(omp_unset_lock )
-!$omp declare target(omp_test_lock )
-!$omp declare target(omp_init_nest_lock )
-!$omp declare target(omp_destroy_nest_lock )
-!$omp declare target(omp_set_nest_lock )
-!$omp declare target(omp_unset_nest_lock )
-!$omp declare target(omp_test_nest_lock )
-!$omp declare target(kmp_set_stacksize )
-!$omp declare target(kmp_set_stacksize_s )
-!$omp declare target(kmp_set_blocktime )
-!$omp declare target(kmp_set_library_serial )
-!$omp declare target(kmp_set_library_turnaround )
-!$omp declare target(kmp_set_library_throughput )
-!$omp declare target(kmp_set_library )
-!$omp declare target(kmp_set_defaults )
-!$omp declare target(kmp_get_stacksize )
-!$omp declare target(kmp_get_stacksize_s )
-!$omp declare target(kmp_get_blocktime )
-!$omp declare target(kmp_get_library )
-!$omp declare target(kmp_set_affinity )
-!$omp declare target(kmp_get_affinity )
-!$omp declare target(kmp_get_affinity_max_proc )
-!$omp declare target(kmp_create_affinity_mask )
-!$omp declare target(kmp_destroy_affinity_mask )
-!$omp declare target(kmp_set_affinity_mask_proc )
-!$omp declare target(kmp_unset_affinity_mask_proc )
-!$omp declare target(kmp_get_affinity_mask_proc )
-!$omp declare target(kmp_malloc )
-!$omp declare target(kmp_aligned_malloc )
-!$omp declare target(kmp_calloc )
-!$omp declare target(kmp_realloc )
-!$omp declare target(kmp_free )
-!$omp declare target(kmp_set_warnings_on )
-!$omp declare target(kmp_set_warnings_off )
-!DIR$ ENDIF
-!DIR$ ENDIF
-
diff --git a/runtime/src/include/45/omp.h.var b/runtime/src/include/45/omp.h.var
deleted file mode 100644
index f30da51d8139..000000000000
--- a/runtime/src/include/45/omp.h.var
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
- * include/45/omp.h.var
- */
-
-
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.txt for details.
-//
-//===----------------------------------------------------------------------===//
-
-
-#ifndef __OMP_H
-# define __OMP_H
-
-# define KMP_VERSION_MAJOR @LIBOMP_VERSION_MAJOR@
-# define KMP_VERSION_MINOR @LIBOMP_VERSION_MINOR@
-# define KMP_VERSION_BUILD @LIBOMP_VERSION_BUILD@
-# define KMP_BUILD_DATE "@LIBOMP_BUILD_DATE@"
-
-# ifdef __cplusplus
- extern "C" {
-# endif
-
-# if defined(_WIN32)
-# define __KAI_KMPC_CONVENTION __cdecl
-# else
-# define __KAI_KMPC_CONVENTION
-# endif
-
- /* schedule kind constants */
- typedef enum omp_sched_t {
- omp_sched_static = 1,
- omp_sched_dynamic = 2,
- omp_sched_guided = 3,
- omp_sched_auto = 4
- } omp_sched_t;
-
- /* set API functions */
- extern void __KAI_KMPC_CONVENTION omp_set_num_threads (int);
- extern void __KAI_KMPC_CONVENTION omp_set_dynamic (int);
- extern void __KAI_KMPC_CONVENTION omp_set_nested (int);
- extern void __KAI_KMPC_CONVENTION omp_set_max_active_levels (int);
- extern void __KAI_KMPC_CONVENTION omp_set_schedule (omp_sched_t, int);
-
- /* query API functions */
- extern int __KAI_KMPC_CONVENTION omp_get_num_threads (void);
- extern int __KAI_KMPC_CONVENTION omp_get_dynamic (void);
- extern int __KAI_KMPC_CONVENTION omp_get_nested (void);
- extern int __KAI_KMPC_CONVENTION omp_get_max_threads (void);
- extern int __KAI_KMPC_CONVENTION omp_get_thread_num (void);
- extern int __KAI_KMPC_CONVENTION omp_get_num_procs (void);
- extern int __KAI_KMPC_CONVENTION omp_in_parallel (void);
- extern int __KAI_KMPC_CONVENTION omp_in_final (void);
- extern int __KAI_KMPC_CONVENTION omp_get_active_level (void);
- extern int __KAI_KMPC_CONVENTION omp_get_level (void);
- extern int __KAI_KMPC_CONVENTION omp_get_ancestor_thread_num (int);
- extern int __KAI_KMPC_CONVENTION omp_get_team_size (int);
- extern int __KAI_KMPC_CONVENTION omp_get_thread_limit (void);
- extern int __KAI_KMPC_CONVENTION omp_get_max_active_levels (void);
- extern void __KAI_KMPC_CONVENTION omp_get_schedule (omp_sched_t *, int *);
- extern int __KAI_KMPC_CONVENTION omp_get_max_task_priority (void);
-
- /* lock API functions */
- typedef struct omp_lock_t {
- void * _lk;
- } omp_lock_t;
-
- extern void __KAI_KMPC_CONVENTION omp_init_lock (omp_lock_t *);
- extern void __KAI_KMPC_CONVENTION omp_set_lock (omp_lock_t *);
- extern void __KAI_KMPC_CONVENTION omp_unset_lock (omp_lock_t *);
- extern void __KAI_KMPC_CONVENTION omp_destroy_lock (omp_lock_t *);
- extern int __KAI_KMPC_CONVENTION omp_test_lock (omp_lock_t *);
-
- /* nested lock API functions */
- typedef struct omp_nest_lock_t {
- void * _lk;
- } omp_nest_lock_t;
-
- extern void __KAI_KMPC_CONVENTION omp_init_nest_lock (omp_nest_lock_t *);
- extern void __KAI_KMPC_CONVENTION omp_set_nest_lock (omp_nest_lock_t *);
- extern void __KAI_KMPC_CONVENTION omp_unset_nest_lock (omp_nest_lock_t *);
- extern void __KAI_KMPC_CONVENTION omp_destroy_nest_lock (omp_nest_lock_t *);
- extern int __KAI_KMPC_CONVENTION omp_test_nest_lock (omp_nest_lock_t *);
-
- /* lock hint type for dynamic user lock */
- typedef enum omp_lock_hint_t {
- omp_lock_hint_none = 0,
- omp_lock_hint_uncontended = 1,
- omp_lock_hint_contended = (1<<1 ),
- omp_lock_hint_nonspeculative = (1<<2 ),
- omp_lock_hint_speculative = (1<<3 ),
- kmp_lock_hint_hle = (1<<16),
- kmp_lock_hint_rtm = (1<<17),
- kmp_lock_hint_adaptive = (1<<18)
- } omp_lock_hint_t;
-
- /* hinted lock initializers */
- extern void __KAI_KMPC_CONVENTION omp_init_lock_with_hint(omp_lock_t *, omp_lock_hint_t);
- extern void __KAI_KMPC_CONVENTION omp_init_nest_lock_with_hint(omp_nest_lock_t *, omp_lock_hint_t);
-
- /* time API functions */
- extern double __KAI_KMPC_CONVENTION omp_get_wtime (void);
- extern double __KAI_KMPC_CONVENTION omp_get_wtick (void);
-
- /* OpenMP 4.0 */
- extern int __KAI_KMPC_CONVENTION omp_get_default_device (void);
- extern void __KAI_KMPC_CONVENTION omp_set_default_device (int);
- extern int __KAI_KMPC_CONVENTION omp_is_initial_device (void);
- extern int __KAI_KMPC_CONVENTION omp_get_num_devices (void);
- extern int __KAI_KMPC_CONVENTION omp_get_num_teams (void);
- extern int __KAI_KMPC_CONVENTION omp_get_team_num (void);
- extern int __KAI_KMPC_CONVENTION omp_get_cancellation (void);
-
-# include <stdlib.h>
- /* OpenMP 4.5 */
- extern int __KAI_KMPC_CONVENTION omp_get_initial_device (void);
- extern void* __KAI_KMPC_CONVENTION omp_target_alloc(size_t, int);
- extern void __KAI_KMPC_CONVENTION omp_target_free(void *, int);
- extern int __KAI_KMPC_CONVENTION omp_target_is_present(void *, int);
- extern int __KAI_KMPC_CONVENTION omp_target_memcpy(void *, void *, size_t, size_t, size_t, int, int);
- extern int __KAI_KMPC_CONVENTION omp_target_memcpy_rect(void *, void *, size_t, int, const size_t *,
- const size_t *, const size_t *, const size_t *, const size_t *, int, int);
- extern int __KAI_KMPC_CONVENTION omp_target_associate_ptr(void *, void *, size_t, size_t, int);
- extern int __KAI_KMPC_CONVENTION omp_target_disassociate_ptr(void *, int);
-
- /* kmp API functions */
- extern int __KAI_KMPC_CONVENTION kmp_get_stacksize (void);
- extern void __KAI_KMPC_CONVENTION kmp_set_stacksize (int);
- extern size_t __KAI_KMPC_CONVENTION kmp_get_stacksize_s (void);
- extern void __KAI_KMPC_CONVENTION kmp_set_stacksize_s (size_t);
- extern int __KAI_KMPC_CONVENTION kmp_get_blocktime (void);
- extern int __KAI_KMPC_CONVENTION kmp_get_library (void);
- extern void __KAI_KMPC_CONVENTION kmp_set_blocktime (int);
- extern void __KAI_KMPC_CONVENTION kmp_set_library (int);
- extern void __KAI_KMPC_CONVENTION kmp_set_library_serial (void);
- extern void __KAI_KMPC_CONVENTION kmp_set_library_turnaround (void);
- extern void __KAI_KMPC_CONVENTION kmp_set_library_throughput (void);
- extern void __KAI_KMPC_CONVENTION kmp_set_defaults (char const *);
- extern void __KAI_KMPC_CONVENTION kmp_set_disp_num_buffers (int);
-
- /* Intel affinity API */
- typedef void * kmp_affinity_mask_t;
-
- extern int __KAI_KMPC_CONVENTION kmp_set_affinity (kmp_affinity_mask_t *);
- extern int __KAI_KMPC_CONVENTION kmp_get_affinity (kmp_affinity_mask_t *);
- extern int __KAI_KMPC_CONVENTION kmp_get_affinity_max_proc (void);
- extern void __KAI_KMPC_CONVENTION kmp_create_affinity_mask (kmp_affinity_mask_t *);
- extern void __KAI_KMPC_CONVENTION kmp_destroy_affinity_mask (kmp_affinity_mask_t *);
- extern int __KAI_KMPC_CONVENTION kmp_set_affinity_mask_proc (int, kmp_affinity_mask_t *);
- extern int __KAI_KMPC_CONVENTION kmp_unset_affinity_mask_proc (int, kmp_affinity_mask_t *);
- extern int __KAI_KMPC_CONVENTION kmp_get_affinity_mask_proc (int, kmp_affinity_mask_t *);
-
- /* OpenMP 4.0 affinity API */
- typedef enum omp_proc_bind_t {
- omp_proc_bind_false = 0,
- omp_proc_bind_true = 1,
- omp_proc_bind_master = 2,
- omp_proc_bind_close = 3,
- omp_proc_bind_spread = 4
- } omp_proc_bind_t;
-
- extern omp_proc_bind_t __KAI_KMPC_CONVENTION omp_get_proc_bind (void);
-
- /* OpenMP 4.5 affinity API */
- extern int __KAI_KMPC_CONVENTION omp_get_num_places (void);
- extern int __KAI_KMPC_CONVENTION omp_get_place_num_procs (int);
- extern void __KAI_KMPC_CONVENTION omp_get_place_proc_ids (int, int *);
- extern int __KAI_KMPC_CONVENTION omp_get_place_num (void);
- extern int __KAI_KMPC_CONVENTION omp_get_partition_num_places (void);
- extern void __KAI_KMPC_CONVENTION omp_get_partition_place_nums (int *);
-
- extern void * __KAI_KMPC_CONVENTION kmp_malloc (size_t);
- extern void * __KAI_KMPC_CONVENTION kmp_aligned_malloc (size_t, size_t);
- extern void * __KAI_KMPC_CONVENTION kmp_calloc (size_t, size_t);
- extern void * __KAI_KMPC_CONVENTION kmp_realloc (void *, size_t);
- extern void __KAI_KMPC_CONVENTION kmp_free (void *);
-
- extern void __KAI_KMPC_CONVENTION kmp_set_warnings_on(void);
- extern void __KAI_KMPC_CONVENTION kmp_set_warnings_off(void);
-
-# undef __KAI_KMPC_CONVENTION
-
- /* Warning:
- The following typedefs are not standard, deprecated and will be removed in a future release.
- */
- typedef int omp_int_t;
- typedef double omp_wtime_t;
-
-# ifdef __cplusplus
- }
-# endif
-
-#endif /* __OMP_H */
diff --git a/runtime/src/include/45/omp_lib.f.var b/runtime/src/include/45/omp_lib.f.var
deleted file mode 100644
index 44e7cc2cdcec..000000000000
--- a/runtime/src/include/45/omp_lib.f.var
+++ /dev/null
@@ -1,861 +0,0 @@
-! include/45/omp_lib.f.var
-
-!
-!//===----------------------------------------------------------------------===//
-!//
-!// The LLVM Compiler Infrastructure
-!//
-!// This file is dual licensed under the MIT and the University of Illinois Open
-!// Source Licenses. See LICENSE.txt for details.
-!//
-!//===----------------------------------------------------------------------===//
-!
-
-!***
-!*** Some of the directives for the following routine extend past column 72,
-!*** so process this file in 132-column mode.
-!***
-
-!dec$ fixedformlinesize:132
-
- module omp_lib_kinds
-
- integer, parameter :: omp_integer_kind = 4
- integer, parameter :: omp_logical_kind = 4
- integer, parameter :: omp_real_kind = 4
- integer, parameter :: omp_lock_kind = int_ptr_kind()
- integer, parameter :: omp_nest_lock_kind = int_ptr_kind()
- integer, parameter :: omp_sched_kind = omp_integer_kind
- integer, parameter :: omp_proc_bind_kind = omp_integer_kind
- integer, parameter :: kmp_pointer_kind = int_ptr_kind()
- integer, parameter :: kmp_size_t_kind = int_ptr_kind()
- integer, parameter :: kmp_affinity_mask_kind = int_ptr_kind()
- integer, parameter :: kmp_cancel_kind = omp_integer_kind
- integer, parameter :: omp_lock_hint_kind = omp_integer_kind
-
- end module omp_lib_kinds
-
- module omp_lib
-
- use omp_lib_kinds
-
- integer (kind=omp_integer_kind), parameter :: kmp_version_major = @LIBOMP_VERSION_MAJOR@
- integer (kind=omp_integer_kind), parameter :: kmp_version_minor = @LIBOMP_VERSION_MINOR@
- integer (kind=omp_integer_kind), parameter :: kmp_version_build = @LIBOMP_VERSION_BUILD@
- character(*), parameter :: kmp_build_date = '@LIBOMP_BUILD_DATE@'
- integer (kind=omp_integer_kind), parameter :: openmp_version = @LIBOMP_OMP_YEAR_MONTH@
-
- integer(kind=omp_sched_kind), parameter :: omp_sched_static = 1
- integer(kind=omp_sched_kind), parameter :: omp_sched_dynamic = 2
- integer(kind=omp_sched_kind), parameter :: omp_sched_guided = 3
- integer(kind=omp_sched_kind), parameter :: omp_sched_auto = 4
-
- integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_false = 0
- integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_true = 1
- integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_master = 2
- integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_close = 3
- integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_spread = 4
-
- integer (kind=kmp_cancel_kind), parameter :: kmp_cancel_parallel = 1
- integer (kind=kmp_cancel_kind), parameter :: kmp_cancel_loop = 2
- integer (kind=kmp_cancel_kind), parameter :: kmp_cancel_sections = 3
- integer (kind=kmp_cancel_kind), parameter :: kmp_cancel_taskgroup = 4
-
- integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_none = 0
- integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_uncontended = 1
- integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_contended = 2
- integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_nonspeculative = 4
- integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_speculative = 8
- integer (kind=omp_lock_hint_kind), parameter :: kmp_lock_hint_hle = 65536
- integer (kind=omp_lock_hint_kind), parameter :: kmp_lock_hint_rtm = 131072
- integer (kind=omp_lock_hint_kind), parameter :: kmp_lock_hint_adaptive = 262144
-
- interface
-
-! ***
-! *** omp_* entry points
-! ***
-
- subroutine omp_set_num_threads(num_threads)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) num_threads
- end subroutine omp_set_num_threads
-
- subroutine omp_set_dynamic(dynamic_threads)
- use omp_lib_kinds
- logical (kind=omp_logical_kind) dynamic_threads
- end subroutine omp_set_dynamic
-
- subroutine omp_set_nested(nested)
- use omp_lib_kinds
- logical (kind=omp_logical_kind) nested
- end subroutine omp_set_nested
-
- function omp_get_num_threads()
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_num_threads
- end function omp_get_num_threads
-
- function omp_get_max_threads()
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_max_threads
- end function omp_get_max_threads
-
- function omp_get_thread_num()
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_thread_num
- end function omp_get_thread_num
-
- function omp_get_num_procs()
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_num_procs
- end function omp_get_num_procs
-
- function omp_in_parallel()
- use omp_lib_kinds
- logical (kind=omp_logical_kind) omp_in_parallel
- end function omp_in_parallel
-
- function omp_in_final()
- use omp_lib_kinds
- logical (kind=omp_logical_kind) omp_in_final
- end function omp_in_final
-
- function omp_get_dynamic()
- use omp_lib_kinds
- logical (kind=omp_logical_kind) omp_get_dynamic
- end function omp_get_dynamic
-
- function omp_get_nested()
- use omp_lib_kinds
- logical (kind=omp_logical_kind) omp_get_nested
- end function omp_get_nested
-
- function omp_get_thread_limit()
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_thread_limit
- end function omp_get_thread_limit
-
- subroutine omp_set_max_active_levels(max_levels)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) max_levels
- end subroutine omp_set_max_active_levels
-
- function omp_get_max_active_levels()
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_max_active_levels
- end function omp_get_max_active_levels
-
- function omp_get_level()
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_level
- end function omp_get_level
-
- function omp_get_active_level()
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_active_level
- end function omp_get_active_level
-
- function omp_get_ancestor_thread_num(level)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) level
- integer (kind=omp_integer_kind) omp_get_ancestor_thread_num
- end function omp_get_ancestor_thread_num
-
- function omp_get_team_size(level)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) level
- integer (kind=omp_integer_kind) omp_get_team_size
- end function omp_get_team_size
-
- subroutine omp_set_schedule(kind, chunk_size)
- use omp_lib_kinds
- integer (kind=omp_sched_kind) kind
- integer (kind=omp_integer_kind) chunk_size
- end subroutine omp_set_schedule
-
- subroutine omp_get_schedule(kind, chunk_size)
- use omp_lib_kinds
- integer (kind=omp_sched_kind) kind
- integer (kind=omp_integer_kind) chunk_size
- end subroutine omp_get_schedule
-
- function omp_get_proc_bind()
- use omp_lib_kinds
- integer (kind=omp_proc_bind_kind) omp_get_proc_bind
- end function omp_get_proc_bind
-
- function omp_get_num_places()
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_num_places
- end function omp_get_num_places
-
- function omp_get_place_num_procs(place_num)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) place_num
- integer (kind=omp_integer_kind) omp_get_place_num_procs
- end function omp_get_place_num_procs
-
- subroutine omp_get_place_proc_ids(place_num, ids)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) place_num
- integer (kind=omp_integer_kind) ids(*)
- end subroutine omp_get_place_proc_ids
-
- function omp_get_place_num()
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_place_num
- end function omp_get_place_num
-
- function omp_get_partition_num_places()
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_partition_num_places
- end function omp_get_partition_num_places
-
- subroutine omp_get_partition_place_nums(place_nums)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) place_nums(*)
- end subroutine omp_get_partition_place_nums
-
- function omp_get_wtime()
- double precision omp_get_wtime
- end function omp_get_wtime
-
- function omp_get_wtick ()
- double precision omp_get_wtick
- end function omp_get_wtick
-
- function omp_get_default_device()
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_default_device
- end function omp_get_default_device
-
- subroutine omp_set_default_device(device_num)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) device_num
- end subroutine omp_set_default_device
-
- function omp_get_num_devices()
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_num_devices
- end function omp_get_num_devices
-
- function omp_get_num_teams()
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_num_teams
- end function omp_get_num_teams
-
- function omp_get_team_num()
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_team_num
- end function omp_get_team_num
-
- function omp_get_cancellation()
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_cancellation
- end function omp_get_cancellation
-
- function omp_is_initial_device()
- use omp_lib_kinds
- logical (kind=omp_logical_kind) omp_is_initial_device
- end function omp_is_initial_device
-
- function omp_get_initial_device()
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_initial_device
- end function omp_get_initial_device
-
- subroutine omp_init_lock(svar)
-!DIR$ IF(__INTEL_COMPILER.GE.1400)
-!DIR$ attributes known_intrinsic :: omp_init_lock
-!DIR$ ENDIF
- use omp_lib_kinds
- integer (kind=omp_lock_kind) svar
- end subroutine omp_init_lock
-
- subroutine omp_destroy_lock(svar)
-!DIR$ IF(__INTEL_COMPILER.GE.1400)
-!DIR$ attributes known_intrinsic :: omp_destroy_lock
-!DIR$ ENDIF
- use omp_lib_kinds
- integer (kind=omp_lock_kind) svar
- end subroutine omp_destroy_lock
-
- subroutine omp_set_lock(svar)
-!DIR$ IF(__INTEL_COMPILER.GE.1400)
-!DIR$ attributes known_intrinsic :: omp_set_lock
-!DIR$ ENDIF
- use omp_lib_kinds
- integer (kind=omp_lock_kind) svar
- end subroutine omp_set_lock
-
- subroutine omp_unset_lock(svar)
-!DIR$ IF(__INTEL_COMPILER.GE.1400)
-!DIR$ attributes known_intrinsic :: omp_unset_lock
-!DIR$ ENDIF
- use omp_lib_kinds
- integer (kind=omp_lock_kind) svar
- end subroutine omp_unset_lock
-
- function omp_test_lock(svar)
-!DIR$ IF(__INTEL_COMPILER.GE.1400)
-!DIR$ attributes known_intrinsic :: omp_test_lock
-!DIR$ ENDIF
- use omp_lib_kinds
- logical (kind=omp_logical_kind) omp_test_lock
- integer (kind=omp_lock_kind) svar
- end function omp_test_lock
-
- subroutine omp_init_nest_lock(nvar)
-!DIR$ IF(__INTEL_COMPILER.GE.1400)
-!DIR$ attributes known_intrinsic :: omp_init_nest_lock
-!DIR$ ENDIF
- use omp_lib_kinds
- integer (kind=omp_nest_lock_kind) nvar
- end subroutine omp_init_nest_lock
-
- subroutine omp_destroy_nest_lock(nvar)
-!DIR$ IF(__INTEL_COMPILER.GE.1400)
-!DIR$ attributes known_intrinsic :: omp_destroy_nest_lock
-!DIR$ ENDIF
- use omp_lib_kinds
- integer (kind=omp_nest_lock_kind) nvar
- end subroutine omp_destroy_nest_lock
-
- subroutine omp_set_nest_lock(nvar)
-!DIR$ IF(__INTEL_COMPILER.GE.1400)
-!DIR$ attributes known_intrinsic :: omp_set_nest_lock
-!DIR$ ENDIF
- use omp_lib_kinds
- integer (kind=omp_nest_lock_kind) nvar
- end subroutine omp_set_nest_lock
-
- subroutine omp_unset_nest_lock(nvar)
-!DIR$ IF(__INTEL_COMPILER.GE.1400)
-!DIR$ attributes known_intrinsic :: omp_unset_nest_lock
-!DIR$ ENDIF
- use omp_lib_kinds
- integer (kind=omp_nest_lock_kind) nvar
- end subroutine omp_unset_nest_lock
-
- function omp_test_nest_lock(nvar)
-!DIR$ IF(__INTEL_COMPILER.GE.1400)
-!DIR$ attributes known_intrinsic :: omp_test_nest_lock
-!DIR$ ENDIF
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_test_nest_lock
- integer (kind=omp_nest_lock_kind) nvar
- end function omp_test_nest_lock
-
- function omp_get_max_task_priority()
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_max_task_priority
- end function omp_get_max_task_priority
-
-! ***
-! *** kmp_* entry points
-! ***
-
- subroutine kmp_set_stacksize(size)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) size
- end subroutine kmp_set_stacksize
-
- subroutine kmp_set_stacksize_s(size)
- use omp_lib_kinds
- integer (kind=kmp_size_t_kind) size
- end subroutine kmp_set_stacksize_s
-
- subroutine kmp_set_blocktime(msec)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) msec
- end subroutine kmp_set_blocktime
-
- subroutine kmp_set_library_serial()
- end subroutine kmp_set_library_serial
-
- subroutine kmp_set_library_turnaround()
- end subroutine kmp_set_library_turnaround
-
- subroutine kmp_set_library_throughput()
- end subroutine kmp_set_library_throughput
-
- subroutine kmp_set_library(libnum)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) libnum
- end subroutine kmp_set_library
-
- subroutine kmp_set_defaults(string)
- character*(*) string
- end subroutine kmp_set_defaults
-
- function kmp_get_stacksize()
- use omp_lib_kinds
- integer (kind=omp_integer_kind) kmp_get_stacksize
- end function kmp_get_stacksize
-
- function kmp_get_stacksize_s()
- use omp_lib_kinds
- integer (kind=kmp_size_t_kind) kmp_get_stacksize_s
- end function kmp_get_stacksize_s
-
- function kmp_get_blocktime()
- use omp_lib_kinds
- integer (kind=omp_integer_kind) kmp_get_blocktime
- end function kmp_get_blocktime
-
- function kmp_get_library()
- use omp_lib_kinds
- integer (kind=omp_integer_kind) kmp_get_library
- end function kmp_get_library
-
- subroutine kmp_set_disp_num_buffers(num)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) num
- end subroutine kmp_set_disp_num_buffers
-
- function kmp_set_affinity(mask)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) kmp_set_affinity
- integer (kind=kmp_affinity_mask_kind) mask
- end function kmp_set_affinity
-
- function kmp_get_affinity(mask)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) kmp_get_affinity
- integer (kind=kmp_affinity_mask_kind) mask
- end function kmp_get_affinity
-
- function kmp_get_affinity_max_proc()
- use omp_lib_kinds
- integer (kind=omp_integer_kind) kmp_get_affinity_max_proc
- end function kmp_get_affinity_max_proc
-
- subroutine kmp_create_affinity_mask(mask)
- use omp_lib_kinds
- integer (kind=kmp_affinity_mask_kind) mask
- end subroutine kmp_create_affinity_mask
-
- subroutine kmp_destroy_affinity_mask(mask)
- use omp_lib_kinds
- integer (kind=kmp_affinity_mask_kind) mask
- end subroutine kmp_destroy_affinity_mask
-
- function kmp_set_affinity_mask_proc(proc, mask)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) kmp_set_affinity_mask_proc
- integer (kind=omp_integer_kind) proc
- integer (kind=kmp_affinity_mask_kind) mask
- end function kmp_set_affinity_mask_proc
-
- function kmp_unset_affinity_mask_proc(proc, mask)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) kmp_unset_affinity_mask_proc
- integer (kind=omp_integer_kind) proc
- integer (kind=kmp_affinity_mask_kind) mask
- end function kmp_unset_affinity_mask_proc
-
- function kmp_get_affinity_mask_proc(proc, mask)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) kmp_get_affinity_mask_proc
- integer (kind=omp_integer_kind) proc
- integer (kind=kmp_affinity_mask_kind) mask
- end function kmp_get_affinity_mask_proc
-
- function kmp_malloc(size)
- use omp_lib_kinds
- integer (kind=kmp_pointer_kind) kmp_malloc
- integer (kind=kmp_size_t_kind) size
- end function kmp_malloc
-
- function kmp_aligned_malloc(size, alignment)
- use omp_lib_kinds
- integer (kind=kmp_pointer_kind) kmp_aligned_malloc
- integer (kind=kmp_size_t_kind) size
- integer (kind=kmp_size_t_kind) alignment
- end function kmp_aligned_malloc
-
- function kmp_calloc(nelem, elsize)
- use omp_lib_kinds
- integer (kind=kmp_pointer_kind) kmp_calloc
- integer (kind=kmp_size_t_kind) nelem
- integer (kind=kmp_size_t_kind) elsize
- end function kmp_calloc
-
- function kmp_realloc(ptr, size)
- use omp_lib_kinds
- integer (kind=kmp_pointer_kind) kmp_realloc
- integer (kind=kmp_pointer_kind) ptr
- integer (kind=kmp_size_t_kind) size
- end function kmp_realloc
-
- subroutine kmp_free(ptr)
- use omp_lib_kinds
- integer (kind=kmp_pointer_kind) ptr
- end subroutine kmp_free
-
- subroutine kmp_set_warnings_on()
- end subroutine kmp_set_warnings_on
-
- subroutine kmp_set_warnings_off()
- end subroutine kmp_set_warnings_off
-
- function kmp_get_cancellation_status(cancelkind)
- use omp_lib_kinds
- integer (kind=kmp_cancel_kind) cancelkind
- logical (kind=omp_logical_kind) kmp_get_cancellation_status
- end function kmp_get_cancellation_status
-
- subroutine omp_init_lock_with_hint(svar, hint)
- use omp_lib_kinds
- integer (kind=omp_lock_kind) svar
- integer (kind=omp_lock_hint_kind) hint
- end subroutine omp_init_lock_with_hint
-
- subroutine omp_init_nest_lock_with_hint(nvar, hint)
- use omp_lib_kinds
- integer (kind=omp_nest_lock_kind) nvar
- integer (kind=omp_lock_hint_kind) hint
- end subroutine omp_init_nest_lock_with_hint
-
- end interface
-
-!dec$ if defined(_WIN32)
-!dec$ if defined(_WIN64) .or. defined(_M_AMD64)
-
-!***
-!*** The Fortran entry points must be in uppercase, even if the /Qlowercase
-!*** option is specified. The alias attribute ensures that the specified
-!*** string is used as the entry point.
-!***
-!*** On the Windows* OS IA-32 architecture, the Fortran entry points have an
-!*** underscore prepended. On the Windows* OS Intel(R) 64
-!*** architecture, no underscore is prepended.
-!***
-
-!dec$ attributes alias:'OMP_SET_NUM_THREADS' :: omp_set_num_threads
-!dec$ attributes alias:'OMP_SET_DYNAMIC' :: omp_set_dynamic
-!dec$ attributes alias:'OMP_SET_NESTED' :: omp_set_nested
-!dec$ attributes alias:'OMP_GET_NUM_THREADS' :: omp_get_num_threads
-!dec$ attributes alias:'OMP_GET_MAX_THREADS' :: omp_get_max_threads
-!dec$ attributes alias:'OMP_GET_THREAD_NUM' :: omp_get_thread_num
-!dec$ attributes alias:'OMP_GET_NUM_PROCS' :: omp_get_num_procs
-!dec$ attributes alias:'OMP_IN_PARALLEL' :: omp_in_parallel
-!dec$ attributes alias:'OMP_GET_DYNAMIC' :: omp_get_dynamic
-!dec$ attributes alias:'OMP_GET_NESTED' :: omp_get_nested
-!dec$ attributes alias:'OMP_GET_THREAD_LIMIT' :: omp_get_thread_limit
-!dec$ attributes alias:'OMP_SET_MAX_ACTIVE_LEVELS' :: omp_set_max_active_levels
-!dec$ attributes alias:'OMP_GET_MAX_ACTIVE_LEVELS' :: omp_get_max_active_levels
-!dec$ attributes alias:'OMP_GET_LEVEL' :: omp_get_level
-!dec$ attributes alias:'OMP_GET_ACTIVE_LEVEL' :: omp_get_active_level
-!dec$ attributes alias:'OMP_GET_ANCESTOR_THREAD_NUM' :: omp_get_ancestor_thread_num
-!dec$ attributes alias:'OMP_GET_TEAM_SIZE' :: omp_get_team_size
-!dec$ attributes alias:'OMP_SET_SCHEDULE' :: omp_set_schedule
-!dec$ attributes alias:'OMP_GET_SCHEDULE' :: omp_get_schedule
-!dec$ attributes alias:'OMP_GET_PROC_BIND' :: omp_get_proc_bind
-!dec$ attributes alias:'OMP_GET_WTIME' :: omp_get_wtime
-!dec$ attributes alias:'OMP_GET_WTICK' :: omp_get_wtick
-!dec$ attributes alias:'OMP_GET_DEFAULT_DEVICE' :: omp_get_default_device
-!dec$ attributes alias:'OMP_SET_DEFAULT_DEVICE' :: omp_set_default_device
-!dec$ attributes alias:'OMP_GET_NUM_DEVICES' :: omp_get_num_devices
-!dec$ attributes alias:'OMP_GET_NUM_TEAMS' :: omp_get_num_teams
-!dec$ attributes alias:'OMP_GET_TEAM_NUM' :: omp_get_team_num
-!dec$ attributes alias:'OMP_GET_CANCELLATION' :: omp_get_cancellation
-!dec$ attributes alias:'OMP_IS_INITIAL_DEVICE' :: omp_is_initial_device
-!dec$ attributes alias:'OMP_GET_INITIAL_DEVICE' :: omp_get_initial_device
-!dec$ attributes alias:'OMP_GET_MAX_TASK_PRIORITY' :: omp_get_max_task_priority
-
-!dec$ attributes alias:'omp_init_lock' :: omp_init_lock
-!dec$ attributes alias:'omp_init_lock_with_hint' :: omp_init_lock_with_hint
-!dec$ attributes alias:'omp_destroy_lock' :: omp_destroy_lock
-!dec$ attributes alias:'omp_set_lock' :: omp_set_lock
-!dec$ attributes alias:'omp_unset_lock' :: omp_unset_lock
-!dec$ attributes alias:'omp_test_lock' :: omp_test_lock
-!dec$ attributes alias:'omp_init_nest_lock' :: omp_init_nest_lock
-!dec$ attributes alias:'omp_init_nest_lock_with_hint' :: omp_init_nest_lock_with_hint
-!dec$ attributes alias:'omp_destroy_nest_lock' :: omp_destroy_nest_lock
-!dec$ attributes alias:'omp_set_nest_lock' :: omp_set_nest_lock
-!dec$ attributes alias:'omp_unset_nest_lock' :: omp_unset_nest_lock
-!dec$ attributes alias:'omp_test_nest_lock' :: omp_test_nest_lock
-
-!dec$ attributes alias:'KMP_SET_STACKSIZE'::kmp_set_stacksize
-!dec$ attributes alias:'KMP_SET_STACKSIZE_S'::kmp_set_stacksize_s
-!dec$ attributes alias:'KMP_SET_BLOCKTIME'::kmp_set_blocktime
-!dec$ attributes alias:'KMP_SET_LIBRARY_SERIAL'::kmp_set_library_serial
-!dec$ attributes alias:'KMP_SET_LIBRARY_TURNAROUND'::kmp_set_library_turnaround
-!dec$ attributes alias:'KMP_SET_LIBRARY_THROUGHPUT'::kmp_set_library_throughput
-!dec$ attributes alias:'KMP_SET_LIBRARY'::kmp_set_library
-!dec$ attributes alias:'KMP_GET_STACKSIZE'::kmp_get_stacksize
-!dec$ attributes alias:'KMP_GET_STACKSIZE_S'::kmp_get_stacksize_s
-!dec$ attributes alias:'KMP_GET_BLOCKTIME'::kmp_get_blocktime
-!dec$ attributes alias:'KMP_GET_LIBRARY'::kmp_get_library
-!dec$ attributes alias:'KMP_SET_AFFINITY'::kmp_set_affinity
-!dec$ attributes alias:'KMP_GET_AFFINITY'::kmp_get_affinity
-!dec$ attributes alias:'KMP_GET_AFFINITY_MAX_PROC'::kmp_get_affinity_max_proc
-!dec$ attributes alias:'KMP_CREATE_AFFINITY_MASK'::kmp_create_affinity_mask
-!dec$ attributes alias:'KMP_DESTROY_AFFINITY_MASK'::kmp_destroy_affinity_mask
-!dec$ attributes alias:'KMP_SET_AFFINITY_MASK_PROC'::kmp_set_affinity_mask_proc
-!dec$ attributes alias:'KMP_UNSET_AFFINITY_MASK_PROC'::kmp_unset_affinity_mask_proc
-!dec$ attributes alias:'KMP_GET_AFFINITY_MASK_PROC'::kmp_get_affinity_mask_proc
-!dec$ attributes alias:'KMP_MALLOC'::kmp_malloc
-!dec$ attributes alias:'KMP_ALIGNED_MALLOC'::kmp_aligned_malloc
-!dec$ attributes alias:'KMP_CALLOC'::kmp_calloc
-!dec$ attributes alias:'KMP_REALLOC'::kmp_realloc
-!dec$ attributes alias:'KMP_FREE'::kmp_free
-
-!dec$ attributes alias:'KMP_SET_WARNINGS_ON'::kmp_set_warnings_on
-!dec$ attributes alias:'KMP_SET_WARNINGS_OFF'::kmp_set_warnings_off
-
-!dec$ attributes alias:'KMP_GET_CANCELLATION_STATUS' :: kmp_get_cancellation_status
-
-!dec$ else
-
-!***
-!*** On Windows* OS IA-32 architecture, the Fortran entry points have an underscore prepended.
-!***
-
-!dec$ attributes alias:'_OMP_SET_NUM_THREADS' :: omp_set_num_threads
-!dec$ attributes alias:'_OMP_SET_DYNAMIC' :: omp_set_dynamic
-!dec$ attributes alias:'_OMP_SET_NESTED' :: omp_set_nested
-!dec$ attributes alias:'_OMP_GET_NUM_THREADS' :: omp_get_num_threads
-!dec$ attributes alias:'_OMP_GET_MAX_THREADS' :: omp_get_max_threads
-!dec$ attributes alias:'_OMP_GET_THREAD_NUM' :: omp_get_thread_num
-!dec$ attributes alias:'_OMP_GET_NUM_PROCS' :: omp_get_num_procs
-!dec$ attributes alias:'_OMP_IN_PARALLEL' :: omp_in_parallel
-!dec$ attributes alias:'_OMP_GET_DYNAMIC' :: omp_get_dynamic
-!dec$ attributes alias:'_OMP_GET_NESTED' :: omp_get_nested
-!dec$ attributes alias:'_OMP_GET_THREAD_LIMIT' :: omp_get_thread_limit
-!dec$ attributes alias:'_OMP_SET_MAX_ACTIVE_LEVELS' :: omp_set_max_active_levels
-!dec$ attributes alias:'_OMP_GET_MAX_ACTIVE_LEVELS' :: omp_get_max_active_levels
-!dec$ attributes alias:'_OMP_GET_LEVEL' :: omp_get_level
-!dec$ attributes alias:'_OMP_GET_ACTIVE_LEVEL' :: omp_get_active_level
-!dec$ attributes alias:'_OMP_GET_ANCESTOR_THREAD_NUM' :: omp_get_ancestor_thread_num
-!dec$ attributes alias:'_OMP_GET_TEAM_SIZE' :: omp_get_team_size
-!dec$ attributes alias:'_OMP_SET_SCHEDULE' :: omp_set_schedule
-!dec$ attributes alias:'_OMP_GET_SCHEDULE' :: omp_get_schedule
-!dec$ attributes alias:'_OMP_GET_PROC_BIND' :: omp_get_proc_bind
-!dec$ attributes alias:'_OMP_GET_WTIME' :: omp_get_wtime
-!dec$ attributes alias:'_OMP_GET_WTICK' :: omp_get_wtick
-!dec$ attributes alias:'_OMP_GET_DEFAULT_DEVICE' :: omp_get_default_device
-!dec$ attributes alias:'_OMP_SET_DEFAULT_DEVICE' :: omp_set_default_device
-!dec$ attributes alias:'_OMP_GET_NUM_DEVICES' :: omp_get_num_devices
-!dec$ attributes alias:'_OMP_GET_NUM_TEAMS' :: omp_get_num_teams
-!dec$ attributes alias:'_OMP_GET_TEAM_NUM' :: omp_get_team_num
-!dec$ attributes alias:'_OMP_GET_CANCELLATION' :: omp_get_cancellation
-!dec$ attributes alias:'_OMP_IS_INITIAL_DEVICE' :: omp_is_initial_device
-!dec$ attributes alias:'_OMP_GET_INITIAL_DEVICE' :: omp_get_initial_device
-!dec$ attributes alias:'_OMP_GET_MAX_TASK_PRIORTY' :: omp_get_max_task_priority
-
-!dec$ attributes alias:'_omp_init_lock' :: omp_init_lock
-!dec$ attributes alias:'_omp_init_lock_with_hint' :: omp_init_lock_with_hint
-!dec$ attributes alias:'_omp_destroy_lock' :: omp_destroy_lock
-!dec$ attributes alias:'_omp_set_lock' :: omp_set_lock
-!dec$ attributes alias:'_omp_unset_lock' :: omp_unset_lock
-!dec$ attributes alias:'_omp_test_lock' :: omp_test_lock
-!dec$ attributes alias:'_omp_init_nest_lock' :: omp_init_nest_lock
-!dec$ attributes alias:'_omp_init_nest_lock_with_hint' :: omp_init_nest_lock_with_hint
-!dec$ attributes alias:'_omp_destroy_nest_lock' :: omp_destroy_nest_lock
-!dec$ attributes alias:'_omp_set_nest_lock' :: omp_set_nest_lock
-!dec$ attributes alias:'_omp_unset_nest_lock' :: omp_unset_nest_lock
-!dec$ attributes alias:'_omp_test_nest_lock' :: omp_test_nest_lock
-
-!dec$ attributes alias:'_KMP_SET_STACKSIZE'::kmp_set_stacksize
-!dec$ attributes alias:'_KMP_SET_STACKSIZE_S'::kmp_set_stacksize_s
-!dec$ attributes alias:'_KMP_SET_BLOCKTIME'::kmp_set_blocktime
-!dec$ attributes alias:'_KMP_SET_LIBRARY_SERIAL'::kmp_set_library_serial
-!dec$ attributes alias:'_KMP_SET_LIBRARY_TURNAROUND'::kmp_set_library_turnaround
-!dec$ attributes alias:'_KMP_SET_LIBRARY_THROUGHPUT'::kmp_set_library_throughput
-!dec$ attributes alias:'_KMP_SET_LIBRARY'::kmp_set_library
-!dec$ attributes alias:'_KMP_GET_STACKSIZE'::kmp_get_stacksize
-!dec$ attributes alias:'_KMP_GET_STACKSIZE_S'::kmp_get_stacksize_s
-!dec$ attributes alias:'_KMP_GET_BLOCKTIME'::kmp_get_blocktime
-!dec$ attributes alias:'_KMP_GET_LIBRARY'::kmp_get_library
-!dec$ attributes alias:'_KMP_SET_AFFINITY'::kmp_set_affinity
-!dec$ attributes alias:'_KMP_GET_AFFINITY'::kmp_get_affinity
-!dec$ attributes alias:'_KMP_GET_AFFINITY_MAX_PROC'::kmp_get_affinity_max_proc
-!dec$ attributes alias:'_KMP_CREATE_AFFINITY_MASK'::kmp_create_affinity_mask
-!dec$ attributes alias:'_KMP_DESTROY_AFFINITY_MASK'::kmp_destroy_affinity_mask
-!dec$ attributes alias:'_KMP_SET_AFFINITY_MASK_PROC'::kmp_set_affinity_mask_proc
-!dec$ attributes alias:'_KMP_UNSET_AFFINITY_MASK_PROC'::kmp_unset_affinity_mask_proc
-!dec$ attributes alias:'_KMP_GET_AFFINITY_MASK_PROC'::kmp_get_affinity_mask_proc
-!dec$ attributes alias:'_KMP_MALLOC'::kmp_malloc
-!dec$ attributes alias:'_KMP_ALIGNED_MALLOC'::kmp_aligned_malloc
-!dec$ attributes alias:'_KMP_CALLOC'::kmp_calloc
-!dec$ attributes alias:'_KMP_REALLOC'::kmp_realloc
-!dec$ attributes alias:'_KMP_FREE'::kmp_free
-
-!dec$ attributes alias:'_KMP_SET_WARNINGS_ON'::kmp_set_warnings_on
-!dec$ attributes alias:'_KMP_SET_WARNINGS_OFF'::kmp_set_warnings_off
-
-!dec$ attributes alias:'_KMP_GET_CANCELLATION_STATUS' :: kmp_get_cancellation_status
-
-!dec$ endif
-!dec$ endif
-
-!dec$ if defined(__linux)
-
-!***
-!*** The Linux* OS entry points are in lowercase, with an underscore appended.
-!***
-
-!dec$ attributes alias:'omp_set_num_threads_'::omp_set_num_threads
-!dec$ attributes alias:'omp_set_dynamic_'::omp_set_dynamic
-!dec$ attributes alias:'omp_set_nested_'::omp_set_nested
-!dec$ attributes alias:'omp_get_num_threads_'::omp_get_num_threads
-!dec$ attributes alias:'omp_get_max_threads_'::omp_get_max_threads
-!dec$ attributes alias:'omp_get_thread_num_'::omp_get_thread_num
-!dec$ attributes alias:'omp_get_num_procs_'::omp_get_num_procs
-!dec$ attributes alias:'omp_in_parallel_'::omp_in_parallel
-!dec$ attributes alias:'omp_get_dynamic_'::omp_get_dynamic
-!dec$ attributes alias:'omp_get_nested_'::omp_get_nested
-!dec$ attributes alias:'omp_get_thread_limit_'::omp_get_thread_limit
-!dec$ attributes alias:'omp_set_max_active_levels_'::omp_set_max_active_levels
-!dec$ attributes alias:'omp_get_max_active_levels_'::omp_get_max_active_levels
-!dec$ attributes alias:'omp_get_level_'::omp_get_level
-!dec$ attributes alias:'omp_get_active_level_'::omp_get_active_level
-!dec$ attributes alias:'omp_get_ancestor_thread_num_'::omp_get_ancestor_thread_num
-!dec$ attributes alias:'omp_get_team_size_'::omp_get_team_size
-!dec$ attributes alias:'omp_set_schedule_'::omp_set_schedule
-!dec$ attributes alias:'omp_get_schedule_'::omp_get_schedule
-!dec$ attributes alias:'omp_get_proc_bind_' :: omp_get_proc_bind
-!dec$ attributes alias:'omp_get_wtime_'::omp_get_wtime
-!dec$ attributes alias:'omp_get_wtick_'::omp_get_wtick
-!dec$ attributes alias:'omp_get_default_device_'::omp_get_default_device
-!dec$ attributes alias:'omp_set_default_device_'::omp_set_default_device
-!dec$ attributes alias:'omp_get_num_devices_'::omp_get_num_devices
-!dec$ attributes alias:'omp_get_num_teams_'::omp_get_num_teams
-!dec$ attributes alias:'omp_get_team_num_'::omp_get_team_num
-!dec$ attributes alias:'omp_get_cancellation_'::omp_get_cancellation
-!dec$ attributes alias:'omp_is_initial_device_'::omp_is_initial_device
-!dec$ attributes alias:'omp_get_initial_device_'::omp_get_initial_device
-!dec$ attributes alias:'omp_get_max_task_priority_'::omp_get_max_task_priority
-
-!dec$ attributes alias:'omp_init_lock_'::omp_init_lock
-!dec$ attributes alias:'omp_init_lock_with_hint_'::omp_init_lock_with_hint
-!dec$ attributes alias:'omp_destroy_lock_'::omp_destroy_lock
-!dec$ attributes alias:'omp_set_lock_'::omp_set_lock
-!dec$ attributes alias:'omp_unset_lock_'::omp_unset_lock
-!dec$ attributes alias:'omp_test_lock_'::omp_test_lock
-!dec$ attributes alias:'omp_init_nest_lock_'::omp_init_nest_lock
-!dec$ attributes alias:'omp_init_nest_lock_with_hint_'::omp_init_nest_lock_with_hint
-!dec$ attributes alias:'omp_destroy_nest_lock_'::omp_destroy_nest_lock
-!dec$ attributes alias:'omp_set_nest_lock_'::omp_set_nest_lock
-!dec$ attributes alias:'omp_unset_nest_lock_'::omp_unset_nest_lock
-!dec$ attributes alias:'omp_test_nest_lock_'::omp_test_nest_lock
-
-!dec$ attributes alias:'kmp_set_stacksize_'::kmp_set_stacksize
-!dec$ attributes alias:'kmp_set_stacksize_s_'::kmp_set_stacksize_s
-!dec$ attributes alias:'kmp_set_blocktime_'::kmp_set_blocktime
-!dec$ attributes alias:'kmp_set_library_serial_'::kmp_set_library_serial
-!dec$ attributes alias:'kmp_set_library_turnaround_'::kmp_set_library_turnaround
-!dec$ attributes alias:'kmp_set_library_throughput_'::kmp_set_library_throughput
-!dec$ attributes alias:'kmp_set_library_'::kmp_set_library
-!dec$ attributes alias:'kmp_get_stacksize_'::kmp_get_stacksize
-!dec$ attributes alias:'kmp_get_stacksize_s_'::kmp_get_stacksize_s
-!dec$ attributes alias:'kmp_get_blocktime_'::kmp_get_blocktime
-!dec$ attributes alias:'kmp_get_library_'::kmp_get_library
-!dec$ attributes alias:'kmp_set_affinity_'::kmp_set_affinity
-!dec$ attributes alias:'kmp_get_affinity_'::kmp_get_affinity
-!dec$ attributes alias:'kmp_get_affinity_max_proc_'::kmp_get_affinity_max_proc
-!dec$ attributes alias:'kmp_create_affinity_mask_'::kmp_create_affinity_mask
-!dec$ attributes alias:'kmp_destroy_affinity_mask_'::kmp_destroy_affinity_mask
-!dec$ attributes alias:'kmp_set_affinity_mask_proc_'::kmp_set_affinity_mask_proc
-!dec$ attributes alias:'kmp_unset_affinity_mask_proc_'::kmp_unset_affinity_mask_proc
-!dec$ attributes alias:'kmp_get_affinity_mask_proc_'::kmp_get_affinity_mask_proc
-!dec$ attributes alias:'kmp_malloc_'::kmp_malloc
-!dec$ attributes alias:'kmp_aligned_malloc_'::kmp_aligned_malloc
-!dec$ attributes alias:'kmp_calloc_'::kmp_calloc
-!dec$ attributes alias:'kmp_realloc_'::kmp_realloc
-!dec$ attributes alias:'kmp_free_'::kmp_free
-
-!dec$ attributes alias:'kmp_set_warnings_on_'::kmp_set_warnings_on
-!dec$ attributes alias:'kmp_set_warnings_off_'::kmp_set_warnings_off
-!dec$ attributes alias:'kmp_get_cancellation_status_'::kmp_get_cancellation_status
-
-!dec$ endif
-
-!dec$ if defined(__APPLE__)
-
-!***
-!*** The Mac entry points are in lowercase, with an both an underscore
-!*** appended and an underscore prepended.
-!***
-
-!dec$ attributes alias:'_omp_set_num_threads_'::omp_set_num_threads
-!dec$ attributes alias:'_omp_set_dynamic_'::omp_set_dynamic
-!dec$ attributes alias:'_omp_set_nested_'::omp_set_nested
-!dec$ attributes alias:'_omp_get_num_threads_'::omp_get_num_threads
-!dec$ attributes alias:'_omp_get_max_threads_'::omp_get_max_threads
-!dec$ attributes alias:'_omp_get_thread_num_'::omp_get_thread_num
-!dec$ attributes alias:'_omp_get_num_procs_'::omp_get_num_procs
-!dec$ attributes alias:'_omp_in_parallel_'::omp_in_parallel
-!dec$ attributes alias:'_omp_get_dynamic_'::omp_get_dynamic
-!dec$ attributes alias:'_omp_get_nested_'::omp_get_nested
-!dec$ attributes alias:'_omp_get_thread_limit_'::omp_get_thread_limit
-!dec$ attributes alias:'_omp_set_max_active_levels_'::omp_set_max_active_levels
-!dec$ attributes alias:'_omp_get_max_active_levels_'::omp_get_max_active_levels
-!dec$ attributes alias:'_omp_get_level_'::omp_get_level
-!dec$ attributes alias:'_omp_get_active_level_'::omp_get_active_level
-!dec$ attributes alias:'_omp_get_ancestor_thread_num_'::omp_get_ancestor_thread_num
-!dec$ attributes alias:'_omp_get_team_size_'::omp_get_team_size
-!dec$ attributes alias:'_omp_set_schedule_'::omp_set_schedule
-!dec$ attributes alias:'_omp_get_schedule_'::omp_get_schedule
-!dec$ attributes alias:'_omp_get_proc_bind_' :: omp_get_proc_bind
-!dec$ attributes alias:'_omp_get_wtime_'::omp_get_wtime
-!dec$ attributes alias:'_omp_get_wtick_'::omp_get_wtick
-!dec$ attributes alias:'_omp_get_default_device_'::omp_get_default_device
-!dec$ attributes alias:'_omp_set_default_device_'::omp_set_default_device
-!dec$ attributes alias:'_omp_get_num_devices_'::omp_get_num_devices
-!dec$ attributes alias:'_omp_get_num_teams_'::omp_get_num_teams
-!dec$ attributes alias:'_omp_get_team_num_'::omp_get_team_num
-!dec$ attributes alias:'_omp_get_cancellation_'::omp_get_cancellation
-!dec$ attributes alias:'_omp_is_initial_device_'::omp_is_initial_device
-!dec$ attributes alias:'_omp_get_initial_device_'::omp_get_initial_device
-!dec$ attributes alias:'_omp_get_max_task_priorty_'::omp_get_max_task_priority
-
-!dec$ attributes alias:'_omp_init_lock_'::omp_init_lock
-!dec$ attributes alias:'_omp_init_lock_with_hint_'::omp_init_lock_with_hint
-!dec$ attributes alias:'_omp_destroy_lock_'::omp_destroy_lock
-!dec$ attributes alias:'_omp_set_lock_'::omp_set_lock
-!dec$ attributes alias:'_omp_unset_lock_'::omp_unset_lock
-!dec$ attributes alias:'_omp_test_lock_'::omp_test_lock
-!dec$ attributes alias:'_omp_init_nest_lock_'::omp_init_nest_lock
-!dec$ attributes alias:'_omp_init_nest_lock_with_hint_'::omp_init_nest_lock_with_hint
-!dec$ attributes alias:'_omp_destroy_nest_lock_'::omp_destroy_nest_lock
-!dec$ attributes alias:'_omp_set_nest_lock_'::omp_set_nest_lock
-!dec$ attributes alias:'_omp_unset_nest_lock_'::omp_unset_nest_lock
-!dec$ attributes alias:'_omp_test_nest_lock_'::omp_test_nest_lock
-
-!dec$ attributes alias:'_kmp_set_stacksize_'::kmp_set_stacksize
-!dec$ attributes alias:'_kmp_set_stacksize_s_'::kmp_set_stacksize_s
-!dec$ attributes alias:'_kmp_set_blocktime_'::kmp_set_blocktime
-!dec$ attributes alias:'_kmp_set_library_serial_'::kmp_set_library_serial
-!dec$ attributes alias:'_kmp_set_library_turnaround_'::kmp_set_library_turnaround
-!dec$ attributes alias:'_kmp_set_library_throughput_'::kmp_set_library_throughput
-!dec$ attributes alias:'_kmp_set_library_'::kmp_set_library
-!dec$ attributes alias:'_kmp_get_stacksize_'::kmp_get_stacksize
-!dec$ attributes alias:'_kmp_get_stacksize_s_'::kmp_get_stacksize_s
-!dec$ attributes alias:'_kmp_get_blocktime_'::kmp_get_blocktime
-!dec$ attributes alias:'_kmp_get_library_'::kmp_get_library
-!dec$ attributes alias:'_kmp_set_affinity_'::kmp_set_affinity
-!dec$ attributes alias:'_kmp_get_affinity_'::kmp_get_affinity
-!dec$ attributes alias:'_kmp_get_affinity_max_proc_'::kmp_get_affinity_max_proc
-!dec$ attributes alias:'_kmp_create_affinity_mask_'::kmp_create_affinity_mask
-!dec$ attributes alias:'_kmp_destroy_affinity_mask_'::kmp_destroy_affinity_mask
-!dec$ attributes alias:'_kmp_set_affinity_mask_proc_'::kmp_set_affinity_mask_proc
-!dec$ attributes alias:'_kmp_unset_affinity_mask_proc_'::kmp_unset_affinity_mask_proc
-!dec$ attributes alias:'_kmp_get_affinity_mask_proc_'::kmp_get_affinity_mask_proc
-!dec$ attributes alias:'_kmp_malloc_'::kmp_malloc
-!dec$ attributes alias:'_kmp_aligned_malloc_'::kmp_aligned_malloc
-!dec$ attributes alias:'_kmp_calloc_'::kmp_calloc
-!dec$ attributes alias:'_kmp_realloc_'::kmp_realloc
-!dec$ attributes alias:'_kmp_free_'::kmp_free
-
-!dec$ attributes alias:'_kmp_set_warnings_on_'::kmp_set_warnings_on
-!dec$ attributes alias:'_kmp_set_warnings_off_'::kmp_set_warnings_off
-
-!dec$ attributes alias:'_kmp_get_cancellation_status_'::kmp_get_cancellation_status
-
-!dec$ endif
-
- end module omp_lib
diff --git a/runtime/src/include/45/omp_lib.f90.var b/runtime/src/include/45/omp_lib.f90.var
deleted file mode 100644
index b5fc44ece9f9..000000000000
--- a/runtime/src/include/45/omp_lib.f90.var
+++ /dev/null
@@ -1,524 +0,0 @@
-! include/45/omp_lib.f90.var
-
-!
-!//===----------------------------------------------------------------------===//
-!//
-!// The LLVM Compiler Infrastructure
-!//
-!// This file is dual licensed under the MIT and the University of Illinois Open
-!// Source Licenses. See LICENSE.txt for details.
-!//
-!//===----------------------------------------------------------------------===//
-!
-
- module omp_lib_kinds
-
- use, intrinsic :: iso_c_binding
-
- integer, parameter :: omp_integer_kind = c_int
- integer, parameter :: omp_logical_kind = 4
- integer, parameter :: omp_real_kind = c_float
- integer, parameter :: kmp_double_kind = c_double
- integer, parameter :: omp_lock_kind = c_intptr_t
- integer, parameter :: omp_nest_lock_kind = c_intptr_t
- integer, parameter :: omp_sched_kind = omp_integer_kind
- integer, parameter :: omp_proc_bind_kind = omp_integer_kind
- integer, parameter :: kmp_pointer_kind = c_intptr_t
- integer, parameter :: kmp_size_t_kind = c_size_t
- integer, parameter :: kmp_affinity_mask_kind = c_intptr_t
- integer, parameter :: kmp_cancel_kind = omp_integer_kind
- integer, parameter :: omp_lock_hint_kind = omp_integer_kind
-
- end module omp_lib_kinds
-
- module omp_lib
-
- use omp_lib_kinds
-
- integer (kind=omp_integer_kind), parameter :: openmp_version = @LIBOMP_OMP_YEAR_MONTH@
- integer (kind=omp_integer_kind), parameter :: kmp_version_major = @LIBOMP_VERSION_MAJOR@
- integer (kind=omp_integer_kind), parameter :: kmp_version_minor = @LIBOMP_VERSION_MINOR@
- integer (kind=omp_integer_kind), parameter :: kmp_version_build = @LIBOMP_VERSION_BUILD@
- character(*) kmp_build_date
- parameter( kmp_build_date = '@LIBOMP_BUILD_DATE@' )
-
- integer(kind=omp_sched_kind), parameter :: omp_sched_static = 1
- integer(kind=omp_sched_kind), parameter :: omp_sched_dynamic = 2
- integer(kind=omp_sched_kind), parameter :: omp_sched_guided = 3
- integer(kind=omp_sched_kind), parameter :: omp_sched_auto = 4
-
-
- integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_false = 0
- integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_true = 1
- integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_master = 2
- integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_close = 3
- integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_spread = 4
-
- integer (kind=kmp_cancel_kind), parameter :: kmp_cancel_parallel = 1
- integer (kind=kmp_cancel_kind), parameter :: kmp_cancel_loop = 2
- integer (kind=kmp_cancel_kind), parameter :: kmp_cancel_sections = 3
- integer (kind=kmp_cancel_kind), parameter :: kmp_cancel_taskgroup = 4
-
- integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_none = 0
- integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_uncontended = 1
- integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_contended = 2
- integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_nonspeculative = 4
- integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_speculative = 8
- integer (kind=omp_lock_hint_kind), parameter :: kmp_lock_hint_hle = 65536
- integer (kind=omp_lock_hint_kind), parameter :: kmp_lock_hint_rtm = 131072
- integer (kind=omp_lock_hint_kind), parameter :: kmp_lock_hint_adaptive = 262144
-
- interface
-
-! ***
-! *** omp_* entry points
-! ***
-
- subroutine omp_set_num_threads(num_threads) bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind), value :: num_threads
- end subroutine omp_set_num_threads
-
- subroutine omp_set_dynamic(dynamic_threads) bind(c)
- use omp_lib_kinds
- logical (kind=omp_logical_kind), value :: dynamic_threads
- end subroutine omp_set_dynamic
-
- subroutine omp_set_nested(nested) bind(c)
- use omp_lib_kinds
- logical (kind=omp_logical_kind), value :: nested
- end subroutine omp_set_nested
-
- function omp_get_num_threads() bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_num_threads
- end function omp_get_num_threads
-
- function omp_get_max_threads() bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_max_threads
- end function omp_get_max_threads
-
- function omp_get_thread_num() bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_thread_num
- end function omp_get_thread_num
-
- function omp_get_num_procs() bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_num_procs
- end function omp_get_num_procs
-
- function omp_in_parallel() bind(c)
- use omp_lib_kinds
- logical (kind=omp_logical_kind) omp_in_parallel
- end function omp_in_parallel
-
- function omp_in_final() bind(c)
- use omp_lib_kinds
- logical (kind=omp_logical_kind) omp_in_final
- end function omp_in_final
-
- function omp_get_dynamic() bind(c)
- use omp_lib_kinds
- logical (kind=omp_logical_kind) omp_get_dynamic
- end function omp_get_dynamic
-
- function omp_get_nested() bind(c)
- use omp_lib_kinds
- logical (kind=omp_logical_kind) omp_get_nested
- end function omp_get_nested
-
- function omp_get_thread_limit() bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_thread_limit
- end function omp_get_thread_limit
-
- subroutine omp_set_max_active_levels(max_levels) bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind), value :: max_levels
- end subroutine omp_set_max_active_levels
-
- function omp_get_max_active_levels() bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_max_active_levels
- end function omp_get_max_active_levels
-
- function omp_get_level() bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_level
- end function omp_get_level
-
- function omp_get_active_level() bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_active_level
- end function omp_get_active_level
-
- function omp_get_ancestor_thread_num(level) bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_ancestor_thread_num
- integer (kind=omp_integer_kind), value :: level
- end function omp_get_ancestor_thread_num
-
- function omp_get_team_size(level) bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_team_size
- integer (kind=omp_integer_kind), value :: level
- end function omp_get_team_size
-
- subroutine omp_set_schedule(kind, chunk_size) bind(c)
- use omp_lib_kinds
- integer (kind=omp_sched_kind), value :: kind
- integer (kind=omp_integer_kind), value :: chunk_size
- end subroutine omp_set_schedule
-
- subroutine omp_get_schedule(kind, chunk_size) bind(c)
- use omp_lib_kinds
- integer (kind=omp_sched_kind) kind
- integer (kind=omp_integer_kind) chunk_size
- end subroutine omp_get_schedule
-
- function omp_get_proc_bind() bind(c)
- use omp_lib_kinds
- integer (kind=omp_proc_bind_kind) omp_get_proc_bind
- end function omp_get_proc_bind
-
- function omp_get_num_places() bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_num_places
- end function omp_get_num_places
-
- function omp_get_place_num_procs(place_num) bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind), value :: place_num
- integer (kind=omp_integer_kind) omp_get_place_num_procs
- end function omp_get_place_num_procs
-
- subroutine omp_get_place_proc_ids(place_num, ids) bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind), value :: place_num
- integer (kind=omp_integer_kind) ids(*)
- end subroutine omp_get_place_proc_ids
-
- function omp_get_place_num() bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_place_num
- end function omp_get_place_num
-
- function omp_get_partition_num_places() bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_partition_num_places
- end function omp_get_partition_num_places
-
- subroutine omp_get_partition_place_nums(place_nums) bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) place_nums(*)
- end subroutine omp_get_partition_place_nums
-
- function omp_get_wtime() bind(c)
- use omp_lib_kinds
- real (kind=kmp_double_kind) omp_get_wtime
- end function omp_get_wtime
-
- function omp_get_wtick() bind(c)
- use omp_lib_kinds
- real (kind=kmp_double_kind) omp_get_wtick
- end function omp_get_wtick
-
- function omp_get_default_device() bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_default_device
- end function omp_get_default_device
-
- subroutine omp_set_default_device(device_num) bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind), value :: device_num
- end subroutine omp_set_default_device
-
- function omp_get_num_devices() bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_num_devices
- end function omp_get_num_devices
-
- function omp_get_num_teams() bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_num_teams
- end function omp_get_num_teams
-
- function omp_get_team_num() bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_team_num
- end function omp_get_team_num
-
- function omp_get_cancellation() bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_cancellation
- end function omp_get_cancellation
-
- function omp_is_initial_device() bind(c)
- use omp_lib_kinds
- logical (kind=omp_logical_kind) omp_is_initial_device
- end function omp_is_initial_device
-
- function omp_get_initial_device() bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_initial_device
- end function omp_get_initial_device
-
- subroutine omp_init_lock(svar) bind(c)
-!DIR$ IF(__INTEL_COMPILER.GE.1400)
-!DIR$ attributes known_intrinsic :: omp_init_lock
-!DIR$ ENDIF
- use omp_lib_kinds
- integer (kind=omp_lock_kind) svar
- end subroutine omp_init_lock
-
- subroutine omp_destroy_lock(svar) bind(c)
-!DIR$ IF(__INTEL_COMPILER.GE.1400)
-!DIR$ attributes known_intrinsic :: omp_destroy_lock
-!DIR$ ENDIF
- use omp_lib_kinds
- integer (kind=omp_lock_kind) svar
- end subroutine omp_destroy_lock
-
- subroutine omp_set_lock(svar) bind(c)
-!DIR$ IF(__INTEL_COMPILER.GE.1400)
-!DIR$ attributes known_intrinsic :: omp_set_lock
-!DIR$ ENDIF
- use omp_lib_kinds
- integer (kind=omp_lock_kind) svar
- end subroutine omp_set_lock
-
- subroutine omp_unset_lock(svar) bind(c)
-!DIR$ IF(__INTEL_COMPILER.GE.1400)
-!DIR$ attributes known_intrinsic :: omp_unset_lock
-!DIR$ ENDIF
- use omp_lib_kinds
- integer (kind=omp_lock_kind) svar
- end subroutine omp_unset_lock
-
- function omp_test_lock(svar) bind(c)
-!DIR$ IF(__INTEL_COMPILER.GE.1400)
-!DIR$ attributes known_intrinsic :: omp_test_lock
-!DIR$ ENDIF
- use omp_lib_kinds
- logical (kind=omp_logical_kind) omp_test_lock
- integer (kind=omp_lock_kind) svar
- end function omp_test_lock
-
- subroutine omp_init_nest_lock(nvar) bind(c)
-!DIR$ IF(__INTEL_COMPILER.GE.1400)
-!DIR$ attributes known_intrinsic :: omp_init_nest_lock
-!DIR$ ENDIF
- use omp_lib_kinds
- integer (kind=omp_nest_lock_kind) nvar
- end subroutine omp_init_nest_lock
-
- subroutine omp_destroy_nest_lock(nvar) bind(c)
-!DIR$ IF(__INTEL_COMPILER.GE.1400)
-!DIR$ attributes known_intrinsic :: omp_destroy_nest_lock
-!DIR$ ENDIF
- use omp_lib_kinds
- integer (kind=omp_nest_lock_kind) nvar
- end subroutine omp_destroy_nest_lock
-
- subroutine omp_set_nest_lock(nvar) bind(c)
-!DIR$ IF(__INTEL_COMPILER.GE.1400)
-!DIR$ attributes known_intrinsic :: omp_set_nest_lock
-!DIR$ ENDIF
- use omp_lib_kinds
- integer (kind=omp_nest_lock_kind) nvar
- end subroutine omp_set_nest_lock
-
- subroutine omp_unset_nest_lock(nvar) bind(c)
-!DIR$ IF(__INTEL_COMPILER.GE.1400)
-!DIR$ attributes known_intrinsic :: omp_unset_nest_lock
-!DIR$ ENDIF
- use omp_lib_kinds
- integer (kind=omp_nest_lock_kind) nvar
- end subroutine omp_unset_nest_lock
-
- function omp_test_nest_lock(nvar) bind(c)
-!DIR$ IF(__INTEL_COMPILER.GE.1400)
-!DIR$ attributes known_intrinsic :: omp_test_nest_lock
-!DIR$ ENDIF
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_test_nest_lock
- integer (kind=omp_nest_lock_kind) nvar
- end function omp_test_nest_lock
-
- function omp_get_max_task_priority() bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) omp_get_max_task_priority
- end function omp_get_max_task_priority
-
-! ***
-! *** kmp_* entry points
-! ***
-
- subroutine kmp_set_stacksize(size) bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind), value :: size
- end subroutine kmp_set_stacksize
-
- subroutine kmp_set_stacksize_s(size) bind(c)
- use omp_lib_kinds
- integer (kind=kmp_size_t_kind), value :: size
- end subroutine kmp_set_stacksize_s
-
- subroutine kmp_set_blocktime(msec) bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind), value :: msec
- end subroutine kmp_set_blocktime
-
- subroutine kmp_set_library_serial() bind(c)
- end subroutine kmp_set_library_serial
-
- subroutine kmp_set_library_turnaround() bind(c)
- end subroutine kmp_set_library_turnaround
-
- subroutine kmp_set_library_throughput() bind(c)
- end subroutine kmp_set_library_throughput
-
- subroutine kmp_set_library(libnum) bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind), value :: libnum
- end subroutine kmp_set_library
-
- subroutine kmp_set_defaults(string) bind(c)
- use, intrinsic :: iso_c_binding
- character (kind=c_char) :: string(*)
- end subroutine kmp_set_defaults
-
- function kmp_get_stacksize() bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) kmp_get_stacksize
- end function kmp_get_stacksize
-
- function kmp_get_stacksize_s() bind(c)
- use omp_lib_kinds
- integer (kind=kmp_size_t_kind) kmp_get_stacksize_s
- end function kmp_get_stacksize_s
-
- function kmp_get_blocktime() bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) kmp_get_blocktime
- end function kmp_get_blocktime
-
- function kmp_get_library() bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) kmp_get_library
- end function kmp_get_library
-
- subroutine kmp_set_disp_num_buffers(num) bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind), value :: num
- end subroutine kmp_set_disp_num_buffers
-
- function kmp_set_affinity(mask) bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) kmp_set_affinity
- integer (kind=kmp_affinity_mask_kind) mask
- end function kmp_set_affinity
-
- function kmp_get_affinity(mask) bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) kmp_get_affinity
- integer (kind=kmp_affinity_mask_kind) mask
- end function kmp_get_affinity
-
- function kmp_get_affinity_max_proc() bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) kmp_get_affinity_max_proc
- end function kmp_get_affinity_max_proc
-
- subroutine kmp_create_affinity_mask(mask) bind(c)
- use omp_lib_kinds
- integer (kind=kmp_affinity_mask_kind) mask
- end subroutine kmp_create_affinity_mask
-
- subroutine kmp_destroy_affinity_mask(mask) bind(c)
- use omp_lib_kinds
- integer (kind=kmp_affinity_mask_kind) mask
- end subroutine kmp_destroy_affinity_mask
-
- function kmp_set_affinity_mask_proc(proc, mask) bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) kmp_set_affinity_mask_proc
- integer (kind=omp_integer_kind), value :: proc
- integer (kind=kmp_affinity_mask_kind) mask
- end function kmp_set_affinity_mask_proc
-
- function kmp_unset_affinity_mask_proc(proc, mask) bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) kmp_unset_affinity_mask_proc
- integer (kind=omp_integer_kind), value :: proc
- integer (kind=kmp_affinity_mask_kind) mask
- end function kmp_unset_affinity_mask_proc
-
- function kmp_get_affinity_mask_proc(proc, mask) bind(c)
- use omp_lib_kinds
- integer (kind=omp_integer_kind) kmp_get_affinity_mask_proc
- integer (kind=omp_integer_kind), value :: proc
- integer (kind=kmp_affinity_mask_kind) mask
- end function kmp_get_affinity_mask_proc
-
- function kmp_malloc(size) bind(c)
- use omp_lib_kinds
- integer (kind=kmp_pointer_kind) kmp_malloc
- integer (kind=kmp_size_t_kind), value :: size
- end function kmp_malloc
-
- function kmp_aligned_malloc(size, alignment) bind(c)
- use omp_lib_kinds
- integer (kind=kmp_pointer_kind) kmp_aligned_malloc
- integer (kind=kmp_size_t_kind), value :: size
- integer (kind=kmp_size_t_kind), value :: alignment
- end function kmp_aligned_malloc
-
- function kmp_calloc(nelem, elsize) bind(c)
- use omp_lib_kinds
- integer (kind=kmp_pointer_kind) kmp_calloc
- integer (kind=kmp_size_t_kind), value :: nelem
- integer (kind=kmp_size_t_kind), value :: elsize
- end function kmp_calloc
-
- function kmp_realloc(ptr, size) bind(c)
- use omp_lib_kinds
- integer (kind=kmp_pointer_kind) kmp_realloc
- integer (kind=kmp_pointer_kind), value :: ptr
- integer (kind=kmp_size_t_kind), value :: size
- end function kmp_realloc
-
- subroutine kmp_free(ptr) bind(c)
- use omp_lib_kinds
- integer (kind=kmp_pointer_kind), value :: ptr
- end subroutine kmp_free
-
- subroutine kmp_set_warnings_on() bind(c)
- end subroutine kmp_set_warnings_on
-
- subroutine kmp_set_warnings_off() bind(c)
- end subroutine kmp_set_warnings_off
-
- function kmp_get_cancellation_status(cancelkind) bind(c)
- use omp_lib_kinds
- integer (kind=kmp_cancel_kind), value :: cancelkind
- logical (kind=omp_logical_kind) kmp_get_cancellation_status
- end function kmp_get_cancellation_status
-
- subroutine omp_init_lock_with_hint(svar, hint) bind(c)
- use omp_lib_kinds
- integer (kind=omp_lock_kind) svar
- integer (kind=omp_lock_hint_kind), value :: hint
- end subroutine omp_init_lock_with_hint
-
- subroutine omp_init_nest_lock_with_hint(nvar, hint) bind(c)
- use omp_lib_kinds
- integer (kind=omp_nest_lock_kind) nvar
- integer (kind=omp_lock_hint_kind), value :: hint
- end subroutine omp_init_nest_lock_with_hint
-
- end interface
-
- end module omp_lib
diff --git a/runtime/src/include/45/omp_lib.h.var b/runtime/src/include/45/omp_lib.h.var
deleted file mode 100644
index 1ed00cd02de3..000000000000
--- a/runtime/src/include/45/omp_lib.h.var
+++ /dev/null
@@ -1,645 +0,0 @@
-! include/45/omp_lib.h.var
-
-!
-!//===----------------------------------------------------------------------===//
-!//
-!// The LLVM Compiler Infrastructure
-!//
-!// This file is dual licensed under the MIT and the University of Illinois Open
-!// Source Licenses. See LICENSE.txt for details.
-!//
-!//===----------------------------------------------------------------------===//
-!
-
-!***
-!*** Some of the directives for the following routine extend past column 72,
-!*** so process this file in 132-column mode.
-!***
-
-!DIR$ fixedformlinesize:132
-
- integer, parameter :: omp_integer_kind = 4
- integer, parameter :: omp_logical_kind = 4
- integer, parameter :: omp_real_kind = 4
- integer, parameter :: omp_lock_kind = int_ptr_kind()
- integer, parameter :: omp_nest_lock_kind = int_ptr_kind()
- integer, parameter :: omp_sched_kind = omp_integer_kind
- integer, parameter :: omp_proc_bind_kind = omp_integer_kind
- integer, parameter :: kmp_pointer_kind = int_ptr_kind()
- integer, parameter :: kmp_size_t_kind = int_ptr_kind()
- integer, parameter :: kmp_affinity_mask_kind = int_ptr_kind()
- integer, parameter :: omp_lock_hint_kind = omp_integer_kind
-
- integer (kind=omp_integer_kind), parameter :: openmp_version = @LIBOMP_OMP_YEAR_MONTH@
- integer (kind=omp_integer_kind), parameter :: kmp_version_major = @LIBOMP_VERSION_MAJOR@
- integer (kind=omp_integer_kind), parameter :: kmp_version_minor = @LIBOMP_VERSION_MINOR@
- integer (kind=omp_integer_kind), parameter :: kmp_version_build = @LIBOMP_VERSION_BUILD@
- character(*) kmp_build_date
- parameter( kmp_build_date = '@LIBOMP_BUILD_DATE@' )
-
- integer(kind=omp_sched_kind), parameter :: omp_sched_static = 1
- integer(kind=omp_sched_kind), parameter :: omp_sched_dynamic = 2
- integer(kind=omp_sched_kind), parameter :: omp_sched_guided = 3
- integer(kind=omp_sched_kind), parameter :: omp_sched_auto = 4
-
- integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_false = 0
- integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_true = 1
- integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_master = 2
- integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_close = 3
- integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_spread = 4
-
- integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_none = 0
- integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_uncontended = 1
- integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_contended = 2
- integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_nonspeculative = 4
- integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_speculative = 8
- integer (kind=omp_lock_hint_kind), parameter :: kmp_lock_hint_hle = 65536
- integer (kind=omp_lock_hint_kind), parameter :: kmp_lock_hint_rtm = 131072
- integer (kind=omp_lock_hint_kind), parameter :: kmp_lock_hint_adaptive = 262144
-
- interface
-
-! ***
-! *** omp_* entry points
-! ***
-
- subroutine omp_set_num_threads(num_threads) bind(c)
- import
- integer (kind=omp_integer_kind), value :: num_threads
- end subroutine omp_set_num_threads
-
- subroutine omp_set_dynamic(dynamic_threads) bind(c)
- import
- logical (kind=omp_logical_kind), value :: dynamic_threads
- end subroutine omp_set_dynamic
-
- subroutine omp_set_nested(nested) bind(c)
- import
- logical (kind=omp_logical_kind), value :: nested
- end subroutine omp_set_nested
-
- function omp_get_num_threads() bind(c)
- import
- integer (kind=omp_integer_kind) omp_get_num_threads
- end function omp_get_num_threads
-
- function omp_get_max_threads() bind(c)
- import
- integer (kind=omp_integer_kind) omp_get_max_threads
- end function omp_get_max_threads
-
- function omp_get_thread_num() bind(c)
- import
- integer (kind=omp_integer_kind) omp_get_thread_num
- end function omp_get_thread_num
-
- function omp_get_num_procs() bind(c)
- import
- integer (kind=omp_integer_kind) omp_get_num_procs
- end function omp_get_num_procs
-
- function omp_in_parallel() bind(c)
- import
- logical (kind=omp_logical_kind) omp_in_parallel
- end function omp_in_parallel
-
- function omp_in_final() bind(c)
- import
- logical (kind=omp_logical_kind) omp_in_final
- end function omp_in_final
-
- function omp_get_dynamic() bind(c)
- import
- logical (kind=omp_logical_kind) omp_get_dynamic
- end function omp_get_dynamic
-
- function omp_get_nested() bind(c)
- import
- logical (kind=omp_logical_kind) omp_get_nested
- end function omp_get_nested
-
- function omp_get_thread_limit() bind(c)
- import
- integer (kind=omp_integer_kind) omp_get_thread_limit
- end function omp_get_thread_limit
-
- subroutine omp_set_max_active_levels(max_levels) bind(c)
- import
- integer (kind=omp_integer_kind), value :: max_levels
- end subroutine omp_set_max_active_levels
-
- function omp_get_max_active_levels() bind(c)
- import
- integer (kind=omp_integer_kind) omp_get_max_active_levels
- end function omp_get_max_active_levels
-
- function omp_get_level() bind(c)
- import
- integer (kind=omp_integer_kind) omp_get_level
- end function omp_get_level
-
- function omp_get_active_level() bind(c)
- import
- integer (kind=omp_integer_kind) omp_get_active_level
- end function omp_get_active_level
-
- function omp_get_ancestor_thread_num(level) bind(c)
- import
- integer (kind=omp_integer_kind) omp_get_ancestor_thread_num
- integer (kind=omp_integer_kind), value :: level
- end function omp_get_ancestor_thread_num
-
- function omp_get_team_size(level) bind(c)
- import
- integer (kind=omp_integer_kind) omp_get_team_size
- integer (kind=omp_integer_kind), value :: level
- end function omp_get_team_size
-
- subroutine omp_set_schedule(kind, chunk_size) bind(c)
- import
- integer (kind=omp_sched_kind), value :: kind
- integer (kind=omp_integer_kind), value :: chunk_size
- end subroutine omp_set_schedule
-
- subroutine omp_get_schedule(kind, chunk_size) bind(c)
- import
- integer (kind=omp_sched_kind) kind
- integer (kind=omp_integer_kind) chunk_size
- end subroutine omp_get_schedule
-
- function omp_get_proc_bind() bind(c)
- import
- integer (kind=omp_proc_bind_kind) omp_get_proc_bind
- end function omp_get_proc_bind
-
- function omp_get_num_places() bind(c)
- import
- integer (kind=omp_integer_kind) omp_get_num_places
- end function omp_get_num_places
-
- function omp_get_place_num_procs(place_num) bind(c)
- import
- integer (kind=omp_integer_kind), value :: place_num
- integer (kind=omp_integer_kind) omp_get_place_num_procs
- end function omp_get_place_num_procs
-
- subroutine omp_get_place_proc_ids(place_num, ids) bind(c)
- import
- integer (kind=omp_integer_kind), value :: place_num
- integer (kind=omp_integer_kind) ids(*)
- end subroutine omp_get_place_proc_ids
-
- function omp_get_place_num() bind(c)
- import
- integer (kind=omp_integer_kind) omp_get_place_num
- end function omp_get_place_num
-
- function omp_get_partition_num_places() bind(c)
- import
- integer (kind=omp_integer_kind) omp_get_partition_num_places
- end function omp_get_partition_num_places
-
- subroutine omp_get_partition_place_nums(place_nums) bind(c)
- import
- integer (kind=omp_integer_kind) place_nums(*)
- end subroutine omp_get_partition_place_nums
-
- function omp_get_wtime() bind(c)
- double precision omp_get_wtime
- end function omp_get_wtime
-
- function omp_get_wtick() bind(c)
- double precision omp_get_wtick
- end function omp_get_wtick
-
- function omp_get_default_device() bind(c)
- import
- integer (kind=omp_integer_kind) omp_get_default_device
- end function omp_get_default_device
-
- subroutine omp_set_default_device(device_num) bind(c)
- import
- integer (kind=omp_integer_kind), value :: device_num
- end subroutine omp_set_default_device
-
- function omp_get_num_devices() bind(c)
- import
- integer (kind=omp_integer_kind) omp_get_num_devices
- end function omp_get_num_devices
-
- function omp_get_num_teams() bind(c)
- import
- integer (kind=omp_integer_kind) omp_get_num_teams
- end function omp_get_num_teams
-
- function omp_get_team_num() bind(c)
- import
- integer (kind=omp_integer_kind) omp_get_team_num
- end function omp_get_team_num
-
- function omp_is_initial_device() bind(c)
- import
- logical (kind=omp_logical_kind) omp_is_initial_device
- end function omp_is_initial_device
-
- function omp_get_initial_device() bind(c)
- import
- integer (kind=omp_integer_kind) omp_get_initial_device
- end function omp_get_initial_device
-
- subroutine omp_init_lock(svar) bind(c)
-!DIR$ IF(__INTEL_COMPILER.GE.1400)
-!DIR$ attributes known_intrinsic :: omp_init_lock
-!DIR$ ENDIF
- import
- integer (kind=omp_lock_kind) svar
- end subroutine omp_init_lock
-
- subroutine omp_destroy_lock(svar) bind(c)
-!DIR$ IF(__INTEL_COMPILER.GE.1400)
-!DIR$ attributes known_intrinsic :: omp_destroy_lock
-!DIR$ ENDIF
- import
- integer (kind=omp_lock_kind) svar
- end subroutine omp_destroy_lock
-
- subroutine omp_set_lock(svar) bind(c)
-!DIR$ IF(__INTEL_COMPILER.GE.1400)
-!DIR$ attributes known_intrinsic :: omp_set_lock
-!DIR$ ENDIF
- import
- integer (kind=omp_lock_kind) svar
- end subroutine omp_set_lock
-
- subroutine omp_unset_lock(svar) bind(c)
-!DIR$ IF(__INTEL_COMPILER.GE.1400)
-!DIR$ attributes known_intrinsic :: omp_unset_lock
-!DIR$ ENDIF
- import
- integer (kind=omp_lock_kind) svar
- end subroutine omp_unset_lock
-
- function omp_test_lock(svar) bind(c)
-!DIR$ IF(__INTEL_COMPILER.GE.1400)
-!DIR$ attributes known_intrinsic :: omp_test_lock
-!DIR$ ENDIF
- import
- logical (kind=omp_logical_kind) omp_test_lock
- integer (kind=omp_lock_kind) svar
- end function omp_test_lock
-
- subroutine omp_init_nest_lock(nvar) bind(c)
-!DIR$ IF(__INTEL_COMPILER.GE.1400)
-!DIR$ attributes known_intrinsic :: omp_init_nest_lock
-!DIR$ ENDIF
- import
- integer (kind=omp_nest_lock_kind) nvar
- end subroutine omp_init_nest_lock
-
- subroutine omp_destroy_nest_lock(nvar) bind(c)
-!DIR$ IF(__INTEL_COMPILER.GE.1400)
-!DIR$ attributes known_intrinsic :: omp_destroy_nest_lock
-!DIR$ ENDIF
- import
- integer (kind=omp_nest_lock_kind) nvar
- end subroutine omp_destroy_nest_lock
-
- subroutine omp_set_nest_lock(nvar) bind(c)
-!DIR$ IF(__INTEL_COMPILER.GE.1400)
-!DIR$ attributes known_intrinsic :: omp_set_nest_lock
-!DIR$ ENDIF
- import
- integer (kind=omp_nest_lock_kind) nvar
- end subroutine omp_set_nest_lock
-
- subroutine omp_unset_nest_lock(nvar) bind(c)
-!DIR$ IF(__INTEL_COMPILER.GE.1400)
-!DIR$ attributes known_intrinsic :: omp_unset_nest_lock
-!DIR$ ENDIF
- import
- integer (kind=omp_nest_lock_kind) nvar
- end subroutine omp_unset_nest_lock
-
- function omp_test_nest_lock(nvar) bind(c)
-!DIR$ IF(__INTEL_COMPILER.GE.1400)
-!DIR$ attributes known_intrinsic :: omp_test_nest_lock
-!DIR$ ENDIF
- import
- integer (kind=omp_integer_kind) omp_test_nest_lock
- integer (kind=omp_nest_lock_kind) nvar
- end function omp_test_nest_lock
-
- function omp_get_max_task_priority() bind(c)
- import
- integer (kind=omp_integer_kind) omp_get_max_task_priority
- end function omp_get_max_task_priority
-
-! ***
-! *** kmp_* entry points
-! ***
-
- subroutine kmp_set_stacksize(size) bind(c)
- import
- integer (kind=omp_integer_kind), value :: size
- end subroutine kmp_set_stacksize
-
- subroutine kmp_set_stacksize_s(size) bind(c)
- import
- integer (kind=kmp_size_t_kind), value :: size
- end subroutine kmp_set_stacksize_s
-
- subroutine kmp_set_blocktime(msec) bind(c)
- import
- integer (kind=omp_integer_kind), value :: msec
- end subroutine kmp_set_blocktime
-
- subroutine kmp_set_library_serial() bind(c)
- end subroutine kmp_set_library_serial
-
- subroutine kmp_set_library_turnaround() bind(c)
- end subroutine kmp_set_library_turnaround
-
- subroutine kmp_set_library_throughput() bind(c)
- end subroutine kmp_set_library_throughput
-
- subroutine kmp_set_library(libnum) bind(c)
- import
- integer (kind=omp_integer_kind), value :: libnum
- end subroutine kmp_set_library
-
- subroutine kmp_set_defaults(string) bind(c)
- character string(*)
- end subroutine kmp_set_defaults
-
- function kmp_get_stacksize() bind(c)
- import
- integer (kind=omp_integer_kind) kmp_get_stacksize
- end function kmp_get_stacksize
-
- function kmp_get_stacksize_s() bind(c)
- import
- integer (kind=kmp_size_t_kind) kmp_get_stacksize_s
- end function kmp_get_stacksize_s
-
- function kmp_get_blocktime() bind(c)
- import
- integer (kind=omp_integer_kind) kmp_get_blocktime
- end function kmp_get_blocktime
-
- function kmp_get_library() bind(c)
- import
- integer (kind=omp_integer_kind) kmp_get_library
- end function kmp_get_library
-
- subroutine kmp_set_disp_num_buffers(num) bind(c)
- import
- integer (kind=omp_integer_kind), value :: num
- end subroutine kmp_set_disp_num_buffers
-
- function kmp_set_affinity(mask) bind(c)
- import
- integer (kind=omp_integer_kind) kmp_set_affinity
- integer (kind=kmp_affinity_mask_kind) mask
- end function kmp_set_affinity
-
- function kmp_get_affinity(mask) bind(c)
- import
- integer (kind=omp_integer_kind) kmp_get_affinity
- integer (kind=kmp_affinity_mask_kind) mask
- end function kmp_get_affinity
-
- function kmp_get_affinity_max_proc() bind(c)
- import
- integer (kind=omp_integer_kind) kmp_get_affinity_max_proc
- end function kmp_get_affinity_max_proc
-
- subroutine kmp_create_affinity_mask(mask) bind(c)
- import
- integer (kind=kmp_affinity_mask_kind) mask
- end subroutine kmp_create_affinity_mask
-
- subroutine kmp_destroy_affinity_mask(mask) bind(c)
- import
- integer (kind=kmp_affinity_mask_kind) mask
- end subroutine kmp_destroy_affinity_mask
-
- function kmp_set_affinity_mask_proc(proc, mask) bind(c)
- import
- integer (kind=omp_integer_kind) kmp_set_affinity_mask_proc
- integer (kind=omp_integer_kind), value :: proc
- integer (kind=kmp_affinity_mask_kind) mask
- end function kmp_set_affinity_mask_proc
-
- function kmp_unset_affinity_mask_proc(proc, mask) bind(c)
- import
- integer (kind=omp_integer_kind) kmp_unset_affinity_mask_proc
- integer (kind=omp_integer_kind), value :: proc
- integer (kind=kmp_affinity_mask_kind) mask
- end function kmp_unset_affinity_mask_proc
-
- function kmp_get_affinity_mask_proc(proc, mask) bind(c)
- import
- integer (kind=omp_integer_kind) kmp_get_affinity_mask_proc
- integer (kind=omp_integer_kind), value :: proc
- integer (kind=kmp_affinity_mask_kind) mask
- end function kmp_get_affinity_mask_proc
-
- function kmp_malloc(size) bind(c)
- import
- integer (kind=kmp_pointer_kind) kmp_malloc
- integer (kind=kmp_size_t_kind), value :: size
- end function kmp_malloc
-
- function kmp_aligned_malloc(size, alignment) bind(c)
- import
- integer (kind=kmp_pointer_kind) kmp_aligned_malloc
- integer (kind=kmp_size_t_kind), value :: size
- integer (kind=kmp_size_t_kind), value :: alignment
- end function kmp_aligned_malloc
-
- function kmp_calloc(nelem, elsize) bind(c)
- import
- integer (kind=kmp_pointer_kind) kmp_calloc
- integer (kind=kmp_size_t_kind), value :: nelem
- integer (kind=kmp_size_t_kind), value :: elsize
- end function kmp_calloc
-
- function kmp_realloc(ptr, size) bind(c)
- import
- integer (kind=kmp_pointer_kind) kmp_realloc
- integer (kind=kmp_pointer_kind), value :: ptr
- integer (kind=kmp_size_t_kind), value :: size
- end function kmp_realloc
-
- subroutine kmp_free(ptr) bind(c)
- import
- integer (kind=kmp_pointer_kind), value :: ptr
- end subroutine kmp_free
-
- subroutine kmp_set_warnings_on() bind(c)
- end subroutine kmp_set_warnings_on
-
- subroutine kmp_set_warnings_off() bind(c)
- end subroutine kmp_set_warnings_off
-
- subroutine omp_init_lock_with_hint(svar, hint) bind(c)
- import
- integer (kind=omp_lock_kind) svar
- integer (kind=omp_lock_hint_kind), value :: hint
- end subroutine omp_init_lock_with_hint
-
- subroutine omp_init_nest_lock_with_hint(nvar, hint) bind(c)
- import
- integer (kind=omp_nest_lock_kind) nvar
- integer (kind=omp_lock_hint_kind), value :: hint
- end subroutine omp_init_nest_lock_with_hint
-
- end interface
-
-!DIR$ IF DEFINED (__INTEL_OFFLOAD)
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_set_num_threads
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_set_dynamic
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_set_nested
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_num_threads
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_max_threads
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_thread_num
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_num_procs
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_in_parallel
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_in_final
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_dynamic
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_nested
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_thread_limit
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_set_max_active_levels
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_max_active_levels
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_level
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_active_level
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_ancestor_thread_num
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_team_size
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_set_schedule
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_schedule
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_proc_bind
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_wtime
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_wtick
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_default_device
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_set_default_device
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_is_initial_device
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_initial_device
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_num_devices
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_num_teams
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_team_num
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_init_lock
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_destroy_lock
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_set_lock
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_unset_lock
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_test_lock
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_init_nest_lock
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_destroy_nest_lock
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_set_nest_lock
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_unset_nest_lock
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_test_nest_lock
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_max_task_priority
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_set_stacksize
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_set_stacksize_s
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_set_blocktime
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_set_library_serial
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_set_library_turnaround
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_set_library_throughput
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_set_library
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_set_defaults
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_get_stacksize
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_get_stacksize_s
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_get_blocktime
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_get_library
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_set_disp_num_buffers
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_set_affinity
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_get_affinity
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_get_affinity_max_proc
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_create_affinity_mask
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_destroy_affinity_mask
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_set_affinity_mask_proc
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_unset_affinity_mask_proc
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_get_affinity_mask_proc
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_malloc
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_aligned_malloc
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_calloc
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_realloc
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_free
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_set_warnings_on
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_set_warnings_off
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_init_lock_with_hint
-!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_init_nest_lock_with_hint
-
-!DIR$ IF(__INTEL_COMPILER.GE.1400)
-!$omp declare target(omp_set_num_threads )
-!$omp declare target(omp_set_dynamic )
-!$omp declare target(omp_set_nested )
-!$omp declare target(omp_get_num_threads )
-!$omp declare target(omp_get_max_threads )
-!$omp declare target(omp_get_thread_num )
-!$omp declare target(omp_get_num_procs )
-!$omp declare target(omp_in_parallel )
-!$omp declare target(omp_in_final )
-!$omp declare target(omp_get_dynamic )
-!$omp declare target(omp_get_nested )
-!$omp declare target(omp_get_thread_limit )
-!$omp declare target(omp_set_max_active_levels )
-!$omp declare target(omp_get_max_active_levels )
-!$omp declare target(omp_get_level )
-!$omp declare target(omp_get_active_level )
-!$omp declare target(omp_get_ancestor_thread_num )
-!$omp declare target(omp_get_team_size )
-!$omp declare target(omp_set_schedule )
-!$omp declare target(omp_get_schedule )
-!$omp declare target(omp_get_proc_bind )
-!$omp declare target(omp_get_wtime )
-!$omp declare target(omp_get_wtick )
-!$omp declare target(omp_get_default_device )
-!$omp declare target(omp_set_default_device )
-!$omp declare target(omp_is_initial_device )
-!$omp declare target(omp_get_initial_device )
-!$omp declare target(omp_get_num_devices )
-!$omp declare target(omp_get_num_teams )
-!$omp declare target(omp_get_team_num )
-!$omp declare target(omp_init_lock )
-!$omp declare target(omp_destroy_lock )
-!$omp declare target(omp_set_lock )
-!$omp declare target(omp_unset_lock )
-!$omp declare target(omp_test_lock )
-!$omp declare target(omp_init_nest_lock )
-!$omp declare target(omp_destroy_nest_lock )
-!$omp declare target(omp_set_nest_lock )
-!$omp declare target(omp_unset_nest_lock )
-!$omp declare target(omp_test_nest_lock )
-!$omp declare target(omp_get_max_task_priority )
-!$omp declare target(kmp_set_stacksize )
-!$omp declare target(kmp_set_stacksize_s )
-!$omp declare target(kmp_set_blocktime )
-!$omp declare target(kmp_set_library_serial )
-!$omp declare target(kmp_set_library_turnaround )
-!$omp declare target(kmp_set_library_throughput )
-!$omp declare target(kmp_set_library )
-!$omp declare target(kmp_set_defaults )
-!$omp declare target(kmp_get_stacksize )
-!$omp declare target(kmp_get_stacksize_s )
-!$omp declare target(kmp_get_blocktime )
-!$omp declare target(kmp_get_library )
-!$omp declare target(kmp_set_disp_num_buffers )
-!$omp declare target(kmp_set_affinity )
-!$omp declare target(kmp_get_affinity )
-!$omp declare target(kmp_get_affinity_max_proc )
-!$omp declare target(kmp_create_affinity_mask )
-!$omp declare target(kmp_destroy_affinity_mask )
-!$omp declare target(kmp_set_affinity_mask_proc )
-!$omp declare target(kmp_unset_affinity_mask_proc )
-!$omp declare target(kmp_get_affinity_mask_proc )
-!$omp declare target(kmp_malloc )
-!$omp declare target(kmp_aligned_malloc )
-!$omp declare target(kmp_calloc )
-!$omp declare target(kmp_realloc )
-!$omp declare target(kmp_free )
-!$omp declare target(kmp_set_warnings_on )
-!$omp declare target(kmp_set_warnings_off )
-!$omp declare target(omp_init_lock_with_hint )
-!$omp declare target(omp_init_nest_lock_with_hint )
-!DIR$ ENDIF
-!DIR$ ENDIF
diff --git a/runtime/src/include/50/omp-tools.h.var b/runtime/src/include/omp-tools.h.var
index 276967d07e8f..190b538fa03c 100644
--- a/runtime/src/include/50/omp-tools.h.var
+++ b/runtime/src/include/omp-tools.h.var
@@ -1,13 +1,12 @@
/*
- * include/50/omp-tools.h.var
+ * include/omp-tools.h.var
*/
//===----------------------------------------------------------------------===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.txt for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -372,7 +371,7 @@ typedef enum ompt_frame_flag_t {
ompt_frame_cfa = 0x10,
ompt_frame_framepointer = 0x20,
ompt_frame_stackaddress = 0x30
-} ompt_frame_flag_t;
+} ompt_frame_flag_t;
typedef enum ompt_state_t {
ompt_state_work_serial = 0x000,
@@ -721,14 +720,14 @@ typedef void (*ompt_callback_dispatch_t) (
ompt_data_t *parallel_data,
ompt_data_t *task_data,
ompt_dispatch_t kind,
- ompt_data_t instance
+ ompt_data_t instance
);
typedef struct ompt_record_dispatch_t {
ompt_id_t parallel_id;
ompt_id_t task_id;
ompt_dispatch_t kind;
- ompt_data_t instance;
+ ompt_data_t instance;
} ompt_record_dispatch_t;
typedef void (*ompt_callback_task_create_t) (
diff --git a/runtime/src/include/50/omp.h.var b/runtime/src/include/omp.h.var
index 872b8f5007d7..2246e7012bee 100644
--- a/runtime/src/include/50/omp.h.var
+++ b/runtime/src/include/omp.h.var
@@ -1,14 +1,13 @@
/*
- * include/50/omp.h.var
+ * include/omp.h.var
*/
//===----------------------------------------------------------------------===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.txt for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -16,6 +15,9 @@
#ifndef __OMP_H
# define __OMP_H
+# include <stdlib.h>
+# include <stdint.h>
+
# define KMP_VERSION_MAJOR @LIBOMP_VERSION_MAJOR@
# define KMP_VERSION_MINOR @LIBOMP_VERSION_MINOR@
# define KMP_VERSION_BUILD @LIBOMP_VERSION_BUILD@
@@ -44,10 +46,11 @@
/* schedule kind constants */
typedef enum omp_sched_t {
- omp_sched_static = 1,
- omp_sched_dynamic = 2,
- omp_sched_guided = 3,
- omp_sched_auto = 4
+ omp_sched_static = 1,
+ omp_sched_dynamic = 2,
+ omp_sched_guided = 3,
+ omp_sched_auto = 4,
+ omp_sched_monotonic = 0x80000000
} omp_sched_t;
/* set API functions */
@@ -134,7 +137,6 @@
extern int __KAI_KMPC_CONVENTION omp_get_team_num (void);
extern int __KAI_KMPC_CONVENTION omp_get_cancellation (void);
-# include <stdlib.h>
/* OpenMP 4.5 */
extern int __KAI_KMPC_CONVENTION omp_get_initial_device (void);
extern void* __KAI_KMPC_CONVENTION omp_target_alloc(size_t, int);
@@ -148,6 +150,7 @@
/* OpenMP 5.0 */
extern int __KAI_KMPC_CONVENTION omp_get_device_num (void);
+ typedef void * omp_depend_t;
/* kmp API functions */
extern int __KAI_KMPC_CONVENTION kmp_get_stacksize (void);
@@ -218,30 +221,113 @@
omp_control_tool_flush = 3,
omp_control_tool_end = 4
} omp_control_tool_t;
-
+
extern int __KAI_KMPC_CONVENTION omp_control_tool(int, int, void*);
/* OpenMP 5.0 Memory Management */
- typedef void *omp_allocator_t;
- extern __KMP_IMP const omp_allocator_t *OMP_NULL_ALLOCATOR;
- extern __KMP_IMP const omp_allocator_t *omp_default_mem_alloc;
- extern __KMP_IMP const omp_allocator_t *omp_large_cap_mem_alloc;
- extern __KMP_IMP const omp_allocator_t *omp_const_mem_alloc;
- extern __KMP_IMP const omp_allocator_t *omp_high_bw_mem_alloc;
- extern __KMP_IMP const omp_allocator_t *omp_low_lat_mem_alloc;
- extern __KMP_IMP const omp_allocator_t *omp_cgroup_mem_alloc;
- extern __KMP_IMP const omp_allocator_t *omp_pteam_mem_alloc;
- extern __KMP_IMP const omp_allocator_t *omp_thread_mem_alloc;
-
- extern void __KAI_KMPC_CONVENTION omp_set_default_allocator(const omp_allocator_t *);
- extern const omp_allocator_t * __KAI_KMPC_CONVENTION omp_get_default_allocator(void);
-#ifdef __cplusplus
- extern void *__KAI_KMPC_CONVENTION omp_alloc(size_t size, const omp_allocator_t *allocator = OMP_NULL_ALLOCATOR);
- extern void __KAI_KMPC_CONVENTION omp_free(void * ptr, const omp_allocator_t *allocator = OMP_NULL_ALLOCATOR);
-#else
- extern void *__KAI_KMPC_CONVENTION omp_alloc(size_t size, const omp_allocator_t *allocator);
- extern void __KAI_KMPC_CONVENTION omp_free(void *ptr, const omp_allocator_t *allocator);
-#endif
+ typedef uintptr_t omp_uintptr_t;
+
+ typedef enum {
+ OMP_ATK_THREADMODEL = 1,
+ OMP_ATK_ALIGNMENT = 2,
+ OMP_ATK_ACCESS = 3,
+ OMP_ATK_POOL_SIZE = 4,
+ OMP_ATK_FALLBACK = 5,
+ OMP_ATK_FB_DATA = 6,
+ OMP_ATK_PINNED = 7,
+ OMP_ATK_PARTITION = 8
+ } omp_alloctrait_key_t;
+
+ typedef enum {
+ OMP_ATV_FALSE = 0,
+ OMP_ATV_TRUE = 1,
+ OMP_ATV_DEFAULT = 2,
+ OMP_ATV_CONTENDED = 3,
+ OMP_ATV_UNCONTENDED = 4,
+ OMP_ATV_SEQUENTIAL = 5,
+ OMP_ATV_PRIVATE = 6,
+ OMP_ATV_ALL = 7,
+ OMP_ATV_THREAD = 8,
+ OMP_ATV_PTEAM = 9,
+ OMP_ATV_CGROUP = 10,
+ OMP_ATV_DEFAULT_MEM_FB = 11,
+ OMP_ATV_NULL_FB = 12,
+ OMP_ATV_ABORT_FB = 13,
+ OMP_ATV_ALLOCATOR_FB = 14,
+ OMP_ATV_ENVIRONMENT = 15,
+ OMP_ATV_NEAREST = 16,
+ OMP_ATV_BLOCKED = 17,
+ OMP_ATV_INTERLEAVED = 18
+ } omp_alloctrait_value_t;
+
+ typedef struct {
+ omp_alloctrait_key_t key;
+ omp_uintptr_t value;
+ } omp_alloctrait_t;
+
+# if defined(_WIN32)
+ // On Windows cl and icl do not support 64-bit enum, let's use integer then.
+ typedef omp_uintptr_t omp_allocator_handle_t;
+ extern __KMP_IMP omp_allocator_handle_t const omp_null_allocator;
+ extern __KMP_IMP omp_allocator_handle_t const omp_default_mem_alloc;
+ extern __KMP_IMP omp_allocator_handle_t const omp_large_cap_mem_alloc;
+ extern __KMP_IMP omp_allocator_handle_t const omp_const_mem_alloc;
+ extern __KMP_IMP omp_allocator_handle_t const omp_high_bw_mem_alloc;
+ extern __KMP_IMP omp_allocator_handle_t const omp_low_lat_mem_alloc;
+ extern __KMP_IMP omp_allocator_handle_t const omp_cgroup_mem_alloc;
+ extern __KMP_IMP omp_allocator_handle_t const omp_pteam_mem_alloc;
+ extern __KMP_IMP omp_allocator_handle_t const omp_thread_mem_alloc;
+ typedef omp_uintptr_t omp_memspace_handle_t;
+ extern __KMP_IMP omp_memspace_handle_t const omp_default_mem_space;
+ extern __KMP_IMP omp_memspace_handle_t const omp_large_cap_mem_space;
+ extern __KMP_IMP omp_memspace_handle_t const omp_const_mem_space;
+ extern __KMP_IMP omp_memspace_handle_t const omp_high_bw_mem_space;
+ extern __KMP_IMP omp_memspace_handle_t const omp_low_lat_mem_space;
+# else
+# if __cplusplus >= 201103
+ typedef enum omp_allocator_handle_t : omp_uintptr_t
+# else
+ typedef enum omp_allocator_handle_t
+# endif
+ {
+ omp_null_allocator = 0,
+ omp_default_mem_alloc = 1,
+ omp_large_cap_mem_alloc = 2,
+ omp_const_mem_alloc = 3,
+ omp_high_bw_mem_alloc = 4,
+ omp_low_lat_mem_alloc = 5,
+ omp_cgroup_mem_alloc = 6,
+ omp_pteam_mem_alloc = 7,
+ omp_thread_mem_alloc = 8,
+ KMP_ALLOCATOR_MAX_HANDLE = UINTPTR_MAX
+ } omp_allocator_handle_t;
+# if __cplusplus >= 201103
+ typedef enum omp_memspace_handle_t : omp_uintptr_t
+# else
+ typedef enum omp_memspace_handle_t
+# endif
+ {
+ omp_default_mem_space = 0,
+ omp_large_cap_mem_space = 1,
+ omp_const_mem_space = 2,
+ omp_high_bw_mem_space = 3,
+ omp_low_lat_mem_space = 4,
+ KMP_MEMSPACE_MAX_HANDLE = UINTPTR_MAX
+ } omp_memspace_handle_t;
+# endif
+ extern omp_allocator_handle_t __KAI_KMPC_CONVENTION omp_init_allocator(omp_memspace_handle_t m,
+ int ntraits, omp_alloctrait_t traits[]);
+ extern void __KAI_KMPC_CONVENTION omp_destroy_allocator(omp_allocator_handle_t allocator);
+
+ extern void __KAI_KMPC_CONVENTION omp_set_default_allocator(omp_allocator_handle_t a);
+ extern omp_allocator_handle_t __KAI_KMPC_CONVENTION omp_get_default_allocator(void);
+# ifdef __cplusplus
+ extern void *__KAI_KMPC_CONVENTION omp_alloc(size_t size, omp_allocator_handle_t a = omp_null_allocator);
+ extern void __KAI_KMPC_CONVENTION omp_free(void * ptr, omp_allocator_handle_t a = omp_null_allocator);
+# else
+ extern void *__KAI_KMPC_CONVENTION omp_alloc(size_t size, omp_allocator_handle_t a);
+ extern void __KAI_KMPC_CONVENTION omp_free(void *ptr, omp_allocator_handle_t a);
+# endif
/* OpenMP 5.0 Affinity Format */
extern void __KAI_KMPC_CONVENTION omp_set_affinity_format(char const *);
@@ -249,6 +335,26 @@
extern void __KAI_KMPC_CONVENTION omp_display_affinity(char const *);
extern size_t __KAI_KMPC_CONVENTION omp_capture_affinity(char *, size_t, char const *);
+ /* OpenMP 5.0 events */
+# if defined(_WIN32)
+ // On Windows cl and icl do not support 64-bit enum, let's use integer then.
+ typedef omp_uintptr_t omp_event_handle_t;
+# else
+ typedef enum omp_event_handle_t { KMP_EVENT_MAX_HANDLE = UINTPTR_MAX } omp_event_handle_t;
+# endif
+ extern void __KAI_KMPC_CONVENTION omp_fulfill_event ( omp_event_handle_t event );
+
+ /* OpenMP 5.0 Pause Resources */
+ typedef enum omp_pause_resource_t {
+ omp_pause_resume = 0,
+ omp_pause_soft = 1,
+ omp_pause_hard = 2
+ } omp_pause_resource_t;
+ extern int __KAI_KMPC_CONVENTION omp_pause_resource(omp_pause_resource_t, int);
+ extern int __KAI_KMPC_CONVENTION omp_pause_resource_all(omp_pause_resource_t);
+
+ extern int __KAI_KMPC_CONVENTION omp_get_supported_active_levels(void);
+
# undef __KAI_KMPC_CONVENTION
# undef __KMP_IMP
diff --git a/runtime/src/include/50/omp_lib.f.var b/runtime/src/include/omp_lib.f.var
index bebb6e9de942..19f14d75f21c 100644
--- a/runtime/src/include/50/omp_lib.f.var
+++ b/runtime/src/include/omp_lib.f.var
@@ -1,12 +1,11 @@
-! include/50/omp_lib.f.var
+! include/omp_lib.f.var
!
!//===----------------------------------------------------------------------===//
!//
-!// The LLVM Compiler Infrastructure
-!//
-!// This file is dual licensed under the MIT and the University of Illinois Open
-!// Source Licenses. See LICENSE.txt for details.
+!// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+!// See https://llvm.org/LICENSE.txt for license information.
+!// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
!//
!//===----------------------------------------------------------------------===//
!
@@ -34,7 +33,19 @@
integer, parameter :: omp_lock_hint_kind = omp_integer_kind
integer, parameter :: omp_control_tool_kind = omp_integer_kind
integer, parameter :: omp_control_tool_result_kind = omp_integer_kind
- integer, parameter :: omp_allocator_kind = int_ptr_kind()
+ integer, parameter :: omp_allocator_handle_kind = int_ptr_kind()
+ integer, parameter :: omp_memspace_handle_kind = int_ptr_kind()
+ integer, parameter :: omp_alloctrait_key_kind = omp_integer_kind
+ integer, parameter :: omp_alloctrait_val_kind = int_ptr_kind()
+
+ type omp_alloctrait
+ integer(kind=omp_alloctrait_key_kind) key
+ integer(kind=omp_alloctrait_val_kind) value
+ end type omp_alloctrait
+
+ integer, parameter :: omp_pause_resource_kind = omp_integer_kind
+ integer, parameter :: omp_depend_kind = int_ptr_kind()
+ integer, parameter :: omp_event_handle_kind = int_ptr_kind()
end module omp_lib_kinds
@@ -52,6 +63,7 @@
integer(kind=omp_sched_kind), parameter :: omp_sched_dynamic = 2
integer(kind=omp_sched_kind), parameter :: omp_sched_guided = 3
integer(kind=omp_sched_kind), parameter :: omp_sched_auto = 4
+ integer(kind=omp_sched_kind), parameter :: omp_sched_monotonic = Z'80000000'
integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_false = 0
integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_true = 1
@@ -73,15 +85,54 @@
integer (kind=omp_lock_hint_kind), parameter :: kmp_lock_hint_rtm = 131072
integer (kind=omp_lock_hint_kind), parameter :: kmp_lock_hint_adaptive = 262144
- integer (kind=omp_allocator_kind), parameter :: omp_null_allocator = 0
- integer (kind=omp_allocator_kind), parameter :: omp_default_mem_alloc = 1
- integer (kind=omp_allocator_kind), parameter :: omp_large_cap_mem_alloc = 2
- integer (kind=omp_allocator_kind), parameter :: omp_const_mem_alloc = 3
- integer (kind=omp_allocator_kind), parameter :: omp_high_bw_mem_alloc = 4
- integer (kind=omp_allocator_kind), parameter :: omp_low_lat_mem_alloc = 5
- integer (kind=omp_allocator_kind), parameter :: omp_cgroup_mem_alloc = 6
- integer (kind=omp_allocator_kind), parameter :: omp_pteam_mem_alloc = 7
- integer (kind=omp_allocator_kind), parameter :: omp_thread_mem_alloc = 8
+ integer (kind=omp_alloctrait_key_kind), parameter :: omp_atk_threadmodel = 1
+ integer (kind=omp_alloctrait_key_kind), parameter :: omp_atk_alignment = 2
+ integer (kind=omp_alloctrait_key_kind), parameter :: omp_atk_access = 3
+ integer (kind=omp_alloctrait_key_kind), parameter :: omp_atk_pool_size = 4
+ integer (kind=omp_alloctrait_key_kind), parameter :: omp_atk_fallback = 5
+ integer (kind=omp_alloctrait_key_kind), parameter :: omp_atk_fb_data = 6
+ integer (kind=omp_alloctrait_key_kind), parameter :: omp_atk_pinned = 7
+ integer (kind=omp_alloctrait_key_kind), parameter :: omp_atk_partition = 8
+
+ integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_false = 0
+ integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_true = 1
+ integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_default = 2
+ integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_contended = 3
+ integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_uncontended = 4
+ integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_sequential = 5
+ integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_private = 6
+ integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_all = 7
+ integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_thread = 8
+ integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_pteam = 9
+ integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_cgroup = 10
+ integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_default_mem_fb = 11
+ integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_null_fb = 12
+ integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_abort_fb = 13
+ integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_allocator_fb = 14
+ integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_environment = 15
+ integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_nearest = 16
+ integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_blocked = 17
+ integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_interleaved = 18
+
+ integer (kind=omp_allocator_handle_kind), parameter :: omp_null_allocator = 0
+ integer (kind=omp_allocator_handle_kind), parameter :: omp_default_mem_alloc = 1
+ integer (kind=omp_allocator_handle_kind), parameter :: omp_large_cap_mem_alloc = 2
+ integer (kind=omp_allocator_handle_kind), parameter :: omp_const_mem_alloc = 3
+ integer (kind=omp_allocator_handle_kind), parameter :: omp_high_bw_mem_alloc = 4
+ integer (kind=omp_allocator_handle_kind), parameter :: omp_low_lat_mem_alloc = 5
+ integer (kind=omp_allocator_handle_kind), parameter :: omp_cgroup_mem_alloc = 6
+ integer (kind=omp_allocator_handle_kind), parameter :: omp_pteam_mem_alloc = 7
+ integer (kind=omp_allocator_handle_kind), parameter :: omp_thread_mem_alloc = 8
+
+ integer (kind=omp_memspace_handle_kind), parameter :: omp_default_mem_space = 0
+ integer (kind=omp_memspace_handle_kind), parameter :: omp_large_cap_mem_space = 1
+ integer (kind=omp_memspace_handle_kind), parameter :: omp_const_mem_space = 2
+ integer (kind=omp_memspace_handle_kind), parameter :: omp_high_bw_mem_space = 3
+ integer (kind=omp_memspace_handle_kind), parameter :: omp_low_lat_mem_space = 4
+
+ integer (kind=omp_pause_resource_kind), parameter :: omp_pause_resume = 0
+ integer (kind=omp_pause_resource_kind), parameter :: omp_pause_soft = 1
+ integer (kind=omp_pause_resource_kind), parameter :: omp_pause_hard = 2
interface
@@ -283,6 +334,29 @@
integer (kind=omp_integer_kind) omp_get_device_num
end function omp_get_device_num
+ function omp_pause_resource(kind, device_num)
+ use omp_lib_kinds
+ integer (kind=omp_pause_resource_kind) kind
+ integer (kind=omp_integer_kind) device_num
+ integer (kind=omp_integer_kind) omp_pause_resource
+ end function omp_pause_resource
+
+ function omp_pause_resource_all(kind)
+ use omp_lib_kinds
+ integer (kind=omp_pause_resource_kind) kind
+ integer (kind=omp_integer_kind) omp_pause_resource_all
+ end function omp_pause_resource_all
+
+ function omp_get_supported_active_levels()
+ use omp_lib_kinds
+ integer (kind=omp_integer_kind) omp_get_supported_active_levels
+ end function omp_get_supported_active_levels
+
+ subroutine omp_fulfill_event(event)
+ use omp_lib_kinds
+ integer (kind=omp_event_handle_kind) event
+ end subroutine omp_fulfill_event
+
subroutine omp_init_lock(svar)
!DIR$ IF(__INTEL_COMPILER.GE.1400)
!DIR$ attributes known_intrinsic :: omp_init_lock
@@ -370,14 +444,27 @@
integer (kind=omp_integer_kind) omp_get_max_task_priority
end function omp_get_max_task_priority
- subroutine omp_set_default_allocator(svar)
+ function omp_init_allocator(memspace, ntraits, traits)
+ use omp_lib_kinds
+ integer (omp_allocator_handle_kind) omp_init_allocator
+ integer (omp_memspace_handle_kind) :: memspace
+ integer (omp_integer_kind) :: ntraits
+ type(omp_alloctrait), intent(in) :: traits(*)
+ end function omp_init_allocator
+
+ subroutine omp_destroy_allocator(allocator) bind(c)
+ use omp_lib_kinds
+ integer (omp_allocator_handle_kind), value :: allocator
+ end subroutine omp_destroy_allocator
+
+ subroutine omp_set_default_allocator(allocator) bind(c)
use omp_lib_kinds
- integer (kind=omp_allocator_kind) svar
+ integer (omp_allocator_handle_kind) allocator
end subroutine omp_set_default_allocator
- function omp_get_default_allocator()
+ function omp_get_default_allocator() bind(c)
use omp_lib_kinds
- integer (kind=omp_allocator_kind) omp_get_default_allocator
+ integer(omp_allocator_handle_kind)omp_get_default_allocator
end function omp_get_default_allocator
subroutine omp_set_affinity_format(format)
@@ -621,6 +708,11 @@
!dec$ attributes alias:'OMP_GET_INITIAL_DEVICE' :: omp_get_initial_device
!dec$ attributes alias:'OMP_GET_MAX_TASK_PRIORITY' :: omp_get_max_task_priority
!dec$ attributes alias:'OMP_GET_DEVICE_NUM' :: omp_get_device_num
+!dec$ attributes alias:'OMP_PAUSE_RESOURCE' :: omp_pause_resource
+!dec$ attributes alias:'OMP_PAUSE_RESOURCE_ALL' :: omp_pause_resource_all
+!dec$ attributes alias:'OMP_GET_SUPPORTED_ACTIVE_LEVELS' :: omp_get_supported_active_levels
+!dec$ attributes alias:'OMP_FULFILL_EVENT' :: omp_fulfill_event
+
!dec$ attributes alias:'OMP_CONTROL_TOOL' :: omp_control_tool
!dec$ attributes alias:'OMP_SET_AFFINITY_FORMAT' :: omp_set_affinity_format
!dec$ attributes alias:'OMP_GET_AFFINITY_FORMAT' :: omp_get_affinity_format
@@ -708,6 +800,11 @@
!dec$ attributes alias:'_OMP_GET_INITIAL_DEVICE' :: omp_get_initial_device
!dec$ attributes alias:'_OMP_GET_MAX_TASK_PRIORTY' :: omp_get_max_task_priority
!dec$ attributes alias:'_OMP_GET_DEVICE_NUM' :: omp_get_device_num
+!dec$ attributes alias:'_OMP_PAUSE_RESOURCE' :: omp_pause_resource
+!dec$ attributes alias:'_OMP_PAUSE_RESOURCE_ALL' :: omp_pause_resource_all
+!dec$ attributes alias:'_OMP_GET_SUPPORTED_ACTIVE_LEVELS' :: omp_get_supported_active_levels
+!dec$ attributes alias:'_OMP_FULFILL_EVENT' :: omp_fulfill_event
+
!dec$ attributes alias:'_OMP_CONTROL_TOOL' :: omp_control_tool
!dec$ attributes alias:'_OMP_SET_AFFINITY_FORMAT' :: omp_set_affinity_format
!dec$ attributes alias:'_OMP_GET_AFFINITY_FORMAT' :: omp_get_affinity_format
@@ -798,6 +895,11 @@
!dec$ attributes alias:'omp_get_initial_device_'::omp_get_initial_device
!dec$ attributes alias:'omp_get_max_task_priority_'::omp_get_max_task_priority
!dec$ attributes alias:'omp_get_device_num_'::omp_get_device_num
+!dec$ attributes alias:'omp_pause_resource_' :: omp_pause_resource
+!dec$ attributes alias:'omp_pause_resource_all_' :: omp_pause_resource_all
+!dec$ attributes alias:'omp_get_supported_active_levels_' :: omp_get_supported_active_levels
+!dec$ attributes alias:'omp_fulfill_event_' :: omp_fulfill_event
+
!dec$ attributes alias:'omp_set_affinity_format_' :: omp_set_affinity_format
!dec$ attributes alias:'omp_get_affinity_format_' :: omp_get_affinity_format
!dec$ attributes alias:'omp_display_affinity_' :: omp_display_affinity
@@ -887,6 +989,11 @@
!dec$ attributes alias:'_omp_get_initial_device_'::omp_get_initial_device
!dec$ attributes alias:'_omp_get_max_task_priorty_'::omp_get_max_task_priority
!dec$ attributes alias:'_omp_get_device_num_'::omp_get_device_num
+!dec$ attributes alias:'_omp_pause_resource_' :: omp_pause_resource
+!dec$ attributes alias:'_omp_pause_resource_all_' :: omp_pause_resource_all
+!dec$ attributes alias:'_omp_get_supported_active_levels_' :: omp_get_supported_active_levels
+!dec$ attributes alias:'_omp_fulfill_event_' :: omp_fulfill_event
+
!dec$ attributes alias:'_omp_init_lock_'::omp_init_lock
!dec$ attributes alias:'_omp_init_lock_with_hint_'::omp_init_lock_with_hint
!dec$ attributes alias:'_omp_destroy_lock_'::omp_destroy_lock
diff --git a/runtime/src/include/50/omp_lib.f90.var b/runtime/src/include/omp_lib.f90.var
index e0233de81d78..ac568486d204 100644
--- a/runtime/src/include/50/omp_lib.f90.var
+++ b/runtime/src/include/omp_lib.f90.var
@@ -1,12 +1,11 @@
-! include/50/omp_lib.f90.var
+! include/omp_lib.f90.var
!
!//===----------------------------------------------------------------------===//
!//
-!// The LLVM Compiler Infrastructure
-!//
-!// This file is dual licensed under the MIT and the University of Illinois Open
-!// Source Licenses. See LICENSE.txt for details.
+!// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+!// See https://llvm.org/LICENSE.txt for license information.
+!// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
!//
!//===----------------------------------------------------------------------===//
!
@@ -31,7 +30,19 @@
integer, parameter :: omp_lock_hint_kind = omp_sync_hint_kind
integer, parameter :: omp_control_tool_kind = omp_integer_kind
integer, parameter :: omp_control_tool_result_kind = omp_integer_kind
- integer, parameter :: omp_allocator_kind = c_intptr_t
+ integer, parameter :: omp_allocator_handle_kind = c_intptr_t
+ integer, parameter :: omp_memspace_handle_kind = c_intptr_t
+ integer, parameter :: omp_alloctrait_key_kind = omp_integer_kind
+ integer, parameter :: omp_alloctrait_val_kind = c_intptr_t
+
+ type omp_alloctrait
+ integer(kind=omp_alloctrait_key_kind) key
+ integer(kind=omp_alloctrait_val_kind) value
+ end type omp_alloctrait
+
+ integer, parameter :: omp_pause_resource_kind = omp_integer_kind
+ integer, parameter :: omp_depend_kind = c_intptr_t
+ integer, parameter :: omp_event_handle_kind = c_intptr_t
end module omp_lib_kinds
@@ -50,7 +61,7 @@
integer(kind=omp_sched_kind), parameter :: omp_sched_dynamic = 2
integer(kind=omp_sched_kind), parameter :: omp_sched_guided = 3
integer(kind=omp_sched_kind), parameter :: omp_sched_auto = 4
-
+ integer(kind=omp_sched_kind), parameter :: omp_sched_monotonic = int(Z'80000000', kind=omp_sched_kind)
integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_false = 0
integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_true = 1
@@ -87,15 +98,54 @@
integer (kind=omp_control_tool_result_kind), parameter :: omp_control_tool_success = 0
integer (kind=omp_control_tool_result_kind), parameter :: omp_control_tool_ignored = 1
- integer (kind=omp_allocator_kind), parameter :: omp_null_allocator = 0
- integer (kind=omp_allocator_kind), parameter :: omp_default_mem_alloc = 1
- integer (kind=omp_allocator_kind), parameter :: omp_large_cap_mem_alloc = 2
- integer (kind=omp_allocator_kind), parameter :: omp_const_mem_alloc = 3
- integer (kind=omp_allocator_kind), parameter :: omp_high_bw_mem_alloc = 4
- integer (kind=omp_allocator_kind), parameter :: omp_low_lat_mem_alloc = 5
- integer (kind=omp_allocator_kind), parameter :: omp_cgroup_mem_alloc = 6
- integer (kind=omp_allocator_kind), parameter :: omp_pteam_mem_alloc = 7
- integer (kind=omp_allocator_kind), parameter :: omp_thread_mem_alloc = 8
+ integer (kind=omp_alloctrait_key_kind), parameter :: omp_atk_threadmodel = 1
+ integer (kind=omp_alloctrait_key_kind), parameter :: omp_atk_alignment = 2
+ integer (kind=omp_alloctrait_key_kind), parameter :: omp_atk_access = 3
+ integer (kind=omp_alloctrait_key_kind), parameter :: omp_atk_pool_size = 4
+ integer (kind=omp_alloctrait_key_kind), parameter :: omp_atk_fallback = 5
+ integer (kind=omp_alloctrait_key_kind), parameter :: omp_atk_fb_data = 6
+ integer (kind=omp_alloctrait_key_kind), parameter :: omp_atk_pinned = 7
+ integer (kind=omp_alloctrait_key_kind), parameter :: omp_atk_partition = 8
+
+ integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_false = 0
+ integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_true = 1
+ integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_default = 2
+ integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_contended = 3
+ integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_uncontended = 4
+ integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_sequential = 5
+ integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_private = 6
+ integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_all = 7
+ integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_thread = 8
+ integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_pteam = 9
+ integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_cgroup = 10
+ integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_default_mem_fb = 11
+ integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_null_fb = 12
+ integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_abort_fb = 13
+ integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_allocator_fb = 14
+ integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_environment = 15
+ integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_nearest = 16
+ integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_blocked = 17
+ integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_interleaved = 18
+
+ integer (kind=omp_allocator_handle_kind), parameter :: omp_null_allocator = 0
+ integer (kind=omp_allocator_handle_kind), parameter :: omp_default_mem_alloc = 1
+ integer (kind=omp_allocator_handle_kind), parameter :: omp_large_cap_mem_alloc = 2
+ integer (kind=omp_allocator_handle_kind), parameter :: omp_const_mem_alloc = 3
+ integer (kind=omp_allocator_handle_kind), parameter :: omp_high_bw_mem_alloc = 4
+ integer (kind=omp_allocator_handle_kind), parameter :: omp_low_lat_mem_alloc = 5
+ integer (kind=omp_allocator_handle_kind), parameter :: omp_cgroup_mem_alloc = 6
+ integer (kind=omp_allocator_handle_kind), parameter :: omp_pteam_mem_alloc = 7
+ integer (kind=omp_allocator_handle_kind), parameter :: omp_thread_mem_alloc = 8
+
+ integer (kind=omp_memspace_handle_kind), parameter :: omp_default_mem_space = 0
+ integer (kind=omp_memspace_handle_kind), parameter :: omp_large_cap_mem_space = 1
+ integer (kind=omp_memspace_handle_kind), parameter :: omp_const_mem_space = 2
+ integer (kind=omp_memspace_handle_kind), parameter :: omp_high_bw_mem_space = 3
+ integer (kind=omp_memspace_handle_kind), parameter :: omp_low_lat_mem_space = 4
+
+ integer (kind=omp_pause_resource_kind), parameter :: omp_pause_resume = 0
+ integer (kind=omp_pause_resource_kind), parameter :: omp_pause_soft = 1
+ integer (kind=omp_pause_resource_kind), parameter :: omp_pause_hard = 2
interface
@@ -299,6 +349,29 @@
integer (kind=omp_integer_kind) omp_get_device_num
end function omp_get_device_num
+ function omp_pause_resource(kind, device_num) bind(c)
+ use omp_lib_kinds
+ integer (kind=omp_pause_resource_kind), value :: kind
+ integer (kind=omp_integer_kind), value :: device_num
+ integer (kind=omp_integer_kind) omp_pause_resource
+ end function omp_pause_resource
+
+ function omp_pause_resource_all(kind) bind(c)
+ use omp_lib_kinds
+ integer (kind=omp_pause_resource_kind), value :: kind
+ integer (kind=omp_integer_kind) omp_pause_resource_all
+ end function omp_pause_resource_all
+
+ function omp_get_supported_active_levels() bind(c)
+ use omp_lib_kinds
+ integer (kind=omp_integer_kind) omp_get_supported_active_levels
+ end function omp_get_supported_active_levels
+
+ subroutine omp_fulfill_event(event) bind(c)
+ use omp_lib_kinds
+ integer (kind=omp_event_handle_kind), value :: event
+ end subroutine omp_fulfill_event
+
subroutine omp_init_lock(svar) bind(c)
!DIR$ IF(__INTEL_COMPILER.GE.1400)
!DIR$ attributes known_intrinsic :: omp_init_lock
@@ -386,14 +459,27 @@
integer (kind=omp_integer_kind) omp_get_max_task_priority
end function omp_get_max_task_priority
- subroutine omp_set_default_allocator(svar) bind(c)
+ function omp_init_allocator(memspace, ntraits, traits)
+ use omp_lib_kinds
+ integer (kind=omp_allocator_handle_kind) omp_init_allocator
+ integer (kind=omp_memspace_handle_kind) :: memspace
+ integer (kind=omp_integer_kind) :: ntraits
+ type(omp_alloctrait), intent(in) :: traits(*)
+ end function omp_init_allocator
+
+ subroutine omp_destroy_allocator(allocator) bind(c)
+ use omp_lib_kinds
+ integer (kind=omp_allocator_handle_kind), value :: allocator
+ end subroutine omp_destroy_allocator
+
+ subroutine omp_set_default_allocator(allocator) bind(c)
use omp_lib_kinds
- integer (kind=omp_allocator_kind), value :: svar
+ integer (kind=omp_allocator_handle_kind), value :: allocator
end subroutine omp_set_default_allocator
function omp_get_default_allocator() bind(c)
use omp_lib_kinds
- integer (kind=omp_allocator_kind) omp_get_default_allocator
+ integer (kind=omp_allocator_handle_kind) omp_get_default_allocator
end function omp_get_default_allocator
subroutine omp_set_affinity_format(format)
diff --git a/runtime/src/include/50/omp_lib.h.var b/runtime/src/include/omp_lib.h.var
index 605b410dd827..8775128157bd 100644
--- a/runtime/src/include/50/omp_lib.h.var
+++ b/runtime/src/include/omp_lib.h.var
@@ -1,12 +1,11 @@
-! include/50/omp_lib.h.var
+! include/omp_lib.h.var
!
!//===----------------------------------------------------------------------===//
!//
-!// The LLVM Compiler Infrastructure
-!//
-!// This file is dual licensed under the MIT and the University of Illinois Open
-!// Source Licenses. See LICENSE.txt for details.
+!// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+!// See https://llvm.org/LICENSE.txt for license information.
+!// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
!//
!//===----------------------------------------------------------------------===//
!
@@ -39,8 +38,20 @@
parameter(omp_control_tool_kind=omp_integer_kind)
integer omp_control_tool_result_kind
parameter(omp_control_tool_result_kind=omp_integer_kind)
- integer omp_allocator_kind
- parameter(omp_allocator_kind=int_ptr_kind())
+ integer omp_allocator_handle_kind
+ parameter(omp_allocator_handle_kind=int_ptr_kind())
+ integer omp_memspace_handle_kind
+ parameter(omp_memspace_handle_kind=int_ptr_kind())
+ integer omp_alloctrait_key_kind
+ parameter(omp_alloctrait_key_kind=omp_integer_kind)
+ integer omp_alloctrait_val_kind
+ parameter(omp_alloctrait_val_kind=int_ptr_kind())
+ integer omp_pause_resource_kind
+ parameter(omp_pause_resource_kind=omp_integer_kind)
+ integer omp_depend_kind
+ parameter(omp_depend_kind=int_ptr_kind())
+ integer omp_event_handle_kind
+ parameter(omp_event_handle_kind=int_ptr_kind())
integer(kind=omp_integer_kind)openmp_version
parameter(openmp_version=@LIBOMP_OMP_YEAR_MONTH@)
@@ -61,6 +72,8 @@
parameter(omp_sched_guided=3)
integer(kind=omp_sched_kind)omp_sched_auto
parameter(omp_sched_auto=4)
+ integer(kind=omp_sched_kind)omp_sched_monotonic
+ parameter(omp_sched_monotonic=Z'80000000')
integer(kind=omp_proc_bind_kind)omp_proc_bind_false
parameter(omp_proc_bind_false=0)
@@ -118,25 +131,106 @@
integer(omp_control_tool_result_kind)omp_control_tool_ignored
parameter(omp_control_tool_ignored=1)
- integer(kind=omp_allocator_kind)omp_null_allocator
+ integer(kind=omp_alloctrait_key_kind)omp_atk_threadmodel
+ parameter(omp_atk_threadmodel=1)
+ integer(kind=omp_alloctrait_key_kind)omp_atk_alignment
+ parameter(omp_atk_alignment=2)
+ integer(kind=omp_alloctrait_key_kind)omp_atk_access
+ parameter(omp_atk_access=3)
+ integer(kind=omp_alloctrait_key_kind)omp_atk_pool_size
+ parameter(omp_atk_pool_size=4)
+ integer(kind=omp_alloctrait_key_kind)omp_atk_fallback
+ parameter(omp_atk_fallback=5)
+ integer(kind=omp_alloctrait_key_kind)omp_atk_fb_data
+ parameter(omp_atk_fb_data=6)
+ integer(kind=omp_alloctrait_key_kind)omp_atk_pinned
+ parameter(omp_atk_pinned=7)
+ integer(kind=omp_alloctrait_key_kind)omp_atk_partition
+ parameter(omp_atk_partition=8)
+
+ ! Reserved for future use
+ integer(kind=omp_alloctrait_val_kind)omp_atv_false
+ parameter(omp_atv_false=0)
+ ! Reserved for future use
+ integer(kind=omp_alloctrait_val_kind)omp_atv_true
+ parameter(omp_atv_true=1)
+ integer(kind=omp_alloctrait_val_kind)omp_atv_default
+ parameter(omp_atv_default=2)
+ integer(kind=omp_alloctrait_val_kind)omp_atv_contended
+ parameter(omp_atv_contended=3)
+ integer(kind=omp_alloctrait_val_kind)omp_atv_uncontended
+ parameter(omp_atv_uncontended=4)
+ integer(kind=omp_alloctrait_val_kind)omp_atv_sequential
+ parameter(omp_atv_sequential=5)
+ integer(kind=omp_alloctrait_val_kind)omp_atv_private
+ parameter(omp_atv_private=6)
+ integer(kind=omp_alloctrait_val_kind)omp_atv_all
+ parameter(omp_atv_all=7)
+ integer(kind=omp_alloctrait_val_kind)omp_atv_thread
+ parameter(omp_atv_thread=8)
+ integer(kind=omp_alloctrait_val_kind)omp_atv_pteam
+ parameter(omp_atv_pteam=9)
+ integer(kind=omp_alloctrait_val_kind)omp_atv_cgroup
+ parameter(omp_atv_cgroup=10)
+ integer(kind=omp_alloctrait_val_kind)omp_atv_default_mem_fb
+ parameter(omp_atv_default_mem_fb=11)
+ integer(kind=omp_alloctrait_val_kind)omp_atv_null_fb
+ parameter(omp_atv_null_fb=12)
+ integer(kind=omp_alloctrait_val_kind)omp_atv_abort_fb
+ parameter(omp_atv_abort_fb=13)
+ integer(kind=omp_alloctrait_val_kind)omp_atv_allocator_fb
+ parameter(omp_atv_allocator_fb=14)
+ integer(kind=omp_alloctrait_val_kind)omp_atv_environment
+ parameter(omp_atv_environment=15)
+ integer(kind=omp_alloctrait_val_kind)omp_atv_nearest
+ parameter(omp_atv_nearest=16)
+ integer(kind=omp_alloctrait_val_kind)omp_atv_blocked
+ parameter(omp_atv_blocked=17)
+ integer(kind=omp_alloctrait_val_kind)omp_atv_interleaved
+ parameter(omp_atv_interleaved=18)
+
+ type omp_alloctrait
+ integer (kind=omp_alloctrait_key_kind) key
+ integer (kind=omp_alloctrait_val_kind) value
+ end type omp_alloctrait
+
+ integer(kind=omp_allocator_handle_kind)omp_null_allocator
parameter(omp_null_allocator=0)
- integer(kind=omp_allocator_kind)omp_default_mem_alloc
+ integer(kind=omp_allocator_handle_kind)omp_default_mem_alloc
parameter(omp_default_mem_alloc=1)
- integer(kind=omp_allocator_kind)omp_large_cap_mem_alloc
+ integer(kind=omp_allocator_handle_kind)omp_large_cap_mem_alloc
parameter(omp_large_cap_mem_alloc=2)
- integer(kind=omp_allocator_kind)omp_const_mem_alloc
+ integer(kind=omp_allocator_handle_kind)omp_const_mem_alloc
parameter(omp_const_mem_alloc=3)
- integer(kind=omp_allocator_kind)omp_high_bw_mem_alloc
+ integer(kind=omp_allocator_handle_kind)omp_high_bw_mem_alloc
parameter(omp_high_bw_mem_alloc=4)
- integer(kind=omp_allocator_kind)omp_low_lat_mem_alloc
+ integer(kind=omp_allocator_handle_kind)omp_low_lat_mem_alloc
parameter(omp_low_lat_mem_alloc=5)
- integer(kind=omp_allocator_kind)omp_cgroup_mem_alloc
+ integer(kind=omp_allocator_handle_kind)omp_cgroup_mem_alloc
parameter(omp_cgroup_mem_alloc=6)
- integer(kind=omp_allocator_kind)omp_pteam_mem_alloc
+ integer(kind=omp_allocator_handle_kind)omp_pteam_mem_alloc
parameter(omp_pteam_mem_alloc=7)
- integer(kind=omp_allocator_kind)omp_thread_mem_alloc
+ integer(kind=omp_allocator_handle_kind)omp_thread_mem_alloc
parameter(omp_thread_mem_alloc=8)
+ integer(kind=omp_memspace_handle_kind)omp_default_mem_space
+ parameter(omp_default_mem_space=0)
+ integer(kind=omp_memspace_handle_kind)omp_large_cap_mem_space
+ parameter(omp_large_cap_mem_space=1)
+ integer(kind=omp_memspace_handle_kind)omp_const_mem_space
+ parameter(omp_const_mem_space=2)
+ integer(kind=omp_memspace_handle_kind)omp_high_bw_mem_space
+ parameter(omp_high_bw_mem_space=3)
+ integer(kind=omp_memspace_handle_kind)omp_low_lat_mem_space
+ parameter(omp_low_lat_mem_space=4)
+
+ integer(kind=omp_pause_resource_kind)omp_pause_resume
+ parameter(omp_pause_resume=0)
+ integer(kind=omp_pause_resource_kind)omp_pause_soft
+ parameter(omp_pause_soft=1)
+ integer(kind=omp_pause_resource_kind)omp_pause_hard
+ parameter(omp_pause_hard=2)
+
interface
! ***
@@ -332,6 +426,29 @@
integer (kind=omp_integer_kind) omp_get_device_num
end function omp_get_device_num
+ function omp_pause_resource(kind, device_num) bind(c)
+ import
+ integer (kind=omp_pause_resource_kind), value :: kind
+ integer (kind=omp_integer_kind), value :: device_num
+ integer (kind=omp_integer_kind) omp_pause_resource
+ end function omp_pause_resource
+
+ function omp_pause_resource_all(kind) bind(c)
+ import
+ integer (kind=omp_pause_resource_kind), value :: kind
+ integer (kind=omp_integer_kind) omp_pause_resource_all
+ end function omp_pause_resource_all
+
+ function omp_get_supported_active_levels() bind(c)
+ import
+ integer (kind=omp_integer_kind) omp_get_supported_active_levels
+ end function omp_get_supported_active_levels
+
+ subroutine omp_fulfill_event(event) bind(c)
+ import
+ integer (kind=omp_event_handle_kind), value :: event
+ end subroutine omp_fulfill_event
+
subroutine omp_init_lock(svar) bind(c)
!DIR$ IF(__INTEL_COMPILER.GE.1400)
!DIR$ attributes known_intrinsic :: omp_init_lock
@@ -419,14 +536,27 @@
integer (kind=omp_integer_kind) omp_get_max_task_priority
end function omp_get_max_task_priority
- subroutine omp_set_default_allocator(svar) bind(c)
+ function omp_init_allocator(memspace, ntraits, traits)
+ import
+ integer (omp_allocator_handle_kind) omp_init_allocator
+ integer (omp_memspace_handle_kind) :: memspace
+ integer (omp_integer_kind) :: ntraits
+ type(omp_alloctrait), intent(in) :: traits(*)
+ end function omp_init_allocator
+
+ subroutine omp_destroy_allocator(allocator) bind(c)
+ import
+ integer (omp_allocator_handle_kind), value :: allocator
+ end subroutine omp_destroy_allocator
+
+ subroutine omp_set_default_allocator(allocator) bind(c)
import
- integer (kind=omp_allocator_kind), value :: svar
+ integer (omp_allocator_handle_kind), value :: allocator
end subroutine omp_set_default_allocator
function omp_get_default_allocator() bind(c)
import
- integer (kind=omp_allocator_kind) omp_get_default_allocator
+ integer (omp_allocator_handle_kind) omp_get_default_allocator
end function omp_get_default_allocator
subroutine omp_set_affinity_format(format)
@@ -652,6 +782,10 @@
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_initial_device
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_num_devices
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_device_num
+!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_pause_resource
+!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_pause_resource_all
+!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_supported_active_levels
+!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_fulfill_event
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_num_teams
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_team_num
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_init_lock
@@ -731,6 +865,10 @@
!$omp declare target(omp_get_initial_device )
!$omp declare target(omp_get_num_devices )
!$omp declare target(omp_get_device_num )
+!$omp declare target(omp_pause_resource )
+!$omp declare target(omp_pause_resource_all )
+!$omp declare target(omp_get_supported_active_levels )
+!$omp declare target(omp_fulfill_event)
!$omp declare target(omp_get_num_teams )
!$omp declare target(omp_get_team_num )
!$omp declare target(omp_init_lock )
diff --git a/runtime/src/kmp.h b/runtime/src/kmp.h
index 599cbf23a584..fdb9dbb51981 100644
--- a/runtime/src/kmp.h
+++ b/runtime/src/kmp.h
@@ -5,10 +5,9 @@
//===----------------------------------------------------------------------===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.txt for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -49,6 +48,8 @@
#define TASK_IMPLICIT 0
#define TASK_PROXY 1
#define TASK_FULL 0
+#define TASK_DETACHABLE 1
+#define TASK_UNDETACHABLE 0
#define KMP_CANCEL_THREADS
#define KMP_THREAD_ATTR
@@ -97,6 +98,12 @@ class kmp_stats_list;
#ifndef HWLOC_OBJ_PACKAGE
#define HWLOC_OBJ_PACKAGE HWLOC_OBJ_SOCKET
#endif
+#if HWLOC_API_VERSION >= 0x00020000
+// hwloc 2.0 changed type of depth of object from unsigned to int
+typedef int kmp_hwloc_depth_t;
+#else
+typedef unsigned int kmp_hwloc_depth_t;
+#endif
#endif
#if KMP_ARCH_X86 || KMP_ARCH_X86_64
@@ -129,10 +136,8 @@ class kmp_stats_list;
#include "ompt-internal.h"
#endif
-#if OMP_50_ENABLED
// Affinity format function
#include "kmp_str.h"
-#endif
// 0 - no fast memory allocation, alignment: 8-byte on x86, 16-byte on x64.
// 3 - fast allocation using sync, non-sync free lists of any size, non-self
@@ -146,15 +151,8 @@ class kmp_stats_list;
#define USE_NESTED_HOT_ARG(x)
#else
#if KMP_NESTED_HOT_TEAMS
-#if OMP_40_ENABLED
#define USE_NESTED_HOT_ARG(x) , x
#else
-// Nested hot teams feature depends on omp 4.0, disable it for earlier versions
-#undef KMP_NESTED_HOT_TEAMS
-#define KMP_NESTED_HOT_TEAMS 0
-#define USE_NESTED_HOT_ARG(x)
-#endif
-#else
#define USE_NESTED_HOT_ARG(x)
#endif
#endif
@@ -326,7 +324,8 @@ typedef enum kmp_sched {
kmp_sched_static_steal = 102, // mapped to kmp_sch_static_steal (44)
#endif
kmp_sched_upper,
- kmp_sched_default = kmp_sched_static // default scheduling
+ kmp_sched_default = kmp_sched_static, // default scheduling
+ kmp_sched_monotonic = 0x80000000
} kmp_sched_t;
#endif
@@ -353,12 +352,10 @@ enum sched_type : kmp_int32 {
/* accessible only through KMP_SCHEDULE environment variable */
kmp_sch_static_steal = 44,
-#if OMP_45_ENABLED
/* static with chunk adjustment (e.g., simd) */
kmp_sch_static_balanced_chunked = 45,
kmp_sch_guided_simd = 46, /**< guided with chunk adjustment */
kmp_sch_runtime_simd = 47, /**< runtime with chunk adjustment */
-#endif
/* accessible only through KMP_SCHEDULE environment variable */
kmp_sch_upper, /**< upper bound for unordered values */
@@ -373,11 +370,9 @@ enum sched_type : kmp_int32 {
kmp_ord_trapezoidal = 71,
kmp_ord_upper, /**< upper bound for ordered values */
-#if OMP_40_ENABLED
/* Schedules for Distribute construct */
kmp_distribute_static_chunked = 91, /**< distribute static chunked */
kmp_distribute_static = 92, /**< distribute static unspecialized */
-#endif
/* For the "nomerge" versions, kmp_dispatch_next*() will always return a
single iteration/chunk, even if the loop is serialized. For the schedule
@@ -412,7 +407,6 @@ enum sched_type : kmp_int32 {
kmp_nm_ord_trapezoidal = 199,
kmp_nm_upper, /**< upper bound for nomerge values */
-#if OMP_45_ENABLED
/* Support for OpenMP 4.5 monotonic and nonmonotonic schedule modifiers. Since
we need to distinguish the three possible cases (no modifier, monotonic
modifier, nonmonotonic modifier), we need separate bits for each modifier.
@@ -439,19 +433,41 @@ enum sched_type : kmp_int32 {
#define SCHEDULE_HAS_NONMONOTONIC(s) (((s)&kmp_sch_modifier_nonmonotonic) != 0)
#define SCHEDULE_HAS_NO_MODIFIERS(s) \
(((s) & (kmp_sch_modifier_nonmonotonic | kmp_sch_modifier_monotonic)) == 0)
-#else
-/* By doing this we hope to avoid multiple tests on OMP_45_ENABLED. Compilers
- can now eliminate tests on compile time constants and dead code that results
- from them, so we can leave code guarded by such an if in place. */
-#define SCHEDULE_WITHOUT_MODIFIERS(s) (s)
-#define SCHEDULE_HAS_MONOTONIC(s) false
-#define SCHEDULE_HAS_NONMONOTONIC(s) false
-#define SCHEDULE_HAS_NO_MODIFIERS(s) true
-#endif
+#define SCHEDULE_GET_MODIFIERS(s) \
+ ((enum sched_type)( \
+ (s) & (kmp_sch_modifier_nonmonotonic | kmp_sch_modifier_monotonic)))
+#define SCHEDULE_SET_MODIFIERS(s, m) \
+ (s = (enum sched_type)((kmp_int32)s | (kmp_int32)m))
+#define SCHEDULE_NONMONOTONIC 0
+#define SCHEDULE_MONOTONIC 1
kmp_sch_default = kmp_sch_static /**< default scheduling algorithm */
};
+// Apply modifiers on internal kind to standard kind
+static inline void
+__kmp_sched_apply_mods_stdkind(kmp_sched_t *kind,
+ enum sched_type internal_kind) {
+ if (SCHEDULE_HAS_MONOTONIC(internal_kind)) {
+ *kind = (kmp_sched_t)((int)*kind | (int)kmp_sched_monotonic);
+ }
+}
+
+// Apply modifiers on standard kind to internal kind
+static inline void
+__kmp_sched_apply_mods_intkind(kmp_sched_t kind,
+ enum sched_type *internal_kind) {
+ if ((int)kind & (int)kmp_sched_monotonic) {
+ *internal_kind = (enum sched_type)((int)*internal_kind |
+ (int)kmp_sch_modifier_monotonic);
+ }
+}
+
+// Get standard schedule without modifiers
+static inline kmp_sched_t __kmp_sched_without_mods(kmp_sched_t kind) {
+ return (kmp_sched_t)((int)kind & ~((int)kmp_sched_monotonic));
+}
+
/* Type to keep runtime schedule set via OMP_SCHEDULE or omp_set_schedule() */
typedef union kmp_r_sched {
struct {
@@ -779,8 +795,6 @@ extern char *__kmp_cpuinfo_file;
#endif /* KMP_AFFINITY_SUPPORTED */
-#if OMP_40_ENABLED
-
// This needs to be kept in sync with the values in omp.h !!!
typedef enum kmp_proc_bind_t {
proc_bind_false = 0,
@@ -800,13 +814,9 @@ typedef struct kmp_nested_proc_bind_t {
extern kmp_nested_proc_bind_t __kmp_nested_proc_bind;
-#endif /* OMP_40_ENABLED */
-
-#if OMP_50_ENABLED
extern int __kmp_display_affinity;
extern char *__kmp_affinity_format;
static const size_t KMP_AFFINITY_FORMAT_SIZE = 512;
-#endif // OMP_50_ENABLED
#if KMP_AFFINITY_SUPPORTED
#define KMP_PLACE_ALL (-1)
@@ -820,7 +830,6 @@ static const size_t KMP_AFFINITY_FORMAT_SIZE = 512;
extern int __kmp_affinity_num_places;
-#if OMP_40_ENABLED
typedef enum kmp_cancel_kind_t {
cancel_noreq = 0,
cancel_parallel = 1,
@@ -828,7 +837,6 @@ typedef enum kmp_cancel_kind_t {
cancel_sections = 3,
cancel_taskgroup = 4
} kmp_cancel_kind_t;
-#endif // OMP_40_ENABLED
// KMP_HW_SUBSET support:
typedef struct kmp_hws_item {
@@ -857,30 +865,99 @@ extern int __kmp_hws_abs_flag; // absolute or per-item number requested
#define KMP_GTID_UNKNOWN (-5) /* Is not known */
#define KMP_GTID_MIN (-6) /* Minimal gtid for low bound check in DEBUG */
-#if OMP_50_ENABLED
/* OpenMP 5.0 Memory Management support */
+
+#ifndef __OMP_H
+// Duplicate type definitios from omp.h
+typedef uintptr_t omp_uintptr_t;
+
+typedef enum {
+ OMP_ATK_THREADMODEL = 1,
+ OMP_ATK_ALIGNMENT = 2,
+ OMP_ATK_ACCESS = 3,
+ OMP_ATK_POOL_SIZE = 4,
+ OMP_ATK_FALLBACK = 5,
+ OMP_ATK_FB_DATA = 6,
+ OMP_ATK_PINNED = 7,
+ OMP_ATK_PARTITION = 8
+} omp_alloctrait_key_t;
+
+typedef enum {
+ OMP_ATV_FALSE = 0,
+ OMP_ATV_TRUE = 1,
+ OMP_ATV_DEFAULT = 2,
+ OMP_ATV_CONTENDED = 3,
+ OMP_ATV_UNCONTENDED = 4,
+ OMP_ATV_SEQUENTIAL = 5,
+ OMP_ATV_PRIVATE = 6,
+ OMP_ATV_ALL = 7,
+ OMP_ATV_THREAD = 8,
+ OMP_ATV_PTEAM = 9,
+ OMP_ATV_CGROUP = 10,
+ OMP_ATV_DEFAULT_MEM_FB = 11,
+ OMP_ATV_NULL_FB = 12,
+ OMP_ATV_ABORT_FB = 13,
+ OMP_ATV_ALLOCATOR_FB = 14,
+ OMP_ATV_ENVIRONMENT = 15,
+ OMP_ATV_NEAREST = 16,
+ OMP_ATV_BLOCKED = 17,
+ OMP_ATV_INTERLEAVED = 18
+} omp_alloctrait_value_t;
+
+typedef void *omp_memspace_handle_t;
+extern omp_memspace_handle_t const omp_default_mem_space;
+extern omp_memspace_handle_t const omp_large_cap_mem_space;
+extern omp_memspace_handle_t const omp_const_mem_space;
+extern omp_memspace_handle_t const omp_high_bw_mem_space;
+extern omp_memspace_handle_t const omp_low_lat_mem_space;
+
+typedef struct {
+ omp_alloctrait_key_t key;
+ omp_uintptr_t value;
+} omp_alloctrait_t;
+
+typedef void *omp_allocator_handle_t;
+extern omp_allocator_handle_t const omp_null_allocator;
+extern omp_allocator_handle_t const omp_default_mem_alloc;
+extern omp_allocator_handle_t const omp_large_cap_mem_alloc;
+extern omp_allocator_handle_t const omp_const_mem_alloc;
+extern omp_allocator_handle_t const omp_high_bw_mem_alloc;
+extern omp_allocator_handle_t const omp_low_lat_mem_alloc;
+extern omp_allocator_handle_t const omp_cgroup_mem_alloc;
+extern omp_allocator_handle_t const omp_pteam_mem_alloc;
+extern omp_allocator_handle_t const omp_thread_mem_alloc;
+extern omp_allocator_handle_t const kmp_max_mem_alloc;
+extern omp_allocator_handle_t __kmp_def_allocator;
+
+// end of duplicate type definitios from omp.h
+#endif
+
extern int __kmp_memkind_available;
-extern int __kmp_hbw_mem_available;
-typedef void *omp_allocator_t;
-extern const omp_allocator_t *OMP_NULL_ALLOCATOR;
-extern const omp_allocator_t *omp_default_mem_alloc;
-extern const omp_allocator_t *omp_large_cap_mem_alloc;
-extern const omp_allocator_t *omp_const_mem_alloc;
-extern const omp_allocator_t *omp_high_bw_mem_alloc;
-extern const omp_allocator_t *omp_low_lat_mem_alloc;
-extern const omp_allocator_t *omp_cgroup_mem_alloc;
-extern const omp_allocator_t *omp_pteam_mem_alloc;
-extern const omp_allocator_t *omp_thread_mem_alloc;
-extern const omp_allocator_t *__kmp_def_allocator;
-
-extern void __kmpc_set_default_allocator(int gtid, const omp_allocator_t *al);
-extern const omp_allocator_t *__kmpc_get_default_allocator(int gtid);
-extern void *__kmpc_alloc(int gtid, size_t sz, const omp_allocator_t *al);
-extern void __kmpc_free(int gtid, void *ptr, const omp_allocator_t *al);
+
+typedef omp_memspace_handle_t kmp_memspace_t; // placeholder
+
+typedef struct kmp_allocator_t {
+ omp_memspace_handle_t memspace;
+ void **memkind; // pointer to memkind
+ int alignment;
+ omp_alloctrait_value_t fb;
+ kmp_allocator_t *fb_data;
+ kmp_uint64 pool_size;
+ kmp_uint64 pool_used;
+} kmp_allocator_t;
+
+extern omp_allocator_handle_t __kmpc_init_allocator(int gtid,
+ omp_memspace_handle_t,
+ int ntraits,
+ omp_alloctrait_t traits[]);
+extern void __kmpc_destroy_allocator(int gtid, omp_allocator_handle_t al);
+extern void __kmpc_set_default_allocator(int gtid, omp_allocator_handle_t al);
+extern omp_allocator_handle_t __kmpc_get_default_allocator(int gtid);
+extern void *__kmpc_alloc(int gtid, size_t sz, omp_allocator_handle_t al);
+extern void __kmpc_free(int gtid, void *ptr, omp_allocator_handle_t al);
extern void __kmp_init_memkind();
extern void __kmp_fini_memkind();
-#endif // OMP_50_ENABLED
/* ------------------------------------------------------------------------ */
@@ -982,10 +1059,6 @@ extern kmp_uint64 __kmp_now_nsec();
(KMP_BLOCKTIME(team, tid) * KMP_USEC_PER_SEC)
#define KMP_BLOCKING(goal, count) ((count) % 1000 != 0 || (goal) > KMP_NOW())
#endif
-#define KMP_YIELD_NOW() \
- (KMP_NOW_MSEC() / KMP_MAX(__kmp_dflt_blocktime, 1) % \
- (__kmp_yield_on_count + __kmp_yield_off_count) < \
- (kmp_uint32)__kmp_yield_on_count)
#endif // KMP_USE_MONITOR
#define KMP_MIN_STATSCOLS 40
@@ -1000,14 +1073,6 @@ extern kmp_uint64 __kmp_now_nsec();
#define KMP_MAX_CHUNK (INT_MAX - 1)
#define KMP_DEFAULT_CHUNK 1
-#define KMP_MIN_INIT_WAIT 1
-#define KMP_MAX_INIT_WAIT (INT_MAX / 2)
-#define KMP_DEFAULT_INIT_WAIT 2048U
-
-#define KMP_MIN_NEXT_WAIT 1
-#define KMP_MAX_NEXT_WAIT (INT_MAX / 2)
-#define KMP_DEFAULT_NEXT_WAIT 1024U
-
#define KMP_DFLT_DISP_NUM_BUFF 7
#define KMP_MAX_ORDERED 8
@@ -1086,12 +1151,87 @@ typedef struct kmp_cpuid {
kmp_uint32 ecx;
kmp_uint32 edx;
} kmp_cpuid_t;
+
+typedef struct kmp_cpuinfo {
+ int initialized; // If 0, other fields are not initialized.
+ int signature; // CPUID(1).EAX
+ int family; // CPUID(1).EAX[27:20]+CPUID(1).EAX[11:8] (Extended Family+Family)
+ int model; // ( CPUID(1).EAX[19:16] << 4 ) + CPUID(1).EAX[7:4] ( ( Extended
+ // Model << 4 ) + Model)
+ int stepping; // CPUID(1).EAX[3:0] ( Stepping )
+ int sse2; // 0 if SSE2 instructions are not supported, 1 otherwise.
+ int rtm; // 0 if RTM instructions are not supported, 1 otherwise.
+ int cpu_stackoffset;
+ int apic_id;
+ int physical_id;
+ int logical_id;
+ kmp_uint64 frequency; // Nominal CPU frequency in Hz.
+ char name[3 * sizeof(kmp_cpuid_t)]; // CPUID(0x80000002,0x80000003,0x80000004)
+} kmp_cpuinfo_t;
+
+extern void __kmp_query_cpuid(kmp_cpuinfo_t *p);
+
+#if KMP_OS_UNIX
+// subleaf is only needed for cache and topology discovery and can be set to
+// zero in most cases
+static inline void __kmp_x86_cpuid(int leaf, int subleaf, struct kmp_cpuid *p) {
+ __asm__ __volatile__("cpuid"
+ : "=a"(p->eax), "=b"(p->ebx), "=c"(p->ecx), "=d"(p->edx)
+ : "a"(leaf), "c"(subleaf));
+}
+// Load p into FPU control word
+static inline void __kmp_load_x87_fpu_control_word(const kmp_int16 *p) {
+ __asm__ __volatile__("fldcw %0" : : "m"(*p));
+}
+// Store FPU control word into p
+static inline void __kmp_store_x87_fpu_control_word(kmp_int16 *p) {
+ __asm__ __volatile__("fstcw %0" : "=m"(*p));
+}
+static inline void __kmp_clear_x87_fpu_status_word() {
+#if KMP_MIC
+ // 32-bit protected mode x87 FPU state
+ struct x87_fpu_state {
+ unsigned cw;
+ unsigned sw;
+ unsigned tw;
+ unsigned fip;
+ unsigned fips;
+ unsigned fdp;
+ unsigned fds;
+ };
+ struct x87_fpu_state fpu_state = {0, 0, 0, 0, 0, 0, 0};
+ __asm__ __volatile__("fstenv %0\n\t" // store FP env
+ "andw $0x7f00, %1\n\t" // clear 0-7,15 bits of FP SW
+ "fldenv %0\n\t" // load FP env back
+ : "+m"(fpu_state), "+m"(fpu_state.sw));
+#else
+ __asm__ __volatile__("fnclex");
+#endif // KMP_MIC
+}
+#if __SSE__
+static inline void __kmp_load_mxcsr(const kmp_uint32 *p) { _mm_setcsr(*p); }
+static inline void __kmp_store_mxcsr(kmp_uint32 *p) { *p = _mm_getcsr(); }
+#else
+static inline void __kmp_load_mxcsr(const kmp_uint32 *p) {}
+static inline void __kmp_store_mxcsr(kmp_uint32 *p) { *p = 0; }
+#endif
+#else
+// Windows still has these as external functions in assembly file
extern void __kmp_x86_cpuid(int mode, int mode2, struct kmp_cpuid *p);
+extern void __kmp_load_x87_fpu_control_word(const kmp_int16 *p);
+extern void __kmp_store_x87_fpu_control_word(kmp_int16 *p);
+extern void __kmp_clear_x87_fpu_status_word();
+static inline void __kmp_load_mxcsr(const kmp_uint32 *p) { _mm_setcsr(*p); }
+static inline void __kmp_store_mxcsr(kmp_uint32 *p) { *p = _mm_getcsr(); }
+#endif // KMP_OS_UNIX
+
+#define KMP_X86_MXCSR_MASK 0xffffffc0 /* ignore status flags (6 lsb) */
+
#if KMP_ARCH_X86
extern void __kmp_x86_pause(void);
#elif KMP_MIC
// Performance testing on KNC (C0QS-7120 P/A/X/D, 61-core, 16 GB Memory) showed
-// regression after removal of extra PAUSE from KMP_YIELD_SPIN(). Changing
+// regression after removal of extra PAUSE from spin loops. Changing
// the delay from 100 to 300 showed even better performance than double PAUSE
// on Spec OMP2001 and LCPC tasking tests, no regressions on EPCC.
static inline void __kmp_x86_pause(void) { _mm_delay_32(300); }
@@ -1116,31 +1256,54 @@ static inline void __kmp_x86_pause(void) { _mm_pause(); }
#define KMP_INIT_YIELD(count) \
{ (count) = __kmp_yield_init; }
+#define KMP_OVERSUBSCRIBED \
+ (TCR_4(__kmp_nth) > (__kmp_avail_proc ? __kmp_avail_proc : __kmp_xproc))
+
+#define KMP_TRY_YIELD \
+ ((__kmp_use_yield == 1) || (__kmp_use_yield == 2 && (KMP_OVERSUBSCRIBED)))
+
+#define KMP_TRY_YIELD_OVERSUB \
+ ((__kmp_use_yield == 1 || __kmp_use_yield == 2) && (KMP_OVERSUBSCRIBED))
+
#define KMP_YIELD(cond) \
{ \
KMP_CPU_PAUSE(); \
- __kmp_yield((cond)); \
+ if ((cond) && (KMP_TRY_YIELD)) \
+ __kmp_yield(); \
+ }
+
+#define KMP_YIELD_OVERSUB() \
+ { \
+ KMP_CPU_PAUSE(); \
+ if ((KMP_TRY_YIELD_OVERSUB)) \
+ __kmp_yield(); \
}
// Note the decrement of 2 in the following Macros. With KMP_LIBRARY=turnaround,
// there should be no yielding since initial value from KMP_INIT_YIELD() is odd.
-
-#define KMP_YIELD_WHEN(cond, count) \
+#define KMP_YIELD_SPIN(count) \
{ \
KMP_CPU_PAUSE(); \
- (count) -= 2; \
- if (!(count)) { \
- __kmp_yield(cond); \
- (count) = __kmp_yield_next; \
+ if (KMP_TRY_YIELD) { \
+ (count) -= 2; \
+ if (!(count)) { \
+ __kmp_yield(); \
+ (count) = __kmp_yield_next; \
+ } \
} \
}
-#define KMP_YIELD_SPIN(count) \
+
+#define KMP_YIELD_OVERSUB_ELSE_SPIN(count) \
{ \
KMP_CPU_PAUSE(); \
- (count) -= 2; \
- if (!(count)) { \
- __kmp_yield(1); \
- (count) = __kmp_yield_next; \
+ if ((KMP_TRY_YIELD_OVERSUB)) \
+ __kmp_yield(); \
+ else if (__kmp_use_yield == 1) { \
+ (count) -= 2; \
+ if (!(count)) { \
+ __kmp_yield(); \
+ (count) = __kmp_yield_next; \
+ } \
} \
}
@@ -1155,28 +1318,15 @@ enum cons_type {
ct_pdo_ordered,
ct_psections,
ct_psingle,
-
- /* the following must be left in order and not split up */
- ct_taskq,
- ct_task, // really task inside non-ordered taskq, considered worksharing type
- ct_task_ordered, /* really task inside ordered taskq, considered a worksharing
- type */
- /* the preceding must be left in order and not split up */
-
ct_critical,
ct_ordered_in_parallel,
ct_ordered_in_pdo,
- ct_ordered_in_taskq,
ct_master,
ct_reduce,
ct_barrier
};
-/* test to see if we are in a taskq construct */
-#define IS_CONS_TYPE_TASKQ(ct) \
- (((int)(ct)) >= ((int)ct_taskq) && ((int)(ct)) <= ((int)ct_task_ordered))
-#define IS_CONS_TYPE_ORDERED(ct) \
- ((ct) == ct_pdo_ordered || (ct) == ct_task_ordered)
+#define IS_CONS_TYPE_ORDERED(ct) ((ct) == ct_pdo_ordered)
struct cons_data {
ident_t const *ident;
@@ -1224,25 +1374,6 @@ typedef struct kmp_sys_info {
long nivcsw; /* the number of times a context switch was forced */
} kmp_sys_info_t;
-#if KMP_ARCH_X86 || KMP_ARCH_X86_64
-typedef struct kmp_cpuinfo {
- int initialized; // If 0, other fields are not initialized.
- int signature; // CPUID(1).EAX
- int family; // CPUID(1).EAX[27:20]+CPUID(1).EAX[11:8] (Extended Family+Family)
- int model; // ( CPUID(1).EAX[19:16] << 4 ) + CPUID(1).EAX[7:4] ( ( Extended
- // Model << 4 ) + Model)
- int stepping; // CPUID(1).EAX[3:0] ( Stepping )
- int sse2; // 0 if SSE2 instructions are not supported, 1 otherwise.
- int rtm; // 0 if RTM instructions are not supported, 1 otherwise.
- int cpu_stackoffset;
- int apic_id;
- int physical_id;
- int logical_id;
- kmp_uint64 frequency; // Nominal CPU frequency in Hz.
- char name[3 * sizeof(kmp_cpuid_t)]; // CPUID(0x80000002,0x80000003,0x80000004)
-} kmp_cpuinfo_t;
-#endif
-
#if USE_ITT_BUILD
// We cannot include "kmp_itt.h" due to circular dependency. Declare the only
// required type here. Later we will check the type meets requirements.
@@ -1250,163 +1381,6 @@ typedef int kmp_itt_mark_t;
#define KMP_ITT_DEBUG 0
#endif /* USE_ITT_BUILD */
-/* Taskq data structures */
-
-#define HIGH_WATER_MARK(nslots) (((nslots)*3) / 4)
-// num thunks that each thread can simultaneously execute from a task queue
-#define __KMP_TASKQ_THUNKS_PER_TH 1
-
-/* flags for taskq_global_flags, kmp_task_queue_t tq_flags, kmpc_thunk_t
- th_flags */
-
-#define TQF_IS_ORDERED 0x0001 // __kmpc_taskq interface, taskq ordered
-// __kmpc_taskq interface, taskq with lastprivate list
-#define TQF_IS_LASTPRIVATE 0x0002
-#define TQF_IS_NOWAIT 0x0004 // __kmpc_taskq interface, end taskq nowait
-// __kmpc_taskq interface, use heuristics to decide task queue size
-#define TQF_HEURISTICS 0x0008
-
-// __kmpc_taskq interface, reserved for future use
-#define TQF_INTERFACE_RESERVED1 0x0010
-// __kmpc_taskq interface, reserved for future use
-#define TQF_INTERFACE_RESERVED2 0x0020
-// __kmpc_taskq interface, reserved for future use
-#define TQF_INTERFACE_RESERVED3 0x0040
-// __kmpc_taskq interface, reserved for future use
-#define TQF_INTERFACE_RESERVED4 0x0080
-
-#define TQF_INTERFACE_FLAGS 0x00ff // all the __kmpc_taskq interface flags
-// internal/read by instrumentation; only used with TQF_IS_LASTPRIVATE
-#define TQF_IS_LAST_TASK 0x0100
-// internal use only; this thunk->th_task is the taskq_task
-#define TQF_TASKQ_TASK 0x0200
-// internal use only; must release worker threads once ANY queued task
-// exists (global)
-#define TQF_RELEASE_WORKERS 0x0400
-// internal use only; notify workers that master has finished enqueuing tasks
-#define TQF_ALL_TASKS_QUEUED 0x0800
-// internal use only: this queue encountered in parallel context: not serialized
-#define TQF_PARALLEL_CONTEXT 0x1000
-// internal use only; this queue is on the freelist and not in use
-#define TQF_DEALLOCATED 0x2000
-
-#define TQF_INTERNAL_FLAGS 0x3f00 // all the internal use only flags
-
-typedef struct KMP_ALIGN_CACHE kmpc_aligned_int32_t {
- kmp_int32 ai_data;
-} kmpc_aligned_int32_t;
-
-typedef struct KMP_ALIGN_CACHE kmpc_aligned_queue_slot_t {
- struct kmpc_thunk_t *qs_thunk;
-} kmpc_aligned_queue_slot_t;
-
-typedef struct kmpc_task_queue_t {
- /* task queue linkage fields for n-ary tree of queues (locked with global
- taskq_tree_lck) */
- kmp_lock_t tq_link_lck; /* lock for child link, child next/prev links and
- child ref counts */
- union {
- struct kmpc_task_queue_t *tq_parent; // pointer to parent taskq, not locked
- // for taskq internal freelists, locked with global taskq_freelist_lck
- struct kmpc_task_queue_t *tq_next_free;
- } tq;
- // pointer to linked-list of children, locked by tq's tq_link_lck
- volatile struct kmpc_task_queue_t *tq_first_child;
- // next child in linked-list, locked by parent tq's tq_link_lck
- struct kmpc_task_queue_t *tq_next_child;
- // previous child in linked-list, locked by parent tq's tq_link_lck
- struct kmpc_task_queue_t *tq_prev_child;
- // reference count of threads with access to this task queue
- volatile kmp_int32 tq_ref_count;
- /* (other than the thread executing the kmpc_end_taskq call) */
- /* locked by parent tq's tq_link_lck */
-
- /* shared data for task queue */
- /* per-thread array of pointers to shared variable structures */
- struct kmpc_aligned_shared_vars_t *tq_shareds;
- /* only one array element exists for all but outermost taskq */
-
- /* bookkeeping for ordered task queue */
- kmp_uint32 tq_tasknum_queuing; // ordered task # assigned while queuing tasks
- // ordered number of next task to be served (executed)
- volatile kmp_uint32 tq_tasknum_serving;
-
- /* thunk storage management for task queue */
- kmp_lock_t tq_free_thunks_lck; /* lock for thunk freelist manipulation */
- // thunk freelist, chained via th.th_next_free
- struct kmpc_thunk_t *tq_free_thunks;
- // space allocated for thunks for this task queue
- struct kmpc_thunk_t *tq_thunk_space;
-
- /* data fields for queue itself */
- kmp_lock_t tq_queue_lck; /* lock for [de]enqueue operations: tq_queue,
- tq_head, tq_tail, tq_nfull */
- /* array of queue slots to hold thunks for tasks */
- kmpc_aligned_queue_slot_t *tq_queue;
- volatile struct kmpc_thunk_t *tq_taskq_slot; /* special slot for taskq task
- thunk, occupied if not NULL */
- kmp_int32 tq_nslots; /* # of tq_thunk_space thunks alloc'd (not incl.
- tq_taskq_slot space) */
- kmp_int32 tq_head; // enqueue puts item here (index into tq_queue array)
- kmp_int32 tq_tail; // dequeue takes item from here (index into tq_queue array)
- volatile kmp_int32 tq_nfull; // # of occupied entries in task queue right now
- kmp_int32 tq_hiwat; /* high-water mark for tq_nfull and queue scheduling */
- volatile kmp_int32 tq_flags; /* TQF_xxx */
-
- /* bookkeeping for outstanding thunks */
-
- /* per-thread array for # of regular thunks currently being executed */
- struct kmpc_aligned_int32_t *tq_th_thunks;
- kmp_int32 tq_nproc; /* number of thunks in the th_thunks array */
-
- /* statistics library bookkeeping */
- ident_t *tq_loc; /* source location information for taskq directive */
-} kmpc_task_queue_t;
-
-typedef void (*kmpc_task_t)(kmp_int32 global_tid, struct kmpc_thunk_t *thunk);
-
-/* sizeof_shareds passed as arg to __kmpc_taskq call */
-typedef struct kmpc_shared_vars_t { /* aligned during dynamic allocation */
- kmpc_task_queue_t *sv_queue; /* (pointers to) shared vars */
-} kmpc_shared_vars_t;
-
-typedef struct KMP_ALIGN_CACHE kmpc_aligned_shared_vars_t {
- volatile struct kmpc_shared_vars_t *ai_data;
-} kmpc_aligned_shared_vars_t;
-
-/* sizeof_thunk passed as arg to kmpc_taskq call */
-typedef struct kmpc_thunk_t { /* aligned during dynamic allocation */
- union { /* field used for internal freelists too */
- kmpc_shared_vars_t *th_shareds;
- struct kmpc_thunk_t *th_next_free; /* freelist of individual thunks within
- queue, head at tq_free_thunks */
- } th;
- kmpc_task_t th_task; /* taskq_task if flags & TQF_TASKQ_TASK */
- struct kmpc_thunk_t *th_encl_thunk; /* pointer to dynamically enclosing thunk
- on this thread's call stack */
- // TQF_xxx(tq_flags interface plus possible internal flags)
- kmp_int32 th_flags;
-
- kmp_int32 th_status;
- kmp_uint32 th_tasknum; /* task number assigned in order of queuing, used for
- ordered sections */
- /* private vars */
-} kmpc_thunk_t;
-
-typedef struct KMP_ALIGN_CACHE kmp_taskq {
- int tq_curr_thunk_capacity;
-
- kmpc_task_queue_t *tq_root;
- kmp_int32 tq_global_flags;
-
- kmp_lock_t tq_freelist_lck;
- kmpc_task_queue_t *tq_freelist;
-
- kmpc_thunk_t **tq_curr_thunk;
-} kmp_taskq_t;
-
-/* END Taskq data structures */
-
typedef kmp_int32 kmp_critical_name[8];
/*!
@@ -1721,11 +1695,9 @@ typedef struct dispatch_shared_info {
dispatch_shared_info64_t s64;
} u;
volatile kmp_uint32 buffer_index;
-#if OMP_45_ENABLED
volatile kmp_int32 doacross_buf_idx; // teamwise index
volatile kmp_uint32 *doacross_flags; // shared array of iteration flags (0/1)
kmp_int32 doacross_num_done; // count finished threads
-#endif
#if KMP_USE_HIER_SCHED
void *hier;
#endif
@@ -1748,7 +1720,6 @@ typedef struct kmp_disp {
dispatch_private_info_t *th_disp_buffer;
kmp_int32 th_disp_index;
-#if OMP_45_ENABLED
kmp_int32 th_doacross_buf_idx; // thread's doacross buffer index
volatile kmp_uint32 *th_doacross_flags; // pointer to shared array of flags
union { // we can use union here because doacross cannot be used in
@@ -1756,14 +1727,6 @@ typedef struct kmp_disp {
kmp_int64 *th_doacross_info; // info on loop bounds
kmp_lock_t *th_steal_lock; // lock used for chunk stealing (8-byte variable)
};
-#else
-#if KMP_STATIC_STEAL_ENABLED
- kmp_lock_t *th_steal_lock; // lock used for chunk stealing (8-byte variable)
- void *dummy_padding[1]; // make it 64 bytes on Intel(R) 64
-#else
- void *dummy_padding[2]; // make it 64 bytes on Intel(R) 64
-#endif
-#endif
#if KMP_USE_INTERNODE_ALIGNMENT
char more_padding[INTERNODE_CACHE_LINE];
#endif
@@ -1837,7 +1800,6 @@ typedef enum kmp_bar_pat { /* Barrier communication patterns */
typedef struct kmp_internal_control {
int serial_nesting_level; /* corresponds to the value of the
th_team_serialized field */
- kmp_int8 nested; /* internal control for nested parallelism (per thread) */
kmp_int8 dynamic; /* internal control for dynamic adjustment of threads (per
thread) */
kmp_int8
@@ -1848,13 +1810,12 @@ typedef struct kmp_internal_control {
#endif
int nproc; /* internal control for #threads for next parallel region (per
thread) */
+ int thread_limit; /* internal control for thread-limit-var */
int max_active_levels; /* internal control for max_active_levels */
kmp_r_sched_t
sched; /* internal control for runtime schedule {sched,chunk} pair */
-#if OMP_40_ENABLED
kmp_proc_bind_t proc_bind; /* internal control for affinity */
kmp_int32 default_device; /* internal control for default device */
-#endif // OMP_40_ENABLED
struct kmp_internal_control *next;
} kmp_internal_control_t;
@@ -2043,8 +2004,6 @@ typedef struct kmp_local {
((xteam)->t.t_threads[(xtid)]->th.th_current_task->td_icvs.bt_intervals)
#endif
-#define get__nested_2(xteam, xtid) \
- ((xteam)->t.t_threads[(xtid)]->th.th_current_task->td_icvs.nested)
#define get__dynamic_2(xteam, xtid) \
((xteam)->t.t_threads[(xtid)]->th.th_current_task->td_icvs.dynamic)
#define get__nproc_2(xteam, xtid) \
@@ -2065,11 +2024,6 @@ typedef struct kmp_local {
#define set__bt_set_team(xteam, xtid, xval) \
(((xteam)->t.t_threads[(xtid)]->th.th_current_task->td_icvs.bt_set) = (xval))
-#define set__nested(xthread, xval) \
- (((xthread)->th.th_current_task->td_icvs.nested) = (xval))
-#define get__nested(xthread) \
- (((xthread)->th.th_current_task->td_icvs.nested) ? (FTN_TRUE) : (FTN_FALSE))
-
#define set__dynamic(xthread, xval) \
(((xthread)->th.th_current_task->td_icvs.dynamic) = (xval))
#define get__dynamic(xthread) \
@@ -2078,21 +2032,23 @@ typedef struct kmp_local {
#define set__nproc(xthread, xval) \
(((xthread)->th.th_current_task->td_icvs.nproc) = (xval))
+#define set__thread_limit(xthread, xval) \
+ (((xthread)->th.th_current_task->td_icvs.thread_limit) = (xval))
+
#define set__max_active_levels(xthread, xval) \
(((xthread)->th.th_current_task->td_icvs.max_active_levels) = (xval))
+#define get__max_active_levels(xthread) \
+ ((xthread)->th.th_current_task->td_icvs.max_active_levels)
+
#define set__sched(xthread, xval) \
(((xthread)->th.th_current_task->td_icvs.sched) = (xval))
-#if OMP_40_ENABLED
-
#define set__proc_bind(xthread, xval) \
(((xthread)->th.th_current_task->td_icvs.proc_bind) = (xval))
#define get__proc_bind(xthread) \
((xthread)->th.th_current_task->td_icvs.proc_bind)
-#endif /* OMP_40_ENABLED */
-
// OpenMP tasking data structures
typedef enum kmp_tasking_mode {
@@ -2105,16 +2061,13 @@ typedef enum kmp_tasking_mode {
extern kmp_tasking_mode_t
__kmp_tasking_mode; /* determines how/when to execute tasks */
extern int __kmp_task_stealing_constraint;
-#if OMP_40_ENABLED
+extern int __kmp_enable_task_throttling;
extern kmp_int32 __kmp_default_device; // Set via OMP_DEFAULT_DEVICE if
// specified, defaults to 0 otherwise
-#endif
-#if OMP_45_ENABLED
// Set via OMP_MAX_TASK_PRIORITY if specified, defaults to 0 otherwise
extern kmp_int32 __kmp_max_task_priority;
// Set via KMP_TASKLOOP_MIN_TASKS if specified, defaults to 0 otherwise
extern kmp_uint64 __kmp_taskloop_min_tasks;
-#endif
/* NOTE: kmp_taskdata_t and kmp_task_t structures allocated in single block with
taskdata first */
@@ -2134,19 +2087,13 @@ extern kmp_uint64 __kmp_taskloop_min_tasks;
*/
typedef kmp_int32 (*kmp_routine_entry_t)(kmp_int32, void *);
-#if OMP_40_ENABLED || OMP_45_ENABLED
typedef union kmp_cmplrdata {
-#if OMP_45_ENABLED
kmp_int32 priority; /**< priority specified by user for the task */
-#endif // OMP_45_ENABLED
-#if OMP_40_ENABLED
kmp_routine_entry_t
destructors; /* pointer to function to invoke deconstructors of
firstprivate C++ objects */
-#endif // OMP_40_ENABLED
/* future data */
} kmp_cmplrdata_t;
-#endif
/* sizeof_kmp_task_t passed as arg to kmpc_omp_task call */
/*!
@@ -2156,12 +2103,10 @@ typedef struct kmp_task { /* GEH: Shouldn't this be aligned somehow? */
kmp_routine_entry_t
routine; /**< pointer to routine to call for executing task */
kmp_int32 part_id; /**< part id for the task */
-#if OMP_40_ENABLED || OMP_45_ENABLED
kmp_cmplrdata_t
data1; /* Two known optional additions: destructors and priority */
kmp_cmplrdata_t data2; /* Process destructors first, priority second */
-/* future data */
-#endif
+ /* future data */
/* private vars */
} kmp_task_t;
@@ -2169,17 +2114,14 @@ typedef struct kmp_task { /* GEH: Shouldn't this be aligned somehow? */
@}
*/
-#if OMP_40_ENABLED
typedef struct kmp_taskgroup {
std::atomic<kmp_int32> count; // number of allocated and incomplete tasks
std::atomic<kmp_int32>
cancel_request; // request for cancellation of this taskgroup
struct kmp_taskgroup *parent; // parent taskgroup
-#if OMP_50_ENABLED
// Block of data to perform task reduction
void *reduce_data; // reduction related info
kmp_int32 reduce_num_data; // number of data items to reduce
-#endif
} kmp_taskgroup_t;
// forward declarations
@@ -2245,7 +2187,6 @@ typedef struct kmp_dephash {
#endif
} kmp_dephash_t;
-#if OMP_50_ENABLED
typedef struct kmp_task_affinity_info {
kmp_intptr_t base_addr;
size_t len;
@@ -2255,9 +2196,19 @@ typedef struct kmp_task_affinity_info {
kmp_int32 reserved : 30;
} flags;
} kmp_task_affinity_info_t;
-#endif
-#endif
+typedef enum kmp_event_type_t {
+ KMP_EVENT_UNINITIALIZED = 0,
+ KMP_EVENT_ALLOW_COMPLETION = 1
+} kmp_event_type_t;
+
+typedef struct {
+ kmp_event_type_t type;
+ kmp_tas_lock_t lock;
+ union {
+ kmp_task_t *task;
+ } ed;
+} kmp_event_t;
#ifdef BUILD_TIED_TASK_STACK
@@ -2282,21 +2233,14 @@ typedef struct kmp_tasking_flags { /* Total struct must be exactly 32 bits */
unsigned final : 1; /* task is final(1) so execute immediately */
unsigned merged_if0 : 1; /* no __kmpc_task_{begin/complete}_if0 calls in if0
code path */
-#if OMP_40_ENABLED
unsigned destructors_thunk : 1; /* set if the compiler creates a thunk to
invoke destructors from the runtime */
-#if OMP_45_ENABLED
unsigned proxy : 1; /* task is a proxy task (it will be executed outside the
context of the RTL) */
unsigned priority_specified : 1; /* set if the compiler provides priority
setting for the task */
- unsigned reserved : 10; /* reserved for compiler use */
-#else
- unsigned reserved : 12; /* reserved for compiler use */
-#endif
-#else // OMP_40_ENABLED
- unsigned reserved : 13; /* reserved for compiler use */
-#endif // OMP_40_ENABLED
+ unsigned detachable : 1; /* 1 == can detach */
+ unsigned reserved : 9; /* reserved for compiler use */
/* Library flags */ /* Total library flags must be 16 bits */
unsigned tasktype : 1; /* task is either explicit(1) or implicit (0) */
@@ -2337,27 +2281,24 @@ struct kmp_taskdata { /* aligned during dynamic allocation */
deallocated */
std::atomic<kmp_int32>
td_incomplete_child_tasks; /* Child tasks not yet complete */
-#if OMP_40_ENABLED
kmp_taskgroup_t
*td_taskgroup; // Each task keeps pointer to its current taskgroup
kmp_dephash_t
*td_dephash; // Dependencies for children tasks are tracked from here
kmp_depnode_t
*td_depnode; // Pointer to graph node if this task has dependencies
-#endif // OMP_40_ENABLED
-#if OMP_45_ENABLED
kmp_task_team_t *td_task_team;
kmp_int32 td_size_alloc; // The size of task structure, including shareds etc.
#if defined(KMP_GOMP_COMPAT)
// 4 or 8 byte integers for the loop bounds in GOMP_taskloop
kmp_int32 td_size_loop_bounds;
#endif
-#endif // OMP_45_ENABLED
kmp_taskdata_t *td_last_tied; // keep tied task for task scheduling constraint
-#if defined(KMP_GOMP_COMPAT) && OMP_45_ENABLED
+#if defined(KMP_GOMP_COMPAT)
// GOMP sends in a copy function for copy constructors
void (*td_copy_func)(void *, void *);
#endif
+ kmp_event_t td_allow_completion_event;
#if OMPT_SUPPORT
ompt_task_info_t ompt_task_info;
#endif
@@ -2411,12 +2352,8 @@ typedef struct kmp_base_task_team {
executing this team? */
/* TRUE means tt_threads_data is set up and initialized */
kmp_int32 tt_nproc; /* #threads in team */
- kmp_int32
- tt_max_threads; /* number of entries allocated for threads_data array */
-#if OMP_45_ENABLED
- kmp_int32
- tt_found_proxy_tasks; /* Have we found proxy tasks since last barrier */
-#endif
+ kmp_int32 tt_max_threads; // # entries allocated for threads_data array
+ kmp_int32 tt_found_proxy_tasks; // found proxy tasks since last barrier
kmp_int32 tt_untied_task_encountered;
KMP_ALIGN_CACHE
@@ -2452,12 +2389,30 @@ typedef struct kmp_hot_team_ptr {
kmp_int32 hot_team_nth; // number of threads allocated for the hot_team
} kmp_hot_team_ptr_t;
#endif
-#if OMP_40_ENABLED
typedef struct kmp_teams_size {
kmp_int32 nteams; // number of teams in a league
kmp_int32 nth; // number of threads in each team of the league
} kmp_teams_size_t;
-#endif
+
+// This struct stores a thread that acts as a "root" for a contention
+// group. Contention groups are rooted at kmp_root threads, but also at
+// each master thread of each team created in the teams construct.
+// This struct therefore also stores a thread_limit associated with
+// that contention group, and a counter to track the number of threads
+// active in that contention group. Each thread has a list of these: CG
+// root threads have an entry in their list in which cg_root refers to
+// the thread itself, whereas other workers in the CG will have a
+// single entry where cg_root is same as the entry containing their CG
+// root. When a thread encounters a teams construct, it will add a new
+// entry to the front of its list, because it now roots a new CG.
+typedef struct kmp_cg_root {
+ kmp_info_p *cg_root; // "root" thread for a contention group
+ // The CG root's limit comes from OMP_THREAD_LIMIT for root threads, or
+ // thread_limit clause for teams masters
+ kmp_int32 cg_thread_limit;
+ kmp_int32 cg_nthreads; // Count of active threads in CG rooted at cg_root
+ struct kmp_cg_root *up; // pointer to higher level CG root in list
+} kmp_cg_root_t;
// OpenMP thread data structures
@@ -2477,11 +2432,9 @@ typedef struct KMP_ALIGN_CACHE kmp_base_info {
int th_team_nproc; /* number of threads in a team */
kmp_info_p *th_team_master; /* the team's master thread */
int th_team_serialized; /* team is serialized */
-#if OMP_40_ENABLED
microtask_t th_teams_microtask; /* save entry address for teams construct */
int th_teams_level; /* save initial level of teams construct */
/* it is 0 on device but may be any on host */
-#endif
/* The blocktime info is copied from the team struct to the thread sruct */
/* at the start of a barrier, and the values stored in the team are used */
@@ -2497,16 +2450,13 @@ typedef struct KMP_ALIGN_CACHE kmp_base_info {
#if KMP_AFFINITY_SUPPORTED
kmp_affin_mask_t *th_affin_mask; /* thread's current affinity mask */
#endif
-#if OMP_50_ENABLED
- void *const *th_def_allocator; /* per implicit task default allocator */
-#endif
+ omp_allocator_handle_t th_def_allocator; /* default allocator */
/* The data set by the master at reinit, then R/W by the worker */
KMP_ALIGN_CACHE int
th_set_nproc; /* if > 0, then only use this request for the next fork */
#if KMP_NESTED_HOT_TEAMS
kmp_hot_team_ptr_t *th_hot_teams; /* array of hot teams */
#endif
-#if OMP_40_ENABLED
kmp_proc_bind_t
th_set_proc_bind; /* if != proc_bind_default, use request for next fork */
kmp_teams_size_t
@@ -2517,11 +2467,8 @@ typedef struct KMP_ALIGN_CACHE kmp_base_info {
int th_first_place; /* first place in partition */
int th_last_place; /* last place in partition */
#endif
-#endif
-#if OMP_50_ENABLED
int th_prev_level; /* previous level for affinity format */
int th_prev_num_threads; /* previous num_threads for affinity format */
-#endif
#if USE_ITT_BUILD
kmp_uint64 th_bar_arrive_time; /* arrival to barrier timestamp */
kmp_uint64 th_bar_min_time; /* minimum arrival time at the barrier */
@@ -2588,12 +2535,12 @@ typedef struct KMP_ALIGN_CACHE kmp_base_info {
#if KMP_OS_WINDOWS
kmp_win32_cond_t th_suspend_cv;
kmp_win32_mutex_t th_suspend_mx;
- int th_suspend_init;
+ std::atomic<int> th_suspend_init;
#endif
#if KMP_OS_UNIX
kmp_cond_align_t th_suspend_cv;
kmp_mutex_align_t th_suspend_mx;
- int th_suspend_init_count;
+ std::atomic<int> th_suspend_init_count;
#endif
#if USE_ITT_BUILD
@@ -2606,6 +2553,7 @@ typedef struct KMP_ALIGN_CACHE kmp_base_info {
#if KMP_OS_UNIX
std::atomic<bool> th_blocking;
#endif
+ kmp_cg_root_t *th_cg_roots; // list of cg_roots associated with this thread
} kmp_base_info_t;
typedef union KMP_ALIGN_CACHE kmp_info {
@@ -2659,6 +2607,10 @@ typedef struct KMP_ALIGN_CACHE kmp_base_team {
std::atomic<int> t_construct; // count of single directive encountered by team
char pad[sizeof(kmp_lock_t)]; // padding to maintain performance on big iron
+ // [0] - parallel / [1] - worksharing task reduction data shared by taskgroups
+ std::atomic<void *> t_tg_reduce_data[2]; // to support task modifier
+ std::atomic<int> t_tg_fini_counter[2]; // sync end of task reductions
+
// Master only
// ---------------------------------------------------------------------------
KMP_ALIGN_CACHE int t_master_tid; // tid of master in parent team
@@ -2670,9 +2622,7 @@ typedef struct KMP_ALIGN_CACHE kmp_base_team {
kmp_team_p *t_next_pool; // next free team in the team pool
kmp_disp_t *t_dispatch; // thread's dispatch data
kmp_task_team_t *t_task_team[2]; // Task team struct; switch between 2
-#if OMP_40_ENABLED
kmp_proc_bind_t t_proc_bind; // bind type for par region
-#endif // OMP_40_ENABLED
#if USE_ITT_BUILD
kmp_uint64 t_region_time; // region begin timestamp
#endif /* USE_ITT_BUILD */
@@ -2711,18 +2661,14 @@ typedef struct KMP_ALIGN_CACHE kmp_base_team {
int t_id; // team's id, assigned by debugger.
int t_active_level; // nested active parallel level
kmp_r_sched_t t_sched; // run-time schedule for the team
-#if OMP_40_ENABLED && KMP_AFFINITY_SUPPORTED
+#if KMP_AFFINITY_SUPPORTED
int t_first_place; // first & last place in parent thread's partition.
int t_last_place; // Restore these values to master after par region.
-#endif // OMP_40_ENABLED && KMP_AFFINITY_SUPPORTED
-#if OMP_50_ENABLED
+#endif // KMP_AFFINITY_SUPPORTED
int t_display_affinity;
-#endif
int t_size_changed; // team size was changed?: 0: no, 1: yes, -1: changed via
-// omp_set_num_threads() call
-#if OMP_50_ENABLED
- void *const *t_def_allocator; /* per implicit task default allocator */
-#endif
+ // omp_set_num_threads() call
+ omp_allocator_handle_t t_def_allocator; /* default allocator */
// Read/write by workers as well
#if (KMP_ARCH_X86 || KMP_ARCH_X86_64)
@@ -2734,13 +2680,10 @@ typedef struct KMP_ALIGN_CACHE kmp_base_team {
#endif
// Internal control stack for additional nested teams.
KMP_ALIGN_CACHE kmp_internal_control_t *t_control_stack_top;
-// for SERIALIZED teams nested 2 or more levels deep
-#if OMP_40_ENABLED
+ // for SERIALIZED teams nested 2 or more levels deep
// typed flag to store request state of cancellation
std::atomic<kmp_int32> t_cancel_request;
-#endif
int t_master_active; // save on fork, restore on join
- kmp_taskq_t t_taskq; // this team's task queue
void *t_copypriv_data; // team specific pointer to copyprivate data array
#if KMP_OS_WINDOWS
std::atomic<kmp_uint32> t_copyin_counter;
@@ -2786,8 +2729,6 @@ typedef struct kmp_base_root {
// TODO: GEH - then replace r_active with t_active_levels if we can to reduce
// the synch overhead or keeping r_active
volatile int r_active; /* TRUE if some region in a nest has > 1 thread */
- // GEH: This is misnamed, should be r_in_parallel
- volatile int r_nested; // TODO: GEH - This is unused, just remove it entirely.
// keeps a count of active parallel regions per root
std::atomic<int> r_in_parallel;
// GEH: This is misnamed, should be r_active_levels
@@ -2797,7 +2738,6 @@ typedef struct kmp_base_root {
kmp_lock_t r_begin_lock;
volatile int r_begin;
int r_blocktime; /* blocktime for this root and descendants */
- int r_cg_nthreads; // count of active threads in a contention group
} kmp_base_root_t;
typedef union KMP_ALIGN_CACHE kmp_root {
@@ -2922,10 +2862,6 @@ extern kmp_lock_t __kmp_global_lock; /* control OS/global access */
extern kmp_queuing_lock_t __kmp_dispatch_lock; /* control dispatch access */
extern kmp_lock_t __kmp_debug_lock; /* control I/O access for KMP_DEBUG */
-/* used for yielding spin-waits */
-extern unsigned int __kmp_init_wait; /* initial number of spin-tests */
-extern unsigned int __kmp_next_wait; /* susequent number of spin-tests */
-
extern enum library_type __kmp_library;
extern enum sched_type __kmp_sched; /* default runtime scheduling */
@@ -2954,16 +2890,11 @@ extern int __kmp_reserve_warn; /* have we issued reserve_threads warning? */
extern int __kmp_suspend_count; /* count inside __kmp_suspend_template() */
#endif
+extern kmp_int32 __kmp_use_yield;
+extern kmp_int32 __kmp_use_yield_exp_set;
extern kmp_uint32 __kmp_yield_init;
extern kmp_uint32 __kmp_yield_next;
-#if KMP_USE_MONITOR
-extern kmp_uint32 __kmp_yielding_on;
-#endif
-extern kmp_uint32 __kmp_yield_cycle;
-extern kmp_int32 __kmp_yield_on_count;
-extern kmp_int32 __kmp_yield_off_count;
-
/* ------------------------------------------------------------------------- */
extern int __kmp_allThreadsSpecified;
@@ -2988,8 +2919,6 @@ extern int __kmp_tp_capacity; /* capacity of __kmp_threads if threadprivate is
used (fixed) */
extern int __kmp_tp_cached; /* whether threadprivate cache has been created
(__kmpc_threadprivate_cached()) */
-extern int __kmp_dflt_nested; /* nested parallelism enabled by default a la
- OMP_NESTED */
extern int __kmp_dflt_blocktime; /* number of milliseconds to wait before
blocking (env setting) */
#if KMP_USE_MONITOR
@@ -3031,9 +2960,12 @@ extern kmp_int16 __kmp_init_x87_fpu_control_word; // init thread's FP ctrl reg
extern kmp_uint32 __kmp_init_mxcsr; /* init thread's mxscr */
#endif /* KMP_ARCH_X86 || KMP_ARCH_X86_64 */
-extern int __kmp_dflt_max_active_levels; /* max_active_levels for nested
- parallelism enabled by default via
- OMP_MAX_ACTIVE_LEVELS */
+// max_active_levels for nested parallelism enabled by default via
+// OMP_MAX_ACTIVE_LEVELS, OMP_NESTED, OMP_NUM_THREADS, and OMP_PROC_BIND
+extern int __kmp_dflt_max_active_levels;
+// Indicates whether value of __kmp_dflt_max_active_levels was already
+// explicitly set by OMP_MAX_ACTIVE_LEVELS or OMP_NESTED=false
+extern bool __kmp_dflt_max_active_levels_set;
extern int __kmp_dispatch_num_buffers; /* max possible dynamic loops in
concurrent execution per team */
#if KMP_NESTED_HOT_TEAMS
@@ -3082,11 +3014,9 @@ extern const char *__kmp_speculative_statsfile;
#endif // KMP_USE_ADAPTIVE_LOCKS
-#if OMP_40_ENABLED
extern int __kmp_display_env; /* TRUE or FALSE */
extern int __kmp_display_env_verbose; /* TRUE if OMP_DISPLAY_ENV=VERBOSE */
extern int __kmp_omp_cancellation; /* TRUE or FALSE */
-#endif
/* ------------------------------------------------------------------------- */
@@ -3103,7 +3033,6 @@ extern volatile int __kmp_nth;
/* total number of threads reachable from some root thread including all root
threads, and those in the thread pool */
extern volatile int __kmp_all_nth;
-extern int __kmp_thread_pool_nth;
extern std::atomic<int> __kmp_thread_pool_active_nth;
extern kmp_root_t **__kmp_root; /* root of thread hierarchy */
@@ -3237,6 +3166,7 @@ extern void __kmp_init_random(kmp_info_t *thread);
extern kmp_r_sched_t __kmp_get_schedule_global(void);
extern void __kmp_adjust_num_threads(int new_nproc);
+extern void __kmp_check_stksize(size_t *val);
extern void *___kmp_allocate(size_t size KMP_SRC_LOC_DECL);
extern void *___kmp_page_allocate(size_t size KMP_SRC_LOC_DECL);
@@ -3279,14 +3209,12 @@ extern void ___kmp_thread_free(kmp_info_t *th, void *ptr KMP_SRC_LOC_DECL);
extern void __kmp_push_num_threads(ident_t *loc, int gtid, int num_threads);
-#if OMP_40_ENABLED
extern void __kmp_push_proc_bind(ident_t *loc, int gtid,
kmp_proc_bind_t proc_bind);
extern void __kmp_push_num_teams(ident_t *loc, int gtid, int num_teams,
int num_threads);
-#endif
-extern void __kmp_yield(int cond);
+extern void __kmp_yield();
extern void __kmpc_dispatch_init_4(ident_t *loc, kmp_int32 gtid,
enum sched_type schedule, kmp_int32 lb,
@@ -3351,13 +3279,11 @@ extern kmp_uint32 __kmp_neq_4(kmp_uint32 value, kmp_uint32 checker);
extern kmp_uint32 __kmp_lt_4(kmp_uint32 value, kmp_uint32 checker);
extern kmp_uint32 __kmp_ge_4(kmp_uint32 value, kmp_uint32 checker);
extern kmp_uint32 __kmp_le_4(kmp_uint32 value, kmp_uint32 checker);
-extern kmp_uint32 __kmp_wait_yield_4(kmp_uint32 volatile *spinner,
- kmp_uint32 checker,
- kmp_uint32 (*pred)(kmp_uint32, kmp_uint32),
- void *obj);
-extern void __kmp_wait_yield_4_ptr(void *spinner, kmp_uint32 checker,
- kmp_uint32 (*pred)(void *, kmp_uint32),
- void *obj);
+extern kmp_uint32 __kmp_wait_4(kmp_uint32 volatile *spinner, kmp_uint32 checker,
+ kmp_uint32 (*pred)(kmp_uint32, kmp_uint32),
+ void *obj);
+extern void __kmp_wait_4_ptr(void *spinner, kmp_uint32 checker,
+ kmp_uint32 (*pred)(void *, kmp_uint32), void *obj);
class kmp_flag_32;
class kmp_flag_64;
@@ -3407,9 +3333,7 @@ extern void __kmp_affinity_initialize(void);
extern void __kmp_affinity_uninitialize(void);
extern void __kmp_affinity_set_init_mask(
int gtid, int isa_root); /* set affinity according to KMP_AFFINITY */
-#if OMP_40_ENABLED
extern void __kmp_affinity_set_place(int gtid);
-#endif
extern void __kmp_affinity_determine_capable(const char *env_var);
extern int __kmp_aux_set_affinity(void **mask);
extern int __kmp_aux_get_affinity(void **mask);
@@ -3422,14 +3346,12 @@ extern void __kmp_balanced_affinity(kmp_info_t *th, int team_size);
extern int kmp_set_thread_affinity_mask_initial(void);
#endif
#endif /* KMP_AFFINITY_SUPPORTED */
-#if OMP_50_ENABLED
// No need for KMP_AFFINITY_SUPPORTED guard as only one field in the
// format string is for affinity, so platforms that do not support
// affinity can still use the other fields, e.g., %n for num_threads
extern size_t __kmp_aux_capture_affinity(int gtid, const char *format,
kmp_str_buf_t *buffer);
extern void __kmp_aux_display_affinity(int gtid, const char *format);
-#endif
extern void __kmp_cleanup_hierarchy();
extern void __kmp_get_hierarchy(kmp_uint32 nproc, kmp_bstate_t *thr_bar);
@@ -3467,6 +3389,10 @@ extern void __kmp_reap_monitor(kmp_info_t *th);
extern void __kmp_reap_worker(kmp_info_t *th);
extern void __kmp_terminate_thread(int gtid);
+extern int __kmp_try_suspend_mx(kmp_info_t *th);
+extern void __kmp_lock_suspend_mx(kmp_info_t *th);
+extern void __kmp_unlock_suspend_mx(kmp_info_t *th);
+
extern void __kmp_suspend_32(int th_gtid, kmp_flag_32 *flag);
extern void __kmp_suspend_64(int th_gtid, kmp_flag_64 *flag);
extern void __kmp_suspend_oncore(int th_gtid, kmp_flag_oncore *flag);
@@ -3490,11 +3416,11 @@ extern void __kmp_common_destroy_gtid(int gtid);
extern void __kmp_register_atfork(void);
#endif
extern void __kmp_suspend_initialize(void);
+extern void __kmp_suspend_initialize_thread(kmp_info_t *th);
extern void __kmp_suspend_uninitialize_thread(kmp_info_t *th);
extern kmp_info_t *__kmp_allocate_thread(kmp_root_t *root, kmp_team_t *team,
int tid);
-#if OMP_40_ENABLED
extern kmp_team_t *
__kmp_allocate_team(kmp_root_t *root, int new_nproc, int max_nproc,
#if OMPT_SUPPORT
@@ -3502,15 +3428,6 @@ __kmp_allocate_team(kmp_root_t *root, int new_nproc, int max_nproc,
#endif
kmp_proc_bind_t proc_bind, kmp_internal_control_t *new_icvs,
int argc USE_NESTED_HOT_ARG(kmp_info_t *thr));
-#else
-extern kmp_team_t *
-__kmp_allocate_team(kmp_root_t *root, int new_nproc, int max_nproc,
-#if OMPT_SUPPORT
- ompt_id_t ompt_parallel_id,
-#endif
- kmp_internal_control_t *new_icvs,
- int argc USE_NESTED_HOT_ARG(kmp_info_t *thr));
-#endif // OMP_40_ENABLED
extern void __kmp_free_thread(kmp_info_t *);
extern void __kmp_free_team(kmp_root_t *,
kmp_team_t *USE_NESTED_HOT_ARG(kmp_info_t *));
@@ -3533,6 +3450,7 @@ extern int __kmp_barrier(enum barrier_type bt, int gtid, int is_split,
size_t reduce_size, void *reduce_data,
void (*reduce)(void *, void *));
extern void __kmp_end_split_barrier(enum barrier_type bt, int gtid);
+extern int __kmp_barrier_gomp_cancel(int gtid);
/*!
* Tell the fork call which compiler generated the fork call, and therefore how
@@ -3560,11 +3478,8 @@ extern void __kmp_join_call(ident_t *loc, int gtid
,
enum fork_context_e fork_context
#endif
-#if OMP_40_ENABLED
,
- int exit_teams = 0
-#endif
- );
+ int exit_teams = 0);
extern void __kmp_serialized_parallel(ident_t *id, kmp_int32 gtid);
extern void __kmp_internal_fork(ident_t *id, int gtid, kmp_team_t *team);
@@ -3579,12 +3494,10 @@ extern void __kmp_run_after_invoked_task(int gtid, int tid,
// should never have been exported
KMP_EXPORT int __kmpc_invoke_task_func(int gtid);
-#if OMP_40_ENABLED
extern int __kmp_invoke_teams_master(int gtid);
extern void __kmp_teams_master(int gtid);
extern int __kmp_aux_get_team_num();
extern int __kmp_aux_get_num_teams();
-#endif
extern void __kmp_save_internal_controls(kmp_info_t *thread);
extern void __kmp_user_set_library(enum library_type arg);
extern void __kmp_aux_set_library(enum library_type arg);
@@ -3611,6 +3524,12 @@ extern void __kmp_init_implicit_task(ident_t *loc_ref, kmp_info_t *this_thr,
int set_curr_task);
extern void __kmp_finish_implicit_task(kmp_info_t *this_thr);
extern void __kmp_free_implicit_task(kmp_info_t *this_thr);
+
+extern kmp_event_t *__kmpc_task_allow_completion_event(ident_t *loc_ref,
+ int gtid,
+ kmp_task_t *task);
+extern void __kmp_fulfill_event(kmp_event_t *event);
+
int __kmp_execute_tasks_32(kmp_info_t *thread, kmp_int32 gtid,
kmp_flag_32 *flag, int final_spin,
int *thread_finished,
@@ -3662,20 +3581,6 @@ extern int __kmp_read_from_file(char const *path, char const *format, ...);
// Assembly routines that have no compiler intrinsic replacement
//
-#if KMP_ARCH_X86 || KMP_ARCH_X86_64
-
-extern void __kmp_query_cpuid(kmp_cpuinfo_t *p);
-
-#define __kmp_load_mxcsr(p) _mm_setcsr(*(p))
-static inline void __kmp_store_mxcsr(kmp_uint32 *p) { *p = _mm_getcsr(); }
-
-extern void __kmp_load_x87_fpu_control_word(kmp_int16 *p);
-extern void __kmp_store_x87_fpu_control_word(kmp_int16 *p);
-extern void __kmp_clear_x87_fpu_status_word();
-#define KMP_X86_MXCSR_MASK 0xffffffc0 /* ignore status flags (6 lsb) */
-
-#endif /* KMP_ARCH_X86 || KMP_ARCH_X86_64 */
-
extern int __kmp_invoke_microtask(microtask_t pkfn, int gtid, int npr, int argc,
void *argv[]
#if OMPT_SUPPORT
@@ -3722,11 +3627,8 @@ KMP_EXPORT void __kmpc_critical(ident_t *, kmp_int32 global_tid,
kmp_critical_name *);
KMP_EXPORT void __kmpc_end_critical(ident_t *, kmp_int32 global_tid,
kmp_critical_name *);
-
-#if OMP_45_ENABLED
KMP_EXPORT void __kmpc_critical_with_hint(ident_t *, kmp_int32 global_tid,
kmp_critical_name *, uint32_t hint);
-#endif
KMP_EXPORT kmp_int32 __kmpc_barrier_master(ident_t *, kmp_int32 global_tid);
KMP_EXPORT void __kmpc_end_barrier_master(ident_t *, kmp_int32 global_tid);
@@ -3754,24 +3656,6 @@ extern void KMPC_SET_NUM_THREADS(int arg);
extern void KMPC_SET_DYNAMIC(int flag);
extern void KMPC_SET_NESTED(int flag);
-/* Taskq interface routines */
-KMP_EXPORT kmpc_thunk_t *__kmpc_taskq(ident_t *loc, kmp_int32 global_tid,
- kmpc_task_t taskq_task,
- size_t sizeof_thunk,
- size_t sizeof_shareds, kmp_int32 flags,
- kmpc_shared_vars_t **shareds);
-KMP_EXPORT void __kmpc_end_taskq(ident_t *loc, kmp_int32 global_tid,
- kmpc_thunk_t *thunk);
-KMP_EXPORT kmp_int32 __kmpc_task(ident_t *loc, kmp_int32 global_tid,
- kmpc_thunk_t *thunk);
-KMP_EXPORT void __kmpc_taskq_task(ident_t *loc, kmp_int32 global_tid,
- kmpc_thunk_t *thunk, kmp_int32 status);
-KMP_EXPORT void __kmpc_end_taskq_task(ident_t *loc, kmp_int32 global_tid,
- kmpc_thunk_t *thunk);
-KMP_EXPORT kmpc_thunk_t *__kmpc_task_buffer(ident_t *loc, kmp_int32 global_tid,
- kmpc_thunk_t *taskq_thunk,
- kmpc_task_t task);
-
/* OMP 3.0 tasking interface routines */
KMP_EXPORT kmp_int32 __kmpc_omp_task(ident_t *loc_ref, kmp_int32 gtid,
kmp_task_t *new_task);
@@ -3780,6 +3664,12 @@ KMP_EXPORT kmp_task_t *__kmpc_omp_task_alloc(ident_t *loc_ref, kmp_int32 gtid,
size_t sizeof_kmp_task_t,
size_t sizeof_shareds,
kmp_routine_entry_t task_entry);
+KMP_EXPORT kmp_task_t *__kmpc_omp_target_task_alloc(ident_t *loc_ref, kmp_int32 gtid,
+ kmp_int32 flags,
+ size_t sizeof_kmp_task_t,
+ size_t sizeof_shareds,
+ kmp_routine_entry_t task_entry,
+ kmp_int64 device_id);
KMP_EXPORT void __kmpc_omp_task_begin_if0(ident_t *loc_ref, kmp_int32 gtid,
kmp_task_t *task);
KMP_EXPORT void __kmpc_omp_task_complete_if0(ident_t *loc_ref, kmp_int32 gtid,
@@ -3799,8 +3689,6 @@ void __kmpc_omp_task_complete(ident_t *loc_ref, kmp_int32 gtid,
/* ------------------------------------------------------------------------ */
-#if OMP_40_ENABLED
-
KMP_EXPORT void __kmpc_taskgroup(ident_t *loc, int gtid);
KMP_EXPORT void __kmpc_end_taskgroup(ident_t *loc, int gtid);
@@ -3813,7 +3701,6 @@ KMP_EXPORT void __kmpc_omp_wait_deps(ident_t *loc_ref, kmp_int32 gtid,
kmp_depend_info_t *dep_list,
kmp_int32 ndeps_noalias,
kmp_depend_info_t *noalias_dep_list);
-
extern kmp_int32 __kmp_omp_task(kmp_int32 gtid, kmp_task_t *new_task,
bool serialize_immediate);
@@ -3824,8 +3711,6 @@ KMP_EXPORT kmp_int32 __kmpc_cancellationpoint(ident_t *loc_ref, kmp_int32 gtid,
KMP_EXPORT kmp_int32 __kmpc_cancel_barrier(ident_t *loc_ref, kmp_int32 gtid);
KMP_EXPORT int __kmp_get_cancellation_status(int cancel_kind);
-#if OMP_45_ENABLED
-
KMP_EXPORT void __kmpc_proxy_task_completed(kmp_int32 gtid, kmp_task_t *ptask);
KMP_EXPORT void __kmpc_proxy_task_completed_ooo(kmp_task_t *ptask);
KMP_EXPORT void __kmpc_taskloop(ident_t *loc, kmp_int32 gtid, kmp_task_t *task,
@@ -3833,16 +3718,19 @@ KMP_EXPORT void __kmpc_taskloop(ident_t *loc, kmp_int32 gtid, kmp_task_t *task,
kmp_uint64 *ub, kmp_int64 st, kmp_int32 nogroup,
kmp_int32 sched, kmp_uint64 grainsize,
void *task_dup);
-#endif
-#if OMP_50_ENABLED
KMP_EXPORT void *__kmpc_task_reduction_init(int gtid, int num_data, void *data);
+KMP_EXPORT void *__kmpc_taskred_init(int gtid, int num_data, void *data);
KMP_EXPORT void *__kmpc_task_reduction_get_th_data(int gtid, void *tg, void *d);
+KMP_EXPORT void *__kmpc_task_reduction_modifier_init(ident_t *loc, int gtid,
+ int is_ws, int num,
+ void *data);
+KMP_EXPORT void *__kmpc_taskred_modifier_init(ident_t *loc, int gtid, int is_ws,
+ int num, void *data);
+KMP_EXPORT void __kmpc_task_reduction_modifier_fini(ident_t *loc, int gtid,
+ int is_ws);
KMP_EXPORT kmp_int32 __kmpc_omp_reg_task_with_affinity(
ident_t *loc_ref, kmp_int32 gtid, kmp_task_t *new_task, kmp_int32 naffins,
kmp_task_affinity_info_t *affin_list);
-#endif
-
-#endif
/* Lock interface routines (fast versions with gtid passed in) */
KMP_EXPORT void __kmpc_init_lock(ident_t *loc, kmp_int32 gtid,
@@ -3864,13 +3752,11 @@ KMP_EXPORT int __kmpc_test_lock(ident_t *loc, kmp_int32 gtid, void **user_lock);
KMP_EXPORT int __kmpc_test_nest_lock(ident_t *loc, kmp_int32 gtid,
void **user_lock);
-#if OMP_45_ENABLED
KMP_EXPORT void __kmpc_init_lock_with_hint(ident_t *loc, kmp_int32 gtid,
void **user_lock, uintptr_t hint);
KMP_EXPORT void __kmpc_init_nest_lock_with_hint(ident_t *loc, kmp_int32 gtid,
void **user_lock,
uintptr_t hint);
-#endif
/* Interface to fast scalable reduce methods routines */
@@ -3908,7 +3794,6 @@ KMP_EXPORT void __kmpc_pop_num_threads(ident_t *loc, kmp_int32 global_tid);
KMP_EXPORT void __kmpc_push_num_threads(ident_t *loc, kmp_int32 global_tid,
kmp_int32 num_threads);
-#if OMP_40_ENABLED
KMP_EXPORT void __kmpc_push_proc_bind(ident_t *loc, kmp_int32 global_tid,
int proc_bind);
KMP_EXPORT void __kmpc_push_num_teams(ident_t *loc, kmp_int32 global_tid,
@@ -3916,8 +3801,6 @@ KMP_EXPORT void __kmpc_push_num_teams(ident_t *loc, kmp_int32 global_tid,
kmp_int32 num_threads);
KMP_EXPORT void __kmpc_fork_teams(ident_t *loc, kmp_int32 argc,
kmpc_micro microtask, ...);
-#endif
-#if OMP_45_ENABLED
struct kmp_dim { // loop bounds info casted to kmp_int64
kmp_int64 lo; // lower
kmp_int64 up; // upper
@@ -3931,7 +3814,6 @@ KMP_EXPORT void __kmpc_doacross_wait(ident_t *loc, kmp_int32 gtid,
KMP_EXPORT void __kmpc_doacross_post(ident_t *loc, kmp_int32 gtid,
const kmp_int64 *vec);
KMP_EXPORT void __kmpc_doacross_fini(ident_t *loc, kmp_int32 gtid);
-#endif
KMP_EXPORT void *__kmpc_threadprivate_cached(ident_t *loc, kmp_int32 global_tid,
void *data, size_t size,
@@ -3988,7 +3870,6 @@ KMP_EXPORT void KMPC_CONVENTION kmpc_set_library(int);
KMP_EXPORT void KMPC_CONVENTION kmpc_set_defaults(char const *);
KMP_EXPORT void KMPC_CONVENTION kmpc_set_disp_num_buffers(int);
-#if OMP_50_ENABLED
enum kmp_target_offload_kind {
tgt_disabled = 0,
tgt_default = 1,
@@ -3998,14 +3879,36 @@ typedef enum kmp_target_offload_kind kmp_target_offload_kind_t;
// Set via OMP_TARGET_OFFLOAD if specified, defaults to tgt_default otherwise
extern kmp_target_offload_kind_t __kmp_target_offload;
extern int __kmpc_get_target_offload();
-#endif
-#if OMP_40_ENABLED
// Constants used in libomptarget
#define KMP_DEVICE_DEFAULT -1 // This is libomptarget's default device.
#define KMP_HOST_DEVICE -10 // This is what it is in libomptarget, go figure.
#define KMP_DEVICE_ALL -11 // This is libomptarget's "all devices".
-#endif // OMP_40_ENABLED
+
+// OMP Pause Resource
+
+// The following enum is used both to set the status in __kmp_pause_status, and
+// as the internal equivalent of the externally-visible omp_pause_resource_t.
+typedef enum kmp_pause_status_t {
+ kmp_not_paused = 0, // status is not paused, or, requesting resume
+ kmp_soft_paused = 1, // status is soft-paused, or, requesting soft pause
+ kmp_hard_paused = 2 // status is hard-paused, or, requesting hard pause
+} kmp_pause_status_t;
+
+// This stores the pause state of the runtime
+extern kmp_pause_status_t __kmp_pause_status;
+extern int __kmpc_pause_resource(kmp_pause_status_t level);
+extern int __kmp_pause_resource(kmp_pause_status_t level);
+// Soft resume sets __kmp_pause_status, and wakes up all threads.
+extern void __kmp_resume_if_soft_paused();
+// Hard resume simply resets the status to not paused. Library will appear to
+// be uninitialized after hard pause. Let OMP constructs trigger required
+// initializations.
+static inline void __kmp_resume_if_hard_paused() {
+ if (__kmp_pause_status == kmp_hard_paused) {
+ __kmp_pause_status = kmp_not_paused;
+ }
+}
#ifdef __cplusplus
}
diff --git a/runtime/src/kmp_affinity.cpp b/runtime/src/kmp_affinity.cpp
index f14cdf68c086..372c300d44eb 100644
--- a/runtime/src/kmp_affinity.cpp
+++ b/runtime/src/kmp_affinity.cpp
@@ -4,10 +4,9 @@
//===----------------------------------------------------------------------===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.txt for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -458,7 +457,8 @@ static int __kmp_hwloc_get_nobjs_under_obj(hwloc_obj_t obj,
}
static int __kmp_hwloc_count_children_by_depth(hwloc_topology_t t,
- hwloc_obj_t o, unsigned depth,
+ hwloc_obj_t o,
+ kmp_hwloc_depth_t depth,
hwloc_obj_t *f) {
if (o->depth == depth) {
if (*f == NULL)
@@ -531,7 +531,7 @@ static int __kmp_hwloc_process_obj_core_pu(AddrUnsPair *addrPair,
static int __kmp_hwloc_check_numa() {
hwloc_topology_t &tp = __kmp_hwloc_topology;
hwloc_obj_t hT, hC, hL, hN, hS; // hwloc objects (pointers to)
- int depth;
+ int depth, l2cache_depth, package_depth;
// Get some PU
hT = hwloc_get_obj_by_type(tp, HWLOC_OBJ_PU, 0);
@@ -545,12 +545,14 @@ static int __kmp_hwloc_check_numa() {
if (hN != NULL && hN->depth > hS->depth) {
__kmp_numa_detected = TRUE; // socket includes node(s)
if (__kmp_affinity_gran == affinity_gran_node) {
- __kmp_affinity_gran == affinity_gran_numa;
+ __kmp_affinity_gran = affinity_gran_numa;
}
}
+ package_depth = hwloc_get_type_depth(tp, HWLOC_OBJ_PACKAGE);
+ l2cache_depth = hwloc_get_cache_type_depth(tp, 2, HWLOC_OBJ_CACHE_UNIFIED);
// check tile, get object by depth because of multiple caches possible
- depth = hwloc_get_cache_type_depth(tp, 2, HWLOC_OBJ_CACHE_UNIFIED);
+ depth = (l2cache_depth < package_depth) ? package_depth : l2cache_depth;
hL = hwloc_get_ancestor_obj_by_depth(tp, depth, hT);
hC = NULL; // not used, but reset it here just in case
if (hL != NULL &&
@@ -3017,8 +3019,6 @@ static void __kmp_affinity_process_proclist(kmp_affin_mask_t **out_masks,
KMP_CPU_FREE(sumMask);
}
-#if OMP_40_ENABLED
-
/*-----------------------------------------------------------------------------
Re-parse the OMP_PLACES proc id list, forming the newMasks for the different
places. Again, Here is the grammar:
@@ -3039,7 +3039,6 @@ signed := num
signed := + signed
signed := - signed
-----------------------------------------------------------------------------*/
-
static void __kmp_process_subplace_list(const char **scan,
kmp_affin_mask_t *osId2Mask,
int maxOsId, kmp_affin_mask_t *tempMask,
@@ -3358,8 +3357,6 @@ void __kmp_affinity_process_placelist(kmp_affin_mask_t **out_masks,
KMP_CPU_INTERNAL_FREE_ARRAY(newMasks, numNewMasks);
}
-#endif /* OMP_40_ENABLED */
-
#undef ADD_MASK
#undef ADD_MASK_OSID
@@ -4484,21 +4481,15 @@ static void __kmp_aux_affinity_initialize(void) {
case affinity_explicit:
KMP_DEBUG_ASSERT(__kmp_affinity_proclist != NULL);
-#if OMP_40_ENABLED
- if (__kmp_nested_proc_bind.bind_types[0] == proc_bind_intel)
-#endif
- {
+ if (__kmp_nested_proc_bind.bind_types[0] == proc_bind_intel) {
__kmp_affinity_process_proclist(
&__kmp_affinity_masks, &__kmp_affinity_num_masks,
__kmp_affinity_proclist, osId2Mask, maxIndex);
- }
-#if OMP_40_ENABLED
- else {
+ } else {
__kmp_affinity_process_placelist(
&__kmp_affinity_masks, &__kmp_affinity_num_masks,
__kmp_affinity_proclist, osId2Mask, maxIndex);
}
-#endif
if (__kmp_affinity_num_masks == 0) {
if (__kmp_affinity_verbose ||
(__kmp_affinity_warnings && (__kmp_affinity_type != affinity_none))) {
@@ -4614,13 +4605,11 @@ static void __kmp_aux_affinity_initialize(void) {
__kmp_affinity_num_masks = numUnique;
}
-#if OMP_40_ENABLED
if ((__kmp_nested_proc_bind.bind_types[0] != proc_bind_intel) &&
(__kmp_affinity_num_places > 0) &&
((unsigned)__kmp_affinity_num_places < __kmp_affinity_num_masks)) {
__kmp_affinity_num_masks = __kmp_affinity_num_places;
}
-#endif
KMP_CPU_ALLOC_ARRAY(__kmp_affinity_masks, __kmp_affinity_num_masks);
@@ -4690,9 +4679,7 @@ void __kmp_affinity_uninitialize(void) {
}
__kmp_affinity_num_masks = 0;
__kmp_affinity_type = affinity_default;
-#if OMP_40_ENABLED
__kmp_affinity_num_places = 0;
-#endif
if (__kmp_affinity_proclist != NULL) {
__kmp_free(__kmp_affinity_proclist);
__kmp_affinity_proclist = NULL;
@@ -4733,10 +4720,7 @@ void __kmp_affinity_set_init_mask(int gtid, int isa_root) {
kmp_affin_mask_t *mask;
int i;
-#if OMP_40_ENABLED
- if (KMP_AFFINITY_NON_PROC_BIND)
-#endif
- {
+ if (KMP_AFFINITY_NON_PROC_BIND) {
if ((__kmp_affinity_type == affinity_none) ||
(__kmp_affinity_type == affinity_balanced)) {
#if KMP_GROUP_AFFINITY
@@ -4752,9 +4736,7 @@ void __kmp_affinity_set_init_mask(int gtid, int isa_root) {
i = (gtid + __kmp_affinity_offset) % __kmp_affinity_num_masks;
mask = KMP_CPU_INDEX(__kmp_affinity_masks, i);
}
- }
-#if OMP_40_ENABLED
- else {
+ } else {
if ((!isa_root) ||
(__kmp_nested_proc_bind.bind_types[0] == proc_bind_false)) {
#if KMP_GROUP_AFFINITY
@@ -4773,9 +4755,7 @@ void __kmp_affinity_set_init_mask(int gtid, int isa_root) {
mask = KMP_CPU_INDEX(__kmp_affinity_masks, i);
}
}
-#endif
-#if OMP_40_ENABLED
th->th.th_current_place = i;
if (isa_root) {
th->th.th_new_place = i;
@@ -4795,17 +4775,6 @@ void __kmp_affinity_set_init_mask(int gtid, int isa_root) {
KA_TRACE(100, ("__kmp_affinity_set_init_mask: binding T#%d to place %d\n",
gtid, i));
}
-#else
- if (i == -1) {
- KA_TRACE(
- 100,
- ("__kmp_affinity_set_init_mask: binding T#%d to __kmp_affin_fullMask\n",
- gtid));
- } else {
- KA_TRACE(100, ("__kmp_affinity_set_init_mask: binding T#%d to mask %d\n",
- gtid, i));
- }
-#endif /* OMP_40_ENABLED */
KMP_CPU_COPY(th->th.th_affin_mask, mask);
@@ -4831,8 +4800,6 @@ void __kmp_affinity_set_init_mask(int gtid, int isa_root) {
__kmp_set_system_affinity(th->th.th_affin_mask, TRUE);
}
-#if OMP_40_ENABLED
-
void __kmp_affinity_set_place(int gtid) {
if (!KMP_AFFINITY_CAPABLE()) {
return;
@@ -4873,8 +4840,6 @@ void __kmp_affinity_set_place(int gtid) {
__kmp_set_system_affinity(th->th.th_affin_mask, TRUE);
}
-#endif /* OMP_40_ENABLED */
-
int __kmp_aux_set_affinity(void **mask) {
int gtid;
kmp_info_t *th;
@@ -4885,7 +4850,7 @@ int __kmp_aux_set_affinity(void **mask) {
}
gtid = __kmp_entry_gtid();
- KA_TRACE(1000, ; {
+ KA_TRACE(1000, (""); {
char buf[KMP_AFFIN_MASK_PRINT_LEN];
__kmp_affinity_print_mask(buf, KMP_AFFIN_MASK_PRINT_LEN,
(kmp_affin_mask_t *)(*mask));
@@ -4929,7 +4894,6 @@ int __kmp_aux_set_affinity(void **mask) {
KMP_CPU_COPY(th->th.th_affin_mask, (kmp_affin_mask_t *)(*mask));
}
-#if OMP_40_ENABLED
th->th.th_current_place = KMP_PLACE_UNDEFINED;
th->th.th_new_place = KMP_PLACE_UNDEFINED;
th->th.th_first_place = 0;
@@ -4937,7 +4901,6 @@ int __kmp_aux_set_affinity(void **mask) {
// Turn off 4.0 affinity for the current tread at this parallel level.
th->th.th_current_task->td_icvs.proc_bind = proc_bind_false;
-#endif
return retval;
}
@@ -4955,7 +4918,7 @@ int __kmp_aux_get_affinity(void **mask) {
th = __kmp_threads[gtid];
KMP_DEBUG_ASSERT(th->th.th_affin_mask != NULL);
- KA_TRACE(1000, ; {
+ KA_TRACE(1000, (""); {
char buf[KMP_AFFIN_MASK_PRINT_LEN];
__kmp_affinity_print_mask(buf, KMP_AFFIN_MASK_PRINT_LEN,
th->th.th_affin_mask);
@@ -4972,7 +4935,7 @@ int __kmp_aux_get_affinity(void **mask) {
#if !KMP_OS_WINDOWS
retval = __kmp_get_system_affinity((kmp_affin_mask_t *)(*mask), FALSE);
- KA_TRACE(1000, ; {
+ KA_TRACE(1000, (""); {
char buf[KMP_AFFIN_MASK_PRINT_LEN];
__kmp_affinity_print_mask(buf, KMP_AFFIN_MASK_PRINT_LEN,
(kmp_affin_mask_t *)(*mask));
@@ -5006,7 +4969,7 @@ int __kmp_aux_set_affinity_mask_proc(int proc, void **mask) {
return -1;
}
- KA_TRACE(1000, ; {
+ KA_TRACE(1000, (""); {
int gtid = __kmp_entry_gtid();
char buf[KMP_AFFIN_MASK_PRINT_LEN];
__kmp_affinity_print_mask(buf, KMP_AFFIN_MASK_PRINT_LEN,
@@ -5038,7 +5001,7 @@ int __kmp_aux_unset_affinity_mask_proc(int proc, void **mask) {
return -1;
}
- KA_TRACE(1000, ; {
+ KA_TRACE(1000, (""); {
int gtid = __kmp_entry_gtid();
char buf[KMP_AFFIN_MASK_PRINT_LEN];
__kmp_affinity_print_mask(buf, KMP_AFFIN_MASK_PRINT_LEN,
@@ -5070,7 +5033,7 @@ int __kmp_aux_get_affinity_mask_proc(int proc, void **mask) {
return -1;
}
- KA_TRACE(1000, ; {
+ KA_TRACE(1000, (""); {
int gtid = __kmp_entry_gtid();
char buf[KMP_AFFIN_MASK_PRINT_LEN];
__kmp_affinity_print_mask(buf, KMP_AFFIN_MASK_PRINT_LEN,
diff --git a/runtime/src/kmp_affinity.h b/runtime/src/kmp_affinity.h
index 34147fd395bf..c00ad3645661 100644
--- a/runtime/src/kmp_affinity.h
+++ b/runtime/src/kmp_affinity.h
@@ -4,10 +4,9 @@
//===----------------------------------------------------------------------===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.txt for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/runtime/src/kmp_alloc.cpp b/runtime/src/kmp_alloc.cpp
index ae60fef02d12..861940120e90 100644
--- a/runtime/src/kmp_alloc.cpp
+++ b/runtime/src/kmp_alloc.cpp
@@ -4,10 +4,9 @@
//===----------------------------------------------------------------------===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.txt for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -34,7 +33,7 @@ typedef kmp_int64 bufsize;
#endif
#else
typedef ssize_t bufsize;
-#endif
+#endif // KMP_OS_WINDOWS
/* The three modes of operation are, fifo search, lifo search, and best-fit */
@@ -1221,74 +1220,216 @@ void ___kmp_thread_free(kmp_info_t *th, void *ptr KMP_SRC_LOC_DECL) {
KE_TRACE(30, ("<- __kmp_thread_free()\n"));
}
-#if OMP_50_ENABLED
/* OMP 5.0 Memory Management support */
-static int (*p_hbw_check)(void);
-static void *(*p_hbw_malloc)(size_t);
-static void (*p_hbw_free)(void *);
-static int (*p_hbw_set_policy)(int);
static const char *kmp_mk_lib_name;
static void *h_memkind;
+/* memkind experimental API: */
+// memkind_alloc
+static void *(*kmp_mk_alloc)(void *k, size_t sz);
+// memkind_free
+static void (*kmp_mk_free)(void *kind, void *ptr);
+// memkind_check_available
+static int (*kmp_mk_check)(void *kind);
+// kinds we are going to use
+static void **mk_default;
+static void **mk_interleave;
+static void **mk_hbw;
+static void **mk_hbw_interleave;
+static void **mk_hbw_preferred;
+static void **mk_hugetlb;
+static void **mk_hbw_hugetlb;
+static void **mk_hbw_preferred_hugetlb;
+
+#if KMP_OS_UNIX && KMP_DYNAMIC_LIB
+static inline void chk_kind(void ***pkind) {
+ KMP_DEBUG_ASSERT(pkind);
+ if (*pkind) // symbol found
+ if (kmp_mk_check(**pkind)) // kind not available or error
+ *pkind = NULL;
+}
+#endif
void __kmp_init_memkind() {
+// as of 2018-07-31 memkind does not support Windows*, exclude it for now
#if KMP_OS_UNIX && KMP_DYNAMIC_LIB
+ // use of statically linked memkind is problematic, as it depends on libnuma
kmp_mk_lib_name = "libmemkind.so";
h_memkind = dlopen(kmp_mk_lib_name, RTLD_LAZY);
if (h_memkind) {
- p_hbw_check = (int (*)())dlsym(h_memkind, "hbw_check_available");
- p_hbw_malloc = (void *(*)(size_t))dlsym(h_memkind, "hbw_malloc");
- p_hbw_free = (void (*)(void *))dlsym(h_memkind, "hbw_free");
- p_hbw_set_policy = (int (*)(int))dlsym(h_memkind, "hbw_set_policy");
- if (p_hbw_check && p_hbw_malloc && p_hbw_free && p_hbw_set_policy) {
+ kmp_mk_check = (int (*)(void *))dlsym(h_memkind, "memkind_check_available");
+ kmp_mk_alloc =
+ (void *(*)(void *, size_t))dlsym(h_memkind, "memkind_malloc");
+ kmp_mk_free = (void (*)(void *, void *))dlsym(h_memkind, "memkind_free");
+ mk_default = (void **)dlsym(h_memkind, "MEMKIND_DEFAULT");
+ if (kmp_mk_check && kmp_mk_alloc && kmp_mk_free && mk_default &&
+ !kmp_mk_check(*mk_default)) {
__kmp_memkind_available = 1;
- if (p_hbw_check() == 0) {
- p_hbw_set_policy(1); // return NULL is not enough memory
- __kmp_hbw_mem_available = 1; // found HBW memory available
- }
- return; // success - all symbols resolved
+ mk_interleave = (void **)dlsym(h_memkind, "MEMKIND_INTERLEAVE");
+ chk_kind(&mk_interleave);
+ mk_hbw = (void **)dlsym(h_memkind, "MEMKIND_HBW");
+ chk_kind(&mk_hbw);
+ mk_hbw_interleave = (void **)dlsym(h_memkind, "MEMKIND_HBW_INTERLEAVE");
+ chk_kind(&mk_hbw_interleave);
+ mk_hbw_preferred = (void **)dlsym(h_memkind, "MEMKIND_HBW_PREFERRED");
+ chk_kind(&mk_hbw_preferred);
+ mk_hugetlb = (void **)dlsym(h_memkind, "MEMKIND_HUGETLB");
+ chk_kind(&mk_hugetlb);
+ mk_hbw_hugetlb = (void **)dlsym(h_memkind, "MEMKIND_HBW_HUGETLB");
+ chk_kind(&mk_hbw_hugetlb);
+ mk_hbw_preferred_hugetlb =
+ (void **)dlsym(h_memkind, "MEMKIND_HBW_PREFERRED_HUGETLB");
+ chk_kind(&mk_hbw_preferred_hugetlb);
+ KE_TRACE(25, ("__kmp_init_memkind: memkind library initialized\n"));
+ return; // success
}
dlclose(h_memkind); // failure
h_memkind = NULL;
}
- p_hbw_check = NULL;
- p_hbw_malloc = NULL;
- p_hbw_free = NULL;
- p_hbw_set_policy = NULL;
+ kmp_mk_check = NULL;
+ kmp_mk_alloc = NULL;
+ kmp_mk_free = NULL;
+ mk_default = NULL;
+ mk_interleave = NULL;
+ mk_hbw = NULL;
+ mk_hbw_interleave = NULL;
+ mk_hbw_preferred = NULL;
+ mk_hugetlb = NULL;
+ mk_hbw_hugetlb = NULL;
+ mk_hbw_preferred_hugetlb = NULL;
#else
kmp_mk_lib_name = "";
h_memkind = NULL;
- p_hbw_check = NULL;
- p_hbw_malloc = NULL;
- p_hbw_free = NULL;
- p_hbw_set_policy = NULL;
+ kmp_mk_check = NULL;
+ kmp_mk_alloc = NULL;
+ kmp_mk_free = NULL;
+ mk_default = NULL;
+ mk_interleave = NULL;
+ mk_hbw = NULL;
+ mk_hbw_interleave = NULL;
+ mk_hbw_preferred = NULL;
+ mk_hugetlb = NULL;
+ mk_hbw_hugetlb = NULL;
+ mk_hbw_preferred_hugetlb = NULL;
#endif
}
void __kmp_fini_memkind() {
#if KMP_OS_UNIX && KMP_DYNAMIC_LIB
+ if (__kmp_memkind_available)
+ KE_TRACE(25, ("__kmp_fini_memkind: finalize memkind library\n"));
if (h_memkind) {
dlclose(h_memkind);
h_memkind = NULL;
}
- p_hbw_check = NULL;
- p_hbw_malloc = NULL;
- p_hbw_free = NULL;
- p_hbw_set_policy = NULL;
+ kmp_mk_check = NULL;
+ kmp_mk_alloc = NULL;
+ kmp_mk_free = NULL;
+ mk_default = NULL;
+ mk_interleave = NULL;
+ mk_hbw = NULL;
+ mk_hbw_interleave = NULL;
+ mk_hbw_preferred = NULL;
+ mk_hugetlb = NULL;
+ mk_hbw_hugetlb = NULL;
+ mk_hbw_preferred_hugetlb = NULL;
#endif
}
-void __kmpc_set_default_allocator(int gtid, const omp_allocator_t *allocator) {
- if (allocator == OMP_NULL_ALLOCATOR)
+omp_allocator_handle_t __kmpc_init_allocator(int gtid, omp_memspace_handle_t ms,
+ int ntraits,
+ omp_alloctrait_t traits[]) {
+ // OpenMP 5.0 only allows predefined memspaces
+ KMP_DEBUG_ASSERT(ms == omp_default_mem_space || ms == omp_low_lat_mem_space ||
+ ms == omp_large_cap_mem_space || ms == omp_const_mem_space ||
+ ms == omp_high_bw_mem_space);
+ kmp_allocator_t *al;
+ int i;
+ al = (kmp_allocator_t *)__kmp_allocate(sizeof(kmp_allocator_t)); // zeroed
+ al->memspace = ms; // not used currently
+ for (i = 0; i < ntraits; ++i) {
+ switch (traits[i].key) {
+ case OMP_ATK_THREADMODEL:
+ case OMP_ATK_ACCESS:
+ case OMP_ATK_PINNED:
+ break;
+ case OMP_ATK_ALIGNMENT:
+ al->alignment = traits[i].value;
+ KMP_ASSERT(IS_POWER_OF_TWO(al->alignment));
+ break;
+ case OMP_ATK_POOL_SIZE:
+ al->pool_size = traits[i].value;
+ break;
+ case OMP_ATK_FALLBACK:
+ al->fb = (omp_alloctrait_value_t)traits[i].value;
+ KMP_DEBUG_ASSERT(
+ al->fb == OMP_ATV_DEFAULT_MEM_FB || al->fb == OMP_ATV_NULL_FB ||
+ al->fb == OMP_ATV_ABORT_FB || al->fb == OMP_ATV_ALLOCATOR_FB);
+ break;
+ case OMP_ATK_FB_DATA:
+ al->fb_data = RCAST(kmp_allocator_t *, traits[i].value);
+ break;
+ case OMP_ATK_PARTITION:
+ al->memkind = RCAST(void **, traits[i].value);
+ break;
+ default:
+ KMP_ASSERT2(0, "Unexpected allocator trait");
+ }
+ }
+ if (al->fb == 0) {
+ // set default allocator
+ al->fb = OMP_ATV_DEFAULT_MEM_FB;
+ al->fb_data = (kmp_allocator_t *)omp_default_mem_alloc;
+ } else if (al->fb == OMP_ATV_ALLOCATOR_FB) {
+ KMP_ASSERT(al->fb_data != NULL);
+ } else if (al->fb == OMP_ATV_DEFAULT_MEM_FB) {
+ al->fb_data = (kmp_allocator_t *)omp_default_mem_alloc;
+ }
+ if (__kmp_memkind_available) {
+ // Let's use memkind library if available
+ if (ms == omp_high_bw_mem_space) {
+ if (al->memkind == (void *)OMP_ATV_INTERLEAVED && mk_hbw_interleave) {
+ al->memkind = mk_hbw_interleave;
+ } else if (mk_hbw_preferred) {
+ // AC: do not try to use MEMKIND_HBW for now, because memkind library
+ // cannot reliably detect exhaustion of HBW memory.
+ // It could be possible using hbw_verify_memory_region() but memkind
+ // manual says: "Using this function in production code may result in
+ // serious performance penalty".
+ al->memkind = mk_hbw_preferred;
+ } else {
+ // HBW is requested but not available --> return NULL allocator
+ __kmp_free(al);
+ return omp_null_allocator;
+ }
+ } else {
+ if (al->memkind == (void *)OMP_ATV_INTERLEAVED && mk_interleave) {
+ al->memkind = mk_interleave;
+ } else {
+ al->memkind = mk_default;
+ }
+ }
+ } else {
+ if (ms == omp_high_bw_mem_space) {
+ // cannot detect HBW memory presence without memkind library
+ __kmp_free(al);
+ return omp_null_allocator;
+ }
+ }
+ return (omp_allocator_handle_t)al;
+}
+
+void __kmpc_destroy_allocator(int gtid, omp_allocator_handle_t allocator) {
+ if (allocator > kmp_max_mem_alloc)
+ __kmp_free(allocator);
+}
+
+void __kmpc_set_default_allocator(int gtid, omp_allocator_handle_t allocator) {
+ if (allocator == omp_null_allocator)
allocator = omp_default_mem_alloc;
- KMP_DEBUG_ASSERT(
- allocator == omp_default_mem_alloc ||
- allocator == omp_large_cap_mem_alloc ||
- allocator == omp_const_mem_alloc || allocator == omp_high_bw_mem_alloc ||
- allocator == omp_low_lat_mem_alloc || allocator == omp_cgroup_mem_alloc ||
- allocator == omp_pteam_mem_alloc || allocator == omp_thread_mem_alloc);
__kmp_threads[gtid]->th.th_def_allocator = allocator;
}
-const omp_allocator_t *__kmpc_get_default_allocator(int gtid) {
+
+omp_allocator_handle_t __kmpc_get_default_allocator(int gtid) {
return __kmp_threads[gtid]->th.th_def_allocator;
}
@@ -1296,44 +1437,137 @@ typedef struct kmp_mem_desc { // Memory block descriptor
void *ptr_alloc; // Pointer returned by allocator
size_t size_a; // Size of allocated memory block (initial+descriptor+align)
void *ptr_align; // Pointer to aligned memory, returned
- const omp_allocator_t *allocator; // allocator
+ kmp_allocator_t *allocator; // allocator
} kmp_mem_desc_t;
static int alignment = sizeof(void *); // let's align to pointer size
-void *__kmpc_alloc(int gtid, size_t size, const omp_allocator_t *allocator) {
+void *__kmpc_alloc(int gtid, size_t size, omp_allocator_handle_t allocator) {
+ void *ptr = NULL;
+ kmp_allocator_t *al;
KMP_DEBUG_ASSERT(__kmp_init_serial);
- if (allocator == OMP_NULL_ALLOCATOR)
+ if (allocator == omp_null_allocator)
allocator = __kmp_threads[gtid]->th.th_def_allocator;
+ KE_TRACE(25, ("__kmpc_alloc: T#%d (%d, %p)\n", gtid, (int)size, allocator));
+ al = RCAST(kmp_allocator_t *, CCAST(omp_allocator_handle_t, allocator));
+
int sz_desc = sizeof(kmp_mem_desc_t);
- void *ptr = NULL;
kmp_mem_desc_t desc;
kmp_uintptr_t addr; // address returned by allocator
kmp_uintptr_t addr_align; // address to return to caller
kmp_uintptr_t addr_descr; // address of memory block descriptor
-
- KE_TRACE(25, ("__kmpc_alloc: T#%d (%d, %p)\n", gtid, (int)size, allocator));
-
- desc.size_a = size + sz_desc + alignment;
- if (allocator == omp_default_mem_alloc)
- ptr = __kmp_allocate(desc.size_a);
- if (allocator == omp_high_bw_mem_alloc && __kmp_hbw_mem_available) {
- KMP_DEBUG_ASSERT(p_hbw_malloc != NULL);
- ptr = p_hbw_malloc(desc.size_a);
+ int align = alignment; // default alignment
+ if (allocator > kmp_max_mem_alloc && al->alignment > 0) {
+ align = al->alignment; // alignment requested by user
}
+ desc.size_a = size + sz_desc + align;
- KE_TRACE(10, ("__kmpc_alloc: T#%d %p=alloc(%d) hbw %d\n", gtid, ptr,
- desc.size_a, __kmp_hbw_mem_available));
+ if (__kmp_memkind_available) {
+ if (allocator < kmp_max_mem_alloc) {
+ // pre-defined allocator
+ if (allocator == omp_high_bw_mem_alloc && mk_hbw_preferred) {
+ ptr = kmp_mk_alloc(*mk_hbw_preferred, desc.size_a);
+ } else {
+ ptr = kmp_mk_alloc(*mk_default, desc.size_a);
+ }
+ } else if (al->pool_size > 0) {
+ // custom allocator with pool size requested
+ kmp_uint64 used =
+ KMP_TEST_THEN_ADD64((kmp_int64 *)&al->pool_used, desc.size_a);
+ if (used + desc.size_a > al->pool_size) {
+ // not enough space, need to go fallback path
+ KMP_TEST_THEN_ADD64((kmp_int64 *)&al->pool_used, -desc.size_a);
+ if (al->fb == OMP_ATV_DEFAULT_MEM_FB) {
+ al = (kmp_allocator_t *)omp_default_mem_alloc;
+ ptr = kmp_mk_alloc(*mk_default, desc.size_a);
+ } else if (al->fb == OMP_ATV_ABORT_FB) {
+ KMP_ASSERT(0); // abort fallback requested
+ } else if (al->fb == OMP_ATV_ALLOCATOR_FB) {
+ KMP_ASSERT(al != al->fb_data);
+ al = al->fb_data;
+ return __kmpc_alloc(gtid, size, (omp_allocator_handle_t)al);
+ } // else ptr == NULL;
+ } else {
+ // pool has enough space
+ ptr = kmp_mk_alloc(*al->memkind, desc.size_a);
+ if (ptr == NULL) {
+ if (al->fb == OMP_ATV_DEFAULT_MEM_FB) {
+ al = (kmp_allocator_t *)omp_default_mem_alloc;
+ ptr = kmp_mk_alloc(*mk_default, desc.size_a);
+ } else if (al->fb == OMP_ATV_ABORT_FB) {
+ KMP_ASSERT(0); // abort fallback requested
+ } else if (al->fb == OMP_ATV_ALLOCATOR_FB) {
+ KMP_ASSERT(al != al->fb_data);
+ al = al->fb_data;
+ return __kmpc_alloc(gtid, size, (omp_allocator_handle_t)al);
+ }
+ }
+ }
+ } else {
+ // custom allocator, pool size not requested
+ ptr = kmp_mk_alloc(*al->memkind, desc.size_a);
+ if (ptr == NULL) {
+ if (al->fb == OMP_ATV_DEFAULT_MEM_FB) {
+ al = (kmp_allocator_t *)omp_default_mem_alloc;
+ ptr = kmp_mk_alloc(*mk_default, desc.size_a);
+ } else if (al->fb == OMP_ATV_ABORT_FB) {
+ KMP_ASSERT(0); // abort fallback requested
+ } else if (al->fb == OMP_ATV_ALLOCATOR_FB) {
+ KMP_ASSERT(al != al->fb_data);
+ al = al->fb_data;
+ return __kmpc_alloc(gtid, size, (omp_allocator_handle_t)al);
+ }
+ }
+ }
+ } else if (allocator < kmp_max_mem_alloc) {
+ // pre-defined allocator
+ if (allocator == omp_high_bw_mem_alloc) {
+ // ptr = NULL;
+ } else {
+ ptr = __kmp_thread_malloc(__kmp_thread_from_gtid(gtid), desc.size_a);
+ }
+ } else if (al->pool_size > 0) {
+ // custom allocator with pool size requested
+ kmp_uint64 used =
+ KMP_TEST_THEN_ADD64((kmp_int64 *)&al->pool_used, desc.size_a);
+ if (used + desc.size_a > al->pool_size) {
+ // not enough space, need to go fallback path
+ KMP_TEST_THEN_ADD64((kmp_int64 *)&al->pool_used, -desc.size_a);
+ if (al->fb == OMP_ATV_DEFAULT_MEM_FB) {
+ al = (kmp_allocator_t *)omp_default_mem_alloc;
+ ptr = __kmp_thread_malloc(__kmp_thread_from_gtid(gtid), desc.size_a);
+ } else if (al->fb == OMP_ATV_ABORT_FB) {
+ KMP_ASSERT(0); // abort fallback requested
+ } else if (al->fb == OMP_ATV_ALLOCATOR_FB) {
+ KMP_ASSERT(al != al->fb_data);
+ al = al->fb_data;
+ return __kmpc_alloc(gtid, size, (omp_allocator_handle_t)al);
+ } // else ptr == NULL;
+ } else {
+ // pool has enough space
+ ptr = __kmp_thread_malloc(__kmp_thread_from_gtid(gtid), desc.size_a);
+ if (ptr == NULL && al->fb == OMP_ATV_ABORT_FB) {
+ KMP_ASSERT(0); // abort fallback requested
+ } // no sense to look for another fallback because of same internal alloc
+ }
+ } else {
+ // custom allocator, pool size not requested
+ ptr = __kmp_thread_malloc(__kmp_thread_from_gtid(gtid), desc.size_a);
+ if (ptr == NULL && al->fb == OMP_ATV_ABORT_FB) {
+ KMP_ASSERT(0); // abort fallback requested
+ } // no sense to look for another fallback because of same internal alloc
+ }
+ KE_TRACE(10, ("__kmpc_alloc: T#%d %p=alloc(%d)\n", gtid, ptr, desc.size_a));
if (ptr == NULL)
return NULL;
addr = (kmp_uintptr_t)ptr;
- addr_align = (addr + sz_desc + alignment - 1) & ~(alignment - 1);
+ addr_align = (addr + sz_desc + align - 1) & ~(align - 1);
addr_descr = addr_align - sz_desc;
desc.ptr_alloc = ptr;
desc.ptr_align = (void *)addr_align;
- desc.allocator = allocator;
+ desc.allocator = al;
*((kmp_mem_desc_t *)addr_descr) = desc; // save descriptor contents
KMP_MB();
@@ -1341,11 +1575,14 @@ void *__kmpc_alloc(int gtid, size_t size, const omp_allocator_t *allocator) {
return desc.ptr_align;
}
-void __kmpc_free(int gtid, void *ptr, const omp_allocator_t *allocator) {
+void __kmpc_free(int gtid, void *ptr, const omp_allocator_handle_t allocator) {
KE_TRACE(25, ("__kmpc_free: T#%d free(%p,%p)\n", gtid, ptr, allocator));
if (ptr == NULL)
return;
+ kmp_allocator_t *al;
+ omp_allocator_handle_t oal;
+ al = RCAST(kmp_allocator_t *, CCAST(omp_allocator_handle_t, allocator));
kmp_mem_desc_t desc;
kmp_uintptr_t addr_align; // address to return to caller
kmp_uintptr_t addr_descr; // address of memory block descriptor
@@ -1356,24 +1593,42 @@ void __kmpc_free(int gtid, void *ptr, const omp_allocator_t *allocator) {
KMP_DEBUG_ASSERT(desc.ptr_align == ptr);
if (allocator) {
- KMP_DEBUG_ASSERT(desc.allocator == allocator);
- } else {
- allocator = desc.allocator;
+ KMP_DEBUG_ASSERT(desc.allocator == al || desc.allocator == al->fb_data);
}
- KMP_DEBUG_ASSERT(allocator);
-
- if (allocator == omp_default_mem_alloc)
- __kmp_free(desc.ptr_alloc);
- if (allocator == omp_high_bw_mem_alloc && __kmp_hbw_mem_available) {
- KMP_DEBUG_ASSERT(p_hbw_free != NULL);
- p_hbw_free(desc.ptr_alloc);
+ al = desc.allocator;
+ oal = (omp_allocator_handle_t)al; // cast to void* for comparisons
+ KMP_DEBUG_ASSERT(al);
+
+ if (__kmp_memkind_available) {
+ if (oal < kmp_max_mem_alloc) {
+ // pre-defined allocator
+ if (oal == omp_high_bw_mem_alloc && mk_hbw_preferred) {
+ kmp_mk_free(*mk_hbw_preferred, desc.ptr_alloc);
+ } else {
+ kmp_mk_free(*mk_default, desc.ptr_alloc);
+ }
+ } else {
+ if (al->pool_size > 0) { // custom allocator with pool size requested
+ kmp_uint64 used =
+ KMP_TEST_THEN_ADD64((kmp_int64 *)&al->pool_used, -desc.size_a);
+ (void)used; // to suppress compiler warning
+ KMP_DEBUG_ASSERT(used >= desc.size_a);
+ }
+ kmp_mk_free(*al->memkind, desc.ptr_alloc);
+ }
+ } else {
+ if (oal > kmp_max_mem_alloc && al->pool_size > 0) {
+ kmp_uint64 used =
+ KMP_TEST_THEN_ADD64((kmp_int64 *)&al->pool_used, -desc.size_a);
+ (void)used; // to suppress compiler warning
+ KMP_DEBUG_ASSERT(used >= desc.size_a);
+ }
+ __kmp_thread_free(__kmp_thread_from_gtid(gtid), desc.ptr_alloc);
}
KE_TRACE(10, ("__kmpc_free: T#%d freed %p (%p)\n", gtid, desc.ptr_alloc,
allocator));
}
-#endif
-
/* If LEAK_MEMORY is defined, __kmp_free() will *not* free memory. It causes
memory leaks, but it may be useful for debugging memory corruptions, used
freed pointers, etc. */
diff --git a/runtime/src/kmp_atomic.cpp b/runtime/src/kmp_atomic.cpp
index 437f1585a47c..f1ee3d2cd486 100644
--- a/runtime/src/kmp_atomic.cpp
+++ b/runtime/src/kmp_atomic.cpp
@@ -4,10 +4,9 @@
//===----------------------------------------------------------------------===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.txt for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -675,7 +674,7 @@ static inline void operator/=(kmp_cmplx128_a16_t &lhs,
lhs.q /= rhs.q;
}
-#endif
+#endif // (KMP_ARCH_X86) && KMP_HAVE_QUAD
// ATOMIC implementation routines -----------------------------------------
// One routine for each operation and operand type.
@@ -844,7 +843,7 @@ static inline void operator/=(kmp_cmplx128_a16_t &lhs,
OP_CMPXCHG_WORKAROUND(TYPE, BITS, OP) \
}
// end of the second part of the workaround for C78287
-#endif
+#endif // USE_CMPXCHG_FIX
#else
// -------------------------------------------------------------------------
@@ -1194,8 +1193,8 @@ MIN_MAX_CRITICAL(float16, max_a16, Quad_a16_t, <, 16r,
1) // __kmpc_atomic_float16_max_a16
MIN_MAX_CRITICAL(float16, min_a16, Quad_a16_t, >, 16r,
1) // __kmpc_atomic_float16_min_a16
-#endif
-#endif
+#endif // (KMP_ARCH_X86)
+#endif // KMP_HAVE_QUAD
// ------------------------------------------------------------------------
// Need separate macros for .EQV. because of the need of complement (~)
// OP ignored for critical sections, ^=~ used instead
@@ -1290,8 +1289,8 @@ ATOMIC_CRITICAL(float16, mul_a16, Quad_a16_t, *, 16r,
1) // __kmpc_atomic_float16_mul_a16
ATOMIC_CRITICAL(float16, div_a16, Quad_a16_t, /, 16r,
1) // __kmpc_atomic_float16_div_a16
-#endif
-#endif
+#endif // (KMP_ARCH_X86)
+#endif // KMP_HAVE_QUAD
// routines for complex types
#if USE_CMPXCHG_FIX
@@ -1342,10 +1341,8 @@ ATOMIC_CRITICAL(cmplx16, mul_a16, kmp_cmplx128_a16_t, *, 32c,
1) // __kmpc_atomic_cmplx16_mul_a16
ATOMIC_CRITICAL(cmplx16, div_a16, kmp_cmplx128_a16_t, /, 32c,
1) // __kmpc_atomic_cmplx16_div_a16
-#endif
-#endif
-
-#if OMP_40_ENABLED
+#endif // (KMP_ARCH_X86)
+#endif // KMP_HAVE_QUAD
// OpenMP 4.0: x = expr binop x for non-commutative operations.
// Supported only on IA-32 architecture and Intel(R) 64
@@ -1524,8 +1521,8 @@ ATOMIC_CRITICAL_REV(float16, sub_a16, Quad_a16_t, -, 16r,
1) // __kmpc_atomic_float16_sub_a16_rev
ATOMIC_CRITICAL_REV(float16, div_a16, Quad_a16_t, /, 16r,
1) // __kmpc_atomic_float16_div_a16_rev
-#endif
-#endif
+#endif // KMP_ARCH_X86
+#endif // KMP_HAVE_QUAD
// routines for complex types
ATOMIC_CRITICAL_REV(cmplx4, sub, kmp_cmplx32, -, 8c,
@@ -1550,14 +1547,12 @@ ATOMIC_CRITICAL_REV(cmplx16, sub_a16, kmp_cmplx128_a16_t, -, 32c,
1) // __kmpc_atomic_cmplx16_sub_a16_rev
ATOMIC_CRITICAL_REV(cmplx16, div_a16, kmp_cmplx128_a16_t, /, 32c,
1) // __kmpc_atomic_cmplx16_div_a16_rev
-#endif
-#endif
+#endif // KMP_ARCH_X86
+#endif // KMP_HAVE_QUAD
#endif // KMP_ARCH_X86 || KMP_ARCH_X86_64
// End of OpenMP 4.0: x = expr binop x for non-commutative operations.
-#endif // OMP_40_ENABLED
-
/* ------------------------------------------------------------------------ */
/* Routines for mixed types of LHS and RHS, when RHS is "larger" */
/* Note: in order to reduce the total number of types combinations */
@@ -1807,7 +1802,7 @@ ATOMIC_CRITICAL_REV_FP(float10, long double, div_rev, /, fp, _Quad, 10r,
1) // __kmpc_atomic_float10_div_rev_fp
#endif /* KMP_ARCH_X86 || KMP_ARCH_X86_64 */
-#endif
+#endif // KMP_HAVE_QUAD
#if KMP_ARCH_X86 || KMP_ARCH_X86_64
// ------------------------------------------------------------------------
@@ -2021,7 +2016,7 @@ ATOMIC_CRITICAL_READ_WRK(cmplx4, rd, kmp_cmplx32, +, 8c,
#else
ATOMIC_CRITICAL_READ(cmplx4, rd, kmp_cmplx32, +, 8c,
1) // __kmpc_atomic_cmplx4_rd
-#endif
+#endif // (KMP_OS_WINDOWS)
ATOMIC_CRITICAL_READ(cmplx8, rd, kmp_cmplx64, +, 16c,
1) // __kmpc_atomic_cmplx8_rd
ATOMIC_CRITICAL_READ(cmplx10, rd, kmp_cmplx80, +, 20c,
@@ -2034,8 +2029,8 @@ ATOMIC_CRITICAL_READ(float16, a16_rd, Quad_a16_t, +, 16r,
1) // __kmpc_atomic_float16_a16_rd
ATOMIC_CRITICAL_READ(cmplx16, a16_rd, kmp_cmplx128_a16_t, +, 32c,
1) // __kmpc_atomic_cmplx16_a16_rd
-#endif
-#endif
+#endif // (KMP_ARCH_X86)
+#endif // KMP_HAVE_QUAD
// ------------------------------------------------------------------------
// Atomic WRITE routines
@@ -2109,7 +2104,7 @@ ATOMIC_CMPXCHG_WR(fixed8, wr, kmp_int64, 64, =,
#else
ATOMIC_XCHG_WR(fixed8, wr, kmp_int64, 64, =,
KMP_ARCH_X86) // __kmpc_atomic_fixed8_wr
-#endif
+#endif // (KMP_ARCH_X86)
ATOMIC_XCHG_FLOAT_WR(float4, wr, kmp_real32, 32, =,
KMP_ARCH_X86) // __kmpc_atomic_float4_wr
@@ -2119,14 +2114,14 @@ ATOMIC_CMPXCHG_WR(float8, wr, kmp_real64, 64, =,
#else
ATOMIC_XCHG_FLOAT_WR(float8, wr, kmp_real64, 64, =,
KMP_ARCH_X86) // __kmpc_atomic_float8_wr
-#endif
+#endif // (KMP_ARCH_X86)
ATOMIC_CRITICAL_WR(float10, wr, long double, =, 10r,
1) // __kmpc_atomic_float10_wr
#if KMP_HAVE_QUAD
ATOMIC_CRITICAL_WR(float16, wr, QUAD_LEGACY, =, 16r,
1) // __kmpc_atomic_float16_wr
-#endif
+#endif // KMP_HAVE_QUAD
ATOMIC_CRITICAL_WR(cmplx4, wr, kmp_cmplx32, =, 8c, 1) // __kmpc_atomic_cmplx4_wr
ATOMIC_CRITICAL_WR(cmplx8, wr, kmp_cmplx64, =, 16c,
1) // __kmpc_atomic_cmplx8_wr
@@ -2140,8 +2135,8 @@ ATOMIC_CRITICAL_WR(float16, a16_wr, Quad_a16_t, =, 16r,
1) // __kmpc_atomic_float16_a16_wr
ATOMIC_CRITICAL_WR(cmplx16, a16_wr, kmp_cmplx128_a16_t, =, 32c,
1) // __kmpc_atomic_cmplx16_a16_wr
-#endif
-#endif
+#endif // (KMP_ARCH_X86)
+#endif // KMP_HAVE_QUAD
// ------------------------------------------------------------------------
// Atomic CAPTURE routines
@@ -2566,6 +2561,8 @@ ATOMIC_CMPX_L_CPT(fixed8, orl_cpt, kmp_int64, 64, ||,
new_value = rhs; \
else \
new_value = old_value; \
+ } else { \
+ new_value = *lhs; \
} \
__kmp_release_atomic_lock(&ATOMIC_LOCK##LCK_ID, gtid); \
return new_value;
@@ -2659,8 +2656,8 @@ MIN_MAX_CRITICAL_CPT(float16, max_a16_cpt, Quad_a16_t, <, 16r,
1) // __kmpc_atomic_float16_max_a16_cpt
MIN_MAX_CRITICAL_CPT(float16, min_a16_cpt, Quad_a16_t, >, 16r,
1) // __kmpc_atomic_float16_mix_a16_cpt
-#endif
-#endif
+#endif // (KMP_ARCH_X86)
+#endif // KMP_HAVE_QUAD
// ------------------------------------------------------------------------
#ifdef KMP_GOMP_COMPAT
@@ -2784,8 +2781,8 @@ ATOMIC_CRITICAL_CPT(float16, mul_a16_cpt, Quad_a16_t, *, 16r,
1) // __kmpc_atomic_float16_mul_a16_cpt
ATOMIC_CRITICAL_CPT(float16, div_a16_cpt, Quad_a16_t, /, 16r,
1) // __kmpc_atomic_float16_div_a16_cpt
-#endif
-#endif
+#endif // (KMP_ARCH_X86)
+#endif // KMP_HAVE_QUAD
// routines for complex types
@@ -2833,10 +2830,8 @@ ATOMIC_CRITICAL_CPT(cmplx16, mul_a16_cpt, kmp_cmplx128_a16_t, *, 32c,
1) // __kmpc_atomic_cmplx16_mul_a16_cpt
ATOMIC_CRITICAL_CPT(cmplx16, div_a16_cpt, kmp_cmplx128_a16_t, /, 32c,
1) // __kmpc_atomic_cmplx16_div_a16_cpt
-#endif
-#endif
-
-#if OMP_40_ENABLED
+#endif // (KMP_ARCH_X86)
+#endif // KMP_HAVE_QUAD
// OpenMP 4.0: v = x = expr binop x; { v = x; x = expr binop x; } { x = expr
// binop x; v = x; } for non-commutative operations.
@@ -2999,8 +2994,8 @@ ATOMIC_CRITICAL_CPT_REV(float16, sub_a16_cpt_rev, Quad_a16_t, -, 16r,
1) // __kmpc_atomic_float16_sub_a16_cpt_rev
ATOMIC_CRITICAL_CPT_REV(float16, div_a16_cpt_rev, Quad_a16_t, /, 16r,
1) // __kmpc_atomic_float16_div_a16_cpt_rev
-#endif
-#endif
+#endif // (KMP_ARCH_X86)
+#endif // KMP_HAVE_QUAD
// routines for complex types
@@ -3066,8 +3061,8 @@ ATOMIC_CRITICAL_CPT_REV(cmplx16, sub_a16_cpt_rev, kmp_cmplx128_a16_t, -, 32c,
1) // __kmpc_atomic_cmplx16_sub_a16_cpt_rev
ATOMIC_CRITICAL_CPT_REV(cmplx16, div_a16_cpt_rev, kmp_cmplx128_a16_t, /, 32c,
1) // __kmpc_atomic_cmplx16_div_a16_cpt_rev
-#endif
-#endif
+#endif // (KMP_ARCH_X86)
+#endif // KMP_HAVE_QUAD
// Capture reverse for mixed type: RHS=float16
#if KMP_HAVE_QUAD
@@ -3246,7 +3241,7 @@ ATOMIC_CMPXCHG_SWP(float8, kmp_real64, 64,
ATOMIC_XCHG_SWP(fixed8, kmp_int64, 64, KMP_ARCH_X86) // __kmpc_atomic_fixed8_swp
ATOMIC_XCHG_FLOAT_SWP(float8, kmp_real64, 64,
KMP_ARCH_X86) // __kmpc_atomic_float8_swp
-#endif
+#endif // (KMP_ARCH_X86)
// ------------------------------------------------------------------------
// Routines for Extended types: long double, _Quad, complex flavours (use
@@ -3301,7 +3296,7 @@ ATOMIC_XCHG_FLOAT_SWP(float8, kmp_real64, 64,
ATOMIC_CRITICAL_SWP(float10, long double, 10r, 1) // __kmpc_atomic_float10_swp
#if KMP_HAVE_QUAD
ATOMIC_CRITICAL_SWP(float16, QUAD_LEGACY, 16r, 1) // __kmpc_atomic_float16_swp
-#endif
+#endif // KMP_HAVE_QUAD
// cmplx4 routine to return void
ATOMIC_CRITICAL_SWP_WRK(cmplx4, kmp_cmplx32, 8c, 1) // __kmpc_atomic_cmplx4_swp
@@ -3317,13 +3312,11 @@ ATOMIC_CRITICAL_SWP(float16_a16, Quad_a16_t, 16r,
1) // __kmpc_atomic_float16_a16_swp
ATOMIC_CRITICAL_SWP(cmplx16_a16, kmp_cmplx128_a16_t, 32c,
1) // __kmpc_atomic_cmplx16_a16_swp
-#endif
-#endif
+#endif // (KMP_ARCH_X86)
+#endif // KMP_HAVE_QUAD
// End of OpenMP 4.0 Capture
-#endif // OMP_40_ENABLED
-
#endif // KMP_ARCH_X86 || KMP_ARCH_X86_64
#undef OP_CRITICAL
@@ -3340,7 +3333,7 @@ void __kmpc_atomic_1(ident_t *id_ref, int gtid, void *lhs, void *rhs,
FALSE /* must use lock */
#else
TRUE
-#endif
+#endif // KMP_ARCH_X86 && defined(KMP_GOMP_COMPAT)
) {
kmp_int8 old_value, new_value;
@@ -3387,7 +3380,7 @@ void __kmpc_atomic_2(ident_t *id_ref, int gtid, void *lhs, void *rhs,
TRUE /* no alignment problems */
#else
!((kmp_uintptr_t)lhs & 0x1) /* make sure address is 2-byte aligned */
-#endif
+#endif // KMP_ARCH_X86 && defined(KMP_GOMP_COMPAT)
) {
kmp_int16 old_value, new_value;
@@ -3436,7 +3429,7 @@ void __kmpc_atomic_4(ident_t *id_ref, int gtid, void *lhs, void *rhs,
TRUE /* no alignment problems */
#else
!((kmp_uintptr_t)lhs & 0x3) /* make sure address is 4-byte aligned */
-#endif
+#endif // KMP_ARCH_X86 || KMP_ARCH_X86_64
) {
kmp_int32 old_value, new_value;
@@ -3486,7 +3479,7 @@ void __kmpc_atomic_8(ident_t *id_ref, int gtid, void *lhs, void *rhs,
TRUE /* no alignment problems */
#else
!((kmp_uintptr_t)lhs & 0x7) /* make sure address is 8-byte aligned */
-#endif
+#endif // KMP_ARCH_X86 && defined(KMP_GOMP_COMPAT)
) {
kmp_int64 old_value, new_value;
diff --git a/runtime/src/kmp_atomic.h b/runtime/src/kmp_atomic.h
index 288916cd27c9..bb01c31646db 100644
--- a/runtime/src/kmp_atomic.h
+++ b/runtime/src/kmp_atomic.h
@@ -4,10 +4,9 @@
//===----------------------------------------------------------------------===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.txt for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -364,7 +363,7 @@ static inline void __kmp_acquire_atomic_lock(kmp_atomic_lock_t *lck,
#if OMPT_SUPPORT && OMPT_OPTIONAL
if (ompt_enabled.ompt_callback_mutex_acquire) {
ompt_callbacks.ompt_callback(ompt_callback_mutex_acquire)(
- ompt_mutex_atomic, 0, kmp_mutex_impl_queuing, (ompt_wait_id_t)lck,
+ ompt_mutex_atomic, 0, kmp_mutex_impl_queuing, (ompt_wait_id_t)(uintptr_t)lck,
OMPT_GET_RETURN_ADDRESS(0));
}
#endif
@@ -374,7 +373,7 @@ static inline void __kmp_acquire_atomic_lock(kmp_atomic_lock_t *lck,
#if OMPT_SUPPORT && OMPT_OPTIONAL
if (ompt_enabled.ompt_callback_mutex_acquired) {
ompt_callbacks.ompt_callback(ompt_callback_mutex_acquired)(
- ompt_mutex_atomic, (ompt_wait_id_t)lck, OMPT_GET_RETURN_ADDRESS(0));
+ ompt_mutex_atomic, (ompt_wait_id_t)(uintptr_t)lck, OMPT_GET_RETURN_ADDRESS(0));
}
#endif
}
@@ -390,7 +389,7 @@ static inline void __kmp_release_atomic_lock(kmp_atomic_lock_t *lck,
#if OMPT_SUPPORT && OMPT_OPTIONAL
if (ompt_enabled.ompt_callback_mutex_released) {
ompt_callbacks.ompt_callback(ompt_callback_mutex_released)(
- ompt_mutex_atomic, (ompt_wait_id_t)lck, OMPT_GET_RETURN_ADDRESS(0));
+ ompt_mutex_atomic, (ompt_wait_id_t)(uintptr_t)lck, OMPT_GET_RETURN_ADDRESS(0));
}
#endif
}
@@ -688,8 +687,6 @@ void __kmpc_atomic_cmplx16_div_a16(ident_t *id_ref, int gtid,
#endif
#endif
-#if OMP_40_ENABLED
-
// OpenMP 4.0: x = expr binop x for non-commutative operations.
// Supported only on IA-32 architecture and Intel(R) 64
#if KMP_ARCH_X86 || KMP_ARCH_X86_64
@@ -794,8 +791,6 @@ void __kmpc_atomic_cmplx16_div_a16_rev(ident_t *id_ref, int gtid,
#endif // KMP_ARCH_X86 || KMP_ARCH_X86_64
-#endif // OMP_40_ENABLED
-
// routines for mixed types
// RHS=float8
@@ -1404,8 +1399,6 @@ kmp_cmplx128_a16_t __kmpc_atomic_cmplx16_div_a16_cpt(ident_t *id_ref, int gtid,
void __kmpc_atomic_start(void);
void __kmpc_atomic_end(void);
-#if OMP_40_ENABLED
-
// OpenMP 4.0: v = x = expr binop x; { v = x; x = expr binop x; } { x = expr
// binop x; v = x; } for non-commutative operations.
@@ -1761,8 +1754,6 @@ long double __kmpc_atomic_float10_div_cpt_rev_fp(ident_t *id_ref, int gtid,
// End of OpenMP 4.0 capture
-#endif // OMP_40_ENABLED
-
#endif // KMP_ARCH_X86 || KMP_ARCH_X86_64
/* ------------------------------------------------------------------------ */
diff --git a/runtime/src/kmp_barrier.cpp b/runtime/src/kmp_barrier.cpp
index b8e8d933905a..e17986b16a95 100644
--- a/runtime/src/kmp_barrier.cpp
+++ b/runtime/src/kmp_barrier.cpp
@@ -4,10 +4,9 @@
//===----------------------------------------------------------------------===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.txt for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -45,7 +44,8 @@ void __kmp_print_structure(void); // Forward declaration
// ---------------------------- Barrier Algorithms ----------------------------
// Linear Barrier
-static void __kmp_linear_barrier_gather(
+template <bool cancellable = false>
+static bool __kmp_linear_barrier_gather_template(
enum barrier_type bt, kmp_info_t *this_thr, int gtid, int tid,
void (*reduce)(void *, void *) USE_ITT_BUILD_ARG(void *itt_sync_obj)) {
KMP_TIME_DEVELOPER_PARTITIONED_BLOCK(KMP_linear_gather);
@@ -105,7 +105,14 @@ static void __kmp_linear_barrier_gather(
// Wait for worker thread to arrive
kmp_flag_64 flag(&other_threads[i]->th.th_bar[bt].bb.b_arrived,
new_state);
- flag.wait(this_thr, FALSE USE_ITT_BUILD_ARG(itt_sync_obj));
+ if (cancellable) {
+ bool cancelled = flag.wait_cancellable_nosleep(
+ this_thr, FALSE USE_ITT_BUILD_ARG(itt_sync_obj));
+ if (cancelled)
+ return true;
+ } else {
+ flag.wait(this_thr, FALSE USE_ITT_BUILD_ARG(itt_sync_obj));
+ }
ANNOTATE_BARRIER_END(other_threads[i]);
#if USE_ITT_BUILD && USE_ITT_NOTIFY
// Barrier imbalance - write min of the thread time and the other thread
@@ -138,9 +145,11 @@ static void __kmp_linear_barrier_gather(
20,
("__kmp_linear_barrier_gather: T#%d(%d:%d) exit for barrier type %d\n",
gtid, team->t.t_id, tid, bt));
+ return false;
}
-static void __kmp_linear_barrier_release(
+template <bool cancellable = false>
+static bool __kmp_linear_barrier_release_template(
enum barrier_type bt, kmp_info_t *this_thr, int gtid, int tid,
int propagate_icvs USE_ITT_BUILD_ARG(void *itt_sync_obj)) {
KMP_TIME_DEVELOPER_PARTITIONED_BLOCK(KMP_linear_release);
@@ -202,7 +211,15 @@ static void __kmp_linear_barrier_release(
KA_TRACE(20, ("__kmp_linear_barrier_release: T#%d wait go(%p) == %u\n",
gtid, &thr_bar->b_go, KMP_BARRIER_STATE_BUMP));
kmp_flag_64 flag(&thr_bar->b_go, KMP_BARRIER_STATE_BUMP);
- flag.wait(this_thr, TRUE USE_ITT_BUILD_ARG(itt_sync_obj));
+ if (cancellable) {
+ bool cancelled = flag.wait_cancellable_nosleep(
+ this_thr, TRUE USE_ITT_BUILD_ARG(itt_sync_obj));
+ if (cancelled) {
+ return true;
+ }
+ } else {
+ flag.wait(this_thr, TRUE USE_ITT_BUILD_ARG(itt_sync_obj));
+ }
ANNOTATE_BARRIER_END(this_thr);
#if USE_ITT_BUILD && USE_ITT_NOTIFY
if ((__itt_sync_create_ptr && itt_sync_obj == NULL) || KMP_ITT_DEBUG) {
@@ -213,7 +230,7 @@ static void __kmp_linear_barrier_release(
__kmp_itt_task_starting(itt_sync_obj);
if (bt == bs_forkjoin_barrier && TCR_4(__kmp_global.g.g_done))
- return;
+ return false;
itt_sync_obj = __kmp_itt_barrier_object(gtid, bs_forkjoin_barrier);
if (itt_sync_obj != NULL)
@@ -223,7 +240,7 @@ static void __kmp_linear_barrier_release(
#endif /* USE_ITT_BUILD && USE_ITT_NOTIFY */
// Early exit for reaping threads releasing forkjoin barrier
if (bt == bs_forkjoin_barrier && TCR_4(__kmp_global.g.g_done))
- return;
+ return false;
// The worker thread may now assume that the team is valid.
#ifdef KMP_DEBUG
tid = __kmp_tid_from_gtid(gtid);
@@ -240,6 +257,35 @@ static void __kmp_linear_barrier_release(
20,
("__kmp_linear_barrier_release: T#%d(%d:%d) exit for barrier type %d\n",
gtid, team->t.t_id, tid, bt));
+ return false;
+}
+
+static void __kmp_linear_barrier_gather(
+ enum barrier_type bt, kmp_info_t *this_thr, int gtid, int tid,
+ void (*reduce)(void *, void *) USE_ITT_BUILD_ARG(void *itt_sync_obj)) {
+ __kmp_linear_barrier_gather_template<false>(
+ bt, this_thr, gtid, tid, reduce USE_ITT_BUILD_ARG(itt_sync_obj));
+}
+
+static bool __kmp_linear_barrier_gather_cancellable(
+ enum barrier_type bt, kmp_info_t *this_thr, int gtid, int tid,
+ void (*reduce)(void *, void *) USE_ITT_BUILD_ARG(void *itt_sync_obj)) {
+ return __kmp_linear_barrier_gather_template<true>(
+ bt, this_thr, gtid, tid, reduce USE_ITT_BUILD_ARG(itt_sync_obj));
+}
+
+static void __kmp_linear_barrier_release(
+ enum barrier_type bt, kmp_info_t *this_thr, int gtid, int tid,
+ int propagate_icvs USE_ITT_BUILD_ARG(void *itt_sync_obj)) {
+ __kmp_linear_barrier_release_template<false>(
+ bt, this_thr, gtid, tid, propagate_icvs USE_ITT_BUILD_ARG(itt_sync_obj));
+}
+
+static bool __kmp_linear_barrier_release_cancellable(
+ enum barrier_type bt, kmp_info_t *this_thr, int gtid, int tid,
+ int propagate_icvs USE_ITT_BUILD_ARG(void *itt_sync_obj)) {
+ return __kmp_linear_barrier_release_template<true>(
+ bt, this_thr, gtid, tid, propagate_icvs USE_ITT_BUILD_ARG(itt_sync_obj));
}
// Tree barrier
@@ -823,12 +869,10 @@ static void __kmp_hierarchical_barrier_gather(
kmp_uint64 new_state;
int level = team->t.t_level;
-#if OMP_40_ENABLED
if (other_threads[0]
->th.th_teams_microtask) // are we inside the teams construct?
if (this_thr->th.th_teams_size.nteams > 1)
++level; // level was not increased in teams construct for team_of_masters
-#endif
if (level == 1)
thr_bar->use_oncore_barrier = 1;
else
@@ -1053,7 +1097,6 @@ static void __kmp_hierarchical_barrier_release(
nproc = this_thr->th.th_team_nproc;
int level = team->t.t_level;
-#if OMP_40_ENABLED
if (team->t.t_threads[0]
->th.th_teams_microtask) { // are we inside the teams construct?
if (team->t.t_pkfn != (microtask_t)__kmp_teams_master &&
@@ -1062,7 +1105,6 @@ static void __kmp_hierarchical_barrier_release(
if (this_thr->th.th_teams_size.nteams > 1)
++level; // level was not increased in teams construct for team_of_masters
}
-#endif
if (level == 1)
thr_bar->use_oncore_barrier = 1;
else
@@ -1209,24 +1251,49 @@ static void __kmp_hierarchical_barrier_release(
// End of Barrier Algorithms
+// type traits for cancellable value
+// if cancellable is true, then is_cancellable is a normal boolean variable
+// if cancellable is false, then is_cancellable is a compile time constant
+template <bool cancellable> struct is_cancellable {};
+template <> struct is_cancellable<true> {
+ bool value;
+ is_cancellable() : value(false) {}
+ is_cancellable(bool b) : value(b) {}
+ is_cancellable &operator=(bool b) {
+ value = b;
+ return *this;
+ }
+ operator bool() const { return value; }
+};
+template <> struct is_cancellable<false> {
+ is_cancellable &operator=(bool b) { return *this; }
+ constexpr operator bool() const { return false; }
+};
+
// Internal function to do a barrier.
/* If is_split is true, do a split barrier, otherwise, do a plain barrier
If reduce is non-NULL, do a split reduction barrier, otherwise, do a split
barrier
- Returns 0 if master thread, 1 if worker thread. */
-int __kmp_barrier(enum barrier_type bt, int gtid, int is_split,
- size_t reduce_size, void *reduce_data,
- void (*reduce)(void *, void *)) {
+ When cancellable = false,
+ Returns 0 if master thread, 1 if worker thread.
+ When cancellable = true
+ Returns 0 if not cancelled, 1 if cancelled. */
+template <bool cancellable = false>
+static int __kmp_barrier_template(enum barrier_type bt, int gtid, int is_split,
+ size_t reduce_size, void *reduce_data,
+ void (*reduce)(void *, void *)) {
KMP_TIME_PARTITIONED_BLOCK(OMP_plain_barrier);
KMP_SET_THREAD_STATE_BLOCK(PLAIN_BARRIER);
int tid = __kmp_tid_from_gtid(gtid);
kmp_info_t *this_thr = __kmp_threads[gtid];
kmp_team_t *team = this_thr->th.th_team;
int status = 0;
+ is_cancellable<cancellable> cancelled;
#if OMPT_SUPPORT && OMPT_OPTIONAL
ompt_data_t *my_task_data;
ompt_data_t *my_parallel_data;
void *return_address;
+ ompt_sync_region_t barrier_kind;
#endif
KA_TRACE(15, ("__kmp_barrier: T#%d(%d:%d) has arrived\n", gtid,
@@ -1239,15 +1306,16 @@ int __kmp_barrier(enum barrier_type bt, int gtid, int is_split,
my_task_data = OMPT_CUR_TASK_DATA(this_thr);
my_parallel_data = OMPT_CUR_TEAM_DATA(this_thr);
return_address = OMPT_LOAD_RETURN_ADDRESS(gtid);
+ barrier_kind = __ompt_get_barrier_kind(bt, this_thr);
if (ompt_enabled.ompt_callback_sync_region) {
ompt_callbacks.ompt_callback(ompt_callback_sync_region)(
- ompt_sync_region_barrier, ompt_scope_begin, my_parallel_data,
- my_task_data, return_address);
+ barrier_kind, ompt_scope_begin, my_parallel_data, my_task_data,
+ return_address);
}
if (ompt_enabled.ompt_callback_sync_region_wait) {
ompt_callbacks.ompt_callback(ompt_callback_sync_region_wait)(
- ompt_sync_region_barrier, ompt_scope_begin, my_parallel_data,
- my_task_data, return_address);
+ barrier_kind, ompt_scope_begin, my_parallel_data, my_task_data,
+ return_address);
}
#endif
// It is OK to report the barrier state after the barrier begin callback.
@@ -1306,41 +1374,45 @@ int __kmp_barrier(enum barrier_type bt, int gtid, int is_split,
}
if (KMP_MASTER_TID(tid) && __kmp_tasking_mode != tskm_immediate_exec)
- __kmp_task_team_setup(
- this_thr, team,
- 0); // use 0 to only setup the current team if nthreads > 1
-
- switch (__kmp_barrier_gather_pattern[bt]) {
- case bp_hyper_bar: {
- KMP_ASSERT(__kmp_barrier_gather_branch_bits[bt]); // don't set branch bits
- // to 0; use linear
- __kmp_hyper_barrier_gather(bt, this_thr, gtid, tid,
- reduce USE_ITT_BUILD_ARG(itt_sync_obj));
- break;
- }
- case bp_hierarchical_bar: {
- __kmp_hierarchical_barrier_gather(bt, this_thr, gtid, tid,
- reduce USE_ITT_BUILD_ARG(itt_sync_obj));
- break;
- }
- case bp_tree_bar: {
- KMP_ASSERT(__kmp_barrier_gather_branch_bits[bt]); // don't set branch bits
- // to 0; use linear
- __kmp_tree_barrier_gather(bt, this_thr, gtid, tid,
- reduce USE_ITT_BUILD_ARG(itt_sync_obj));
- break;
- }
- default: {
- __kmp_linear_barrier_gather(bt, this_thr, gtid, tid,
+ // use 0 to only setup the current team if nthreads > 1
+ __kmp_task_team_setup(this_thr, team, 0);
+
+ if (cancellable) {
+ cancelled = __kmp_linear_barrier_gather_cancellable(
+ bt, this_thr, gtid, tid, reduce USE_ITT_BUILD_ARG(itt_sync_obj));
+ } else {
+ switch (__kmp_barrier_gather_pattern[bt]) {
+ case bp_hyper_bar: {
+ // don't set branch bits to 0; use linear
+ KMP_ASSERT(__kmp_barrier_gather_branch_bits[bt]);
+ __kmp_hyper_barrier_gather(bt, this_thr, gtid, tid,
+ reduce USE_ITT_BUILD_ARG(itt_sync_obj));
+ break;
+ }
+ case bp_hierarchical_bar: {
+ __kmp_hierarchical_barrier_gather(
+ bt, this_thr, gtid, tid, reduce USE_ITT_BUILD_ARG(itt_sync_obj));
+ break;
+ }
+ case bp_tree_bar: {
+ // don't set branch bits to 0; use linear
+ KMP_ASSERT(__kmp_barrier_gather_branch_bits[bt]);
+ __kmp_tree_barrier_gather(bt, this_thr, gtid, tid,
reduce USE_ITT_BUILD_ARG(itt_sync_obj));
- }
+ break;
+ }
+ default: {
+ __kmp_linear_barrier_gather(bt, this_thr, gtid, tid,
+ reduce USE_ITT_BUILD_ARG(itt_sync_obj));
+ }
+ }
}
KMP_MB();
if (KMP_MASTER_TID(tid)) {
status = 0;
- if (__kmp_tasking_mode != tskm_immediate_exec) {
+ if (__kmp_tasking_mode != tskm_immediate_exec && !cancelled) {
__kmp_task_team_wait(this_thr, team USE_ITT_BUILD_ARG(itt_sync_obj));
}
#if USE_DEBUGGER
@@ -1349,13 +1421,14 @@ int __kmp_barrier(enum barrier_type bt, int gtid, int is_split,
team->t.t_bar[bt].b_team_arrived += 1;
#endif
-#if OMP_40_ENABLED
- kmp_int32 cancel_request = KMP_ATOMIC_LD_RLX(&team->t.t_cancel_request);
- // Reset cancellation flag for worksharing constructs
- if (cancel_request == cancel_loop || cancel_request == cancel_sections) {
- KMP_ATOMIC_ST_RLX(&team->t.t_cancel_request, cancel_noreq);
+ if (__kmp_omp_cancellation) {
+ kmp_int32 cancel_request = KMP_ATOMIC_LD_RLX(&team->t.t_cancel_request);
+ // Reset cancellation flag for worksharing constructs
+ if (cancel_request == cancel_loop ||
+ cancel_request == cancel_sections) {
+ KMP_ATOMIC_ST_RLX(&team->t.t_cancel_request, cancel_noreq);
+ }
}
-#endif
#if USE_ITT_BUILD
/* TODO: In case of split reduction barrier, master thread may send
acquired event early, before the final summation into the shared
@@ -1368,9 +1441,7 @@ int __kmp_barrier(enum barrier_type bt, int gtid, int is_split,
// Barrier - report frame end (only if active_level == 1)
if ((__itt_frame_submit_v3_ptr || KMP_ITT_DEBUG) &&
__kmp_forkjoin_frames_mode &&
-#if OMP_40_ENABLED
this_thr->th.th_teams_microtask == NULL &&
-#endif
team->t.t_active_level == 1) {
ident_t *loc = __kmp_threads[gtid]->th.th_ident;
kmp_uint64 cur_time = __itt_get_timestamp();
@@ -1417,31 +1488,36 @@ int __kmp_barrier(enum barrier_type bt, int gtid, int is_split,
__kmp_itt_barrier_middle(gtid, itt_sync_obj);
#endif /* USE_ITT_BUILD */
}
- if (status == 1 || !is_split) {
- switch (__kmp_barrier_release_pattern[bt]) {
- case bp_hyper_bar: {
- KMP_ASSERT(__kmp_barrier_release_branch_bits[bt]);
- __kmp_hyper_barrier_release(bt, this_thr, gtid, tid,
- FALSE USE_ITT_BUILD_ARG(itt_sync_obj));
- break;
- }
- case bp_hierarchical_bar: {
- __kmp_hierarchical_barrier_release(
+ if ((status == 1 || !is_split) && !cancelled) {
+ if (cancellable) {
+ cancelled = __kmp_linear_barrier_release_cancellable(
bt, this_thr, gtid, tid, FALSE USE_ITT_BUILD_ARG(itt_sync_obj));
- break;
- }
- case bp_tree_bar: {
- KMP_ASSERT(__kmp_barrier_release_branch_bits[bt]);
- __kmp_tree_barrier_release(bt, this_thr, gtid, tid,
- FALSE USE_ITT_BUILD_ARG(itt_sync_obj));
- break;
- }
- default: {
- __kmp_linear_barrier_release(bt, this_thr, gtid, tid,
+ } else {
+ switch (__kmp_barrier_release_pattern[bt]) {
+ case bp_hyper_bar: {
+ KMP_ASSERT(__kmp_barrier_release_branch_bits[bt]);
+ __kmp_hyper_barrier_release(bt, this_thr, gtid, tid,
+ FALSE USE_ITT_BUILD_ARG(itt_sync_obj));
+ break;
+ }
+ case bp_hierarchical_bar: {
+ __kmp_hierarchical_barrier_release(
+ bt, this_thr, gtid, tid, FALSE USE_ITT_BUILD_ARG(itt_sync_obj));
+ break;
+ }
+ case bp_tree_bar: {
+ KMP_ASSERT(__kmp_barrier_release_branch_bits[bt]);
+ __kmp_tree_barrier_release(bt, this_thr, gtid, tid,
FALSE USE_ITT_BUILD_ARG(itt_sync_obj));
+ break;
+ }
+ default: {
+ __kmp_linear_barrier_release(bt, this_thr, gtid, tid,
+ FALSE USE_ITT_BUILD_ARG(itt_sync_obj));
+ }
+ }
}
- }
- if (__kmp_tasking_mode != tskm_immediate_exec) {
+ if (__kmp_tasking_mode != tskm_immediate_exec && !cancelled) {
__kmp_task_team_sync(this_thr, team);
}
}
@@ -1456,7 +1532,6 @@ int __kmp_barrier(enum barrier_type bt, int gtid, int is_split,
} else { // Team is serialized.
status = 0;
if (__kmp_tasking_mode != tskm_immediate_exec) {
-#if OMP_45_ENABLED
if (this_thr->th.th_task_team != NULL) {
#if USE_ITT_NOTIFY
void *itt_sync_obj = NULL;
@@ -1476,12 +1551,6 @@ int __kmp_barrier(enum barrier_type bt, int gtid, int is_split,
__kmp_itt_barrier_finished(gtid, itt_sync_obj);
#endif /* USE_ITT_BUILD */
}
-#else
- // The task team should be NULL for serialized code (tasks will be
- // executed immediately)
- KMP_DEBUG_ASSERT(team->t.t_task_team[this_thr->th.th_task_state] == NULL);
- KMP_DEBUG_ASSERT(this_thr->th.th_task_team == NULL);
-#endif
}
}
KA_TRACE(15, ("__kmp_barrier: T#%d(%d:%d) is leaving with return value %d\n",
@@ -1493,13 +1562,13 @@ int __kmp_barrier(enum barrier_type bt, int gtid, int is_split,
#if OMPT_OPTIONAL
if (ompt_enabled.ompt_callback_sync_region_wait) {
ompt_callbacks.ompt_callback(ompt_callback_sync_region_wait)(
- ompt_sync_region_barrier, ompt_scope_end, my_parallel_data,
- my_task_data, return_address);
+ barrier_kind, ompt_scope_end, my_parallel_data, my_task_data,
+ return_address);
}
if (ompt_enabled.ompt_callback_sync_region) {
ompt_callbacks.ompt_callback(ompt_callback_sync_region)(
- ompt_sync_region_barrier, ompt_scope_end, my_parallel_data,
- my_task_data, return_address);
+ barrier_kind, ompt_scope_end, my_parallel_data, my_task_data,
+ return_address);
}
#endif
this_thr->th.ompt_thread_info.state = ompt_state_work_parallel;
@@ -1507,9 +1576,43 @@ int __kmp_barrier(enum barrier_type bt, int gtid, int is_split,
#endif
ANNOTATE_BARRIER_END(&team->t.t_bar);
+ if (cancellable)
+ return (int)cancelled;
return status;
}
+// Returns 0 if master thread, 1 if worker thread.
+int __kmp_barrier(enum barrier_type bt, int gtid, int is_split,
+ size_t reduce_size, void *reduce_data,
+ void (*reduce)(void *, void *)) {
+ return __kmp_barrier_template<>(bt, gtid, is_split, reduce_size, reduce_data,
+ reduce);
+}
+
+#if defined(KMP_GOMP_COMPAT)
+// Returns 1 if cancelled, 0 otherwise
+int __kmp_barrier_gomp_cancel(int gtid) {
+ if (__kmp_omp_cancellation) {
+ int cancelled = __kmp_barrier_template<true>(bs_plain_barrier, gtid, FALSE,
+ 0, NULL, NULL);
+ if (cancelled) {
+ int tid = __kmp_tid_from_gtid(gtid);
+ kmp_info_t *this_thr = __kmp_threads[gtid];
+ if (KMP_MASTER_TID(tid)) {
+ // Master does not need to revert anything
+ } else {
+ // Workers need to revert their private b_arrived flag
+ this_thr->th.th_bar[bs_plain_barrier].bb.b_arrived -=
+ KMP_BARRIER_STATE_BUMP;
+ }
+ }
+ return cancelled;
+ }
+ __kmp_barrier(bs_plain_barrier, gtid, FALSE, 0, NULL, NULL);
+ return FALSE;
+}
+#endif
+
void __kmp_end_split_barrier(enum barrier_type bt, int gtid) {
KMP_TIME_DEVELOPER_PARTITIONED_BLOCK(KMP_end_split_barrier);
KMP_SET_THREAD_STATE_BLOCK(PLAIN_BARRIER);
@@ -1613,12 +1716,12 @@ void __kmp_join_barrier(int gtid) {
my_parallel_data = OMPT_CUR_TEAM_DATA(this_thr);
if (ompt_enabled.ompt_callback_sync_region) {
ompt_callbacks.ompt_callback(ompt_callback_sync_region)(
- ompt_sync_region_barrier, ompt_scope_begin, my_parallel_data,
+ ompt_sync_region_barrier_implicit, ompt_scope_begin, my_parallel_data,
my_task_data, codeptr);
}
if (ompt_enabled.ompt_callback_sync_region_wait) {
ompt_callbacks.ompt_callback(ompt_callback_sync_region_wait)(
- ompt_sync_region_barrier, ompt_scope_begin, my_parallel_data,
+ ompt_sync_region_barrier_implicit, ompt_scope_begin, my_parallel_data,
my_task_data, codeptr);
}
if (!KMP_MASTER_TID(ds_tid))
@@ -1698,11 +1801,9 @@ void __kmp_join_barrier(int gtid) {
if (__kmp_tasking_mode != tskm_immediate_exec) {
__kmp_task_team_wait(this_thr, team USE_ITT_BUILD_ARG(itt_sync_obj));
}
-#if OMP_50_ENABLED
if (__kmp_display_affinity) {
KMP_CHECK_UPDATE(team->t.t_display_affinity, 0);
}
-#endif
#if KMP_STATS_ENABLED
// Have master thread flag the workers to indicate they are now waiting for
// next parallel region, Also wake them up so they switch their timers to
@@ -1726,10 +1827,7 @@ void __kmp_join_barrier(int gtid) {
#if USE_ITT_BUILD && USE_ITT_NOTIFY
// Join barrier - report frame end
if ((__itt_frame_submit_v3_ptr || KMP_ITT_DEBUG) &&
- __kmp_forkjoin_frames_mode &&
-#if OMP_40_ENABLED
- this_thr->th.th_teams_microtask == NULL &&
-#endif
+ __kmp_forkjoin_frames_mode && this_thr->th.th_teams_microtask == NULL &&
team->t.t_active_level == 1) {
kmp_uint64 cur_time = __itt_get_timestamp();
ident_t *loc = team->t.t_ident;
@@ -1901,11 +1999,13 @@ void __kmp_fork_barrier(int gtid, int tid) {
codeptr = team->t.ompt_team_info.master_return_address;
if (ompt_enabled.ompt_callback_sync_region_wait) {
ompt_callbacks.ompt_callback(ompt_callback_sync_region_wait)(
- ompt_sync_region_barrier, ompt_scope_end, NULL, task_data, codeptr);
+ ompt_sync_region_barrier_implicit, ompt_scope_end, NULL, task_data,
+ codeptr);
}
if (ompt_enabled.ompt_callback_sync_region) {
ompt_callbacks.ompt_callback(ompt_callback_sync_region)(
- ompt_sync_region_barrier, ompt_scope_end, NULL, task_data, codeptr);
+ ompt_sync_region_barrier_implicit, ompt_scope_end, NULL, task_data,
+ codeptr);
}
#endif
if (!KMP_MASTER_TID(ds_tid) && ompt_enabled.ompt_callback_implicit_task) {
@@ -1968,17 +2068,13 @@ void __kmp_fork_barrier(int gtid, int tid) {
__kmp_task_team_sync(this_thr, team);
}
-#if OMP_40_ENABLED && KMP_AFFINITY_SUPPORTED
+#if KMP_AFFINITY_SUPPORTED
kmp_proc_bind_t proc_bind = team->t.t_proc_bind;
if (proc_bind == proc_bind_intel) {
-#endif
-#if KMP_AFFINITY_SUPPORTED
// Call dynamic affinity settings
if (__kmp_affinity_type == affinity_balanced && team->t.t_size_changed) {
__kmp_balanced_affinity(this_thr, team->t.t_nproc);
}
-#endif // KMP_AFFINITY_SUPPORTED
-#if OMP_40_ENABLED && KMP_AFFINITY_SUPPORTED
} else if (proc_bind != proc_bind_false) {
if (this_thr->th.th_new_place == this_thr->th.th_current_place) {
KA_TRACE(100, ("__kmp_fork_barrier: T#%d already in correct place %d\n",
@@ -1988,8 +2084,7 @@ void __kmp_fork_barrier(int gtid, int tid) {
__kmp_affinity_set_place(gtid);
}
}
-#endif
-#if OMP_50_ENABLED
+#endif // KMP_AFFINITY_SUPPORTED
// Perform the display affinity functionality
if (__kmp_display_affinity) {
if (team->t.t_display_affinity
@@ -2005,7 +2100,6 @@ void __kmp_fork_barrier(int gtid, int tid) {
}
if (!KMP_MASTER_TID(tid))
KMP_CHECK_UPDATE(this_thr->th.th_def_allocator, team->t.t_def_allocator);
-#endif
#if USE_ITT_BUILD && USE_ITT_NOTIFY
if (__itt_sync_create_ptr || KMP_ITT_DEBUG) {
diff --git a/runtime/src/kmp_cancel.cpp b/runtime/src/kmp_cancel.cpp
index 5ed91673b77b..d1290493daad 100644
--- a/runtime/src/kmp_cancel.cpp
+++ b/runtime/src/kmp_cancel.cpp
@@ -1,10 +1,9 @@
//===----------------------------------------------------------------------===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.txt for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -16,8 +15,6 @@
#include "ompt-specific.h"
#endif
-#if OMP_40_ENABLED
-
/*!
@ingroup CANCELLATION
@param loc_ref location of the original task directive
@@ -72,7 +69,7 @@ kmp_int32 __kmpc_cancel(ident_t *loc_ref, kmp_int32 gtid, kmp_int32 cncl_kind) {
task_data, type | ompt_cancel_activated,
OMPT_GET_RETURN_ADDRESS(0));
}
-#endif
+#endif // OMPT_SUPPORT && OMPT_OPTIONAL
return 1 /* true */;
}
break;
@@ -332,5 +329,3 @@ int __kmp_get_cancellation_status(int cancel_kind) {
return 0 /* false */;
}
-
-#endif
diff --git a/runtime/src/kmp_config.h.cmake b/runtime/src/kmp_config.h.cmake
index c9ebbc0bd77d..e3a1a8db7714 100644
--- a/runtime/src/kmp_config.h.cmake
+++ b/runtime/src/kmp_config.h.cmake
@@ -3,10 +3,9 @@
*/
//===----------------------------------------------------------------------===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.txt for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef KMP_CONFIG_H
@@ -65,11 +64,6 @@
#define KMP_LIBRARY_FILE "@LIBOMP_LIB_FILE@"
#define KMP_VERSION_MAJOR @LIBOMP_VERSION_MAJOR@
#define KMP_VERSION_MINOR @LIBOMP_VERSION_MINOR@
-#define LIBOMP_OMP_VERSION @LIBOMP_OMP_VERSION@
-#define OMP_50_ENABLED (LIBOMP_OMP_VERSION >= 50)
-#define OMP_45_ENABLED (LIBOMP_OMP_VERSION >= 45)
-#define OMP_40_ENABLED (LIBOMP_OMP_VERSION >= 40)
-#define OMP_30_ENABLED (LIBOMP_OMP_VERSION >= 30)
#cmakedefine01 LIBOMP_TSAN_SUPPORT
#if LIBOMP_TSAN_SUPPORT
#define TSAN_SUPPORT
diff --git a/runtime/src/kmp_csupport.cpp b/runtime/src/kmp_csupport.cpp
index 61d4a9301120..c778c97022f5 100644
--- a/runtime/src/kmp_csupport.cpp
+++ b/runtime/src/kmp_csupport.cpp
@@ -4,10 +4,9 @@
//===----------------------------------------------------------------------===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.txt for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -245,8 +244,6 @@ void __kmpc_pop_num_threads(ident_t *loc, kmp_int32 global_tid) {
/* the num_threads are automatically popped */
}
-#if OMP_40_ENABLED
-
void __kmpc_push_proc_bind(ident_t *loc, kmp_int32 global_tid,
kmp_int32 proc_bind) {
KA_TRACE(20, ("__kmpc_push_proc_bind: enter T#%d proc_bind=%d\n", global_tid,
@@ -255,8 +252,6 @@ void __kmpc_push_proc_bind(ident_t *loc, kmp_int32 global_tid,
__kmp_push_proc_bind(loc, global_tid, (kmp_proc_bind_t)proc_bind);
}
-#endif /* OMP_40_ENABLED */
-
/*!
@ingroup PARALLEL
@param loc source location information
@@ -345,7 +340,6 @@ void __kmpc_fork_call(ident_t *loc, kmp_int32 argc, kmpc_micro microtask, ...) {
#endif // KMP_STATS_ENABLED
}
-#if OMP_40_ENABLED
/*!
@ingroup PARALLEL
@param loc source location information
@@ -383,7 +377,15 @@ void __kmpc_fork_teams(ident_t *loc, kmp_int32 argc, kmpc_micro microtask,
va_list ap;
va_start(ap, microtask);
+#if KMP_STATS_ENABLED
KMP_COUNT_BLOCK(OMP_TEAMS);
+ stats_state_e previous_state = KMP_GET_THREAD_STATE();
+ if (previous_state == stats_state_e::SERIAL_REGION) {
+ KMP_EXCHANGE_PARTITIONED_TIMER(OMP_teams_overhead);
+ } else {
+ KMP_PUSH_PARTITIONED_TIMER(OMP_teams_overhead);
+ }
+#endif
// remember teams entry point and nesting level
this_thr->th.th_teams_microtask = microtask;
@@ -426,12 +428,35 @@ void __kmpc_fork_teams(ident_t *loc, kmp_int32 argc, kmpc_micro microtask,
#endif
);
+ // Pop current CG root off list
+ KMP_DEBUG_ASSERT(this_thr->th.th_cg_roots);
+ kmp_cg_root_t *tmp = this_thr->th.th_cg_roots;
+ this_thr->th.th_cg_roots = tmp->up;
+ KA_TRACE(100, ("__kmpc_fork_teams: Thread %p popping node %p and moving up"
+ " to node %p. cg_nthreads was %d\n",
+ this_thr, tmp, this_thr->th.th_cg_roots, tmp->cg_nthreads));
+ KMP_DEBUG_ASSERT(tmp->cg_nthreads);
+ int i = tmp->cg_nthreads--;
+ if (i == 1) { // check is we are the last thread in CG (not always the case)
+ __kmp_free(tmp);
+ }
+ // Restore current task's thread_limit from CG root
+ KMP_DEBUG_ASSERT(this_thr->th.th_cg_roots);
+ this_thr->th.th_current_task->td_icvs.thread_limit =
+ this_thr->th.th_cg_roots->cg_thread_limit;
+
this_thr->th.th_teams_microtask = NULL;
this_thr->th.th_teams_level = 0;
*(kmp_int64 *)(&this_thr->th.th_teams_size) = 0L;
va_end(ap);
+#if KMP_STATS_ENABLED
+ if (previous_state == stats_state_e::SERIAL_REGION) {
+ KMP_EXCHANGE_PARTITIONED_TIMER(OMP_serial);
+ } else {
+ KMP_POP_PARTITIONED_TIMER();
+ }
+#endif // KMP_STATS_ENABLED
}
-#endif /* OMP_40_ENABLED */
// I don't think this function should ever have been exported.
// The __kmpc_ prefix was misapplied. I'm fairly certain that no generated
@@ -485,16 +510,15 @@ void __kmpc_end_serialized_parallel(ident_t *loc, kmp_int32 global_tid) {
if (!TCR_4(__kmp_init_parallel))
__kmp_parallel_initialize();
+ __kmp_resume_if_soft_paused();
+
this_thr = __kmp_threads[global_tid];
serial_team = this_thr->th.th_serial_team;
-#if OMP_45_ENABLED
kmp_task_team_t *task_team = this_thr->th.th_task_team;
-
// we need to wait for the proxy tasks before finishing the thread
if (task_team != NULL && task_team->tt.tt_found_proxy_tasks)
__kmp_task_team_wait(this_thr, serial_team USE_ITT_BUILD_ARG(NULL));
-#endif
KMP_MB();
KMP_DEBUG_ASSERT(serial_team);
@@ -549,9 +573,7 @@ void __kmpc_end_serialized_parallel(ident_t *loc, kmp_int32 global_tid) {
serial_team->t.t_dispatch->th_disp_buffer->next;
__kmp_free(disp_buffer);
}
-#if OMP_50_ENABLED
this_thr->th.th_def_allocator = serial_team->t.t_def_allocator; // restore
-#endif
--serial_team->t.t_serialized;
if (serial_team->t.t_serialized == 0) {
@@ -667,7 +689,7 @@ void __kmpc_flush(ident_t *loc) {
// }
// and adding the yield here is good for at least a 10x speedup
// when running >2 threads per core (on the NAS LU benchmark).
- __kmp_yield(TRUE);
+ __kmp_yield();
#endif
#else
#error Unknown or unsupported architecture
@@ -696,11 +718,12 @@ void __kmpc_barrier(ident_t *loc, kmp_int32 global_tid) {
if (!TCR_4(__kmp_init_parallel))
__kmp_parallel_initialize();
+ __kmp_resume_if_soft_paused();
+
if (__kmp_env_consistency_check) {
if (loc == 0) {
KMP_WARNING(ConstructIdentInvalid); // ??? What does it mean for the user?
}
-
__kmp_check_barrier(global_tid, ct_barrier, loc);
}
@@ -744,6 +767,8 @@ kmp_int32 __kmpc_master(ident_t *loc, kmp_int32 global_tid) {
if (!TCR_4(__kmp_init_parallel))
__kmp_parallel_initialize();
+ __kmp_resume_if_soft_paused();
+
if (KMP_MASTER_GTID(global_tid)) {
KMP_COUNT_BLOCK(OMP_MASTER);
KMP_PUSH_PARTITIONED_TIMER(OMP_master);
@@ -834,6 +859,8 @@ void __kmpc_ordered(ident_t *loc, kmp_int32 gtid) {
if (!TCR_4(__kmp_init_parallel))
__kmp_parallel_initialize();
+ __kmp_resume_if_soft_paused();
+
#if USE_ITT_BUILD
__kmp_itt_ordered_prep(gtid);
// TODO: ordered_wait_id
@@ -848,7 +875,7 @@ void __kmpc_ordered(ident_t *loc, kmp_int32 gtid) {
if (ompt_enabled.enabled) {
OMPT_STORE_RETURN_ADDRESS(gtid);
team = __kmp_team_from_gtid(gtid);
- lck = (ompt_wait_id_t)&team->t.t_ordered.dt.t_value;
+ lck = (ompt_wait_id_t)(uintptr_t)&team->t.t_ordered.dt.t_value;
/* OMPT state update */
th->th.ompt_thread_info.wait_id = lck;
th->th.ompt_thread_info.state = ompt_state_wait_ordered;
@@ -857,8 +884,8 @@ void __kmpc_ordered(ident_t *loc, kmp_int32 gtid) {
codeptr_ra = OMPT_LOAD_RETURN_ADDRESS(gtid);
if (ompt_enabled.ompt_callback_mutex_acquire) {
ompt_callbacks.ompt_callback(ompt_callback_mutex_acquire)(
- ompt_mutex_ordered, omp_lock_hint_none, kmp_mutex_impl_spin,
- (ompt_wait_id_t)lck, codeptr_ra);
+ ompt_mutex_ordered, omp_lock_hint_none, kmp_mutex_impl_spin, lck,
+ codeptr_ra);
}
}
#endif
@@ -877,7 +904,7 @@ void __kmpc_ordered(ident_t *loc, kmp_int32 gtid) {
/* OMPT event callback */
if (ompt_enabled.ompt_callback_mutex_acquired) {
ompt_callbacks.ompt_callback(ompt_callback_mutex_acquired)(
- ompt_mutex_ordered, (ompt_wait_id_t)lck, codeptr_ra);
+ ompt_mutex_ordered, (ompt_wait_id_t)(uintptr_t)lck, codeptr_ra);
}
}
#endif
@@ -917,7 +944,8 @@ void __kmpc_end_ordered(ident_t *loc, kmp_int32 gtid) {
if (ompt_enabled.ompt_callback_mutex_released) {
ompt_callbacks.ompt_callback(ompt_callback_mutex_released)(
ompt_mutex_ordered,
- (ompt_wait_id_t)&__kmp_team_from_gtid(gtid)->t.t_ordered.dt.t_value,
+ (ompt_wait_id_t)(uintptr_t)&__kmp_team_from_gtid(gtid)
+ ->t.t_ordered.dt.t_value,
OMPT_LOAD_RETURN_ADDRESS(gtid));
}
#endif
@@ -965,24 +993,18 @@ __kmp_init_indirect_csptr(kmp_critical_name *crit, ident_t const *loc,
kmp_uint32 spins; \
KMP_FSYNC_PREPARE(l); \
KMP_INIT_YIELD(spins); \
- if (TCR_4(__kmp_nth) > \
- (__kmp_avail_proc ? __kmp_avail_proc : __kmp_xproc)) { \
- KMP_YIELD(TRUE); \
- } else { \
- KMP_YIELD_SPIN(spins); \
- } \
kmp_backoff_t backoff = __kmp_spin_backoff_params; \
- while ( \
- KMP_ATOMIC_LD_RLX(&l->lk.poll) != tas_free || \
- !__kmp_atomic_compare_store_acq(&l->lk.poll, tas_free, tas_busy)) { \
- __kmp_spin_backoff(&backoff); \
+ do { \
if (TCR_4(__kmp_nth) > \
(__kmp_avail_proc ? __kmp_avail_proc : __kmp_xproc)) { \
KMP_YIELD(TRUE); \
} else { \
KMP_YIELD_SPIN(spins); \
} \
- } \
+ __kmp_spin_backoff(&backoff); \
+ } while ( \
+ KMP_ATOMIC_LD_RLX(&l->lk.poll) != tas_free || \
+ !__kmp_atomic_compare_store_acq(&l->lk.poll, tas_free, tas_busy)); \
} \
KMP_FSYNC_ACQUIRED(l); \
}
@@ -1068,8 +1090,7 @@ __kmp_init_indirect_csptr(kmp_critical_name *crit, ident_t const *loc,
KMP_LOCK_BUSY(1, futex), NULL, NULL, 0); \
} \
KMP_MB(); \
- KMP_YIELD(TCR_4(__kmp_nth) > \
- (__kmp_avail_proc ? __kmp_avail_proc : __kmp_xproc)); \
+ KMP_YIELD_OVERSUB(); \
}
#endif // KMP_USE_FUTEX
@@ -1188,7 +1209,7 @@ void __kmpc_critical(ident_t *loc, kmp_int32 global_tid,
ti = __kmp_threads[global_tid]->th.ompt_thread_info;
/* OMPT state update */
prev_state = ti.state;
- ti.wait_id = (ompt_wait_id_t)lck;
+ ti.wait_id = (ompt_wait_id_t)(uintptr_t)lck;
ti.state = ompt_state_wait_critical;
/* OMPT event callback */
@@ -1196,7 +1217,7 @@ void __kmpc_critical(ident_t *loc, kmp_int32 global_tid,
if (ompt_enabled.ompt_callback_mutex_acquire) {
ompt_callbacks.ompt_callback(ompt_callback_mutex_acquire)(
ompt_mutex_critical, omp_lock_hint_none, __ompt_get_mutex_impl_type(),
- (ompt_wait_id_t)crit, codeptr_ra);
+ (ompt_wait_id_t)(uintptr_t)lck, codeptr_ra);
}
}
#endif
@@ -1216,7 +1237,7 @@ void __kmpc_critical(ident_t *loc, kmp_int32 global_tid,
/* OMPT event callback */
if (ompt_enabled.ompt_callback_mutex_acquired) {
ompt_callbacks.ompt_callback(ompt_callback_mutex_acquired)(
- ompt_mutex_critical, (ompt_wait_id_t)crit, codeptr_ra);
+ ompt_mutex_critical, (ompt_wait_id_t)(uintptr_t)lck, codeptr_ra);
}
}
#endif
@@ -1402,14 +1423,15 @@ void __kmpc_critical_with_hint(ident_t *loc, kmp_int32 global_tid,
ti = __kmp_threads[global_tid]->th.ompt_thread_info;
/* OMPT state update */
prev_state = ti.state;
- ti.wait_id = (ompt_wait_id_t)lck;
+ ti.wait_id = (ompt_wait_id_t)(uintptr_t)lck;
ti.state = ompt_state_wait_critical;
/* OMPT event callback */
if (ompt_enabled.ompt_callback_mutex_acquire) {
ompt_callbacks.ompt_callback(ompt_callback_mutex_acquire)(
ompt_mutex_critical, (unsigned int)hint,
- __ompt_get_mutex_impl_type(crit), (ompt_wait_id_t)crit, codeptr);
+ __ompt_get_mutex_impl_type(crit), (ompt_wait_id_t)(uintptr_t)lck,
+ codeptr);
}
}
#endif
@@ -1440,14 +1462,15 @@ void __kmpc_critical_with_hint(ident_t *loc, kmp_int32 global_tid,
ti = __kmp_threads[global_tid]->th.ompt_thread_info;
/* OMPT state update */
prev_state = ti.state;
- ti.wait_id = (ompt_wait_id_t)lck;
+ ti.wait_id = (ompt_wait_id_t)(uintptr_t)lck;
ti.state = ompt_state_wait_critical;
/* OMPT event callback */
if (ompt_enabled.ompt_callback_mutex_acquire) {
ompt_callbacks.ompt_callback(ompt_callback_mutex_acquire)(
ompt_mutex_critical, (unsigned int)hint,
- __ompt_get_mutex_impl_type(0, ilk), (ompt_wait_id_t)crit, codeptr);
+ __ompt_get_mutex_impl_type(0, ilk), (ompt_wait_id_t)(uintptr_t)lck,
+ codeptr);
}
}
#endif
@@ -1467,7 +1490,7 @@ void __kmpc_critical_with_hint(ident_t *loc, kmp_int32 global_tid,
/* OMPT event callback */
if (ompt_enabled.ompt_callback_mutex_acquired) {
ompt_callbacks.ompt_callback(ompt_callback_mutex_acquired)(
- ompt_mutex_critical, (ompt_wait_id_t)crit, codeptr);
+ ompt_mutex_critical, (ompt_wait_id_t)(uintptr_t)lck, codeptr);
}
}
#endif
@@ -1565,7 +1588,8 @@ void __kmpc_end_critical(ident_t *loc, kmp_int32 global_tid,
OMPT_STORE_RETURN_ADDRESS(global_tid);
if (ompt_enabled.ompt_callback_mutex_released) {
ompt_callbacks.ompt_callback(ompt_callback_mutex_released)(
- ompt_mutex_critical, (ompt_wait_id_t)crit, OMPT_LOAD_RETURN_ADDRESS(0));
+ ompt_mutex_critical, (ompt_wait_id_t)(uintptr_t)lck,
+ OMPT_LOAD_RETURN_ADDRESS(0));
}
#endif
@@ -1590,6 +1614,8 @@ kmp_int32 __kmpc_barrier_master(ident_t *loc, kmp_int32 global_tid) {
if (!TCR_4(__kmp_init_parallel))
__kmp_parallel_initialize();
+ __kmp_resume_if_soft_paused();
+
if (__kmp_env_consistency_check)
__kmp_check_barrier(global_tid, ct_barrier, loc);
@@ -1648,6 +1674,8 @@ kmp_int32 __kmpc_barrier_master_nowait(ident_t *loc, kmp_int32 global_tid) {
if (!TCR_4(__kmp_init_parallel))
__kmp_parallel_initialize();
+ __kmp_resume_if_soft_paused();
+
if (__kmp_env_consistency_check) {
if (loc == 0) {
KMP_WARNING(ConstructIdentInvalid); // ??? What does it mean for the user?
@@ -1843,7 +1871,7 @@ void ompc_set_nested(int flag) {
__kmp_save_internal_controls(thread);
- set__nested(thread, flag ? TRUE : FALSE);
+ set__max_active_levels(thread, flag ? __kmp_dflt_max_active_levels : 1);
}
void ompc_set_max_active_levels(int max_active_levels) {
@@ -1867,7 +1895,6 @@ int ompc_get_team_size(int level) {
return __kmp_get_team_size(__kmp_entry_gtid(), level);
}
-#if OMP_50_ENABLED
/* OpenMP 5.0 Affinity Format API */
void ompc_set_affinity_format(char const *format) {
@@ -1918,7 +1945,6 @@ size_t ompc_capture_affinity(char *buffer, size_t buf_size,
__kmp_str_buf_free(&capture_buf);
return num_required;
}
-#endif /* OMP_50_ENABLED */
void kmpc_set_stacksize(int arg) {
// __kmp_aux_set_stacksize initializes the library if needed
@@ -2189,8 +2215,8 @@ void __kmpc_init_lock_with_hint(ident_t *loc, kmp_int32 gtid, void **user_lock,
if (ompt_enabled.ompt_callback_lock_init) {
ompt_callbacks.ompt_callback(ompt_callback_lock_init)(
ompt_mutex_lock, (omp_lock_hint_t)hint,
- __ompt_get_mutex_impl_type(user_lock), (ompt_wait_id_t)user_lock,
- codeptr);
+ __ompt_get_mutex_impl_type(user_lock),
+ (ompt_wait_id_t)(uintptr_t)user_lock, codeptr);
}
#endif
}
@@ -2213,8 +2239,8 @@ void __kmpc_init_nest_lock_with_hint(ident_t *loc, kmp_int32 gtid,
if (ompt_enabled.ompt_callback_lock_init) {
ompt_callbacks.ompt_callback(ompt_callback_lock_init)(
ompt_mutex_nest_lock, (omp_lock_hint_t)hint,
- __ompt_get_mutex_impl_type(user_lock), (ompt_wait_id_t)user_lock,
- codeptr);
+ __ompt_get_mutex_impl_type(user_lock),
+ (ompt_wait_id_t)(uintptr_t)user_lock, codeptr);
}
#endif
}
@@ -2239,8 +2265,8 @@ void __kmpc_init_lock(ident_t *loc, kmp_int32 gtid, void **user_lock) {
if (ompt_enabled.ompt_callback_lock_init) {
ompt_callbacks.ompt_callback(ompt_callback_lock_init)(
ompt_mutex_lock, omp_lock_hint_none,
- __ompt_get_mutex_impl_type(user_lock), (ompt_wait_id_t)user_lock,
- codeptr);
+ __ompt_get_mutex_impl_type(user_lock),
+ (ompt_wait_id_t)(uintptr_t)user_lock, codeptr);
}
#endif
@@ -2282,7 +2308,7 @@ void __kmpc_init_lock(ident_t *loc, kmp_int32 gtid, void **user_lock) {
if (ompt_enabled.ompt_callback_lock_init) {
ompt_callbacks.ompt_callback(ompt_callback_lock_init)(
ompt_mutex_lock, omp_lock_hint_none, __ompt_get_mutex_impl_type(),
- (ompt_wait_id_t)user_lock, codeptr);
+ (ompt_wait_id_t)(uintptr_t)user_lock, codeptr);
}
#endif
@@ -2311,8 +2337,8 @@ void __kmpc_init_nest_lock(ident_t *loc, kmp_int32 gtid, void **user_lock) {
if (ompt_enabled.ompt_callback_lock_init) {
ompt_callbacks.ompt_callback(ompt_callback_lock_init)(
ompt_mutex_nest_lock, omp_lock_hint_none,
- __ompt_get_mutex_impl_type(user_lock), (ompt_wait_id_t)user_lock,
- codeptr);
+ __ompt_get_mutex_impl_type(user_lock),
+ (ompt_wait_id_t)(uintptr_t)user_lock, codeptr);
}
#endif
@@ -2357,7 +2383,7 @@ void __kmpc_init_nest_lock(ident_t *loc, kmp_int32 gtid, void **user_lock) {
if (ompt_enabled.ompt_callback_lock_init) {
ompt_callbacks.ompt_callback(ompt_callback_lock_init)(
ompt_mutex_nest_lock, omp_lock_hint_none, __ompt_get_mutex_impl_type(),
- (ompt_wait_id_t)user_lock, codeptr);
+ (ompt_wait_id_t)(uintptr_t)user_lock, codeptr);
}
#endif
@@ -2393,7 +2419,7 @@ void __kmpc_destroy_lock(ident_t *loc, kmp_int32 gtid, void **user_lock) {
lck = (kmp_user_lock_p)user_lock;
}
ompt_callbacks.ompt_callback(ompt_callback_lock_destroy)(
- ompt_mutex_lock, (ompt_wait_id_t)user_lock, codeptr);
+ ompt_mutex_lock, (ompt_wait_id_t)(uintptr_t)user_lock, codeptr);
}
#endif
KMP_D_LOCK_FUNC(user_lock, destroy)((kmp_dyna_lock_t *)user_lock);
@@ -2421,7 +2447,7 @@ void __kmpc_destroy_lock(ident_t *loc, kmp_int32 gtid, void **user_lock) {
codeptr = OMPT_GET_RETURN_ADDRESS(0);
if (ompt_enabled.ompt_callback_lock_destroy) {
ompt_callbacks.ompt_callback(ompt_callback_lock_destroy)(
- ompt_mutex_lock, (ompt_wait_id_t)user_lock, codeptr);
+ ompt_mutex_lock, (ompt_wait_id_t)(uintptr_t)user_lock, codeptr);
}
#endif
@@ -2461,7 +2487,7 @@ void __kmpc_destroy_nest_lock(ident_t *loc, kmp_int32 gtid, void **user_lock) {
codeptr = OMPT_GET_RETURN_ADDRESS(0);
if (ompt_enabled.ompt_callback_lock_destroy) {
ompt_callbacks.ompt_callback(ompt_callback_lock_destroy)(
- ompt_mutex_nest_lock, (ompt_wait_id_t)user_lock, codeptr);
+ ompt_mutex_nest_lock, (ompt_wait_id_t)(uintptr_t)user_lock, codeptr);
}
#endif
KMP_D_LOCK_FUNC(user_lock, destroy)((kmp_dyna_lock_t *)user_lock);
@@ -2493,7 +2519,7 @@ void __kmpc_destroy_nest_lock(ident_t *loc, kmp_int32 gtid, void **user_lock) {
codeptr = OMPT_GET_RETURN_ADDRESS(0);
if (ompt_enabled.ompt_callback_lock_destroy) {
ompt_callbacks.ompt_callback(ompt_callback_lock_destroy)(
- ompt_mutex_nest_lock, (ompt_wait_id_t)user_lock, codeptr);
+ ompt_mutex_nest_lock, (ompt_wait_id_t)(uintptr_t)user_lock, codeptr);
}
#endif
@@ -2538,8 +2564,8 @@ void __kmpc_set_lock(ident_t *loc, kmp_int32 gtid, void **user_lock) {
if (ompt_enabled.ompt_callback_mutex_acquire) {
ompt_callbacks.ompt_callback(ompt_callback_mutex_acquire)(
ompt_mutex_lock, omp_lock_hint_none,
- __ompt_get_mutex_impl_type(user_lock), (ompt_wait_id_t)user_lock,
- codeptr);
+ __ompt_get_mutex_impl_type(user_lock),
+ (ompt_wait_id_t)(uintptr_t)user_lock, codeptr);
}
#endif
#if KMP_USE_INLINED_TAS
@@ -2560,7 +2586,7 @@ void __kmpc_set_lock(ident_t *loc, kmp_int32 gtid, void **user_lock) {
#if OMPT_SUPPORT && OMPT_OPTIONAL
if (ompt_enabled.ompt_callback_mutex_acquired) {
ompt_callbacks.ompt_callback(ompt_callback_mutex_acquired)(
- ompt_mutex_lock, (ompt_wait_id_t)user_lock, codeptr);
+ ompt_mutex_lock, (ompt_wait_id_t)(uintptr_t)user_lock, codeptr);
}
#endif
@@ -2593,7 +2619,7 @@ void __kmpc_set_lock(ident_t *loc, kmp_int32 gtid, void **user_lock) {
if (ompt_enabled.ompt_callback_mutex_acquire) {
ompt_callbacks.ompt_callback(ompt_callback_mutex_acquire)(
ompt_mutex_lock, omp_lock_hint_none, __ompt_get_mutex_impl_type(),
- (ompt_wait_id_t)lck, codeptr);
+ (ompt_wait_id_t)(uintptr_t)lck, codeptr);
}
#endif
@@ -2606,7 +2632,7 @@ void __kmpc_set_lock(ident_t *loc, kmp_int32 gtid, void **user_lock) {
#if OMPT_SUPPORT && OMPT_OPTIONAL
if (ompt_enabled.ompt_callback_mutex_acquired) {
ompt_callbacks.ompt_callback(ompt_callback_mutex_acquired)(
- ompt_mutex_lock, (ompt_wait_id_t)lck, codeptr);
+ ompt_mutex_lock, (ompt_wait_id_t)(uintptr_t)lck, codeptr);
}
#endif
@@ -2628,8 +2654,8 @@ void __kmpc_set_nest_lock(ident_t *loc, kmp_int32 gtid, void **user_lock) {
if (ompt_enabled.ompt_callback_mutex_acquire) {
ompt_callbacks.ompt_callback(ompt_callback_mutex_acquire)(
ompt_mutex_nest_lock, omp_lock_hint_none,
- __ompt_get_mutex_impl_type(user_lock), (ompt_wait_id_t)user_lock,
- codeptr);
+ __ompt_get_mutex_impl_type(user_lock),
+ (ompt_wait_id_t)(uintptr_t)user_lock, codeptr);
}
}
#endif
@@ -2646,13 +2672,14 @@ void __kmpc_set_nest_lock(ident_t *loc, kmp_int32 gtid, void **user_lock) {
if (ompt_enabled.ompt_callback_mutex_acquired) {
// lock_first
ompt_callbacks.ompt_callback(ompt_callback_mutex_acquired)(
- ompt_mutex_nest_lock, (ompt_wait_id_t)user_lock, codeptr);
+ ompt_mutex_nest_lock, (ompt_wait_id_t)(uintptr_t)user_lock,
+ codeptr);
}
} else {
if (ompt_enabled.ompt_callback_nest_lock) {
// lock_next
ompt_callbacks.ompt_callback(ompt_callback_nest_lock)(
- ompt_scope_begin, (ompt_wait_id_t)user_lock, codeptr);
+ ompt_scope_begin, (ompt_wait_id_t)(uintptr_t)user_lock, codeptr);
}
}
}
@@ -2690,7 +2717,8 @@ void __kmpc_set_nest_lock(ident_t *loc, kmp_int32 gtid, void **user_lock) {
if (ompt_enabled.ompt_callback_mutex_acquire) {
ompt_callbacks.ompt_callback(ompt_callback_mutex_acquire)(
ompt_mutex_nest_lock, omp_lock_hint_none,
- __ompt_get_mutex_impl_type(), (ompt_wait_id_t)lck, codeptr);
+ __ompt_get_mutex_impl_type(), (ompt_wait_id_t)(uintptr_t)lck,
+ codeptr);
}
}
#endif
@@ -2707,13 +2735,13 @@ void __kmpc_set_nest_lock(ident_t *loc, kmp_int32 gtid, void **user_lock) {
if (ompt_enabled.ompt_callback_mutex_acquired) {
// lock_first
ompt_callbacks.ompt_callback(ompt_callback_mutex_acquired)(
- ompt_mutex_nest_lock, (ompt_wait_id_t)lck, codeptr);
+ ompt_mutex_nest_lock, (ompt_wait_id_t)(uintptr_t)lck, codeptr);
}
} else {
if (ompt_enabled.ompt_callback_nest_lock) {
// lock_next
ompt_callbacks.ompt_callback(ompt_callback_nest_lock)(
- ompt_scope_begin, (ompt_wait_id_t)lck, codeptr);
+ ompt_scope_begin, (ompt_wait_id_t)(uintptr_t)lck, codeptr);
}
}
}
@@ -2749,7 +2777,7 @@ void __kmpc_unset_lock(ident_t *loc, kmp_int32 gtid, void **user_lock) {
codeptr = OMPT_GET_RETURN_ADDRESS(0);
if (ompt_enabled.ompt_callback_mutex_released) {
ompt_callbacks.ompt_callback(ompt_callback_mutex_released)(
- ompt_mutex_lock, (ompt_wait_id_t)user_lock, codeptr);
+ ompt_mutex_lock, (ompt_wait_id_t)(uintptr_t)user_lock, codeptr);
}
#endif
@@ -2778,7 +2806,7 @@ void __kmpc_unset_lock(ident_t *loc, kmp_int32 gtid, void **user_lock) {
codeptr = OMPT_GET_RETURN_ADDRESS(0);
if (ompt_enabled.ompt_callback_mutex_released) {
ompt_callbacks.ompt_callback(ompt_callback_mutex_released)(
- ompt_mutex_lock, (ompt_wait_id_t)lck, codeptr);
+ ompt_mutex_lock, (ompt_wait_id_t)(uintptr_t)lck, codeptr);
}
#endif
@@ -2810,7 +2838,7 @@ void __kmpc_unset_lock(ident_t *loc, kmp_int32 gtid, void **user_lock) {
codeptr = OMPT_GET_RETURN_ADDRESS(0);
if (ompt_enabled.ompt_callback_mutex_released) {
ompt_callbacks.ompt_callback(ompt_callback_mutex_released)(
- ompt_mutex_lock, (ompt_wait_id_t)lck, codeptr);
+ ompt_mutex_lock, (ompt_wait_id_t)(uintptr_t)lck, codeptr);
}
#endif
@@ -2838,12 +2866,13 @@ void __kmpc_unset_nest_lock(ident_t *loc, kmp_int32 gtid, void **user_lock) {
if (ompt_enabled.ompt_callback_mutex_released) {
// release_lock_last
ompt_callbacks.ompt_callback(ompt_callback_mutex_released)(
- ompt_mutex_nest_lock, (ompt_wait_id_t)user_lock, codeptr);
+ ompt_mutex_nest_lock, (ompt_wait_id_t)(uintptr_t)user_lock,
+ codeptr);
}
} else if (ompt_enabled.ompt_callback_nest_lock) {
// release_lock_prev
ompt_callbacks.ompt_callback(ompt_callback_nest_lock)(
- ompt_scope_end, (ompt_wait_id_t)user_lock, codeptr);
+ ompt_scope_end, (ompt_wait_id_t)(uintptr_t)user_lock, codeptr);
}
}
#endif
@@ -2887,12 +2916,12 @@ void __kmpc_unset_nest_lock(ident_t *loc, kmp_int32 gtid, void **user_lock) {
if (ompt_enabled.ompt_callback_mutex_released) {
// release_lock_last
ompt_callbacks.ompt_callback(ompt_callback_mutex_released)(
- ompt_mutex_nest_lock, (ompt_wait_id_t)lck, codeptr);
+ ompt_mutex_nest_lock, (ompt_wait_id_t)(uintptr_t)lck, codeptr);
}
} else if (ompt_enabled.ompt_callback_nest_lock) {
// release_lock_previous
ompt_callbacks.ompt_callback(ompt_callback_nest_lock)(
- ompt_mutex_scope_end, (ompt_wait_id_t)lck, codeptr);
+ ompt_mutex_scope_end, (ompt_wait_id_t)(uintptr_t)lck, codeptr);
}
}
#endif
@@ -2929,12 +2958,12 @@ void __kmpc_unset_nest_lock(ident_t *loc, kmp_int32 gtid, void **user_lock) {
if (ompt_enabled.ompt_callback_mutex_released) {
// release_lock_last
ompt_callbacks.ompt_callback(ompt_callback_mutex_released)(
- ompt_mutex_nest_lock, (ompt_wait_id_t)lck, codeptr);
+ ompt_mutex_nest_lock, (ompt_wait_id_t)(uintptr_t)lck, codeptr);
}
} else if (ompt_enabled.ompt_callback_nest_lock) {
// release_lock_previous
ompt_callbacks.ompt_callback(ompt_callback_nest_lock)(
- ompt_mutex_scope_end, (ompt_wait_id_t)lck, codeptr);
+ ompt_mutex_scope_end, (ompt_wait_id_t)(uintptr_t)lck, codeptr);
}
}
#endif
@@ -2960,8 +2989,8 @@ int __kmpc_test_lock(ident_t *loc, kmp_int32 gtid, void **user_lock) {
if (ompt_enabled.ompt_callback_mutex_acquire) {
ompt_callbacks.ompt_callback(ompt_callback_mutex_acquire)(
ompt_mutex_lock, omp_lock_hint_none,
- __ompt_get_mutex_impl_type(user_lock), (ompt_wait_id_t)user_lock,
- codeptr);
+ __ompt_get_mutex_impl_type(user_lock),
+ (ompt_wait_id_t)(uintptr_t)user_lock, codeptr);
}
#endif
#if KMP_USE_INLINED_TAS
@@ -2983,7 +3012,7 @@ int __kmpc_test_lock(ident_t *loc, kmp_int32 gtid, void **user_lock) {
#if OMPT_SUPPORT && OMPT_OPTIONAL
if (ompt_enabled.ompt_callback_mutex_acquired) {
ompt_callbacks.ompt_callback(ompt_callback_mutex_acquired)(
- ompt_mutex_lock, (ompt_wait_id_t)user_lock, codeptr);
+ ompt_mutex_lock, (ompt_wait_id_t)(uintptr_t)user_lock, codeptr);
}
#endif
return FTN_TRUE;
@@ -3024,7 +3053,7 @@ int __kmpc_test_lock(ident_t *loc, kmp_int32 gtid, void **user_lock) {
if (ompt_enabled.ompt_callback_mutex_acquire) {
ompt_callbacks.ompt_callback(ompt_callback_mutex_acquire)(
ompt_mutex_lock, omp_lock_hint_none, __ompt_get_mutex_impl_type(),
- (ompt_wait_id_t)lck, codeptr);
+ (ompt_wait_id_t)(uintptr_t)lck, codeptr);
}
#endif
@@ -3039,7 +3068,7 @@ int __kmpc_test_lock(ident_t *loc, kmp_int32 gtid, void **user_lock) {
#if OMPT_SUPPORT && OMPT_OPTIONAL
if (rc && ompt_enabled.ompt_callback_mutex_acquired) {
ompt_callbacks.ompt_callback(ompt_callback_mutex_acquired)(
- ompt_mutex_lock, (ompt_wait_id_t)lck, codeptr);
+ ompt_mutex_lock, (ompt_wait_id_t)(uintptr_t)lck, codeptr);
}
#endif
@@ -3065,8 +3094,8 @@ int __kmpc_test_nest_lock(ident_t *loc, kmp_int32 gtid, void **user_lock) {
if (ompt_enabled.ompt_callback_mutex_acquire) {
ompt_callbacks.ompt_callback(ompt_callback_mutex_acquire)(
ompt_mutex_nest_lock, omp_lock_hint_none,
- __ompt_get_mutex_impl_type(user_lock), (ompt_wait_id_t)user_lock,
- codeptr);
+ __ompt_get_mutex_impl_type(user_lock),
+ (ompt_wait_id_t)(uintptr_t)user_lock, codeptr);
}
#endif
rc = KMP_D_LOCK_FUNC(user_lock, test)((kmp_dyna_lock_t *)user_lock, gtid);
@@ -3083,13 +3112,14 @@ int __kmpc_test_nest_lock(ident_t *loc, kmp_int32 gtid, void **user_lock) {
if (ompt_enabled.ompt_callback_mutex_acquired) {
// lock_first
ompt_callbacks.ompt_callback(ompt_callback_mutex_acquired)(
- ompt_mutex_nest_lock, (ompt_wait_id_t)user_lock, codeptr);
+ ompt_mutex_nest_lock, (ompt_wait_id_t)(uintptr_t)user_lock,
+ codeptr);
}
} else {
if (ompt_enabled.ompt_callback_nest_lock) {
// lock_next
ompt_callbacks.ompt_callback(ompt_callback_nest_lock)(
- ompt_scope_begin, (ompt_wait_id_t)user_lock, codeptr);
+ ompt_scope_begin, (ompt_wait_id_t)(uintptr_t)user_lock, codeptr);
}
}
}
@@ -3130,7 +3160,8 @@ int __kmpc_test_nest_lock(ident_t *loc, kmp_int32 gtid, void **user_lock) {
ompt_enabled.ompt_callback_mutex_acquire) {
ompt_callbacks.ompt_callback(ompt_callback_mutex_acquire)(
ompt_mutex_nest_lock, omp_lock_hint_none,
- __ompt_get_mutex_impl_type(), (ompt_wait_id_t)lck, codeptr);
+ __ompt_get_mutex_impl_type(), (ompt_wait_id_t)(uintptr_t)lck,
+ codeptr);
}
#endif
@@ -3148,13 +3179,13 @@ int __kmpc_test_nest_lock(ident_t *loc, kmp_int32 gtid, void **user_lock) {
if (ompt_enabled.ompt_callback_mutex_acquired) {
// lock_first
ompt_callbacks.ompt_callback(ompt_callback_mutex_acquired)(
- ompt_mutex_nest_lock, (ompt_wait_id_t)lck, codeptr);
+ ompt_mutex_nest_lock, (ompt_wait_id_t)(uintptr_t)lck, codeptr);
}
} else {
if (ompt_enabled.ompt_callback_nest_lock) {
// lock_next
ompt_callbacks.ompt_callback(ompt_callback_nest_lock)(
- ompt_mutex_scope_begin, (ompt_wait_id_t)lck, codeptr);
+ ompt_mutex_scope_begin, (ompt_wait_id_t)(uintptr_t)lck, codeptr);
}
}
}
@@ -3288,7 +3319,6 @@ __kmp_end_critical_section_reduce_block(ident_t *loc, kmp_int32 global_tid,
#endif // KMP_USE_DYNAMIC_LOCK
} // __kmp_end_critical_section_reduce_block
-#if OMP_40_ENABLED
static __forceinline int
__kmp_swap_teams_for_teams_reduction(kmp_info_t *th, kmp_team_t **team_p,
int *task_state) {
@@ -3323,7 +3353,6 @@ __kmp_restore_swapped_teams(kmp_info_t *th, kmp_team_t *team, int task_state) {
th->th.th_task_team = team->t.t_task_team[task_state];
th->th.th_task_state = task_state;
}
-#endif
/* 2.a.i. Reduce Block without a terminating barrier */
/*!
@@ -3350,11 +3379,9 @@ __kmpc_reduce_nowait(ident_t *loc, kmp_int32 global_tid, kmp_int32 num_vars,
KMP_COUNT_BLOCK(REDUCE_nowait);
int retval = 0;
PACKED_REDUCTION_METHOD_T packed_reduction_method;
-#if OMP_40_ENABLED
kmp_info_t *th;
kmp_team_t *team;
int teams_swapped = 0, task_state;
-#endif
KA_TRACE(10, ("__kmpc_reduce_nowait() enter: called T#%d\n", global_tid));
// why do we need this initialization here at all?
@@ -3366,6 +3393,8 @@ __kmpc_reduce_nowait(ident_t *loc, kmp_int32 global_tid, kmp_int32 num_vars,
if (!TCR_4(__kmp_init_parallel))
__kmp_parallel_initialize();
+ __kmp_resume_if_soft_paused();
+
// check correctness of reduce block nesting
#if KMP_USE_DYNAMIC_LOCK
if (__kmp_env_consistency_check)
@@ -3375,10 +3404,8 @@ __kmpc_reduce_nowait(ident_t *loc, kmp_int32 global_tid, kmp_int32 num_vars,
__kmp_push_sync(global_tid, ct_reduce, loc, NULL);
#endif
-#if OMP_40_ENABLED
th = __kmp_thread_from_gtid(global_tid);
teams_swapped = __kmp_swap_teams_for_teams_reduction(th, &team, &task_state);
-#endif // OMP_40_ENABLED
// packed_reduction_method value will be reused by __kmp_end_reduce* function,
// the value should be kept in a variable
@@ -3479,11 +3506,9 @@ __kmpc_reduce_nowait(ident_t *loc, kmp_int32 global_tid, kmp_int32 num_vars,
// should never reach this block
KMP_ASSERT(0); // "unexpected method"
}
-#if OMP_40_ENABLED
if (teams_swapped) {
__kmp_restore_swapped_teams(th, team, task_state);
}
-#endif
KA_TRACE(
10,
("__kmpc_reduce_nowait() exit: called T#%d: method %08x, returns %08x\n",
@@ -3569,11 +3594,9 @@ kmp_int32 __kmpc_reduce(ident_t *loc, kmp_int32 global_tid, kmp_int32 num_vars,
KMP_COUNT_BLOCK(REDUCE_wait);
int retval = 0;
PACKED_REDUCTION_METHOD_T packed_reduction_method;
-#if OMP_40_ENABLED
kmp_info_t *th;
kmp_team_t *team;
int teams_swapped = 0, task_state;
-#endif
KA_TRACE(10, ("__kmpc_reduce() enter: called T#%d\n", global_tid));
@@ -3586,6 +3609,8 @@ kmp_int32 __kmpc_reduce(ident_t *loc, kmp_int32 global_tid, kmp_int32 num_vars,
if (!TCR_4(__kmp_init_parallel))
__kmp_parallel_initialize();
+ __kmp_resume_if_soft_paused();
+
// check correctness of reduce block nesting
#if KMP_USE_DYNAMIC_LOCK
if (__kmp_env_consistency_check)
@@ -3595,10 +3620,8 @@ kmp_int32 __kmpc_reduce(ident_t *loc, kmp_int32 global_tid, kmp_int32 num_vars,
__kmp_push_sync(global_tid, ct_reduce, loc, NULL);
#endif
-#if OMP_40_ENABLED
th = __kmp_thread_from_gtid(global_tid);
teams_swapped = __kmp_swap_teams_for_teams_reduction(th, &team, &task_state);
-#endif // OMP_40_ENABLED
packed_reduction_method = __kmp_determine_reduction_method(
loc, global_tid, num_vars, reduce_size, reduce_data, reduce_func, lck);
@@ -3661,16 +3684,13 @@ kmp_int32 __kmpc_reduce(ident_t *loc, kmp_int32 global_tid, kmp_int32 num_vars,
// should never reach this block
KMP_ASSERT(0); // "unexpected method"
}
-#if OMP_40_ENABLED
if (teams_swapped) {
__kmp_restore_swapped_teams(th, team, task_state);
}
-#endif
KA_TRACE(10,
("__kmpc_reduce() exit: called T#%d: method %08x, returns %08x\n",
global_tid, packed_reduction_method, retval));
-
return retval;
}
@@ -3688,18 +3708,14 @@ void __kmpc_end_reduce(ident_t *loc, kmp_int32 global_tid,
kmp_critical_name *lck) {
PACKED_REDUCTION_METHOD_T packed_reduction_method;
-#if OMP_40_ENABLED
kmp_info_t *th;
kmp_team_t *team;
int teams_swapped = 0, task_state;
-#endif
KA_TRACE(10, ("__kmpc_end_reduce() enter: called T#%d\n", global_tid));
-#if OMP_40_ENABLED
th = __kmp_thread_from_gtid(global_tid);
teams_swapped = __kmp_swap_teams_for_teams_reduction(th, &team, &task_state);
-#endif // OMP_40_ENABLED
packed_reduction_method = __KMP_GET_REDUCTION_METHOD(global_tid);
@@ -3707,7 +3723,6 @@ void __kmpc_end_reduce(ident_t *loc, kmp_int32 global_tid,
// tool (it's a terminating barrier on constructs if NOWAIT not specified)
if (packed_reduction_method == critical_reduce_block) {
-
__kmp_end_critical_section_reduce_block(loc, global_tid, lck);
// TODO: implicit barrier: should be exposed
@@ -3788,11 +3803,9 @@ void __kmpc_end_reduce(ident_t *loc, kmp_int32 global_tid,
// should never reach this block
KMP_ASSERT(0); // "unexpected method"
}
-#if OMP_40_ENABLED
if (teams_swapped) {
__kmp_restore_swapped_teams(th, team, task_state);
}
-#endif
if (__kmp_env_consistency_check)
__kmp_pop_sync(global_tid, ct_reduce, loc);
@@ -3838,7 +3851,6 @@ kmp_uint64 __kmpc_get_parent_taskid() {
} // __kmpc_get_parent_taskid
-#if OMP_45_ENABLED
/*!
@ingroup WORK_SHARING
@param loc source location information.
@@ -3932,8 +3944,8 @@ void __kmpc_doacross_init(ident_t *loc, int gtid, int num_dims,
// __kmp_dispatch_num_buffers)
if (idx != sh_buf->doacross_buf_idx) {
// Shared buffer is occupied, wait for it to be free
- __kmp_wait_yield_4((volatile kmp_uint32 *)&sh_buf->doacross_buf_idx, idx,
- __kmp_eq_4, NULL);
+ __kmp_wait_4((volatile kmp_uint32 *)&sh_buf->doacross_buf_idx, idx,
+ __kmp_eq_4, NULL);
}
#if KMP_32_BIT_ARCH
// Check if we are the first thread. After the CAS the first thread gets 0,
@@ -4150,15 +4162,26 @@ void __kmpc_doacross_fini(ident_t *loc, int gtid) {
pr_buf->th_doacross_info = NULL;
KA_TRACE(20, ("__kmpc_doacross_fini() exit: T#%d\n", gtid));
}
-#endif
-#if OMP_50_ENABLED
+/* omp_alloc/omp_free only defined for C/C++, not for Fortran */
+void *omp_alloc(size_t size, omp_allocator_handle_t allocator) {
+ return __kmpc_alloc(__kmp_entry_gtid(), size, allocator);
+}
+
+void omp_free(void *ptr, omp_allocator_handle_t allocator) {
+ __kmpc_free(__kmp_entry_gtid(), ptr, allocator);
+}
+
int __kmpc_get_target_offload(void) {
if (!__kmp_init_serial) {
__kmp_serial_initialize();
}
return __kmp_target_offload;
}
-#endif // OMP_50_ENABLED
-// end of file //
+int __kmpc_pause_resource(kmp_pause_status_t level) {
+ if (!__kmp_init_serial) {
+ return 1; // Can't pause if runtime is not initialized
+ }
+ return __kmp_pause_resource(level);
+}
diff --git a/runtime/src/kmp_debug.cpp b/runtime/src/kmp_debug.cpp
index 50d3876abf84..6c397c5d8e25 100644
--- a/runtime/src/kmp_debug.cpp
+++ b/runtime/src/kmp_debug.cpp
@@ -4,10 +4,9 @@
//===----------------------------------------------------------------------===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.txt for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/runtime/src/kmp_debug.h b/runtime/src/kmp_debug.h
index 29cc15c5cf8c..08d52cc04a10 100644
--- a/runtime/src/kmp_debug.h
+++ b/runtime/src/kmp_debug.h
@@ -4,10 +4,9 @@
//===----------------------------------------------------------------------===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.txt for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/runtime/src/kmp_debugger.cpp b/runtime/src/kmp_debugger.cpp
index 8de2cbaedba9..490300f9b207 100644
--- a/runtime/src/kmp_debugger.cpp
+++ b/runtime/src/kmp_debugger.cpp
@@ -7,10 +7,9 @@
//===----------------------------------------------------------------------===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.txt for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -102,13 +101,11 @@ kmp_omp_struct_info_t __kmp_omp_debug_struct_info = {
offset_and_size_of(kmp_base_info_t, th_bar),
offset_and_size_of(kmp_bstate_t, b_worker_arrived),
-#if OMP_40_ENABLED
// teams information
offset_and_size_of(kmp_base_info_t, th_teams_microtask),
offset_and_size_of(kmp_base_info_t, th_teams_level),
offset_and_size_of(kmp_teams_size_t, nteams),
offset_and_size_of(kmp_teams_size_t, nth),
-#endif
// kmp_desc structure (for info field above)
sizeof(kmp_desc_base_t),
@@ -134,9 +131,7 @@ kmp_omp_struct_info_t __kmp_omp_debug_struct_info = {
offset_and_size_of(kmp_base_team_t, t_pkfn),
offset_and_size_of(kmp_base_team_t, t_task_team),
offset_and_size_of(kmp_base_team_t, t_implicit_task_taskdata),
-#if OMP_40_ENABLED
offset_and_size_of(kmp_base_team_t, t_cancel_request),
-#endif
offset_and_size_of(kmp_base_team_t, t_bar),
offset_and_size_of(kmp_balign_team_t, b_master_arrived),
offset_and_size_of(kmp_balign_team_t, b_team_arrived),
@@ -196,7 +191,6 @@ kmp_omp_struct_info_t __kmp_omp_debug_struct_info = {
offset_and_size_of(kmp_taskdata_t, td_taskwait_counter),
offset_and_size_of(kmp_taskdata_t, td_taskwait_thread),
-#if OMP_40_ENABLED
offset_and_size_of(kmp_taskdata_t, td_taskgroup),
offset_and_size_of(kmp_taskgroup_t, count),
offset_and_size_of(kmp_taskgroup_t, cancel_request),
@@ -208,7 +202,6 @@ kmp_omp_struct_info_t __kmp_omp_debug_struct_info = {
offset_and_size_of(kmp_base_depnode_t, task),
offset_and_size_of(kmp_base_depnode_t, npredecessors),
offset_and_size_of(kmp_base_depnode_t, nrefs),
-#endif
offset_and_size_of(kmp_task_t, routine),
// thread_data_t.
diff --git a/runtime/src/kmp_debugger.h b/runtime/src/kmp_debugger.h
index 6c747b2c8241..7ec74287d721 100644
--- a/runtime/src/kmp_debugger.h
+++ b/runtime/src/kmp_debugger.h
@@ -5,10 +5,9 @@
//===----------------------------------------------------------------------===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.txt for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/runtime/src/kmp_dispatch.cpp b/runtime/src/kmp_dispatch.cpp
index 1090e9de1d0e..161a2c696357 100644
--- a/runtime/src/kmp_dispatch.cpp
+++ b/runtime/src/kmp_dispatch.cpp
@@ -4,10 +4,9 @@
//===----------------------------------------------------------------------===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.txt for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -69,6 +68,20 @@ void __kmp_dispatch_dxo_error(int *gtid_ref, int *cid_ref, ident_t *loc_ref) {
}
}
+// Returns either SCHEDULE_MONOTONIC or SCHEDULE_NONMONOTONIC
+static inline int __kmp_get_monotonicity(enum sched_type schedule,
+ bool use_hier = false) {
+ // Pick up the nonmonotonic/monotonic bits from the scheduling type
+ int monotonicity;
+ // default to monotonic
+ monotonicity = SCHEDULE_MONOTONIC;
+ if (SCHEDULE_HAS_NONMONOTONIC(schedule))
+ monotonicity = SCHEDULE_NONMONOTONIC;
+ else if (SCHEDULE_HAS_MONOTONIC(schedule))
+ monotonicity = SCHEDULE_MONOTONIC;
+ return monotonicity;
+}
+
// Initialize a dispatch_private_info_template<T> buffer for a particular
// type of schedule,chunk. The loop description is found in lb (lower bound),
// ub (upper bound), and st (stride). nproc is the number of threads relevant
@@ -96,6 +109,8 @@ void __kmp_dispatch_init_algorithm(ident_t *loc, int gtid,
T tc;
kmp_info_t *th;
kmp_team_t *team;
+ int monotonicity;
+ bool use_hier;
#ifdef KMP_DEBUG
typedef typename traits_t<T>::signed_t ST;
@@ -118,21 +133,21 @@ void __kmp_dispatch_init_algorithm(ident_t *loc, int gtid,
active = !team->t.t_serialized;
#if USE_ITT_BUILD
- int itt_need_metadata_reporting = __itt_metadata_add_ptr &&
- __kmp_forkjoin_frames_mode == 3 &&
- KMP_MASTER_GTID(gtid) &&
-#if OMP_40_ENABLED
- th->th.th_teams_microtask == NULL &&
+ int itt_need_metadata_reporting =
+ __itt_metadata_add_ptr && __kmp_forkjoin_frames_mode == 3 &&
+ KMP_MASTER_GTID(gtid) && th->th.th_teams_microtask == NULL &&
+ team->t.t_active_level == 1;
#endif
- team->t.t_active_level == 1;
-#endif
-#if (KMP_STATIC_STEAL_ENABLED)
- if (SCHEDULE_HAS_NONMONOTONIC(schedule))
- // AC: we now have only one implementation of stealing, so use it
- schedule = kmp_sch_static_steal;
- else
+
+#if KMP_USE_HIER_SCHED
+ use_hier = pr->flags.use_hier;
+#else
+ use_hier = false;
#endif
- schedule = SCHEDULE_WITHOUT_MODIFIERS(schedule);
+
+ /* Pick up the nonmonotonic/monotonic bits from the scheduling type */
+ monotonicity = __kmp_get_monotonicity(schedule, use_hier);
+ schedule = SCHEDULE_WITHOUT_MODIFIERS(schedule);
/* Pick up the nomerge/ordered bits from the scheduling type */
if ((schedule >= kmp_nm_lower) && (schedule < kmp_nm_upper)) {
@@ -150,6 +165,10 @@ void __kmp_dispatch_init_algorithm(ident_t *loc, int gtid,
} else {
pr->flags.ordered = FALSE;
}
+ // Ordered overrides nonmonotonic
+ if (pr->flags.ordered) {
+ monotonicity = SCHEDULE_MONOTONIC;
+ }
if (schedule == kmp_sch_static) {
schedule = __kmp_static;
@@ -158,6 +177,8 @@ void __kmp_dispatch_init_algorithm(ident_t *loc, int gtid,
// Use the scheduling specified by OMP_SCHEDULE (or __kmp_sch_default if
// not specified)
schedule = team->t.t_sched.r_sched_type;
+ monotonicity = __kmp_get_monotonicity(schedule, use_hier);
+ schedule = SCHEDULE_WITHOUT_MODIFIERS(schedule);
// Detail the schedule if needed (global controls are differentiated
// appropriately)
if (schedule == kmp_sch_guided_chunked) {
@@ -208,16 +229,23 @@ void __kmp_dispatch_init_algorithm(ident_t *loc, int gtid,
}
#endif
}
-
+#if KMP_STATIC_STEAL_ENABLED
+ // map nonmonotonic:dynamic to static steal
+ if (schedule == kmp_sch_dynamic_chunked) {
+ if (monotonicity == SCHEDULE_NONMONOTONIC)
+ schedule = kmp_sch_static_steal;
+ }
+#endif
/* guided analytical not safe for too many threads */
if (schedule == kmp_sch_guided_analytical_chunked && nproc > 1 << 20) {
schedule = kmp_sch_guided_iterative_chunked;
KMP_WARNING(DispatchManyThreads);
}
-#if OMP_45_ENABLED
if (schedule == kmp_sch_runtime_simd) {
// compiler provides simd_width in the chunk parameter
schedule = team->t.t_sched.r_sched_type;
+ monotonicity = __kmp_get_monotonicity(schedule, use_hier);
+ schedule = SCHEDULE_WITHOUT_MODIFIERS(schedule);
// Detail the schedule if needed (global controls are differentiated
// appropriately)
if (schedule == kmp_sch_static || schedule == kmp_sch_auto ||
@@ -237,15 +265,15 @@ void __kmp_dispatch_init_algorithm(ident_t *loc, int gtid,
{
char *buff;
// create format specifiers before the debug output
- buff = __kmp_str_format("__kmp_dispatch_init: T#%%d new: schedule:%%d"
- " chunk:%%%s\n",
- traits_t<ST>::spec);
+ buff = __kmp_str_format(
+ "__kmp_dispatch_init_algorithm: T#%%d new: schedule:%%d"
+ " chunk:%%%s\n",
+ traits_t<ST>::spec);
KD_TRACE(10, (buff, gtid, schedule, chunk));
__kmp_str_free(&buff);
}
#endif
}
-#endif // OMP_45_ENABLED
pr->u.p.parm1 = chunk;
}
KMP_ASSERT2((kmp_sch_lower < schedule && schedule < kmp_sch_upper),
@@ -284,6 +312,12 @@ void __kmp_dispatch_init_algorithm(ident_t *loc, int gtid,
}
}
+#if KMP_STATS_ENABLED
+ if (KMP_MASTER_GTID(gtid)) {
+ KMP_COUNT_VALUE(OMP_loop_dynamic_total_iterations, tc);
+ }
+#endif
+
pr->u.p.lb = lb;
pr->u.p.ub = ub;
pr->u.p.st = st;
@@ -326,7 +360,10 @@ void __kmp_dispatch_init_algorithm(ident_t *loc, int gtid,
pr->u.p.ub = init + small_chunk + (id < extras ? 1 : 0);
pr->u.p.parm2 = lb;
- // pr->pfields.parm3 = 0; // it's not used in static_steal
+ // parm3 is the number of times to attempt stealing which is
+ // proportional to the number of chunks per thread up until
+ // the maximum value of nproc.
+ pr->u.p.parm3 = KMP_MIN(small_chunk + extras, nproc);
pr->u.p.parm4 = (id + 1) % nproc; // remember neighbour tid
pr->u.p.st = st;
if (traits_t<T>::type_size > 4) {
@@ -349,6 +386,7 @@ void __kmp_dispatch_init_algorithm(ident_t *loc, int gtid,
/* too few iterations: fall-through to kmp_sch_static_balanced */
} // if
/* FALL-THROUGH to static balanced */
+ KMP_FALLTHROUGH();
} // case
#endif
case kmp_sch_static_balanced: {
@@ -418,7 +456,6 @@ void __kmp_dispatch_init_algorithm(ident_t *loc, int gtid,
}
break;
} // case
-#if OMP_45_ENABLED
case kmp_sch_static_balanced_chunked: {
// similar to balanced, but chunk adjusted to multiple of simd width
T nth = nproc;
@@ -433,7 +470,6 @@ void __kmp_dispatch_init_algorithm(ident_t *loc, int gtid,
break;
} // case
case kmp_sch_guided_simd:
-#endif // OMP_45_ENABLED
case kmp_sch_guided_iterative_chunked: {
KD_TRACE(
100,
@@ -740,6 +776,8 @@ __kmp_dispatch_init(ident_t *loc, int gtid, enum sched_type schedule, T lb,
if (!TCR_4(__kmp_init_parallel))
__kmp_parallel_initialize();
+ __kmp_resume_if_soft_paused();
+
#if INCLUDE_SSC_MARKS
SSC_MARK_DISPATCH_INIT();
#endif
@@ -804,13 +842,10 @@ __kmp_dispatch_init(ident_t *loc, int gtid, enum sched_type schedule, T lb,
#if USE_ITT_BUILD
kmp_uint64 cur_chunk = chunk;
- int itt_need_metadata_reporting = __itt_metadata_add_ptr &&
- __kmp_forkjoin_frames_mode == 3 &&
- KMP_MASTER_GTID(gtid) &&
-#if OMP_40_ENABLED
- th->th.th_teams_microtask == NULL &&
-#endif
- team->t.t_active_level == 1;
+ int itt_need_metadata_reporting =
+ __itt_metadata_add_ptr && __kmp_forkjoin_frames_mode == 3 &&
+ KMP_MASTER_GTID(gtid) && th->th.th_teams_microtask == NULL &&
+ team->t.t_active_level == 1;
#endif
if (!active) {
pr = reinterpret_cast<dispatch_private_info_template<T> *>(
@@ -854,9 +889,9 @@ __kmp_dispatch_init(ident_t *loc, int gtid, enum sched_type schedule, T lb,
KD_TRACE(100, ("__kmp_dispatch_init: T#%d before wait: my_buffer_index:%d "
"sh->buffer_index:%d\n",
gtid, my_buffer_index, sh->buffer_index));
- __kmp_wait_yield<kmp_uint32>(&sh->buffer_index, my_buffer_index,
- __kmp_eq<kmp_uint32> USE_ITT_BUILD_ARG(NULL));
- // Note: KMP_WAIT_YIELD() cannot be used there: buffer index and
+ __kmp_wait<kmp_uint32>(&sh->buffer_index, my_buffer_index,
+ __kmp_eq<kmp_uint32> USE_ITT_BUILD_ARG(NULL));
+ // Note: KMP_WAIT() cannot be used there: buffer index and
// my_buffer_index are *always* 32-bit integers.
KMP_MB(); /* is this necessary? */
KD_TRACE(100, ("__kmp_dispatch_init: T#%d after wait: my_buffer_index:%d "
@@ -886,9 +921,7 @@ __kmp_dispatch_init(ident_t *loc, int gtid, enum sched_type schedule, T lb,
break;
case kmp_sch_guided_iterative_chunked:
case kmp_sch_guided_analytical_chunked:
-#if OMP_45_ENABLED
case kmp_sch_guided_simd:
-#endif
schedtype = 2;
break;
default:
@@ -1000,8 +1033,8 @@ static void __kmp_dispatch_finish(int gtid, ident_t *loc) {
}
#endif
- __kmp_wait_yield<UT>(&sh->u.s.ordered_iteration, lower,
- __kmp_ge<UT> USE_ITT_BUILD_ARG(NULL));
+ __kmp_wait<UT>(&sh->u.s.ordered_iteration, lower,
+ __kmp_ge<UT> USE_ITT_BUILD_ARG(NULL));
KMP_MB(); /* is this necessary? */
#ifdef KMP_DEBUG
{
@@ -1069,8 +1102,8 @@ static void __kmp_dispatch_finish_chunk(int gtid, ident_t *loc) {
}
#endif
- __kmp_wait_yield<UT>(&sh->u.s.ordered_iteration, lower,
- __kmp_ge<UT> USE_ITT_BUILD_ARG(NULL));
+ __kmp_wait<UT>(&sh->u.s.ordered_iteration, lower,
+ __kmp_ge<UT> USE_ITT_BUILD_ARG(NULL));
KMP_MB(); /* is this necessary? */
KD_TRACE(1000, ("__kmp_dispatch_finish_chunk: T#%d resetting "
@@ -1174,7 +1207,7 @@ int __kmp_dispatch_next_algorithm(int gtid,
}
if (!status) { // try to steal
kmp_info_t **other_threads = team->t.t_threads;
- int while_limit = nproc; // nproc attempts to find a victim
+ int while_limit = pr->u.p.parm3;
int while_index = 0;
// TODO: algorithm of searching for a victim
// should be cleaned up and measured
@@ -1272,7 +1305,7 @@ int __kmp_dispatch_next_algorithm(int gtid,
if (!status) {
kmp_info_t **other_threads = team->t.t_threads;
- int while_limit = nproc; // nproc attempts to find a victim
+ int while_limit = pr->u.p.parm3;
int while_index = 0;
// TODO: algorithm of searching for a victim
@@ -1547,7 +1580,6 @@ int __kmp_dispatch_next_algorithm(int gtid,
} // case
break;
-#if OMP_45_ENABLED
case kmp_sch_guided_simd: {
// same as iterative but curr-chunk adjusted to be multiple of given
// chunk
@@ -1620,7 +1652,6 @@ int __kmp_dispatch_next_algorithm(int gtid,
} // if
} // case
break;
-#endif // OMP_45_ENABLED
case kmp_sch_guided_analytical_chunked: {
T chunkspec = pr->u.p.parm1;
@@ -2156,10 +2187,8 @@ static void __kmp_dist_get_bounds(ident_t *loc, kmp_int32 gtid,
}
th = __kmp_threads[gtid];
team = th->th.th_team;
-#if OMP_40_ENABLED
KMP_DEBUG_ASSERT(th->th.th_teams_microtask); // we are in the teams construct
nteams = th->th.th_teams_size.nteams;
-#endif
team_id = team->t.t_master_tid;
KMP_DEBUG_ASSERT(nteams == (kmp_uint32)team->t.t_parent->t.t_nproc);
@@ -2485,10 +2514,10 @@ kmp_uint32 __kmp_le_4(kmp_uint32 value, kmp_uint32 checker) {
}
kmp_uint32
-__kmp_wait_yield_4(volatile kmp_uint32 *spinner, kmp_uint32 checker,
- kmp_uint32 (*pred)(kmp_uint32, kmp_uint32),
- void *obj // Higher-level synchronization object, or NULL.
- ) {
+__kmp_wait_4(volatile kmp_uint32 *spinner, kmp_uint32 checker,
+ kmp_uint32 (*pred)(kmp_uint32, kmp_uint32),
+ void *obj // Higher-level synchronization object, or NULL.
+ ) {
// note: we may not belong to a team at this point
volatile kmp_uint32 *spin = spinner;
kmp_uint32 check = checker;
@@ -2505,20 +2534,16 @@ __kmp_wait_yield_4(volatile kmp_uint32 *spinner, kmp_uint32 checker,
split. It causes problems with infinite recursion because of exit lock */
/* if ( TCR_4(__kmp_global.g.g_done) && __kmp_global.g.g_abort)
__kmp_abort_thread(); */
-
- /* if we have waited a bit, or are oversubscribed, yield */
- /* pause is in the following code */
- KMP_YIELD(TCR_4(__kmp_nth) > __kmp_avail_proc);
- KMP_YIELD_SPIN(spins);
+ KMP_YIELD_OVERSUB_ELSE_SPIN(spins);
}
KMP_FSYNC_SPIN_ACQUIRED(obj);
return r;
}
-void __kmp_wait_yield_4_ptr(
- void *spinner, kmp_uint32 checker, kmp_uint32 (*pred)(void *, kmp_uint32),
- void *obj // Higher-level synchronization object, or NULL.
- ) {
+void __kmp_wait_4_ptr(void *spinner, kmp_uint32 checker,
+ kmp_uint32 (*pred)(void *, kmp_uint32),
+ void *obj // Higher-level synchronization object, or NULL.
+ ) {
// note: we may not belong to a team at this point
void *spin = spinner;
kmp_uint32 check = checker;
@@ -2530,10 +2555,9 @@ void __kmp_wait_yield_4_ptr(
// main wait spin loop
while (!f(spin, check)) {
KMP_FSYNC_SPIN_PREPARE(obj);
- /* if we have waited a bit, or are oversubscribed, yield */
+ /* if we have waited a bit, or are noversubscribed, yield */
/* pause is in the following code */
- KMP_YIELD(TCR_4(__kmp_nth) > __kmp_avail_proc);
- KMP_YIELD_SPIN(spins);
+ KMP_YIELD_OVERSUB_ELSE_SPIN(spins);
}
KMP_FSYNC_SPIN_ACQUIRED(obj);
}
diff --git a/runtime/src/kmp_dispatch.h b/runtime/src/kmp_dispatch.h
index 955807113ef1..8b3e98435a3f 100644
--- a/runtime/src/kmp_dispatch.h
+++ b/runtime/src/kmp_dispatch.h
@@ -4,10 +4,9 @@
//===----------------------------------------------------------------------===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.txt for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -172,11 +171,9 @@ template <typename T> struct dispatch_shared_info_template {
dispatch_shared_info64_t s64;
} u;
volatile kmp_uint32 buffer_index;
-#if OMP_45_ENABLED
volatile kmp_int32 doacross_buf_idx; // teamwise index
kmp_uint32 *doacross_flags; // array of iteration flags (0/1)
kmp_int32 doacross_num_done; // count finished threads
-#endif
#if KMP_USE_HIER_SCHED
kmp_hier_t<T> *hier;
#endif
@@ -270,7 +267,7 @@ template <typename T> kmp_uint32 __kmp_eq(T value, T checker) {
}
/*
- Spin wait loop that first does pause, then yield.
+ Spin wait loop that pauses between checks.
Waits until function returns non-zero when called with *spinner and check.
Does NOT put threads to sleep.
Arguments:
@@ -283,15 +280,14 @@ template <typename T> kmp_uint32 __kmp_eq(T value, T checker) {
is used to report locks consistently. For example, if lock is acquired
immediately, its address is reported to ittnotify via
KMP_FSYNC_ACQUIRED(). However, it lock cannot be acquired immediately
- and lock routine calls to KMP_WAIT_YIELD(), the later should report the
+ and lock routine calls to KMP_WAIT(), the later should report the
same address, not an address of low-level spinner.
#endif // USE_ITT_BUILD
TODO: make inline function (move to header file for icl)
*/
template <typename UT>
-static UT __kmp_wait_yield(volatile UT *spinner, UT checker,
- kmp_uint32 (*pred)(UT, UT)
- USE_ITT_BUILD_ARG(void *obj)) {
+static UT __kmp_wait(volatile UT *spinner, UT checker,
+ kmp_uint32 (*pred)(UT, UT) USE_ITT_BUILD_ARG(void *obj)) {
// note: we may not belong to a team at this point
volatile UT *spin = spinner;
UT check = checker;
@@ -309,12 +305,8 @@ static UT __kmp_wait_yield(volatile UT *spinner, UT checker,
It causes problems with infinite recursion because of exit lock */
/* if ( TCR_4(__kmp_global.g.g_done) && __kmp_global.g.g_abort)
__kmp_abort_thread(); */
-
- // if we are oversubscribed,
- // or have waited a bit (and KMP_LIBRARY=throughput, then yield
- // pause is in the following code
- KMP_YIELD(TCR_4(__kmp_nth) > __kmp_avail_proc);
- KMP_YIELD_SPIN(spins);
+ // If oversubscribed, or have waited a bit then yield.
+ KMP_YIELD_OVERSUB_ELSE_SPIN(spins);
}
KMP_FSYNC_SPIN_ACQUIRED(obj);
return r;
@@ -380,8 +372,8 @@ void __kmp_dispatch_deo(int *gtid_ref, int *cid_ref, ident_t *loc_ref) {
__kmp_str_free(&buff);
}
#endif
- __kmp_wait_yield<UT>(&sh->u.s.ordered_iteration, lower,
- __kmp_ge<UT> USE_ITT_BUILD_ARG(NULL));
+ __kmp_wait<UT>(&sh->u.s.ordered_iteration, lower,
+ __kmp_ge<UT> USE_ITT_BUILD_ARG(NULL));
KMP_MB(); /* is this necessary? */
#ifdef KMP_DEBUG
{
diff --git a/runtime/src/kmp_dispatch_hier.h b/runtime/src/kmp_dispatch_hier.h
index 8277eaa5a042..24a6d6691240 100644
--- a/runtime/src/kmp_dispatch_hier.h
+++ b/runtime/src/kmp_dispatch_hier.h
@@ -1,3 +1,15 @@
+/*
+ * kmp_dispatch_hier.h -- hierarchical scheduling methods and data structures
+ */
+
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
#ifndef KMP_DISPATCH_HIER_H
#define KMP_DISPATCH_HIER_H
#include "kmp.h"
@@ -196,7 +208,7 @@ template <typename T> struct kmp_hier_shared_bdata_t {
// Can be used in a unit with between 2 to 8 threads
template <typename T> class core_barrier_impl {
static inline kmp_uint64 get_wait_val(int num_active) {
- kmp_uint64 wait_val;
+ kmp_uint64 wait_val = 0LL;
switch (num_active) {
case 2:
wait_val = 0x0101LL;
@@ -263,8 +275,8 @@ void core_barrier_impl<T>::barrier(kmp_int32 id,
next_wait_value));
char v = (current_wait_value ? 0x1 : 0x0);
(RCAST(volatile char *, &(bdata->val[current_index])))[id] = v;
- __kmp_wait_yield<kmp_uint64>(&(bdata->val[current_index]), current_wait_value,
- __kmp_eq<kmp_uint64> USE_ITT_BUILD_ARG(NULL));
+ __kmp_wait<kmp_uint64>(&(bdata->val[current_index]), current_wait_value,
+ __kmp_eq<kmp_uint64> USE_ITT_BUILD_ARG(NULL));
tdata->wait_val[current_index] = next_wait_value;
tdata->index = next_index;
}
@@ -310,8 +322,8 @@ void counter_barrier_impl<T>::barrier(kmp_int32 id,
next_wait_value));
val = RCAST(volatile kmp_int64 *, &(bdata->val[current_index]));
KMP_TEST_THEN_INC64(val);
- __kmp_wait_yield<kmp_uint64>(&(bdata->val[current_index]), current_wait_value,
- __kmp_ge<kmp_uint64> USE_ITT_BUILD_ARG(NULL));
+ __kmp_wait<kmp_uint64>(&(bdata->val[current_index]), current_wait_value,
+ __kmp_ge<kmp_uint64> USE_ITT_BUILD_ARG(NULL));
tdata->wait_val[current_index] = next_wait_value;
tdata->index = next_index;
}
@@ -412,6 +424,7 @@ template <typename T> struct kmp_hier_top_unit_t {
kmp_int32 is_active() const { return active; }
kmp_int32 get_num_active() const { return active; }
+#ifdef KMP_DEBUG
void print() {
KD_TRACE(
10,
@@ -419,6 +432,7 @@ template <typename T> struct kmp_hier_top_unit_t {
active, &hier_pr, hier_pr.u.p.lb, hier_pr.u.p.ub, hier_pr.u.p.st,
hier_pr.u.p.tc));
}
+#endif
};
// Information regarding a single layer within the scheduling hierarchy
@@ -429,6 +443,7 @@ template <typename T> struct kmp_hier_layer_info_t {
typename traits_t<T>::signed_t chunk; // chunk size associated with schedule
int length; // length of the kmp_hier_top_unit_t array
+#ifdef KMP_DEBUG
// Print this layer's information
void print() {
const char *t = __kmp_get_hier_str(type);
@@ -438,6 +453,7 @@ template <typename T> struct kmp_hier_layer_info_t {
"length:%d\n",
num_active, t, sched, chunk, length));
}
+#endif
};
/*
@@ -675,6 +691,7 @@ public:
sizeof(kmp_hier_top_unit_t<T>) * max);
for (int j = 0; j < max; ++j) {
layers[i][j].active = 0;
+ layers[i][j].hier_pr.flags.use_hier = TRUE;
}
}
valid = true;
@@ -875,6 +892,7 @@ public:
int get_top_level_nproc() const { return top_level_nproc; }
// Return whether this hierarchy is valid or not
bool is_valid() const { return valid; }
+#ifdef KMP_DEBUG
// Print the hierarchy
void print() {
KD_TRACE(10, ("kmp_hier_t:\n"));
@@ -889,6 +907,7 @@ public:
}
}
}
+#endif
};
template <typename T>
@@ -898,8 +917,6 @@ void __kmp_dispatch_init_hierarchy(ident_t *loc, int n,
typename traits_t<T>::signed_t *new_chunks,
T lb, T ub,
typename traits_t<T>::signed_t st) {
- typedef typename traits_t<T>::signed_t ST;
- typedef typename traits_t<T>::unsigned_t UT;
int tid, gtid, num_hw_threads, num_threads_per_layer1, active;
int my_buffer_index;
kmp_info_t *th;
@@ -924,31 +941,30 @@ void __kmp_dispatch_init_hierarchy(ident_t *loc, int n,
KMP_DEBUG_ASSERT(new_chunks);
if (!TCR_4(__kmp_init_parallel))
__kmp_parallel_initialize();
+ __kmp_resume_if_soft_paused();
+
th = __kmp_threads[gtid];
team = th->th.th_team;
active = !team->t.t_serialized;
th->th.th_ident = loc;
num_hw_threads = __kmp_hier_max_units[kmp_hier_layer_e::LAYER_THREAD + 1];
+ KMP_DEBUG_ASSERT(th->th.th_dispatch ==
+ &th->th.th_team->t.t_dispatch[th->th.th_info.ds.ds_tid]);
+ my_buffer_index = th->th.th_dispatch->th_disp_index;
+ pr = reinterpret_cast<dispatch_private_info_template<T> *>(
+ &th->th.th_dispatch
+ ->th_disp_buffer[my_buffer_index % __kmp_dispatch_num_buffers]);
+ sh = reinterpret_cast<dispatch_shared_info_template<T> volatile *>(
+ &team->t.t_disp_buffer[my_buffer_index % __kmp_dispatch_num_buffers]);
if (!active) {
KD_TRACE(10, ("__kmp_dispatch_init_hierarchy: T#%d not active parallel. "
"Using normal dispatch functions.\n",
gtid));
- pr = reinterpret_cast<dispatch_private_info_template<T> *>(
- th->th.th_dispatch->th_disp_buffer);
KMP_DEBUG_ASSERT(pr);
pr->flags.use_hier = FALSE;
pr->flags.contains_last = FALSE;
return;
}
- KMP_DEBUG_ASSERT(th->th.th_dispatch ==
- &th->th.th_team->t.t_dispatch[th->th.th_info.ds.ds_tid]);
-
- my_buffer_index = th->th.th_dispatch->th_disp_index;
- pr = reinterpret_cast<dispatch_private_info_template<T> *>(
- &th->th.th_dispatch
- ->th_disp_buffer[my_buffer_index % __kmp_dispatch_num_buffers]);
- sh = reinterpret_cast<dispatch_shared_info_template<T> volatile *>(
- &team->t.t_disp_buffer[my_buffer_index % __kmp_dispatch_num_buffers]);
KMP_DEBUG_ASSERT(pr);
KMP_DEBUG_ASSERT(sh);
pr->flags.use_hier = TRUE;
diff --git a/runtime/src/kmp_environment.cpp b/runtime/src/kmp_environment.cpp
index 22c2941133e1..51bc3cf45589 100644
--- a/runtime/src/kmp_environment.cpp
+++ b/runtime/src/kmp_environment.cpp
@@ -4,10 +4,9 @@
//===----------------------------------------------------------------------===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.txt for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/runtime/src/kmp_environment.h b/runtime/src/kmp_environment.h
index 474aa3495555..76a9672f3240 100644
--- a/runtime/src/kmp_environment.h
+++ b/runtime/src/kmp_environment.h
@@ -4,10 +4,9 @@
//===----------------------------------------------------------------------===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.txt for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/runtime/src/kmp_error.cpp b/runtime/src/kmp_error.cpp
index 1a708b58758e..b30b26e3ab2b 100644
--- a/runtime/src/kmp_error.cpp
+++ b/runtime/src/kmp_error.cpp
@@ -4,10 +4,9 @@
//===----------------------------------------------------------------------===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.txt for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -29,10 +28,8 @@ static char const *cons_text_c[] = {
"\"sections\"",
"work-sharing", /* this is not called "single" because of lowering of
"sections" pragmas */
- "\"taskq\"", "\"taskq\"", "\"taskq ordered\"", "\"critical\"",
- "\"ordered\"", /* in PARALLEL */
+ "\"critical\"", "\"ordered\"", /* in PARALLEL */
"\"ordered\"", /* in PDO */
- "\"ordered\"", /* in TASKQ */
"\"master\"", "\"reduce\"", "\"barrier\""};
#define get_src(ident) ((ident) == NULL ? NULL : (ident)->psource)
@@ -215,9 +212,7 @@ void __kmp_check_workshare(int gtid, enum cons_type ct, ident_t const *ident) {
if (p->stack_top >= p->stack_size) {
__kmp_expand_cons_stack(gtid, p);
}
- if (p->w_top > p->p_top &&
- !(IS_CONS_TYPE_TASKQ(p->stack_data[p->w_top].type) &&
- IS_CONS_TYPE_TASKQ(ct))) {
+ if (p->w_top > p->p_top) {
// We are already in a WORKSHARE construct for this PARALLEL region.
__kmp_error_construct2(kmp_i18n_msg_CnsInvalidNesting, ct, ident,
&p->stack_data[p->w_top]);
@@ -258,8 +253,7 @@ __kmp_check_sync( int gtid, enum cons_type ct, ident_t const * ident, kmp_user_l
if (p->stack_top >= p->stack_size)
__kmp_expand_cons_stack(gtid, p);
- if (ct == ct_ordered_in_parallel || ct == ct_ordered_in_pdo ||
- ct == ct_ordered_in_taskq) {
+ if (ct == ct_ordered_in_parallel || ct == ct_ordered_in_pdo) {
if (p->w_top <= p->p_top) {
/* we are not in a worksharing construct */
#ifdef BUILD_PARALLEL_ORDERED
@@ -271,13 +265,8 @@ __kmp_check_sync( int gtid, enum cons_type ct, ident_t const * ident, kmp_user_l
} else {
/* inside a WORKSHARING construct for this PARALLEL region */
if (!IS_CONS_TYPE_ORDERED(p->stack_data[p->w_top].type)) {
- if (p->stack_data[p->w_top].type == ct_taskq) {
- __kmp_error_construct2(kmp_i18n_msg_CnsNotInTaskConstruct, ct, ident,
- &p->stack_data[p->w_top]);
- } else {
- __kmp_error_construct2(kmp_i18n_msg_CnsNoOrderedClause, ct, ident,
- &p->stack_data[p->w_top]);
- }
+ __kmp_error_construct2(kmp_i18n_msg_CnsNoOrderedClause, ct, ident,
+ &p->stack_data[p->w_top]);
}
}
if (p->s_top > p->p_top && p->s_top > p->w_top) {
@@ -289,10 +278,8 @@ __kmp_check_sync( int gtid, enum cons_type ct, ident_t const * ident, kmp_user_l
if (stack_type == ct_critical ||
((stack_type == ct_ordered_in_parallel ||
- stack_type == ct_ordered_in_pdo ||
- stack_type ==
- ct_ordered_in_taskq) && /* C doesn't allow named ordered;
- ordered in ordered gets error */
+ stack_type == ct_ordered_in_pdo) &&
+ /* C doesn't allow named ordered; ordered in ordered gets error */
p->stack_data[index].ident != NULL &&
(p->stack_data[index].ident->flags & KMP_IDENT_KMPC))) {
/* we are in ORDERED which is inside an ORDERED or CRITICAL construct */
@@ -400,9 +387,8 @@ enum cons_type __kmp_pop_workshare(int gtid, enum cons_type ct,
if (tos != p->w_top ||
(p->stack_data[tos].type != ct &&
- // below are two exceptions to the rule that construct types must match
- !(p->stack_data[tos].type == ct_pdo_ordered && ct == ct_pdo) &&
- !(p->stack_data[tos].type == ct_task_ordered && ct == ct_task))) {
+ // below is the exception to the rule that construct types must match
+ !(p->stack_data[tos].type == ct_pdo_ordered && ct == ct_pdo))) {
__kmp_check_null_func();
__kmp_error_construct2(kmp_i18n_msg_CnsExpectedEnd, ct, ident,
&p->stack_data[tos]);
diff --git a/runtime/src/kmp_error.h b/runtime/src/kmp_error.h
index e1bf8176fab3..fe6fd34299a2 100644
--- a/runtime/src/kmp_error.h
+++ b/runtime/src/kmp_error.h
@@ -4,10 +4,9 @@
//===----------------------------------------------------------------------===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.txt for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/runtime/src/kmp_ftn_cdecl.cpp b/runtime/src/kmp_ftn_cdecl.cpp
index 702fd0d628c4..cf1d429a915c 100644
--- a/runtime/src/kmp_ftn_cdecl.cpp
+++ b/runtime/src/kmp_ftn_cdecl.cpp
@@ -4,10 +4,9 @@
//===----------------------------------------------------------------------===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.txt for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/runtime/src/kmp_ftn_entry.h b/runtime/src/kmp_ftn_entry.h
index c08e31b034dd..e480e0151e1c 100644
--- a/runtime/src/kmp_ftn_entry.h
+++ b/runtime/src/kmp_ftn_entry.h
@@ -4,10 +4,9 @@
//===----------------------------------------------------------------------===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.txt for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -21,11 +20,9 @@
#include "kmp_i18n.h"
-#if OMP_50_ENABLED
// For affinity format functions
#include "kmp_io.h"
#include "kmp_str.h"
-#endif
#if OMPT_SUPPORT
#include "ompt-specific.h"
@@ -350,7 +347,6 @@ int FTN_STDCALL KMP_EXPAND_NAME(FTN_GET_MAX_THREADS)(void) {
#endif
}
-#if OMP_50_ENABLED
int FTN_STDCALL FTN_CONTROL_TOOL(int command, int modifier, void *arg) {
#if defined(KMP_STUB) || !OMPT_SUPPORT
return -2;
@@ -369,35 +365,36 @@ int FTN_STDCALL FTN_CONTROL_TOOL(int command, int modifier, void *arg) {
}
/* OpenMP 5.0 Memory Management support */
-void FTN_STDCALL FTN_SET_DEFAULT_ALLOCATOR(const omp_allocator_t *allocator) {
-#ifndef KMP_STUB
- __kmpc_set_default_allocator(__kmp_entry_gtid(), allocator);
-#endif
-}
-const omp_allocator_t *FTN_STDCALL FTN_GET_DEFAULT_ALLOCATOR(void) {
+omp_allocator_handle_t FTN_STDCALL
+FTN_INIT_ALLOCATOR(omp_memspace_handle_t KMP_DEREF m, int KMP_DEREF ntraits,
+ omp_alloctrait_t tr[]) {
#ifdef KMP_STUB
return NULL;
#else
- return __kmpc_get_default_allocator(__kmp_entry_gtid());
+ return __kmpc_init_allocator(__kmp_entry_gtid(), KMP_DEREF m,
+ KMP_DEREF ntraits, tr);
#endif
}
-void *FTN_STDCALL FTN_ALLOC(size_t size, const omp_allocator_t *allocator) {
-#ifdef KMP_STUB
- return malloc(size);
-#else
- return __kmpc_alloc(__kmp_entry_gtid(), size, allocator);
+
+void FTN_STDCALL FTN_DESTROY_ALLOCATOR(omp_allocator_handle_t al) {
+#ifndef KMP_STUB
+ __kmpc_destroy_allocator(__kmp_entry_gtid(), al);
#endif
}
-void FTN_STDCALL FTN_FREE(void *ptr, const omp_allocator_t *allocator) {
+void FTN_STDCALL FTN_SET_DEFAULT_ALLOCATOR(omp_allocator_handle_t al) {
+#ifndef KMP_STUB
+ __kmpc_set_default_allocator(__kmp_entry_gtid(), al);
+#endif
+}
+omp_allocator_handle_t FTN_STDCALL FTN_GET_DEFAULT_ALLOCATOR(void) {
#ifdef KMP_STUB
- free(ptr);
+ return NULL;
#else
- __kmpc_free(__kmp_entry_gtid(), ptr, allocator);
+ return __kmpc_get_default_allocator(__kmp_entry_gtid());
#endif
}
/* OpenMP 5.0 affinity format support */
-
#ifndef KMP_STUB
static void __kmp_fortran_strncpy_truncate(char *buffer, size_t buf_size,
char const *csrc, size_t csrc_size) {
@@ -526,7 +523,6 @@ size_t FTN_STDCALL FTN_CAPTURE_AFFINITY(char *buffer, char const *format,
return num_required;
#endif
}
-#endif /* OMP_50_ENABLED */
int FTN_STDCALL KMP_EXPAND_NAME(FTN_GET_THREAD_NUM)(void) {
#ifdef KMP_STUB
@@ -596,6 +592,7 @@ int FTN_STDCALL KMP_EXPAND_NAME(FTN_GET_NUM_PROCS)(void) {
}
void FTN_STDCALL KMP_EXPAND_NAME(FTN_SET_NESTED)(int KMP_DEREF flag) {
+ KMP_INFORM(APIDeprecated, "omp_set_nested", "omp_set_max_active_levels");
#ifdef KMP_STUB
__kmps_set_nested(KMP_DEREF flag);
#else
@@ -603,17 +600,22 @@ void FTN_STDCALL KMP_EXPAND_NAME(FTN_SET_NESTED)(int KMP_DEREF flag) {
/* For the thread-private internal controls implementation */
thread = __kmp_entry_thread();
__kmp_save_internal_controls(thread);
- set__nested(thread, ((KMP_DEREF flag) ? TRUE : FALSE));
+ // Somewhat arbitrarily decide where to get a value for max_active_levels
+ int max_active_levels = get__max_active_levels(thread);
+ if (max_active_levels == 1)
+ max_active_levels = KMP_MAX_ACTIVE_LEVELS_LIMIT;
+ set__max_active_levels(thread, (KMP_DEREF flag) ? max_active_levels : 1);
#endif
}
int FTN_STDCALL KMP_EXPAND_NAME(FTN_GET_NESTED)(void) {
+ KMP_INFORM(APIDeprecated, "omp_get_nested", "omp_get_max_active_levels");
#ifdef KMP_STUB
return __kmps_get_nested();
#else
kmp_info_t *thread;
thread = __kmp_entry_thread();
- return get__nested(thread);
+ return get__max_active_levels(thread) > 1;
#endif
}
@@ -645,7 +647,6 @@ int FTN_STDCALL KMP_EXPAND_NAME(FTN_IN_PARALLEL)(void) {
return 0;
#else
kmp_info_t *th = __kmp_entry_thread();
-#if OMP_40_ENABLED
if (th->th.th_teams_microtask) {
// AC: r_in_parallel does not work inside teams construct where real
// parallel is inactive, but all threads have same root, so setting it in
@@ -653,7 +654,6 @@ int FTN_STDCALL KMP_EXPAND_NAME(FTN_IN_PARALLEL)(void) {
// The solution is to use per-team nesting level
return (th->th.th_team->t.t_active_level ? 1 : 0);
} else
-#endif /* OMP_40_ENABLED */
return (th->th.th_root->r.r_in_parallel ? FTN_TRUE : FTN_FALSE);
#endif
}
@@ -735,11 +735,15 @@ int FTN_STDCALL KMP_EXPAND_NAME(FTN_GET_THREAD_LIMIT)(void) {
#ifdef KMP_STUB
return 1; // TO DO: clarify whether it returns 1 or 0?
#else
+ int gtid;
+ kmp_info_t *thread;
if (!__kmp_init_serial) {
__kmp_serial_initialize();
}
- /* global ICV */
- return __kmp_cg_max_nth;
+
+ gtid = __kmp_entry_gtid();
+ thread = __kmp_threads[gtid];
+ return thread->th.th_current_task->td_icvs.thread_limit;
#endif
}
@@ -754,8 +758,6 @@ int FTN_STDCALL KMP_EXPAND_NAME(FTN_IN_FINAL)(void) {
#endif
}
-#if OMP_40_ENABLED
-
kmp_proc_bind_t FTN_STDCALL KMP_EXPAND_NAME(FTN_GET_PROC_BIND)(void) {
#ifdef KMP_STUB
return __kmps_get_proc_bind();
@@ -764,7 +766,6 @@ kmp_proc_bind_t FTN_STDCALL KMP_EXPAND_NAME(FTN_GET_PROC_BIND)(void) {
#endif
}
-#if OMP_45_ENABLED
int FTN_STDCALL KMP_EXPAND_NAME(FTN_GET_NUM_PLACES)(void) {
#if defined(KMP_STUB) || !KMP_AFFINITY_SUPPORTED
return 0;
@@ -902,7 +903,6 @@ void
}
#endif
}
-#endif
int FTN_STDCALL KMP_EXPAND_NAME(FTN_GET_NUM_TEAMS)(void) {
#ifdef KMP_STUB
@@ -962,11 +962,6 @@ int FTN_STDCALL KMP_EXPAND_NAME(FTN_IS_INITIAL_DEVICE)(void) {
return 1; // This is the host
}
-#endif // OMP_40_ENABLED
-
-#if OMP_45_ENABLED
-// OpenMP 4.5 entries
-
// libomptarget, if loaded, provides this function
int FTN_STDCALL FTN_GET_INITIAL_DEVICE(void) KMP_WEAK_ATTRIBUTE;
int FTN_STDCALL FTN_GET_INITIAL_DEVICE(void) {
@@ -1015,7 +1010,6 @@ int FTN_STDCALL FTN_TARGET_DISASSOCIATE_PTR(void *host_ptr, int device_num) {
return -1;
}
#endif // defined(KMP_STUB)
-#endif // OMP_45_ENABLED
#ifdef KMP_STUB
typedef enum { UNINIT = -1, UNLOCKED, LOCKED } kmp_stub_lock_t;
@@ -1288,7 +1282,6 @@ void FTN_STDCALL FTN_SET_DEFAULTS(char const *str
/* ------------------------------------------------------------------------ */
-#if OMP_40_ENABLED
/* returns the status of cancellation */
int FTN_STDCALL KMP_EXPAND_NAME(FTN_GET_CANCELLATION)(void) {
#ifdef KMP_STUB
@@ -1310,9 +1303,6 @@ int FTN_STDCALL FTN_GET_CANCELLATION_STATUS(int cancel_kind) {
#endif
}
-#endif // OMP_40_ENABLED
-
-#if OMP_45_ENABLED
/* returns the maximum allowed task priority */
int FTN_STDCALL KMP_EXPAND_NAME(FTN_GET_MAX_TASK_PRIORITY)(void) {
#ifdef KMP_STUB
@@ -1324,15 +1314,62 @@ int FTN_STDCALL KMP_EXPAND_NAME(FTN_GET_MAX_TASK_PRIORITY)(void) {
return __kmp_max_task_priority;
#endif
}
-#endif
-#if OMP_50_ENABLED
// This function will be defined in libomptarget. When libomptarget is not
// loaded, we assume we are on the host and return KMP_HOST_DEVICE.
// Compiler/libomptarget will handle this if called inside target.
int FTN_STDCALL FTN_GET_DEVICE_NUM(void) KMP_WEAK_ATTRIBUTE;
int FTN_STDCALL FTN_GET_DEVICE_NUM(void) { return KMP_HOST_DEVICE; }
-#endif // OMP_50_ENABLED
+
+// Compiler will ensure that this is only called from host in sequential region
+int FTN_STDCALL FTN_PAUSE_RESOURCE(kmp_pause_status_t kind, int device_num) {
+#ifdef KMP_STUB
+ return 1; // just fail
+#else
+ if (device_num == KMP_HOST_DEVICE)
+ return __kmpc_pause_resource(kind);
+ else {
+#if !KMP_OS_WINDOWS
+ int (*fptr)(kmp_pause_status_t, int);
+ if ((*(void **)(&fptr) = dlsym(RTLD_DEFAULT, "tgt_pause_resource")))
+ return (*fptr)(kind, device_num);
+ else
+#endif
+ return 1; // just fail if there is no libomptarget
+ }
+#endif
+}
+
+// Compiler will ensure that this is only called from host in sequential region
+int FTN_STDCALL FTN_PAUSE_RESOURCE_ALL(kmp_pause_status_t kind) {
+#ifdef KMP_STUB
+ return 1; // just fail
+#else
+ int fails = 0;
+#if !KMP_OS_WINDOWS
+ int (*fptr)(kmp_pause_status_t, int);
+ if ((*(void **)(&fptr) = dlsym(RTLD_DEFAULT, "tgt_pause_resource")))
+ fails = (*fptr)(kind, KMP_DEVICE_ALL); // pause devices
+#endif
+ fails += __kmpc_pause_resource(kind); // pause host
+ return fails;
+#endif
+}
+
+// Returns the maximum number of nesting levels supported by implementation
+int FTN_STDCALL FTN_GET_SUPPORTED_ACTIVE_LEVELS(void) {
+#ifdef KMP_STUB
+ return 1;
+#else
+ return KMP_MAX_ACTIVE_LEVELS_LIMIT;
+#endif
+}
+
+void FTN_STDCALL FTN_FULFILL_EVENT(kmp_event_t *event) {
+#ifndef KMP_STUB
+ __kmp_fulfill_event(event);
+#endif
+}
// GCC compatibility (versioned symbols)
#ifdef KMP_USE_VERSION_SYMBOLS
@@ -1408,7 +1445,6 @@ KMP_VERSION_SYMBOL(FTN_TEST_NEST_LOCK, 30, "OMP_3.0");
// OMP_3.1 versioned symbol
KMP_VERSION_SYMBOL(FTN_IN_FINAL, 31, "OMP_3.1");
-#if OMP_40_ENABLED
// OMP_4.0 versioned symbols
KMP_VERSION_SYMBOL(FTN_GET_PROC_BIND, 40, "OMP_4.0");
KMP_VERSION_SYMBOL(FTN_GET_NUM_TEAMS, 40, "OMP_4.0");
@@ -1418,9 +1454,7 @@ KMP_VERSION_SYMBOL(FTN_GET_DEFAULT_DEVICE, 40, "OMP_4.0");
KMP_VERSION_SYMBOL(FTN_SET_DEFAULT_DEVICE, 40, "OMP_4.0");
KMP_VERSION_SYMBOL(FTN_IS_INITIAL_DEVICE, 40, "OMP_4.0");
KMP_VERSION_SYMBOL(FTN_GET_NUM_DEVICES, 40, "OMP_4.0");
-#endif /* OMP_40_ENABLED */
-#if OMP_45_ENABLED
// OMP_4.5 versioned symbols
KMP_VERSION_SYMBOL(FTN_GET_MAX_TASK_PRIORITY, 45, "OMP_4.5");
KMP_VERSION_SYMBOL(FTN_GET_NUM_PLACES, 45, "OMP_4.5");
@@ -1430,12 +1464,13 @@ KMP_VERSION_SYMBOL(FTN_GET_PLACE_NUM, 45, "OMP_4.5");
KMP_VERSION_SYMBOL(FTN_GET_PARTITION_NUM_PLACES, 45, "OMP_4.5");
KMP_VERSION_SYMBOL(FTN_GET_PARTITION_PLACE_NUMS, 45, "OMP_4.5");
// KMP_VERSION_SYMBOL(FTN_GET_INITIAL_DEVICE, 45, "OMP_4.5");
-#endif
-#if OMP_50_ENABLED
// OMP_5.0 versioned symbols
// KMP_VERSION_SYMBOL(FTN_GET_DEVICE_NUM, 50, "OMP_5.0");
-#endif
+// KMP_VERSION_SYMBOL(FTN_PAUSE_RESOURCE, 50, "OMP_5.0");
+// KMP_VERSION_SYMBOL(FTN_PAUSE_RESOURCE_ALL, 50, "OMP_5.0");
+// KMP_VERSION_SYMBOL(FTN_GET_SUPPORTED_ACTIVE_LEVELS, 50, "OMP_5.0");
+// KMP_VERSION_SYMBOL(FTN_FULFILL_EVENT, 50, "OMP_5.0");
#endif // KMP_USE_VERSION_SYMBOLS
diff --git a/runtime/src/kmp_ftn_extra.cpp b/runtime/src/kmp_ftn_extra.cpp
index ec27dd6e2422..74b3e96ab300 100644
--- a/runtime/src/kmp_ftn_extra.cpp
+++ b/runtime/src/kmp_ftn_extra.cpp
@@ -4,10 +4,9 @@
//===----------------------------------------------------------------------===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.txt for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/runtime/src/kmp_ftn_os.h b/runtime/src/kmp_ftn_os.h
index 776db392a68d..856479cbe212 100644
--- a/runtime/src/kmp_ftn_os.h
+++ b/runtime/src/kmp_ftn_os.h
@@ -4,10 +4,9 @@
//===----------------------------------------------------------------------===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.txt for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -71,13 +70,9 @@
#define FTN_GET_ANCESTOR_THREAD_NUM omp_get_ancestor_thread_num
#define FTN_GET_TEAM_SIZE omp_get_team_size
#define FTN_IN_FINAL omp_in_final
-// #define FTN_SET_PROC_BIND omp_set_proc_bind
#define FTN_GET_PROC_BIND omp_get_proc_bind
-// #define FTN_CURR_PROC_BIND omp_curr_proc_bind
-#if OMP_40_ENABLED
#define FTN_GET_NUM_TEAMS omp_get_num_teams
#define FTN_GET_TEAM_NUM omp_get_team_num
-#endif
#define FTN_INIT_LOCK omp_init_lock
#if KMP_USE_DYNAMIC_LOCK
#define FTN_INIT_LOCK_WITH_HINT omp_init_lock_with_hint
@@ -99,19 +94,14 @@
#define FTN_GET_WTIME omp_get_wtime
#define FTN_GET_WTICK omp_get_wtick
-#if OMP_40_ENABLED
#define FTN_GET_NUM_DEVICES omp_get_num_devices
#define FTN_GET_DEFAULT_DEVICE omp_get_default_device
#define FTN_SET_DEFAULT_DEVICE omp_set_default_device
#define FTN_IS_INITIAL_DEVICE omp_is_initial_device
-#endif
-#if OMP_40_ENABLED
#define FTN_GET_CANCELLATION omp_get_cancellation
#define FTN_GET_CANCELLATION_STATUS kmp_get_cancellation_status
-#endif
-#if OMP_45_ENABLED
#define FTN_GET_MAX_TASK_PRIORITY omp_get_max_task_priority
#define FTN_GET_NUM_PLACES omp_get_num_places
#define FTN_GET_PLACE_NUM_PROCS omp_get_place_num_procs
@@ -129,20 +119,21 @@
#define FTN_TARGET_ASSOCIATE_PTR omp_target_associate_ptr
#define FTN_TARGET_DISASSOCIATE_PTR omp_target_disassociate_ptr
#endif
-#endif
-#if OMP_50_ENABLED
#define FTN_CONTROL_TOOL omp_control_tool
+#define FTN_INIT_ALLOCATOR omp_init_allocator
+#define FTN_DESTROY_ALLOCATOR omp_destroy_allocator
#define FTN_SET_DEFAULT_ALLOCATOR omp_set_default_allocator
#define FTN_GET_DEFAULT_ALLOCATOR omp_get_default_allocator
-#define FTN_ALLOC omp_alloc
-#define FTN_FREE omp_free
#define FTN_GET_DEVICE_NUM omp_get_device_num
#define FTN_SET_AFFINITY_FORMAT omp_set_affinity_format
#define FTN_GET_AFFINITY_FORMAT omp_get_affinity_format
#define FTN_DISPLAY_AFFINITY omp_display_affinity
#define FTN_CAPTURE_AFFINITY omp_capture_affinity
-#endif
+#define FTN_PAUSE_RESOURCE omp_pause_resource
+#define FTN_PAUSE_RESOURCE_ALL omp_pause_resource_all
+#define FTN_GET_SUPPORTED_ACTIVE_LEVELS omp_get_supported_active_levels
+#define FTN_FULFILL_EVENT omp_fulfill_event
#endif /* KMP_FTN_PLAIN */
@@ -200,13 +191,9 @@
#define FTN_GET_ANCESTOR_THREAD_NUM omp_get_ancestor_thread_num_
#define FTN_GET_TEAM_SIZE omp_get_team_size_
#define FTN_IN_FINAL omp_in_final_
-// #define FTN_SET_PROC_BIND omp_set_proc_bind_
#define FTN_GET_PROC_BIND omp_get_proc_bind_
-// #define FTN_CURR_PROC_BIND omp_curr_proc_bind_
-#if OMP_40_ENABLED
#define FTN_GET_NUM_TEAMS omp_get_num_teams_
#define FTN_GET_TEAM_NUM omp_get_team_num_
-#endif
#define FTN_INIT_LOCK omp_init_lock_
#if KMP_USE_DYNAMIC_LOCK
#define FTN_INIT_LOCK_WITH_HINT omp_init_lock_with_hint_
@@ -228,19 +215,14 @@
#define FTN_GET_WTIME omp_get_wtime_
#define FTN_GET_WTICK omp_get_wtick_
-#if OMP_40_ENABLED
#define FTN_GET_NUM_DEVICES omp_get_num_devices_
#define FTN_GET_DEFAULT_DEVICE omp_get_default_device_
#define FTN_SET_DEFAULT_DEVICE omp_set_default_device_
#define FTN_IS_INITIAL_DEVICE omp_is_initial_device_
-#endif
-#if OMP_40_ENABLED
#define FTN_GET_CANCELLATION omp_get_cancellation_
#define FTN_GET_CANCELLATION_STATUS kmp_get_cancellation_status_
-#endif
-#if OMP_45_ENABLED
#define FTN_GET_MAX_TASK_PRIORITY omp_get_max_task_priority_
#define FTN_GET_NUM_PLACES omp_get_num_places_
#define FTN_GET_PLACE_NUM_PROCS omp_get_place_num_procs_
@@ -258,10 +240,10 @@
#define FTN_TARGET_ASSOCIATE_PTR omp_target_associate_ptr_
#define FTN_TARGET_DISASSOCIATE_PTR omp_target_disassociate_ptr_
#endif
-#endif
-#if OMP_50_ENABLED
#define FTN_CONTROL_TOOL omp_control_tool_
+#define FTN_INIT_ALLOCATOR omp_init_allocator_
+#define FTN_DESTROY_ALLOCATOR omp_destroy_allocator_
#define FTN_SET_DEFAULT_ALLOCATOR omp_set_default_allocator_
#define FTN_GET_DEFAULT_ALLOCATOR omp_get_default_allocator_
#define FTN_ALLOC omp_alloc_
@@ -271,7 +253,10 @@
#define FTN_GET_AFFINITY_FORMAT omp_get_affinity_format_
#define FTN_DISPLAY_AFFINITY omp_display_affinity_
#define FTN_CAPTURE_AFFINITY omp_capture_affinity_
-#endif
+#define FTN_PAUSE_RESOURCE omp_pause_resource_
+#define FTN_PAUSE_RESOURCE_ALL omp_pause_resource_all_
+#define FTN_GET_SUPPORTED_ACTIVE_LEVELS omp_get_supported_active_levels_
+#define FTN_FULFILL_EVENT omp_fulfill_event_
#endif /* KMP_FTN_APPEND */
@@ -329,13 +314,9 @@
#define FTN_GET_ANCESTOR_THREAD_NUM OMP_GET_ANCESTOR_THREAD_NUM
#define FTN_GET_TEAM_SIZE OMP_GET_TEAM_SIZE
#define FTN_IN_FINAL OMP_IN_FINAL
-// #define FTN_SET_PROC_BIND OMP_SET_PROC_BIND
#define FTN_GET_PROC_BIND OMP_GET_PROC_BIND
-// #define FTN_CURR_PROC_BIND OMP_CURR_PROC_BIND
-#if OMP_40_ENABLED
#define FTN_GET_NUM_TEAMS OMP_GET_NUM_TEAMS
#define FTN_GET_TEAM_NUM OMP_GET_TEAM_NUM
-#endif
#define FTN_INIT_LOCK OMP_INIT_LOCK
#if KMP_USE_DYNAMIC_LOCK
#define FTN_INIT_LOCK_WITH_HINT OMP_INIT_LOCK_WITH_HINT
@@ -357,19 +338,14 @@
#define FTN_GET_WTIME OMP_GET_WTIME
#define FTN_GET_WTICK OMP_GET_WTICK
-#if OMP_40_ENABLED
#define FTN_GET_NUM_DEVICES OMP_GET_NUM_DEVICES
#define FTN_GET_DEFAULT_DEVICE OMP_GET_DEFAULT_DEVICE
#define FTN_SET_DEFAULT_DEVICE OMP_SET_DEFAULT_DEVICE
#define FTN_IS_INITIAL_DEVICE OMP_IS_INITIAL_DEVICE
-#endif
-#if OMP_40_ENABLED
#define FTN_GET_CANCELLATION OMP_GET_CANCELLATION
#define FTN_GET_CANCELLATION_STATUS KMP_GET_CANCELLATION_STATUS
-#endif
-#if OMP_45_ENABLED
#define FTN_GET_MAX_TASK_PRIORITY OMP_GET_MAX_TASK_PRIORITY
#define FTN_GET_NUM_PLACES OMP_GET_NUM_PLACES
#define FTN_GET_PLACE_NUM_PROCS OMP_GET_PLACE_NUM_PROCS
@@ -387,20 +363,21 @@
#define FTN_TARGET_ASSOCIATE_PTR OMP_TARGET_ASSOCIATE_PTR
#define FTN_TARGET_DISASSOCIATE_PTR OMP_TARGET_DISASSOCIATE_PTR
#endif
-#endif
-#if OMP_50_ENABLED
#define FTN_CONTROL_TOOL OMP_CONTROL_TOOL
+#define FTN_INIT_ALLOCATOR OMP_INIT_ALLOCATOR
+#define FTN_DESTROY_ALLOCATOR OMP_DESTROY_ALLOCATOR
#define FTN_SET_DEFAULT_ALLOCATOR OMP_SET_DEFAULT_ALLOCATOR
#define FTN_GET_DEFAULT_ALLOCATOR OMP_GET_DEFAULT_ALLOCATOR
-#define FTN_ALLOC OMP_ALLOC
-#define FTN_FREE OMP_FREE
#define FTN_GET_DEVICE_NUM OMP_GET_DEVICE_NUM
#define FTN_SET_AFFINITY_FORMAT OMP_SET_AFFINITY_FORMAT
#define FTN_GET_AFFINITY_FORMAT OMP_GET_AFFINITY_FORMAT
#define FTN_DISPLAY_AFFINITY OMP_DISPLAY_AFFINITY
#define FTN_CAPTURE_AFFINITY OMP_CAPTURE_AFFINITY
-#endif
+#define FTN_PAUSE_RESOURCE OMP_PAUSE_RESOURCE
+#define FTN_PAUSE_RESOURCE_ALL OMP_PAUSE_RESOURCE_ALL
+#define FTN_GET_SUPPORTED_ACTIVE_LEVELS OMP_GET_SUPPORTED_ACTIVE_LEVELS
+#define FTN_FULFILL_EVENT OMP_FULFILL_EVENT
#endif /* KMP_FTN_UPPER */
@@ -458,13 +435,9 @@
#define FTN_GET_ANCESTOR_THREAD_NUM OMP_GET_ANCESTOR_THREAD_NUM_
#define FTN_GET_TEAM_SIZE OMP_GET_TEAM_SIZE_
#define FTN_IN_FINAL OMP_IN_FINAL_
-// #define FTN_SET_PROC_BIND OMP_SET_PROC_BIND_
#define FTN_GET_PROC_BIND OMP_GET_PROC_BIND_
-// #define FTN_CURR_PROC_BIND OMP_CURR_PROC_BIND_
-#if OMP_40_ENABLED
#define FTN_GET_NUM_TEAMS OMP_GET_NUM_TEAMS_
#define FTN_GET_TEAM_NUM OMP_GET_TEAM_NUM_
-#endif
#define FTN_INIT_LOCK OMP_INIT_LOCK_
#if KMP_USE_DYNAMIC_LOCK
#define FTN_INIT_LOCK_WITH_HINT OMP_INIT_LOCK_WITH_HINT_
@@ -486,19 +459,14 @@
#define FTN_GET_WTIME OMP_GET_WTIME_
#define FTN_GET_WTICK OMP_GET_WTICK_
-#if OMP_40_ENABLED
#define FTN_GET_NUM_DEVICES OMP_GET_NUM_DEVICES_
#define FTN_GET_DEFAULT_DEVICE OMP_GET_DEFAULT_DEVICE_
#define FTN_SET_DEFAULT_DEVICE OMP_SET_DEFAULT_DEVICE_
#define FTN_IS_INITIAL_DEVICE OMP_IS_INITIAL_DEVICE_
-#endif
-#if OMP_40_ENABLED
#define FTN_GET_CANCELLATION OMP_GET_CANCELLATION_
#define FTN_GET_CANCELLATION_STATUS KMP_GET_CANCELLATION_STATUS_
-#endif
-#if OMP_45_ENABLED
#define FTN_GET_MAX_TASK_PRIORITY OMP_GET_MAX_TASK_PRIORITY_
#define FTN_GET_NUM_PLACES OMP_GET_NUM_PLACES_
#define FTN_GET_PLACE_NUM_PROCS OMP_GET_PLACE_NUM_PROCS_
@@ -516,10 +484,10 @@
#define FTN_TARGET_ASSOCIATE_PTR OMP_TARGET_ASSOCIATE_PTR_
#define FTN_TARGET_DISASSOCIATE_PTR OMP_TARGET_DISASSOCIATE_PTR_
#endif
-#endif
-#if OMP_50_ENABLED
#define FTN_CONTROL_TOOL OMP_CONTROL_TOOL_
+#define FTN_INIT_ALLOCATOR OMP_INIT_ALLOCATOR_
+#define FTN_DESTROY_ALLOCATOR OMP_DESTROY_ALLOCATOR_
#define FTN_SET_DEFAULT_ALLOCATOR OMP_SET_DEFAULT_ALLOCATOR_
#define FTN_GET_DEFAULT_ALLOCATOR OMP_GET_DEFAULT_ALLOCATOR_
#define FTN_ALLOC OMP_ALLOC_
@@ -529,7 +497,10 @@
#define FTN_GET_AFFINITY_FORMAT OMP_GET_AFFINITY_FORMAT_
#define FTN_DISPLAY_AFFINITY OMP_DISPLAY_AFFINITY_
#define FTN_CAPTURE_AFFINITY OMP_CAPTURE_AFFINITY_
-#endif
+#define FTN_PAUSE_RESOURCE OMP_PAUSE_RESOURCE_
+#define FTN_PAUSE_RESOURCE_ALL OMP_PAUSE_RESOURCE_ALL_
+#define FTN_GET_SUPPORTED_ACTIVE_LEVELS OMP_GET_SUPPORTED_ACTIVE_LEVELS_
+#define FTN_FULFILL_EVENT OMP_FULFILL_EVENT_
#endif /* KMP_FTN_UAPPEND */
@@ -619,8 +590,6 @@
#define KMP_API_NAME_GOMP_TASKYIELD GOMP_taskyield
// All GOMP_4.0 symbols
-// TODO: As of 2013-10-14, none of the GOMP_4.0 functions are implemented in
-// libomp
#define KMP_API_NAME_GOMP_BARRIER_CANCEL GOMP_barrier_cancel
#define KMP_API_NAME_GOMP_CANCEL GOMP_cancel
#define KMP_API_NAME_GOMP_CANCELLATION_POINT GOMP_cancellation_point
diff --git a/runtime/src/kmp_ftn_stdcall.cpp b/runtime/src/kmp_ftn_stdcall.cpp
index ccf95f464ecd..174c21973cac 100644
--- a/runtime/src/kmp_ftn_stdcall.cpp
+++ b/runtime/src/kmp_ftn_stdcall.cpp
@@ -4,10 +4,9 @@
//===----------------------------------------------------------------------===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.txt for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/runtime/src/kmp_global.cpp b/runtime/src/kmp_global.cpp
index 5f38009af8f0..1ec73b82e99c 100644
--- a/runtime/src/kmp_global.cpp
+++ b/runtime/src/kmp_global.cpp
@@ -4,10 +4,9 @@
//===----------------------------------------------------------------------===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.txt for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -63,11 +62,6 @@ int __kmp_version = 0;
std::atomic<kmp_int32> __kmp_team_counter = ATOMIC_VAR_INIT(0);
std::atomic<kmp_int32> __kmp_task_counter = ATOMIC_VAR_INIT(0);
-unsigned int __kmp_init_wait =
- KMP_DEFAULT_INIT_WAIT; /* initial number of spin-tests */
-unsigned int __kmp_next_wait =
- KMP_DEFAULT_NEXT_WAIT; /* susequent number of spin-tests */
-
size_t __kmp_stksize = KMP_DEFAULT_STKSIZE;
#if KMP_USE_MONITOR
size_t __kmp_monitor_stksize = 0; // auto adjust
@@ -133,10 +127,9 @@ int __kmp_dflt_team_nth = 0;
int __kmp_dflt_team_nth_ub = 0;
int __kmp_tp_capacity = 0;
int __kmp_tp_cached = 0;
-int __kmp_dflt_nested = FALSE;
int __kmp_dispatch_num_buffers = KMP_DFLT_DISP_NUM_BUFF;
-int __kmp_dflt_max_active_levels =
- KMP_MAX_ACTIVE_LEVELS_LIMIT; /* max_active_levels limit */
+int __kmp_dflt_max_active_levels = 1; // Nesting off by default
+bool __kmp_dflt_max_active_levels_set = false; // Don't override set value
#if KMP_NESTED_HOT_TEAMS
int __kmp_hot_teams_mode = 0; /* 0 - free extra threads when reduced */
/* 1 - keep extra threads when reduced */
@@ -209,11 +202,9 @@ const char *__kmp_speculative_statsfile = "-";
#endif // KMP_USE_ADAPTIVE_LOCKS
-#if OMP_40_ENABLED
int __kmp_display_env = FALSE;
int __kmp_display_env_verbose = FALSE;
int __kmp_omp_cancellation = FALSE;
-#endif
/* map OMP 3.0 schedule types with our internal schedule types */
enum sched_type __kmp_sch_map[kmp_sched_upper - kmp_sched_lower_ext +
@@ -277,15 +268,10 @@ char *__kmp_cpuinfo_file = NULL;
#endif /* KMP_AFFINITY_SUPPORTED */
-#if OMP_40_ENABLED
kmp_nested_proc_bind_t __kmp_nested_proc_bind = {NULL, 0, 0};
int __kmp_affinity_num_places = 0;
-#endif
-
-#if OMP_50_ENABLED
int __kmp_display_affinity = FALSE;
char *__kmp_affinity_format = NULL;
-#endif // OMP_50_ENABLED
kmp_hws_item_t __kmp_hws_socket = {0, 0};
kmp_hws_item_t __kmp_hws_node = {0, 0};
@@ -295,30 +281,44 @@ kmp_hws_item_t __kmp_hws_proc = {0, 0};
int __kmp_hws_requested = 0;
int __kmp_hws_abs_flag = 0; // absolute or per-item number requested
-#if OMP_40_ENABLED
kmp_int32 __kmp_default_device = 0;
-#endif
kmp_tasking_mode_t __kmp_tasking_mode = tskm_task_teams;
-#if OMP_45_ENABLED
kmp_int32 __kmp_max_task_priority = 0;
kmp_uint64 __kmp_taskloop_min_tasks = 0;
-#endif
-#if OMP_50_ENABLED
int __kmp_memkind_available = 0;
-int __kmp_hbw_mem_available = 0;
-const omp_allocator_t *OMP_NULL_ALLOCATOR = NULL;
-const omp_allocator_t *omp_default_mem_alloc = (const omp_allocator_t *)1;
-const omp_allocator_t *omp_large_cap_mem_alloc = (const omp_allocator_t *)2;
-const omp_allocator_t *omp_const_mem_alloc = (const omp_allocator_t *)3;
-const omp_allocator_t *omp_high_bw_mem_alloc = (const omp_allocator_t *)4;
-const omp_allocator_t *omp_low_lat_mem_alloc = (const omp_allocator_t *)5;
-const omp_allocator_t *omp_cgroup_mem_alloc = (const omp_allocator_t *)6;
-const omp_allocator_t *omp_pteam_mem_alloc = (const omp_allocator_t *)7;
-const omp_allocator_t *omp_thread_mem_alloc = (const omp_allocator_t *)8;
-void *const *__kmp_def_allocator = omp_default_mem_alloc;
-#endif
+omp_allocator_handle_t const omp_null_allocator = NULL;
+omp_allocator_handle_t const omp_default_mem_alloc =
+ (omp_allocator_handle_t const)1;
+omp_allocator_handle_t const omp_large_cap_mem_alloc =
+ (omp_allocator_handle_t const)2;
+omp_allocator_handle_t const omp_const_mem_alloc =
+ (omp_allocator_handle_t const)3;
+omp_allocator_handle_t const omp_high_bw_mem_alloc =
+ (omp_allocator_handle_t const)4;
+omp_allocator_handle_t const omp_low_lat_mem_alloc =
+ (omp_allocator_handle_t const)5;
+omp_allocator_handle_t const omp_cgroup_mem_alloc =
+ (omp_allocator_handle_t const)6;
+omp_allocator_handle_t const omp_pteam_mem_alloc =
+ (omp_allocator_handle_t const)7;
+omp_allocator_handle_t const omp_thread_mem_alloc =
+ (omp_allocator_handle_t const)8;
+omp_allocator_handle_t const kmp_max_mem_alloc =
+ (omp_allocator_handle_t const)1024;
+omp_allocator_handle_t __kmp_def_allocator = omp_default_mem_alloc;
+
+omp_memspace_handle_t const omp_default_mem_space =
+ (omp_memspace_handle_t const)0;
+omp_memspace_handle_t const omp_large_cap_mem_space =
+ (omp_memspace_handle_t const)1;
+omp_memspace_handle_t const omp_const_mem_space =
+ (omp_memspace_handle_t const)2;
+omp_memspace_handle_t const omp_high_bw_mem_space =
+ (omp_memspace_handle_t const)3;
+omp_memspace_handle_t const omp_low_lat_mem_space =
+ (omp_memspace_handle_t const)4;
/* This check ensures that the compiler is passing the correct data type for the
flags formal parameter of the function kmpc_omp_task_alloc(). If the type is
@@ -328,6 +328,7 @@ void *const *__kmp_def_allocator = omp_default_mem_alloc;
KMP_BUILD_ASSERT(sizeof(kmp_tasking_flags_t) == 4);
int __kmp_task_stealing_constraint = 1; /* Constrain task stealing by default */
+int __kmp_enable_task_throttling = 1;
#ifdef DEBUG_SUSPEND
int __kmp_suspend_count = 0;
@@ -396,22 +397,17 @@ int __kmp_env_blocktime = FALSE; /* KMP_BLOCKTIME specified? */
int __kmp_env_checks = FALSE; /* KMP_CHECKS specified? */
int __kmp_env_consistency_check = FALSE; /* KMP_CONSISTENCY_CHECK specified? */
+// From KMP_USE_YIELD:
+// 0 = never yield;
+// 1 = always yield (default);
+// 2 = yield only if oversubscribed
+kmp_int32 __kmp_use_yield = 1;
+// This will be 1 if KMP_USE_YIELD environment variable was set explicitly
+kmp_int32 __kmp_use_yield_exp_set = 0;
+
kmp_uint32 __kmp_yield_init = KMP_INIT_WAIT;
kmp_uint32 __kmp_yield_next = KMP_NEXT_WAIT;
-#if KMP_USE_MONITOR
-kmp_uint32 __kmp_yielding_on = 1;
-#endif
-#if KMP_OS_CNK
-kmp_uint32 __kmp_yield_cycle = 0;
-#else
-kmp_uint32 __kmp_yield_cycle = 1; /* Yield-cycle is on by default */
-#endif
-kmp_int32 __kmp_yield_on_count =
- 10; /* By default, yielding is on for 10 monitor periods. */
-kmp_int32 __kmp_yield_off_count =
- 1; /* By default, yielding is off for 1 monitor periods. */
-
/* ------------------------------------------------------ */
/* STATE mostly syncronized with global lock */
/* data written to rarely by masters, read often by workers */
@@ -426,7 +422,6 @@ kmp_root_t **__kmp_root = NULL;
KMP_ALIGN_CACHE
volatile int __kmp_nth = 0;
volatile int __kmp_all_nth = 0;
-int __kmp_thread_pool_nth = 0;
volatile kmp_info_t *__kmp_thread_pool = NULL;
volatile kmp_team_t *__kmp_team_pool = NULL;
@@ -531,7 +526,9 @@ int _You_must_link_with_Intel_OpenMP_library = 1;
int _You_must_link_with_Microsoft_OpenMP_library = 1;
#endif
-#if OMP_50_ENABLED
kmp_target_offload_kind_t __kmp_target_offload = tgt_default;
-#endif
+
+// OMP Pause Resources
+kmp_pause_status_t __kmp_pause_status = kmp_not_paused;
+
// end of file //
diff --git a/runtime/src/kmp_gsupport.cpp b/runtime/src/kmp_gsupport.cpp
index c1f9bdd24c57..d41e027eb2b0 100644
--- a/runtime/src/kmp_gsupport.cpp
+++ b/runtime/src/kmp_gsupport.cpp
@@ -4,10 +4,9 @@
//===----------------------------------------------------------------------===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.txt for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -119,6 +118,7 @@ int KMP_EXPAND_NAME(KMP_API_NAME_GOMP_SINGLE_START)(void) {
if (!TCR_4(__kmp_init_parallel))
__kmp_parallel_initialize();
+ __kmp_resume_if_soft_paused();
// 3rd parameter == FALSE prevents kmp_enter_single from pushing a
// workshare when USE_CHECKS is defined. We need to avoid the push,
@@ -167,6 +167,7 @@ void *KMP_EXPAND_NAME(KMP_API_NAME_GOMP_SINGLE_COPY_START)(void) {
if (!TCR_4(__kmp_init_parallel))
__kmp_parallel_initialize();
+ __kmp_resume_if_soft_paused();
// If this is the first thread to enter, return NULL. The generated code will
// then call GOMP_single_copy_end() for this thread only, with the
@@ -588,14 +589,10 @@ void KMP_EXPAND_NAME(KMP_API_NAME_GOMP_PARALLEL_END)(void) {
return status; \
}
-#if OMP_45_ENABLED
#define KMP_DOACROSS_FINI(status, gtid) \
if (!status && __kmp_threads[gtid]->th.th_dispatch->th_doacross_flags) { \
__kmpc_doacross_fini(NULL, gtid); \
}
-#else
-#define KMP_DOACROSS_FINI(status, gtid) /* Nothing */
-#endif
#define LOOP_NEXT(func, fini_code) \
int func(long *p_lb, long *p_ub) { \
@@ -651,7 +648,6 @@ LOOP_RUNTIME_START(
LOOP_NEXT(KMP_EXPAND_NAME(KMP_API_NAME_GOMP_LOOP_ORDERED_RUNTIME_NEXT),
{ KMP_DISPATCH_FINI_CHUNK(&loc, gtid); })
-#if OMP_45_ENABLED
#define LOOP_DOACROSS_START(func, schedule) \
bool func(unsigned ncounts, long *counts, long chunk_sz, long *p_lb, \
long *p_ub) { \
@@ -757,7 +753,6 @@ LOOP_DOACROSS_START(
LOOP_DOACROSS_RUNTIME_START(
KMP_EXPAND_NAME(KMP_API_NAME_GOMP_LOOP_DOACROSS_RUNTIME_START),
kmp_sch_runtime)
-#endif // OMP_45_ENABLED
void KMP_EXPAND_NAME(KMP_API_NAME_GOMP_LOOP_END)(void) {
int gtid = __kmp_get_gtid();
@@ -920,7 +915,6 @@ LOOP_RUNTIME_START_ULL(
LOOP_NEXT_ULL(KMP_EXPAND_NAME(KMP_API_NAME_GOMP_LOOP_ULL_ORDERED_RUNTIME_NEXT),
{ KMP_DISPATCH_FINI_CHUNK_ULL(&loc, gtid); })
-#if OMP_45_ENABLED
#define LOOP_DOACROSS_START_ULL(func, schedule) \
int func(unsigned ncounts, unsigned long long *counts, \
unsigned long long chunk_sz, unsigned long long *p_lb, \
@@ -1030,7 +1024,6 @@ LOOP_DOACROSS_START_ULL(
LOOP_DOACROSS_RUNTIME_START_ULL(
KMP_EXPAND_NAME(KMP_API_NAME_GOMP_LOOP_ULL_DOACROSS_RUNTIME_START),
kmp_sch_runtime)
-#endif
// Combined parallel / loop worksharing constructs
//
@@ -1113,12 +1106,8 @@ PARALLEL_LOOP_START(
void KMP_EXPAND_NAME(KMP_API_NAME_GOMP_TASK)(void (*func)(void *), void *data,
void (*copy_func)(void *, void *),
long arg_size, long arg_align,
- bool if_cond, unsigned gomp_flags
-#if OMP_40_ENABLED
- ,
- void **depend
-#endif
- ) {
+ bool if_cond, unsigned gomp_flags,
+ void **depend) {
MKLOC(loc, "GOMP_task");
int gtid = __kmp_entry_gtid();
kmp_int32 flags = 0;
@@ -1169,7 +1158,6 @@ void KMP_EXPAND_NAME(KMP_API_NAME_GOMP_TASK)(void (*func)(void *), void *data,
#endif
if (if_cond) {
-#if OMP_40_ENABLED
if (gomp_flags & 8) {
KMP_ASSERT(depend);
const size_t ndeps = (kmp_intptr_t)depend[0];
@@ -1184,7 +1172,6 @@ void KMP_EXPAND_NAME(KMP_API_NAME_GOMP_TASK)(void (*func)(void *), void *data,
}
__kmpc_omp_task_with_deps(&loc, gtid, task, ndeps, dep_list, 0, NULL);
} else {
-#endif
__kmpc_omp_task(&loc, gtid, task);
}
} else {
@@ -1369,8 +1356,6 @@ void KMP_EXPAND_NAME(KMP_API_NAME_GOMP_TASKYIELD)(void) {
return;
}
-#if OMP_40_ENABLED // these are new GOMP_4.0 entry points
-
void KMP_EXPAND_NAME(KMP_API_NAME_GOMP_PARALLEL)(void (*task)(void *),
void *data,
unsigned num_threads,
@@ -1537,11 +1522,7 @@ void KMP_EXPAND_NAME(KMP_API_NAME_GOMP_TASKGROUP_END)(void) {
return;
}
-#ifndef KMP_DEBUG
-static
-#endif /* KMP_DEBUG */
- kmp_int32
- __kmp_gomp_to_omp_cancellation_kind(int gomp_kind) {
+static kmp_int32 __kmp_gomp_to_omp_cancellation_kind(int gomp_kind) {
kmp_int32 cncl_kind = 0;
switch (gomp_kind) {
case 1:
@@ -1560,71 +1541,49 @@ static
return cncl_kind;
}
+// Return true if cancellation should take place, false otherwise
bool KMP_EXPAND_NAME(KMP_API_NAME_GOMP_CANCELLATION_POINT)(int which) {
- if (__kmp_omp_cancellation) {
- KMP_FATAL(NoGompCancellation);
- }
int gtid = __kmp_get_gtid();
MKLOC(loc, "GOMP_cancellation_point");
- KA_TRACE(20, ("GOMP_cancellation_point: T#%d\n", gtid));
-
+ KA_TRACE(20, ("GOMP_cancellation_point: T#%d which:%d\n", gtid, which));
kmp_int32 cncl_kind = __kmp_gomp_to_omp_cancellation_kind(which);
-
return __kmpc_cancellationpoint(&loc, gtid, cncl_kind);
}
-bool KMP_EXPAND_NAME(KMP_API_NAME_GOMP_BARRIER_CANCEL)(void) {
- if (__kmp_omp_cancellation) {
- KMP_FATAL(NoGompCancellation);
- }
- KMP_FATAL(NoGompCancellation);
- int gtid = __kmp_get_gtid();
- MKLOC(loc, "GOMP_barrier_cancel");
- KA_TRACE(20, ("GOMP_barrier_cancel: T#%d\n", gtid));
-
- return __kmpc_cancel_barrier(&loc, gtid);
-}
-
+// Return true if cancellation should take place, false otherwise
bool KMP_EXPAND_NAME(KMP_API_NAME_GOMP_CANCEL)(int which, bool do_cancel) {
- if (__kmp_omp_cancellation) {
- KMP_FATAL(NoGompCancellation);
- } else {
- return FALSE;
- }
-
int gtid = __kmp_get_gtid();
MKLOC(loc, "GOMP_cancel");
- KA_TRACE(20, ("GOMP_cancel: T#%d\n", gtid));
-
+ KA_TRACE(20, ("GOMP_cancel: T#%d which:%d do_cancel:%d\n", gtid, which,
+ (int)do_cancel));
kmp_int32 cncl_kind = __kmp_gomp_to_omp_cancellation_kind(which);
if (do_cancel == FALSE) {
- return KMP_EXPAND_NAME(KMP_API_NAME_GOMP_CANCELLATION_POINT)(which);
+ return __kmpc_cancellationpoint(&loc, gtid, cncl_kind);
} else {
return __kmpc_cancel(&loc, gtid, cncl_kind);
}
}
+// Return true if cancellation should take place, false otherwise
+bool KMP_EXPAND_NAME(KMP_API_NAME_GOMP_BARRIER_CANCEL)(void) {
+ int gtid = __kmp_get_gtid();
+ KA_TRACE(20, ("GOMP_barrier_cancel: T#%d\n", gtid));
+ return __kmp_barrier_gomp_cancel(gtid);
+}
+
+// Return true if cancellation should take place, false otherwise
bool KMP_EXPAND_NAME(KMP_API_NAME_GOMP_SECTIONS_END_CANCEL)(void) {
- if (__kmp_omp_cancellation) {
- KMP_FATAL(NoGompCancellation);
- }
int gtid = __kmp_get_gtid();
- MKLOC(loc, "GOMP_sections_end_cancel");
KA_TRACE(20, ("GOMP_sections_end_cancel: T#%d\n", gtid));
-
- return __kmpc_cancel_barrier(&loc, gtid);
+ return __kmp_barrier_gomp_cancel(gtid);
}
+// Return true if cancellation should take place, false otherwise
bool KMP_EXPAND_NAME(KMP_API_NAME_GOMP_LOOP_END_CANCEL)(void) {
- if (__kmp_omp_cancellation) {
- KMP_FATAL(NoGompCancellation);
- }
int gtid = __kmp_get_gtid();
- MKLOC(loc, "GOMP_loop_end_cancel");
KA_TRACE(20, ("GOMP_loop_end_cancel: T#%d\n", gtid));
-
- return __kmpc_cancel_barrier(&loc, gtid);
+ return __kmp_barrier_gomp_cancel(gtid);
}
// All target functions are empty as of 2014-05-29
@@ -1654,9 +1613,6 @@ void KMP_EXPAND_NAME(KMP_API_NAME_GOMP_TEAMS)(unsigned int num_teams,
unsigned int thread_limit) {
return;
}
-#endif // OMP_40_ENABLED
-
-#if OMP_45_ENABLED
// Task duplication function which copies src to dest (both are
// preallocated task structures)
@@ -1857,8 +1813,6 @@ void KMP_EXPAND_NAME(KMP_API_NAME_GOMP_DOACROSS_ULL_WAIT)(
va_end(args);
}
-#endif // OMP_45_ENABLED
-
/* The following sections of code create aliases for the GOMP_* functions, then
create versioned symbols using the assembler directive .symver. This is only
pertinent for ELF .so library. The KMP_VERSION_SYMBOL macro is defined in
@@ -1946,7 +1900,6 @@ KMP_VERSION_SYMBOL(KMP_API_NAME_GOMP_LOOP_ULL_STATIC_START, 20, "GOMP_2.0");
KMP_VERSION_SYMBOL(KMP_API_NAME_GOMP_TASKYIELD, 30, "GOMP_3.0");
// GOMP_4.0 versioned symbols
-#if OMP_40_ENABLED
KMP_VERSION_SYMBOL(KMP_API_NAME_GOMP_PARALLEL, 40, "GOMP_4.0");
KMP_VERSION_SYMBOL(KMP_API_NAME_GOMP_PARALLEL_SECTIONS, 40, "GOMP_4.0");
KMP_VERSION_SYMBOL(KMP_API_NAME_GOMP_PARALLEL_LOOP_DYNAMIC, 40, "GOMP_4.0");
@@ -1965,10 +1918,8 @@ KMP_VERSION_SYMBOL(KMP_API_NAME_GOMP_TARGET_DATA, 40, "GOMP_4.0");
KMP_VERSION_SYMBOL(KMP_API_NAME_GOMP_TARGET_END_DATA, 40, "GOMP_4.0");
KMP_VERSION_SYMBOL(KMP_API_NAME_GOMP_TARGET_UPDATE, 40, "GOMP_4.0");
KMP_VERSION_SYMBOL(KMP_API_NAME_GOMP_TEAMS, 40, "GOMP_4.0");
-#endif
// GOMP_4.5 versioned symbols
-#if OMP_45_ENABLED
KMP_VERSION_SYMBOL(KMP_API_NAME_GOMP_TASKLOOP, 45, "GOMP_4.5");
KMP_VERSION_SYMBOL(KMP_API_NAME_GOMP_TASKLOOP_ULL, 45, "GOMP_4.5");
KMP_VERSION_SYMBOL(KMP_API_NAME_GOMP_DOACROSS_POST, 45, "GOMP_4.5");
@@ -1991,7 +1942,6 @@ KMP_VERSION_SYMBOL(KMP_API_NAME_GOMP_LOOP_ULL_DOACROSS_GUIDED_START, 45,
"GOMP_4.5");
KMP_VERSION_SYMBOL(KMP_API_NAME_GOMP_LOOP_ULL_DOACROSS_RUNTIME_START, 45,
"GOMP_4.5");
-#endif
#endif // KMP_USE_VERSION_SYMBOLS
diff --git a/runtime/src/kmp_i18n.cpp b/runtime/src/kmp_i18n.cpp
index 95daac2065eb..53c442715b0b 100644
--- a/runtime/src/kmp_i18n.cpp
+++ b/runtime/src/kmp_i18n.cpp
@@ -4,10 +4,9 @@
//===----------------------------------------------------------------------===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.txt for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/runtime/src/kmp_i18n.h b/runtime/src/kmp_i18n.h
index 56dae2270075..9d79a21bb2df 100644
--- a/runtime/src/kmp_i18n.h
+++ b/runtime/src/kmp_i18n.h
@@ -4,10 +4,9 @@
//===----------------------------------------------------------------------===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.txt for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/runtime/src/kmp_import.cpp b/runtime/src/kmp_import.cpp
index 8ad7d1d1dd46..39d841d9d468 100644
--- a/runtime/src/kmp_import.cpp
+++ b/runtime/src/kmp_import.cpp
@@ -4,10 +4,9 @@
//===----------------------------------------------------------------------===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.txt for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/runtime/src/kmp_io.cpp b/runtime/src/kmp_io.cpp
index 24c6e725aefa..4e6ea6a38a33 100644
--- a/runtime/src/kmp_io.cpp
+++ b/runtime/src/kmp_io.cpp
@@ -4,10 +4,9 @@
//===----------------------------------------------------------------------===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.txt for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/runtime/src/kmp_io.h b/runtime/src/kmp_io.h
index dac7a42e2e4d..49afda59ee6d 100644
--- a/runtime/src/kmp_io.h
+++ b/runtime/src/kmp_io.h
@@ -4,10 +4,9 @@
//===----------------------------------------------------------------------===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.txt for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/runtime/src/kmp_itt.cpp b/runtime/src/kmp_itt.cpp
index 820bb591a0d7..fa286eccad22 100644
--- a/runtime/src/kmp_itt.cpp
+++ b/runtime/src/kmp_itt.cpp
@@ -7,10 +7,9 @@
//===----------------------------------------------------------------------===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.txt for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/runtime/src/kmp_itt.h b/runtime/src/kmp_itt.h
index 2062e01c4b13..b14a19301459 100644
--- a/runtime/src/kmp_itt.h
+++ b/runtime/src/kmp_itt.h
@@ -5,10 +5,9 @@
//===----------------------------------------------------------------------===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.txt for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -220,7 +219,7 @@ __kmp_inline void __kmp_itt_stack_callee_leave(__itt_caller);
with a delay (and not called at all if waiting time is small). So, in spin
loops, do not use KMP_FSYNC_PREPARE(), but use KMP_FSYNC_SPIN_INIT() (before
spin loop), KMP_FSYNC_SPIN_PREPARE() (whithin the spin loop), and
- KMP_FSYNC_SPIN_ACQUIRED(). See KMP_WAIT_YIELD() for example. */
+ KMP_FSYNC_SPIN_ACQUIRED(). See KMP_WAIT() for example. */
#undef KMP_FSYNC_SPIN_INIT
#define KMP_FSYNC_SPIN_INIT(obj, spin) \
diff --git a/runtime/src/kmp_itt.inl b/runtime/src/kmp_itt.inl
index a0789fca2abe..6e37ce0f083c 100644
--- a/runtime/src/kmp_itt.inl
+++ b/runtime/src/kmp_itt.inl
@@ -5,10 +5,9 @@
//===----------------------------------------------------------------------===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.txt for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/runtime/src/kmp_lock.cpp b/runtime/src/kmp_lock.cpp
index c0f228ea421e..78d63c67852d 100644
--- a/runtime/src/kmp_lock.cpp
+++ b/runtime/src/kmp_lock.cpp
@@ -4,10 +4,9 @@
//===----------------------------------------------------------------------===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.txt for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -101,23 +100,12 @@ __kmp_acquire_tas_lock_timed_template(kmp_tas_lock_t *lck, kmp_int32 gtid) {
kmp_uint32 spins;
KMP_FSYNC_PREPARE(lck);
KMP_INIT_YIELD(spins);
- if (TCR_4(__kmp_nth) > (__kmp_avail_proc ? __kmp_avail_proc : __kmp_xproc)) {
- KMP_YIELD(TRUE);
- } else {
- KMP_YIELD_SPIN(spins);
- }
-
kmp_backoff_t backoff = __kmp_spin_backoff_params;
- while (KMP_ATOMIC_LD_RLX(&lck->lk.poll) != tas_free ||
- !__kmp_atomic_compare_store_acq(&lck->lk.poll, tas_free, tas_busy)) {
+ do {
__kmp_spin_backoff(&backoff);
- if (TCR_4(__kmp_nth) >
- (__kmp_avail_proc ? __kmp_avail_proc : __kmp_xproc)) {
- KMP_YIELD(TRUE);
- } else {
- KMP_YIELD_SPIN(spins);
- }
- }
+ KMP_YIELD_OVERSUB_ELSE_SPIN(spins);
+ } while (KMP_ATOMIC_LD_RLX(&lck->lk.poll) != tas_free ||
+ !__kmp_atomic_compare_store_acq(&lck->lk.poll, tas_free, tas_busy));
KMP_FSYNC_ACQUIRED(lck);
return KMP_LOCK_ACQUIRED_FIRST;
}
@@ -170,8 +158,7 @@ int __kmp_release_tas_lock(kmp_tas_lock_t *lck, kmp_int32 gtid) {
KMP_ATOMIC_ST_REL(&lck->lk.poll, KMP_LOCK_FREE(tas));
KMP_MB(); /* Flush all pending memory write invalidates. */
- KMP_YIELD(TCR_4(__kmp_nth) >
- (__kmp_avail_proc ? __kmp_avail_proc : __kmp_xproc));
+ KMP_YIELD_OVERSUB();
return KMP_LOCK_RELEASED;
}
@@ -475,8 +462,7 @@ int __kmp_release_futex_lock(kmp_futex_lock_t *lck, kmp_int32 gtid) {
KA_TRACE(1000, ("__kmp_release_futex_lock: lck:%p(0x%x), T#%d exiting\n", lck,
lck->lk.poll, gtid));
- KMP_YIELD(TCR_4(__kmp_nth) >
- (__kmp_avail_proc ? __kmp_avail_proc : __kmp_xproc));
+ KMP_YIELD_OVERSUB();
return KMP_LOCK_RELEASED;
}
@@ -652,7 +638,7 @@ __kmp_acquire_ticket_lock_timed_template(kmp_ticket_lock_t *lck,
std::memory_order_acquire) == my_ticket) {
return KMP_LOCK_ACQUIRED_FIRST;
}
- KMP_WAIT_YIELD_PTR(&lck->lk.now_serving, my_ticket, __kmp_bakery_check, lck);
+ KMP_WAIT_PTR(&lck->lk.now_serving, my_ticket, __kmp_bakery_check, lck);
return KMP_LOCK_ACQUIRED_FIRST;
}
@@ -1250,10 +1236,9 @@ __kmp_acquire_queuing_lock_timed_template(kmp_queuing_lock_t *lck,
("__kmp_acquire_queuing_lock: lck:%p, T#%d waiting for lock\n",
lck, gtid));
- /* ToDo: May want to consider using __kmp_wait_sleep or something that
- sleeps for throughput only here. */
KMP_MB();
- KMP_WAIT_YIELD(spin_here_p, FALSE, KMP_EQ, lck);
+ // ToDo: Use __kmp_wait_sleep or similar when blocktime != inf
+ KMP_WAIT(spin_here_p, FALSE, KMP_EQ, lck);
#ifdef DEBUG_QUEUING_LOCKS
TRACE_LOCK(gtid + 1, "acq spin");
@@ -1283,8 +1268,8 @@ __kmp_acquire_queuing_lock_timed_template(kmp_queuing_lock_t *lck,
/* Yield if number of threads > number of logical processors */
/* ToDo: Not sure why this should only be in oversubscription case,
maybe should be traditional YIELD_INIT/YIELD_WHEN loop */
- KMP_YIELD(TCR_4(__kmp_nth) >
- (__kmp_avail_proc ? __kmp_avail_proc : __kmp_xproc));
+ KMP_YIELD_OVERSUB();
+
#ifdef DEBUG_QUEUING_LOCKS
TRACE_LOCK(gtid + 1, "acq retry");
#endif
@@ -1463,8 +1448,8 @@ int __kmp_release_queuing_lock(kmp_queuing_lock_t *lck, kmp_int32 gtid) {
KMP_MB();
/* make sure enqueuing thread has time to update next waiting thread
* field */
- *head_id_p = KMP_WAIT_YIELD((volatile kmp_uint32 *)waiting_id_p, 0,
- KMP_NEQ, NULL);
+ *head_id_p =
+ KMP_WAIT((volatile kmp_uint32 *)waiting_id_p, 0, KMP_NEQ, NULL);
#ifdef DEBUG_QUEUING_LOCKS
TRACE_LOCK(gtid + 1, "rel deq: (h,t)->(h',t)");
#endif
@@ -2132,7 +2117,7 @@ static void __kmp_acquire_adaptive_lock(kmp_adaptive_lock_t *lck,
// lock from now on.
while (!__kmp_is_unlocked_queuing_lock(GET_QLK_PTR(lck))) {
KMP_INC_STAT(lck, lemmingYields);
- __kmp_yield(TRUE);
+ KMP_YIELD(TRUE);
}
if (__kmp_test_adaptive_lock_only(lck, gtid))
@@ -2260,23 +2245,14 @@ __kmp_acquire_drdpa_lock_timed_template(kmp_drdpa_lock_t *lck, kmp_int32 gtid) {
// polling area has been reconfigured. Unless it is reconfigured, the
// reloads stay in L1 cache and are cheap.
//
- // Keep this code in sync with KMP_WAIT_YIELD, in kmp_dispatch.cpp !!!
- //
- // The current implementation of KMP_WAIT_YIELD doesn't allow for mask
+ // Keep this code in sync with KMP_WAIT, in kmp_dispatch.cpp !!!
+ // The current implementation of KMP_WAIT doesn't allow for mask
// and poll to be re-read every spin iteration.
kmp_uint32 spins;
-
KMP_FSYNC_PREPARE(lck);
KMP_INIT_YIELD(spins);
while (polls[ticket & mask] < ticket) { // atomic load
- // If we are oversubscribed,
- // or have waited a bit (and KMP_LIBRARY=turnaround), then yield.
- // CPU Pause is in the macros for yield.
- //
- KMP_YIELD(TCR_4(__kmp_nth) >
- (__kmp_avail_proc ? __kmp_avail_proc : __kmp_xproc));
- KMP_YIELD_SPIN(spins);
-
+ KMP_YIELD_OVERSUB_ELSE_SPIN(spins);
// Re-read the mask and the poll pointer from the lock structure.
//
// Make certain that "mask" is read before "polls" !!!
@@ -2808,8 +2784,9 @@ static void __kmp_acquire_rtm_lock(kmp_queuing_lock_t *lck, kmp_int32 gtid) {
}
if ((status & _XABORT_EXPLICIT) && _XABORT_CODE(status) == 0xff) {
// Wait until lock becomes free
- while (!__kmp_is_unlocked_queuing_lock(lck))
- __kmp_yield(TRUE);
+ while (!__kmp_is_unlocked_queuing_lock(lck)) {
+ KMP_YIELD(TRUE);
+ }
} else if (!(status & _XABORT_RETRY))
break;
} while (retries--);
diff --git a/runtime/src/kmp_lock.h b/runtime/src/kmp_lock.h
index 6a88d7bc52af..ccd84eb821d9 100644
--- a/runtime/src/kmp_lock.h
+++ b/runtime/src/kmp_lock.h
@@ -4,10 +4,9 @@
//===----------------------------------------------------------------------===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.txt for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -653,21 +652,11 @@ extern int (*__kmp_acquire_user_lock_with_checks_)(kmp_user_lock_p lck,
kmp_uint32 spins; \
KMP_FSYNC_PREPARE(lck); \
KMP_INIT_YIELD(spins); \
- if (TCR_4(__kmp_nth) > \
- (__kmp_avail_proc ? __kmp_avail_proc : __kmp_xproc)) { \
- KMP_YIELD(TRUE); \
- } else { \
- KMP_YIELD_SPIN(spins); \
- } \
- while (lck->tas.lk.poll != 0 || !__kmp_atomic_compare_store_acq( \
- &lck->tas.lk.poll, 0, gtid + 1)) { \
- if (TCR_4(__kmp_nth) > \
- (__kmp_avail_proc ? __kmp_avail_proc : __kmp_xproc)) { \
- KMP_YIELD(TRUE); \
- } else { \
- KMP_YIELD_SPIN(spins); \
- } \
- } \
+ do { \
+ KMP_YIELD_OVERSUB_ELSE_SPIN(spins); \
+ } while ( \
+ lck->tas.lk.poll != 0 || \
+ !__kmp_atomic_compare_store_acq(&lck->tas.lk.poll, 0, gtid + 1)); \
} \
KMP_FSYNC_ACQUIRED(lck); \
} else { \
@@ -771,22 +760,11 @@ extern int (*__kmp_acquire_nested_user_lock_with_checks_)(kmp_user_lock_p lck,
kmp_uint32 spins; \
KMP_FSYNC_PREPARE(lck); \
KMP_INIT_YIELD(spins); \
- if (TCR_4(__kmp_nth) > \
- (__kmp_avail_proc ? __kmp_avail_proc : __kmp_xproc)) { \
- KMP_YIELD(TRUE); \
- } else { \
- KMP_YIELD_SPIN(spins); \
- } \
- while ( \
+ do { \
+ KMP_YIELD_OVERSUB_ELSE_SPIN(spins); \
+ } while ( \
(lck->tas.lk.poll != 0) || \
- !__kmp_atomic_compare_store_acq(&lck->tas.lk.poll, 0, gtid + 1)) { \
- if (TCR_4(__kmp_nth) > \
- (__kmp_avail_proc ? __kmp_avail_proc : __kmp_xproc)) { \
- KMP_YIELD(TRUE); \
- } else { \
- KMP_YIELD_SPIN(spins); \
- } \
- } \
+ !__kmp_atomic_compare_store_acq(&lck->tas.lk.poll, 0, gtid + 1)); \
} \
lck->tas.lk.depth_locked = 1; \
*depth = KMP_LOCK_ACQUIRED_FIRST; \
diff --git a/runtime/src/kmp_omp.h b/runtime/src/kmp_omp.h
index 8dcb7d2634c0..27b550d1f663 100644
--- a/runtime/src/kmp_omp.h
+++ b/runtime/src/kmp_omp.h
@@ -6,10 +6,9 @@
//===----------------------------------------------------------------------===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.txt for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -107,16 +106,14 @@ typedef struct {
th_task_state; // alternating 0/1 for task team identification
offset_and_size_t th_bar;
offset_and_size_t th_b_worker_arrived; // the worker increases it by 1 when it
-// arrives to the barrier
+ // arrives to the barrier
-#if OMP_40_ENABLED
/* teams information */
offset_and_size_t th_teams_microtask; // entry address for teams construct
offset_and_size_t th_teams_level; // initial level of teams construct
offset_and_size_t th_teams_nteams; // number of teams in a league
offset_and_size_t
th_teams_nth; // number of threads in each team of the league
-#endif
/* kmp_desc structure (for info field above) */
kmp_int32 ds_sizeof_struct;
@@ -136,9 +133,7 @@ typedef struct {
offset_and_size_t t_pkfn;
offset_and_size_t t_task_team; // task team structure
offset_and_size_t t_implicit_task; // taskdata for the thread's implicit task
-#if OMP_40_ENABLED
offset_and_size_t t_cancel_request;
-#endif
offset_and_size_t t_bar;
offset_and_size_t
t_b_master_arrived; // increased by 1 when master arrives to a barrier
@@ -204,7 +199,6 @@ typedef struct {
offset_and_size_t
td_taskwait_thread; // gtid + 1 of thread encountered taskwait
-#if OMP_40_ENABLED
/* Taskgroup */
offset_and_size_t td_taskgroup; // pointer to the current taskgroup
offset_and_size_t
@@ -220,7 +214,6 @@ typedef struct {
offset_and_size_t dn_task;
offset_and_size_t dn_npredecessors;
offset_and_size_t dn_nrefs;
-#endif
offset_and_size_t dn_routine;
/* kmp_thread_data_t */
diff --git a/runtime/src/kmp_os.h b/runtime/src/kmp_os.h
index 3c2426bcae46..c4c7bcf6cc57 100644
--- a/runtime/src/kmp_os.h
+++ b/runtime/src/kmp_os.h
@@ -4,10 +4,9 @@
//===----------------------------------------------------------------------===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.txt for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -40,6 +39,14 @@
#define KMP_MEM_CONS_MODEL KMP_MEM_CONS_VOLATILE
#endif
+#ifndef __has_cpp_attribute
+#define __has_cpp_attribute(x) 0
+#endif
+
+#ifndef __has_attribute
+#define __has_attribute(x) 0
+#endif
+
/* ------------------------- Compiler recognition ---------------------- */
#define KMP_COMPILER_ICC 0
#define KMP_COMPILER_GCC 0
@@ -297,6 +304,20 @@ extern "C" {
#define KMP_CACHE_PREFETCH(ADDR) /* nothing */
+// Define attribute that indicates that the fall through from the previous
+// case label is intentional and should not be diagnosed by a compiler
+// Code from libcxx/include/__config
+// Use a function like macro to imply that it must be followed by a semicolon
+#if __cplusplus > 201402L && __has_cpp_attribute(fallthrough)
+# define KMP_FALLTHROUGH() [[fallthrough]]
+#elif __has_cpp_attribute(clang::fallthrough)
+# define KMP_FALLTHROUGH() [[clang::fallthrough]]
+#elif __has_attribute(fallthough) || __GNUC__ >= 7
+# define KMP_FALLTHROUGH() __attribute__((__fallthrough__))
+#else
+# define KMP_FALLTHROUGH() ((void)0)
+#endif
+
// Define attribute that indicates a function does not return
#if __cplusplus >= 201103L
#define KMP_NORETURN [[noreturn]]
@@ -512,32 +533,56 @@ extern kmp_real64 __kmp_xchg_real64(volatile kmp_real64 *p, kmp_real64 v);
__sync_fetch_and_add((volatile kmp_int32 *)(p), 1)
#define KMP_TEST_THEN_INC_ACQ32(p) \
__sync_fetch_and_add((volatile kmp_int32 *)(p), 1)
+#if KMP_ARCH_MIPS
+#define KMP_TEST_THEN_INC64(p) \
+ __atomic_fetch_add((volatile kmp_int64 *)(p), 1LL, __ATOMIC_SEQ_CST)
+#define KMP_TEST_THEN_INC_ACQ64(p) \
+ __atomic_fetch_add((volatile kmp_int64 *)(p), 1LL, __ATOMIC_SEQ_CST)
+#else
#define KMP_TEST_THEN_INC64(p) \
__sync_fetch_and_add((volatile kmp_int64 *)(p), 1LL)
#define KMP_TEST_THEN_INC_ACQ64(p) \
__sync_fetch_and_add((volatile kmp_int64 *)(p), 1LL)
+#endif
#define KMP_TEST_THEN_ADD4_32(p) \
__sync_fetch_and_add((volatile kmp_int32 *)(p), 4)
#define KMP_TEST_THEN_ADD4_ACQ32(p) \
__sync_fetch_and_add((volatile kmp_int32 *)(p), 4)
+#if KMP_ARCH_MIPS
+#define KMP_TEST_THEN_ADD4_64(p) \
+ __atomic_fetch_add((volatile kmp_int64 *)(p), 4LL, __ATOMIC_SEQ_CST)
+#define KMP_TEST_THEN_ADD4_ACQ64(p) \
+ __atomic_fetch_add((volatile kmp_int64 *)(p), 4LL, __ATOMIC_SEQ_CST)
+#define KMP_TEST_THEN_DEC64(p) \
+ __atomic_fetch_sub((volatile kmp_int64 *)(p), 1LL, __ATOMIC_SEQ_CST)
+#define KMP_TEST_THEN_DEC_ACQ64(p) \
+ __atomic_fetch_sub((volatile kmp_int64 *)(p), 1LL, __ATOMIC_SEQ_CST)
+#else
#define KMP_TEST_THEN_ADD4_64(p) \
__sync_fetch_and_add((volatile kmp_int64 *)(p), 4LL)
#define KMP_TEST_THEN_ADD4_ACQ64(p) \
__sync_fetch_and_add((volatile kmp_int64 *)(p), 4LL)
-#define KMP_TEST_THEN_DEC32(p) \
- __sync_fetch_and_sub((volatile kmp_int32 *)(p), 1)
-#define KMP_TEST_THEN_DEC_ACQ32(p) \
- __sync_fetch_and_sub((volatile kmp_int32 *)(p), 1)
#define KMP_TEST_THEN_DEC64(p) \
__sync_fetch_and_sub((volatile kmp_int64 *)(p), 1LL)
#define KMP_TEST_THEN_DEC_ACQ64(p) \
__sync_fetch_and_sub((volatile kmp_int64 *)(p), 1LL)
+#endif
+#define KMP_TEST_THEN_DEC32(p) \
+ __sync_fetch_and_sub((volatile kmp_int32 *)(p), 1)
+#define KMP_TEST_THEN_DEC_ACQ32(p) \
+ __sync_fetch_and_sub((volatile kmp_int32 *)(p), 1)
#define KMP_TEST_THEN_ADD8(p, v) \
__sync_fetch_and_add((volatile kmp_int8 *)(p), (kmp_int8)(v))
#define KMP_TEST_THEN_ADD32(p, v) \
__sync_fetch_and_add((volatile kmp_int32 *)(p), (kmp_int32)(v))
+#if KMP_ARCH_MIPS
+#define KMP_TEST_THEN_ADD64(p, v) \
+ __atomic_fetch_add((volatile kmp_uint64 *)(p), (kmp_uint64)(v), \
+ __ATOMIC_SEQ_CST)
+#else
#define KMP_TEST_THEN_ADD64(p, v) \
__sync_fetch_and_add((volatile kmp_int64 *)(p), (kmp_int64)(v))
+#endif
#define KMP_TEST_THEN_OR8(p, v) \
__sync_fetch_and_or((volatile kmp_int8 *)(p), (kmp_int8)(v))
@@ -547,10 +592,19 @@ extern kmp_real64 __kmp_xchg_real64(volatile kmp_real64 *p, kmp_real64 v);
__sync_fetch_and_or((volatile kmp_uint32 *)(p), (kmp_uint32)(v))
#define KMP_TEST_THEN_AND32(p, v) \
__sync_fetch_and_and((volatile kmp_uint32 *)(p), (kmp_uint32)(v))
+#if KMP_ARCH_MIPS
+#define KMP_TEST_THEN_OR64(p, v) \
+ __atomic_fetch_or((volatile kmp_uint64 *)(p), (kmp_uint64)(v), \
+ __ATOMIC_SEQ_CST)
+#define KMP_TEST_THEN_AND64(p, v) \
+ __atomic_fetch_and((volatile kmp_uint64 *)(p), (kmp_uint64)(v), \
+ __ATOMIC_SEQ_CST)
+#else
#define KMP_TEST_THEN_OR64(p, v) \
__sync_fetch_and_or((volatile kmp_uint64 *)(p), (kmp_uint64)(v))
#define KMP_TEST_THEN_AND64(p, v) \
__sync_fetch_and_and((volatile kmp_uint64 *)(p), (kmp_uint64)(v))
+#endif
#define KMP_COMPARE_AND_STORE_ACQ8(p, cv, sv) \
__sync_bool_compare_and_swap((volatile kmp_uint8 *)(p), (kmp_uint8)(cv), \
@@ -570,12 +624,6 @@ extern kmp_real64 __kmp_xchg_real64(volatile kmp_real64 *p, kmp_real64 v);
#define KMP_COMPARE_AND_STORE_REL32(p, cv, sv) \
__sync_bool_compare_and_swap((volatile kmp_uint32 *)(p), (kmp_uint32)(cv), \
(kmp_uint32)(sv))
-#define KMP_COMPARE_AND_STORE_ACQ64(p, cv, sv) \
- __sync_bool_compare_and_swap((volatile kmp_uint64 *)(p), (kmp_uint64)(cv), \
- (kmp_uint64)(sv))
-#define KMP_COMPARE_AND_STORE_REL64(p, cv, sv) \
- __sync_bool_compare_and_swap((volatile kmp_uint64 *)(p), (kmp_uint64)(cv), \
- (kmp_uint64)(sv))
#define KMP_COMPARE_AND_STORE_PTR(p, cv, sv) \
__sync_bool_compare_and_swap((void *volatile *)(p), (void *)(cv), \
(void *)(sv))
@@ -589,9 +637,38 @@ extern kmp_real64 __kmp_xchg_real64(volatile kmp_real64 *p, kmp_real64 v);
#define KMP_COMPARE_AND_STORE_RET32(p, cv, sv) \
__sync_val_compare_and_swap((volatile kmp_uint32 *)(p), (kmp_uint32)(cv), \
(kmp_uint32)(sv))
+#if KMP_ARCH_MIPS
+static inline bool mips_sync_bool_compare_and_swap(
+ volatile kmp_uint64 *p, kmp_uint64 cv, kmp_uint64 sv) {
+ return __atomic_compare_exchange(p, &cv, &sv, false, __ATOMIC_SEQ_CST,
+ __ATOMIC_SEQ_CST);
+}
+static inline bool mips_sync_val_compare_and_swap(
+ volatile kmp_uint64 *p, kmp_uint64 cv, kmp_uint64 sv) {
+ __atomic_compare_exchange(p, &cv, &sv, false, __ATOMIC_SEQ_CST,
+ __ATOMIC_SEQ_CST);
+ return cv;
+}
+#define KMP_COMPARE_AND_STORE_ACQ64(p, cv, sv) \
+ mips_sync_bool_compare_and_swap((volatile kmp_uint64 *)(p), (kmp_uint64)(cv),\
+ (kmp_uint64)(sv))
+#define KMP_COMPARE_AND_STORE_REL64(p, cv, sv) \
+ mips_sync_bool_compare_and_swap((volatile kmp_uint64 *)(p), (kmp_uint64)(cv),\
+ (kmp_uint64)(sv))
+#define KMP_COMPARE_AND_STORE_RET64(p, cv, sv) \
+ mips_sync_val_compare_and_swap((volatile kmp_uint64 *)(p), (kmp_uint64)(cv), \
+ (kmp_uint64)(sv))
+#else
+#define KMP_COMPARE_AND_STORE_ACQ64(p, cv, sv) \
+ __sync_bool_compare_and_swap((volatile kmp_uint64 *)(p), (kmp_uint64)(cv), \
+ (kmp_uint64)(sv))
+#define KMP_COMPARE_AND_STORE_REL64(p, cv, sv) \
+ __sync_bool_compare_and_swap((volatile kmp_uint64 *)(p), (kmp_uint64)(cv), \
+ (kmp_uint64)(sv))
#define KMP_COMPARE_AND_STORE_RET64(p, cv, sv) \
__sync_val_compare_and_swap((volatile kmp_uint64 *)(p), (kmp_uint64)(cv), \
(kmp_uint64)(sv))
+#endif
#define KMP_XCHG_FIXED8(p, v) \
__sync_lock_test_and_set((volatile kmp_uint8 *)(p), (kmp_uint8)(v))
@@ -861,8 +938,8 @@ typedef void (*microtask_t)(int *gtid, int *npr, ...);
#define VOLATILE_CAST(x) (x)
#endif
-#define KMP_WAIT_YIELD __kmp_wait_yield_4
-#define KMP_WAIT_YIELD_PTR __kmp_wait_yield_4_ptr
+#define KMP_WAIT __kmp_wait_4
+#define KMP_WAIT_PTR __kmp_wait_4_ptr
#define KMP_EQ __kmp_eq_4
#define KMP_NEQ __kmp_neq_4
#define KMP_LT __kmp_lt_4
@@ -888,9 +965,7 @@ typedef void (*microtask_t)(int *gtid, int *npr, ...);
#endif
// Enable dynamic user lock
-#if OMP_45_ENABLED
#define KMP_USE_DYNAMIC_LOCK 1
-#endif
// Enable Intel(R) Transactional Synchronization Extensions (Intel(R) TSX) if
// dynamic user lock is turned on
diff --git a/runtime/src/kmp_platform.h b/runtime/src/kmp_platform.h
index bb23de03d841..e4f2e06b962c 100644
--- a/runtime/src/kmp_platform.h
+++ b/runtime/src/kmp_platform.h
@@ -4,10 +4,9 @@
//===----------------------------------------------------------------------===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.txt for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/runtime/src/kmp_runtime.cpp b/runtime/src/kmp_runtime.cpp
index 0db376159fc7..7f6c149c792e 100644
--- a/runtime/src/kmp_runtime.cpp
+++ b/runtime/src/kmp_runtime.cpp
@@ -4,10 +4,9 @@
//===----------------------------------------------------------------------===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.txt for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -47,16 +46,8 @@ char const __kmp_version_alt_comp[] =
KMP_VERSION_PREFIX "alternative compiler support: yes";
#endif /* defined(KMP_GOMP_COMPAT) */
-char const __kmp_version_omp_api[] = KMP_VERSION_PREFIX "API version: "
-#if OMP_50_ENABLED
- "5.0 (201611)";
-#elif OMP_45_ENABLED
- "4.5 (201511)";
-#elif OMP_40_ENABLED
- "4.0 (201307)";
-#else
- "3.1 (201107)";
-#endif
+char const __kmp_version_omp_api[] =
+ KMP_VERSION_PREFIX "API version: 5.0 (201611)";
#ifdef KMP_DEBUG
char const __kmp_version_lock[] =
@@ -80,7 +71,7 @@ static void __kmp_initialize_info(kmp_info_t *, kmp_team_t *, int tid,
static void __kmp_initialize_team(kmp_team_t *team, int new_nproc,
kmp_internal_control_t *new_icvs,
ident_t *loc);
-#if OMP_40_ENABLED && KMP_AFFINITY_SUPPORTED
+#if KMP_AFFINITY_SUPPORTED
static void __kmp_partition_places(kmp_team_t *team,
int update_master_only = 0);
#endif
@@ -328,7 +319,7 @@ void __kmp_infinite_loop(void) {
static int done = FALSE;
while (!done) {
- KMP_YIELD(1);
+ KMP_YIELD(TRUE);
}
}
@@ -533,22 +524,10 @@ static void __kmp_print_team_storage_map(const char *header, kmp_team_t *team,
&team->t.t_disp_buffer[num_disp_buff],
sizeof(dispatch_shared_info_t) * num_disp_buff,
"%s_%d.t_disp_buffer", header, team_id);
-
- __kmp_print_storage_map_gtid(-1, &team->t.t_taskq, &team->t.t_copypriv_data,
- sizeof(kmp_taskq_t), "%s_%d.t_taskq", header,
- team_id);
}
-static void __kmp_init_allocator() {
-#if OMP_50_ENABLED
- __kmp_init_memkind();
-#endif
-}
-static void __kmp_fini_allocator() {
-#if OMP_50_ENABLED
- __kmp_fini_memkind();
-#endif
-}
+static void __kmp_init_allocator() { __kmp_init_memkind(); }
+static void __kmp_fini_allocator() { __kmp_fini_memkind(); }
/* ------------------------------------------------------------------------ */
@@ -673,24 +652,6 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpReserved) {
#endif /* KMP_OS_WINDOWS */
#endif /* KMP_DYNAMIC_LIB */
-/* Change the library type to "status" and return the old type */
-/* called from within initialization routines where __kmp_initz_lock is held */
-int __kmp_change_library(int status) {
- int old_status;
-
- old_status = __kmp_yield_init &
- 1; // check whether KMP_LIBRARY=throughput (even init count)
-
- if (status) {
- __kmp_yield_init |= 1; // throughput => turnaround (odd init count)
- } else {
- __kmp_yield_init &= ~1; // turnaround => throughput (even init count)
- }
-
- return old_status; // return previous setting of whether
- // KMP_LIBRARY=throughput
-}
-
/* __kmp_parallel_deo -- Wait until it's our turn. */
void __kmp_parallel_deo(int *gtid_ref, int *cid_ref, ident_t *loc_ref) {
int gtid = *gtid_ref;
@@ -709,8 +670,8 @@ void __kmp_parallel_deo(int *gtid_ref, int *cid_ref, ident_t *loc_ref) {
#ifdef BUILD_PARALLEL_ORDERED
if (!team->t.t_serialized) {
KMP_MB();
- KMP_WAIT_YIELD(&team->t.t_ordered.dt.t_value, __kmp_tid_from_gtid(gtid),
- KMP_EQ, NULL);
+ KMP_WAIT(&team->t.t_ordered.dt.t_value, __kmp_tid_from_gtid(gtid), KMP_EQ,
+ NULL);
KMP_MB();
}
#endif /* BUILD_PARALLEL_ORDERED */
@@ -751,6 +712,7 @@ int __kmp_enter_single(int gtid, ident_t *id_ref, int push_ws) {
if (!TCR_4(__kmp_init_parallel))
__kmp_parallel_initialize();
+ __kmp_resume_if_soft_paused();
th = __kmp_threads[gtid];
team = th->th.th_team;
@@ -773,10 +735,7 @@ int __kmp_enter_single(int gtid, ident_t *id_ref, int push_ws) {
}
#if USE_ITT_BUILD
if (__itt_metadata_add_ptr && __kmp_forkjoin_frames_mode == 3 &&
- KMP_MASTER_GTID(gtid) &&
-#if OMP_40_ENABLED
- th->th.th_teams_microtask == NULL &&
-#endif
+ KMP_MASTER_GTID(gtid) && th->th.th_teams_microtask == NULL &&
team->t.t_active_level ==
1) { // Only report metadata by master of active team at level 1
__kmp_itt_metadata_single(id_ref);
@@ -814,16 +773,13 @@ void __kmp_exit_single(int gtid) {
* otherwise the number of threads to use
* The forkjoin lock is held by the caller. */
static int __kmp_reserve_threads(kmp_root_t *root, kmp_team_t *parent_team,
- int master_tid, int set_nthreads
-#if OMP_40_ENABLED
- ,
- int enter_teams
-#endif /* OMP_40_ENABLED */
- ) {
+ int master_tid, int set_nthreads,
+ int enter_teams) {
int capacity;
int new_nthreads;
KMP_DEBUG_ASSERT(__kmp_init_serial);
KMP_DEBUG_ASSERT(root && parent_team);
+ kmp_info_t *this_thr = parent_team->t.t_threads[master_tid];
// If dyn-var is set, dynamically adjust the number of desired threads,
// according to the method specified by dynamic_mode.
@@ -913,10 +869,12 @@ static int __kmp_reserve_threads(kmp_root_t *root, kmp_team_t *parent_team,
}
// Respect OMP_THREAD_LIMIT
- if (root->r.r_cg_nthreads + new_nthreads -
+ int cg_nthreads = this_thr->th.th_cg_roots->cg_nthreads;
+ int max_cg_threads = this_thr->th.th_cg_roots->cg_thread_limit;
+ if (cg_nthreads + new_nthreads -
(root->r.r_active ? 1 : root->r.r_hot_team->t.t_nproc) >
- __kmp_cg_max_nth) {
- int tl_nthreads = __kmp_cg_max_nth - root->r.r_cg_nthreads +
+ max_cg_threads) {
+ int tl_nthreads = max_cg_threads - cg_nthreads +
(root->r.r_active ? 1 : root->r.r_hot_team->t.t_nproc);
if (tl_nthreads <= 0) {
tl_nthreads = 1;
@@ -1069,11 +1027,9 @@ static void __kmp_fork_team_threads(kmp_root_t *root, kmp_team_t *team,
__kmp_gtid_from_tid(i, team), team->t.t_id, i,
team->t.t_bar[bs_forkjoin_barrier].b_arrived,
team->t.t_bar[bs_plain_barrier].b_arrived));
-#if OMP_40_ENABLED
thr->th.th_teams_microtask = master_th->th.th_teams_microtask;
thr->th.th_teams_level = master_th->th.th_teams_level;
thr->th.th_teams_size = master_th->th.th_teams_size;
-#endif
{ // Initialize threads' barrier data.
int b;
kmp_balign_t *balign = team->t.t_threads[i]->th.th_bar;
@@ -1087,12 +1043,11 @@ static void __kmp_fork_team_threads(kmp_root_t *root, kmp_team_t *team,
}
}
-#if OMP_40_ENABLED && KMP_AFFINITY_SUPPORTED
+#if KMP_AFFINITY_SUPPORTED
__kmp_partition_places(team);
#endif
}
-#if OMP_50_ENABLED
if (__kmp_display_affinity && team->t.t_display_affinity != 1) {
for (i = 0; i < team->t.t_nproc; i++) {
kmp_info_t *thr = team->t.t_threads[i];
@@ -1103,7 +1058,6 @@ static void __kmp_fork_team_threads(kmp_root_t *root, kmp_team_t *team,
}
}
}
-#endif
KMP_MB();
}
@@ -1188,6 +1142,7 @@ void __kmp_serialized_parallel(ident_t *loc, kmp_int32 global_tid) {
if (!TCR_4(__kmp_init_parallel))
__kmp_parallel_initialize();
+ __kmp_resume_if_soft_paused();
this_thr = __kmp_threads[global_tid];
serial_team = this_thr->th.th_serial_team;
@@ -1208,7 +1163,6 @@ void __kmp_serialized_parallel(ident_t *loc, kmp_int32 global_tid) {
this_thr->th.th_task_team = NULL;
}
-#if OMP_40_ENABLED
kmp_proc_bind_t proc_bind = this_thr->th.th_set_proc_bind;
if (this_thr->th.th_current_task->td_icvs.proc_bind == proc_bind_false) {
proc_bind = proc_bind_false;
@@ -1219,7 +1173,6 @@ void __kmp_serialized_parallel(ident_t *loc, kmp_int32 global_tid) {
}
// Reset for next parallel region
this_thr->th.th_set_proc_bind = proc_bind_default;
-#endif /* OMP_40_ENABLED */
#if OMPT_SUPPORT
ompt_data_t ompt_parallel_data = ompt_data_none;
@@ -1254,15 +1207,13 @@ void __kmp_serialized_parallel(ident_t *loc, kmp_int32 global_tid) {
__kmp_acquire_bootstrap_lock(&__kmp_forkjoin_lock);
- new_team = __kmp_allocate_team(this_thr->th.th_root, 1, 1,
+ new_team =
+ __kmp_allocate_team(this_thr->th.th_root, 1, 1,
#if OMPT_SUPPORT
- ompt_parallel_data,
+ ompt_parallel_data,
#endif
-#if OMP_40_ENABLED
- proc_bind,
-#endif
- &this_thr->th.th_current_task->td_icvs,
- 0 USE_NESTED_HOT_ARG(NULL));
+ proc_bind, &this_thr->th.th_current_task->td_icvs,
+ 0 USE_NESTED_