Compare commits
106
Commits
release_80
...
release_90
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b76842ed16 | ||
|
|
c1b1ef1c00 | ||
|
|
07f4283e71 | ||
|
|
cff3557e55 | ||
|
|
0519a2c6b2 | ||
|
|
946967528b | ||
|
|
d4b114904a | ||
|
|
bb2634a97e | ||
|
|
8e626ba79d | ||
|
|
201ba9ed4c | ||
|
|
3a22f66a9b | ||
|
|
0b1328156a | ||
|
|
bbbee1dd60 | ||
|
|
f9ad1a04db | ||
|
|
a31ae2e44a | ||
|
|
0afc673b17 | ||
|
|
4df92eda05 | ||
|
|
79d5d6d37a | ||
|
|
3f381f546e | ||
|
|
e9791d7f37 | ||
|
|
402c7439d7 | ||
|
|
dba741d61d | ||
|
|
6973da5c32 | ||
|
|
74db2a4213 | ||
|
|
48eeef98d8 | ||
|
|
93fe5cefbd | ||
|
|
34def82866 | ||
|
|
926938a039 | ||
|
|
f8e8d598bf | ||
|
|
7481323078 | ||
|
|
9994ae3c1c | ||
|
|
665d5c5112 | ||
|
|
dac3432cdb | ||
|
|
ba56714719 | ||
|
|
9a0d0f00e9 | ||
|
|
a86b5e4738 | ||
|
|
0a3b7b60f6 | ||
|
|
c1985baed2 | ||
|
|
8db7163070 | ||
|
|
fe501ad8d1 | ||
|
|
d5bb0a8d36 | ||
|
|
d140b83ae9 | ||
|
|
e55ab99292 | ||
|
|
aebe831622 | ||
|
|
ae9830cdb8 | ||
|
|
49325fc6ab | ||
|
|
2d4c5f915a | ||
|
|
db75b85d57 | ||
|
|
573fae7275 | ||
|
|
ca840d66bb | ||
|
|
9377fa9653 | ||
|
|
67ef47a8a1 | ||
|
|
03f8ac57f0 | ||
|
|
867a57389a | ||
|
|
777f60f39b | ||
|
|
a76db752a7 | ||
|
|
31b09e96f2 | ||
|
|
6c198765a0 | ||
|
|
c1629ee231 | ||
|
|
cc33e97870 | ||
|
|
e45eef02bb | ||
|
|
258655da08 | ||
|
|
4403c91b6b | ||
|
|
c8db463d1f | ||
|
|
3d280aa419 | ||
|
|
cf0276b9ab | ||
|
|
3e3199a800 | ||
|
|
fe2a27367a | ||
|
|
e6bc0b3edb | ||
|
|
28e31a2d58 | ||
|
|
13cfd61cf5 | ||
|
|
5696c2b695 | ||
|
|
59e2a5754d | ||
|
|
9b5ef0220a | ||
|
|
e7e8b2803e | ||
|
|
922ed1345c | ||
|
|
e0a1fba241 | ||
|
|
6b80cedde4 | ||
|
|
9aa5fc8a74 | ||
|
|
2e429f17a6 | ||
|
|
8453ca8594 | ||
|
|
bbb6f01707 | ||
|
|
acb2548dde | ||
|
|
698a904a22 | ||
|
|
eaaceb40bb | ||
|
|
ebd6a4561f | ||
|
|
85df023bba | ||
|
|
553654650e | ||
|
|
e518cdac15 | ||
|
|
bde568706e | ||
|
|
e85e92b0ff | ||
|
|
41cad1362d | ||
|
|
87a0e3609f | ||
|
|
9d191f041c | ||
|
|
71c5f3cb2f | ||
|
|
2853609484 | ||
|
|
95c11ec5a9 | ||
|
|
c1fe93aaa4 | ||
|
|
f30a96a18f | ||
|
|
4b75f4e92a | ||
|
|
7e084d9fdf | ||
|
|
42bf584150 | ||
|
|
e223da31a4 | ||
|
|
4338c2574e | ||
|
|
da71b1ee45 | ||
|
|
9c08284967 |
+237
-50
@@ -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.
|
||||
|
||||
==============================================================================
|
||||
|
||||
+2
-6
@@ -141,10 +141,6 @@ Options for ``libomp``
|
||||
Intel(R) Many Integrated Core Architecture (Intel(R) MIC Architecture) to
|
||||
build for. This value is ignored if **LIBOMP_ARCH** does not equal ``mic``.
|
||||
|
||||
**LIBOMP_OMP_VERSION** = ``50|45|40|30``
|
||||
OpenMP version to build for. Older versions will disable certain
|
||||
functionality and entry points.
|
||||
|
||||
**LIBOMP_LIB_TYPE** = ``normal|profile|stubs``
|
||||
Library type can be ``normal``, ``profile``, or ``stubs``.
|
||||
|
||||
@@ -192,8 +188,8 @@ Optional Features
|
||||
multi-node systems where a small ``CACHE_LINE`` setting leads to false sharing.
|
||||
|
||||
**LIBOMP_OMPT_SUPPORT** = ``ON|OFF``
|
||||
Include support for the OpenMP Tools Interface (OMPT).
|
||||
This option is supported and ``ON`` by default for x86, x86_64, AArch64, and
|
||||
Include support for the OpenMP Tools Interface (OMPT).
|
||||
This option is supported and ``ON`` by default for x86, x86_64, AArch64, and
|
||||
PPC64 on Linux* and macOS*.
|
||||
This option is ``OFF`` if this feature is not supported for the platform.
|
||||
|
||||
|
||||
@@ -18,8 +18,12 @@ if (NOT OpenMP_Found)
|
||||
set(OpenMP_CXX_FLAGS "-fopenmp")
|
||||
endif()
|
||||
|
||||
set(C_FLAGS ${flags} ${OpenMP_C_FLAGS})
|
||||
set(CXX_FLAGS ${flags} ${OpenMP_CXX_FLAGS})
|
||||
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
|
||||
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
|
||||
find_package(Threads REQUIRED)
|
||||
|
||||
set(C_FLAGS "${OpenMP_C_FLAGS} ${CMAKE_THREAD_LIBS_INIT}")
|
||||
set(CXX_FLAGS "${OpenMP_CXX_FLAGS} ${CMAKE_THREAD_LIBS_INIT}")
|
||||
|
||||
# TODO: Implement blockaddress in GlobalISel and remove this flag!
|
||||
if (CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
||||
|
||||
@@ -120,8 +120,16 @@ else()
|
||||
set(OPENMP_TEST_COMPILER_VERSION "${LLVM_VERSION}")
|
||||
set(OPENMP_TEST_COMPILER_VERSION_MAJOR "${LLVM_MAJOR_VERSION}")
|
||||
set(OPENMP_TEST_COMPILER_VERSION_MAJOR_MINOR "${LLVM_MAJOR_VERSION}.${LLVM_MINOR_VERSION}")
|
||||
# Unfortunately the top-level cmake/config-ix.cmake file mangles CMake's
|
||||
# CMAKE_THREAD_LIBS_INIT variable from the FindThreads package, so work
|
||||
# around that, until it is fixed there.
|
||||
if("${CMAKE_THREAD_LIBS_INIT}" STREQUAL "-lpthread")
|
||||
set(OPENMP_TEST_COMPILER_THREAD_FLAGS "-pthread")
|
||||
else()
|
||||
set(OPENMP_TEST_COMPILER_THREAD_FLAGS "${CMAKE_THREAD_LIBS_INIT}")
|
||||
endif()
|
||||
# TODO: Implement blockaddress in GlobalISel and remove this flag!
|
||||
set(OPENMP_TEST_COMPILER_OPENMP_FLAGS "-fopenmp -fno-experimental-isel")
|
||||
set(OPENMP_TEST_COMPILER_OPENMP_FLAGS "-fopenmp ${OPENMP_TEST_COMPILER_THREAD_FLAGS} -fno-experimental-isel")
|
||||
endif()
|
||||
|
||||
# Function to set compiler features for use in lit.
|
||||
@@ -167,7 +175,7 @@ function(add_openmp_testsuite target comment)
|
||||
add_lit_testsuite(${target}
|
||||
${comment}
|
||||
${ARG_UNPARSED_ARGUMENTS}
|
||||
DEPENDS clang clang-headers FileCheck ${ARG_DEPENDS}
|
||||
DEPENDS clang clang-resource-headers FileCheck ${ARG_DEPENDS}
|
||||
ARGS ${ARG_ARGS}
|
||||
)
|
||||
endif()
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
##===----------------------------------------------------------------------===##
|
||||
#
|
||||
# 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
|
||||
#
|
||||
##===----------------------------------------------------------------------===##
|
||||
#
|
||||
@@ -41,13 +40,17 @@ set (LIBOMPTARGET_ALL_TARGETS "${LIBOMPTARGET_ALL_TARGETS} nvptx64-nvidia-cuda")
|
||||
# the list of supported targets in the current system.
|
||||
set (LIBOMPTARGET_SYSTEM_TARGETS "")
|
||||
|
||||
# If building this library in debug mode, we define a macro to enable
|
||||
# dumping progress messages at runtime.
|
||||
# Check whether using debug mode. In debug mode, allow dumping progress
|
||||
# messages at runtime by default. Otherwise, it can be enabled
|
||||
# independently using the LIBOMPTARGET_ENABLE_DEBUG option.
|
||||
string( TOLOWER "${CMAKE_BUILD_TYPE}" LIBOMPTARGET_CMAKE_BUILD_TYPE)
|
||||
if(LIBOMPTARGET_CMAKE_BUILD_TYPE MATCHES debug)
|
||||
option(LIBOMPTARGET_ENABLE_DEBUG "Allow debug output with the environment variable LIBOMPTARGET_DEBUG=1" ON)
|
||||
else()
|
||||
option(LIBOMPTARGET_ENABLE_DEBUG "Allow debug output with the environment variable LIBOMPTARGET_DEBUG=1" OFF)
|
||||
endif()
|
||||
if(LIBOMPTARGET_ENABLE_DEBUG)
|
||||
add_definitions(-DOMPTARGET_DEBUG)
|
||||
add_definitions(-g)
|
||||
add_definitions(-O0)
|
||||
endif()
|
||||
|
||||
include_directories(include)
|
||||
|
||||
@@ -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
|
||||
#//
|
||||
#//===----------------------------------------------------------------------===//
|
||||
#
|
||||
|
||||
@@ -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
|
||||
#//
|
||||
#//===----------------------------------------------------------------------===//
|
||||
#
|
||||
|
||||
@@ -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
|
||||
#//
|
||||
#//===----------------------------------------------------------------------===//
|
||||
#
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
##===----------------------------------------------------------------------===##
|
||||
#
|
||||
# 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
|
||||
#
|
||||
# ##===----------------------------------------------------------------------===##
|
||||
#
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
##===----------------------------------------------------------------------===##
|
||||
#
|
||||
# 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
|
||||
#
|
||||
##===----------------------------------------------------------------------===##
|
||||
#
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
//===------ cancel.cu - NVPTX OpenMP cancel interface ------------ CUDA -*-===//
|
||||
//
|
||||
// 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
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
//===------ critical.cu - NVPTX OpenMP critical ------------------ CUDA -*-===//
|
||||
//
|
||||
// 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
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
//===----- data_sharing.cu - NVPTX OpenMP debug utilities -------- CUDA -*-===//
|
||||
//
|
||||
// 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
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
//===------------- debug.h - NVPTX OpenMP debug macros ----------- CUDA -*-===//
|
||||
//
|
||||
// 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
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
//===------- interface.h - NVPTX OpenMP interface definitions ---- CUDA -*-===//
|
||||
//
|
||||
// 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
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
@@ -11,8 +10,7 @@
|
||||
//
|
||||
// This file contains all the definitions that are relevant to
|
||||
// the interface. The first section contains the interface as
|
||||
// declared by OpenMP. A second section includes library private calls
|
||||
// (mostly debug, temporary?) The third section includes the compiler
|
||||
// declared by OpenMP. The second section includes the compiler
|
||||
// specific interfaces.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
@@ -201,6 +199,7 @@ typedef void (*kmp_CopyToScratchpadFctPtr)(void *reduceData, void *scratchpad,
|
||||
typedef void (*kmp_LoadReduceFctPtr)(void *reduceData, void *scratchpad,
|
||||
int32_t index, int32_t width,
|
||||
int32_t reduce);
|
||||
typedef void (*kmp_ListGlobalFctPtr)(void *buffer, int idx, void *reduce_data);
|
||||
|
||||
// task defs
|
||||
typedef struct kmp_TaskDescr kmp_TaskDescr;
|
||||
@@ -211,51 +210,14 @@ typedef struct kmp_TaskDescr {
|
||||
int32_t partId; // unused
|
||||
kmp_TaskFctPtr destructors; // destructor of c++ first private
|
||||
} kmp_TaskDescr;
|
||||
// task dep defs
|
||||
#define KMP_TASKDEP_IN 0x1u
|
||||
#define KMP_TASKDEP_OUT 0x2u
|
||||
typedef struct kmp_TaskDep_Public {
|
||||
void *addr;
|
||||
size_t len;
|
||||
uint8_t flags; // bit 0: in, bit 1: out
|
||||
} kmp_TaskDep_Public;
|
||||
|
||||
// flags that interpret the interface part of tasking flags
|
||||
#define KMP_TASK_IS_TIED 0x1
|
||||
#define KMP_TASK_FINAL 0x2
|
||||
#define KMP_TASK_MERGED_IF0 0x4 /* unused */
|
||||
#define KMP_TASK_DESTRUCTOR_THUNK 0x8
|
||||
|
||||
// flags for task setup return
|
||||
#define KMP_CURRENT_TASK_NOT_SUSPENDED 0
|
||||
#define KMP_CURRENT_TASK_SUSPENDED 1
|
||||
|
||||
// sync defs
|
||||
typedef int32_t kmp_CriticalName[8];
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// flags for kstate (all bits initially off)
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// first 2 bits used by kmp_Reduction (defined in kmp_reduction.cpp)
|
||||
#define KMP_REDUCTION_MASK 0x3
|
||||
#define KMP_SKIP_NEXT_CALL 0x4
|
||||
#define KMP_SKIP_NEXT_CANCEL_BARRIER 0x8
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// data
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// external interface
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// query
|
||||
EXTERN int32_t __kmpc_global_num_threads(kmp_Ident *loc); // missing
|
||||
EXTERN int32_t __kmpc_bound_thread_num(kmp_Ident *loc); // missing
|
||||
EXTERN int32_t __kmpc_bound_num_threads(kmp_Ident *loc); // missing
|
||||
EXTERN int32_t __kmpc_in_parallel(kmp_Ident *loc); // missing
|
||||
|
||||
// parallel
|
||||
EXTERN int32_t __kmpc_global_thread_num(kmp_Ident *loc);
|
||||
EXTERN void __kmpc_push_num_threads(kmp_Ident *loc, int32_t global_tid,
|
||||
@@ -411,6 +373,12 @@ EXTERN int32_t __kmpc_nvptx_parallel_reduce_nowait_simple_generic(
|
||||
EXTERN int32_t __kmpc_nvptx_simd_reduce_nowait(
|
||||
int32_t global_tid, int32_t num_vars, size_t reduce_size, void *reduce_data,
|
||||
kmp_ShuffleReductFctPtr shflFct, kmp_InterWarpCopyFctPtr cpyFct);
|
||||
EXTERN int32_t __kmpc_nvptx_teams_reduce_nowait_v2(
|
||||
kmp_Ident *loc, int32_t global_tid, void *global_buffer,
|
||||
int32_t num_of_records, void *reduce_data, kmp_ShuffleReductFctPtr shflFct,
|
||||
kmp_InterWarpCopyFctPtr cpyFct, kmp_ListGlobalFctPtr lgcpyFct,
|
||||
kmp_ListGlobalFctPtr lgredFct, kmp_ListGlobalFctPtr glcpyFct,
|
||||
kmp_ListGlobalFctPtr glredFct);
|
||||
EXTERN int32_t __kmpc_nvptx_teams_reduce_nowait(
|
||||
int32_t global_tid, int32_t num_vars, size_t reduce_size, void *reduce_data,
|
||||
kmp_ShuffleReductFctPtr shflFct, kmp_InterWarpCopyFctPtr cpyFct,
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
//===------------ libcall.cu - NVPTX OpenMP user calls ----------- CUDA -*-===//
|
||||
//
|
||||
// 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
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
@@ -38,51 +37,34 @@ EXTERN void omp_set_num_threads(int num) {
|
||||
PRINT(LD_IO, "call omp_set_num_threads(num %d)\n", num);
|
||||
if (num <= 0) {
|
||||
WARNING0(LW_INPUT, "expected positive num; ignore\n");
|
||||
} else {
|
||||
omptarget_nvptx_TaskDescr *currTaskDescr =
|
||||
getMyTopTaskDescriptor(/*isSPMDExecutionMode=*/false);
|
||||
currTaskDescr->NThreads() = num;
|
||||
} else if (parallelLevel[GetWarpId()] == 0) {
|
||||
nThreads = num;
|
||||
}
|
||||
}
|
||||
|
||||
EXTERN int omp_get_num_threads(void) {
|
||||
bool isSPMDExecutionMode = isSPMDMode();
|
||||
int tid = GetLogicalThreadIdInBlock(isSPMDExecutionMode);
|
||||
int rc =
|
||||
GetNumberOfOmpThreads(tid, isSPMDExecutionMode, isRuntimeUninitialized());
|
||||
int rc = GetNumberOfOmpThreads(isSPMDMode());
|
||||
PRINT(LD_IO, "call omp_get_num_threads() return %d\n", rc);
|
||||
return rc;
|
||||
}
|
||||
|
||||
EXTERN int omp_get_max_threads(void) {
|
||||
if (isRuntimeUninitialized()) {
|
||||
ASSERT0(LT_FUSSY, isSPMDMode(),
|
||||
"Expected SPMD mode only with uninitialized runtime.");
|
||||
if (parallelLevel[GetWarpId()] > 0)
|
||||
// We're already in parallel region.
|
||||
return 1; // default is 1 thread avail
|
||||
}
|
||||
omptarget_nvptx_TaskDescr *currTaskDescr =
|
||||
getMyTopTaskDescriptor(isSPMDMode());
|
||||
int rc = 1; // default is 1 thread avail
|
||||
if (!currTaskDescr->InParallelRegion()) {
|
||||
// Not currently in a parallel region, return what was set.
|
||||
rc = currTaskDescr->NThreads();
|
||||
ASSERT0(LT_FUSSY, rc >= 0, "bad number of threads");
|
||||
}
|
||||
return 1; // default is 1 thread avail
|
||||
// Not currently in a parallel region, return what was set.
|
||||
int rc = 1;
|
||||
if (parallelLevel[GetWarpId()] == 0)
|
||||
rc = nThreads;
|
||||
ASSERT0(LT_FUSSY, rc >= 0, "bad number of threads");
|
||||
PRINT(LD_IO, "call omp_get_max_threads() return %d\n", rc);
|
||||
return rc;
|
||||
}
|
||||
|
||||
EXTERN int omp_get_thread_limit(void) {
|
||||
if (isRuntimeUninitialized()) {
|
||||
ASSERT0(LT_FUSSY, isSPMDMode(),
|
||||
"Expected SPMD mode only with uninitialized runtime.");
|
||||
return 0; // default is 0
|
||||
}
|
||||
// per contention group.. meaning threads in current team
|
||||
omptarget_nvptx_TaskDescr *currTaskDescr =
|
||||
getMyTopTaskDescriptor(isSPMDMode());
|
||||
int rc = currTaskDescr->ThreadLimit();
|
||||
if (isSPMDMode())
|
||||
return GetNumberOfThreadsInBlock();
|
||||
int rc = threadLimit;
|
||||
PRINT(LD_IO, "call omp_get_thread_limit() return %d\n", rc);
|
||||
return rc;
|
||||
}
|
||||
@@ -90,7 +72,7 @@ EXTERN int omp_get_thread_limit(void) {
|
||||
EXTERN int omp_get_thread_num() {
|
||||
bool isSPMDExecutionMode = isSPMDMode();
|
||||
int tid = GetLogicalThreadIdInBlock(isSPMDExecutionMode);
|
||||
int rc = GetOmpThreadId(tid, isSPMDExecutionMode, isRuntimeUninitialized());
|
||||
int rc = GetOmpThreadId(tid, isSPMDExecutionMode);
|
||||
PRINT(LD_IO, "call omp_get_thread_num() returns %d\n", rc);
|
||||
return rc;
|
||||
}
|
||||
@@ -102,18 +84,7 @@ EXTERN int omp_get_num_procs(void) {
|
||||
}
|
||||
|
||||
EXTERN int omp_in_parallel(void) {
|
||||
int rc = 0;
|
||||
if (isRuntimeUninitialized()) {
|
||||
ASSERT0(LT_FUSSY, isSPMDMode(),
|
||||
"Expected SPMD mode only with uninitialized runtime.");
|
||||
rc = 1; // SPMD mode is always in parallel.
|
||||
} else {
|
||||
omptarget_nvptx_TaskDescr *currTaskDescr =
|
||||
getMyTopTaskDescriptor(isSPMDMode());
|
||||
if (currTaskDescr->InParallelRegion()) {
|
||||
rc = 1;
|
||||
}
|
||||
}
|
||||
int rc = parallelLevel[GetWarpId()] > OMP_ACTIVE_PARALLEL_LEVEL ? 1 : 0;
|
||||
PRINT(LD_IO, "call omp_in_parallel() returns %d\n", rc);
|
||||
return rc;
|
||||
}
|
||||
@@ -162,63 +133,28 @@ EXTERN int omp_get_max_active_levels(void) {
|
||||
}
|
||||
|
||||
EXTERN int omp_get_level(void) {
|
||||
if (isRuntimeUninitialized()) {
|
||||
ASSERT0(LT_FUSSY, isSPMDMode(),
|
||||
"Expected SPMD mode only with uninitialized runtime.");
|
||||
return parallelLevel;
|
||||
}
|
||||
int level = 0;
|
||||
omptarget_nvptx_TaskDescr *currTaskDescr =
|
||||
getMyTopTaskDescriptor(isSPMDMode());
|
||||
ASSERT0(LT_FUSSY, currTaskDescr,
|
||||
"do not expect fct to be called in a non-active thread");
|
||||
do {
|
||||
if (currTaskDescr->IsParallelConstruct()) {
|
||||
level++;
|
||||
}
|
||||
currTaskDescr = currTaskDescr->GetPrevTaskDescr();
|
||||
} while (currTaskDescr);
|
||||
int level = parallelLevel[GetWarpId()] & (OMP_ACTIVE_PARALLEL_LEVEL - 1);
|
||||
PRINT(LD_IO, "call omp_get_level() returns %d\n", level);
|
||||
return level;
|
||||
}
|
||||
|
||||
EXTERN int omp_get_active_level(void) {
|
||||
if (isRuntimeUninitialized()) {
|
||||
ASSERT0(LT_FUSSY, isSPMDMode(),
|
||||
"Expected SPMD mode only with uninitialized runtime.");
|
||||
return 1;
|
||||
}
|
||||
int level = 0; // no active level parallelism
|
||||
omptarget_nvptx_TaskDescr *currTaskDescr =
|
||||
getMyTopTaskDescriptor(isSPMDMode());
|
||||
ASSERT0(LT_FUSSY, currTaskDescr,
|
||||
"do not expect fct to be called in a non-active thread");
|
||||
do {
|
||||
if (currTaskDescr->ThreadsInTeam() > 1) {
|
||||
// has a parallel with more than one thread in team
|
||||
level = 1;
|
||||
break;
|
||||
}
|
||||
currTaskDescr = currTaskDescr->GetPrevTaskDescr();
|
||||
} while (currTaskDescr);
|
||||
int level = parallelLevel[GetWarpId()] > OMP_ACTIVE_PARALLEL_LEVEL ? 1 : 0;
|
||||
PRINT(LD_IO, "call omp_get_active_level() returns %d\n", level)
|
||||
return level;
|
||||
}
|
||||
|
||||
EXTERN int omp_get_ancestor_thread_num(int level) {
|
||||
if (isRuntimeUninitialized()) {
|
||||
ASSERT0(LT_FUSSY, isSPMDMode(),
|
||||
"Expected SPMD mode only with uninitialized runtime.");
|
||||
if (isSPMDMode())
|
||||
return level == 1 ? GetThreadIdInBlock() : 0;
|
||||
}
|
||||
int rc = -1;
|
||||
if (level == 0) {
|
||||
rc = 0;
|
||||
} else if (level > 0) {
|
||||
// If level is 0 or all parallel regions are not active - return 0.
|
||||
unsigned parLevel = parallelLevel[GetWarpId()];
|
||||
if (level == 1 && parLevel > OMP_ACTIVE_PARALLEL_LEVEL) {
|
||||
int totLevel = omp_get_level();
|
||||
if (level <= totLevel) {
|
||||
omptarget_nvptx_TaskDescr *currTaskDescr =
|
||||
getMyTopTaskDescriptor(isSPMDMode());
|
||||
getMyTopTaskDescriptor(/*isSPMDExecutionMode=*/false);
|
||||
int steps = totLevel - level;
|
||||
PRINT(LD_IO, "backtrack %d steps\n", steps);
|
||||
ASSERT0(LT_FUSSY, currTaskDescr,
|
||||
@@ -234,9 +170,8 @@ EXTERN int omp_get_ancestor_thread_num(int level) {
|
||||
(currTaskDescr->IsParallelConstruct() ? "par" : "task"),
|
||||
(int)currTaskDescr->InParallelRegion(), (int)sched,
|
||||
currTaskDescr->RuntimeChunkSize(),
|
||||
(int)currTaskDescr->ThreadId(),
|
||||
(int)currTaskDescr->ThreadsInTeam(),
|
||||
(int)currTaskDescr->NThreads());
|
||||
(int)currTaskDescr->ThreadId(), (int)threadsInTeam,
|
||||
(int)nThreads);
|
||||
}
|
||||
|
||||
if (currTaskDescr->IsParallelConstruct()) {
|
||||
@@ -251,6 +186,12 @@ EXTERN int omp_get_ancestor_thread_num(int level) {
|
||||
} while (currTaskDescr);
|
||||
ASSERT0(LT_FUSSY, !steps, "expected to find all steps");
|
||||
}
|
||||
} else if (level == 0 ||
|
||||
(level > 0 && parLevel < OMP_ACTIVE_PARALLEL_LEVEL &&
|
||||
level <= parLevel) ||
|
||||
(level > 1 && parLevel > OMP_ACTIVE_PARALLEL_LEVEL &&
|
||||
level <= (parLevel - OMP_ACTIVE_PARALLEL_LEVEL))) {
|
||||
rc = 0;
|
||||
}
|
||||
PRINT(LD_IO, "call omp_get_ancestor_thread_num(level %d) returns %d\n", level,
|
||||
rc)
|
||||
@@ -258,35 +199,19 @@ EXTERN int omp_get_ancestor_thread_num(int level) {
|
||||
}
|
||||
|
||||
EXTERN int omp_get_team_size(int level) {
|
||||
if (isRuntimeUninitialized()) {
|
||||
ASSERT0(LT_FUSSY, isSPMDMode(),
|
||||
"Expected SPMD mode only with uninitialized runtime.");
|
||||
if (isSPMDMode())
|
||||
return level == 1 ? GetNumberOfThreadsInBlock() : 1;
|
||||
}
|
||||
int rc = -1;
|
||||
if (level == 0) {
|
||||
unsigned parLevel = parallelLevel[GetWarpId()];
|
||||
// If level is 0 or all parallel regions are not active - return 1.
|
||||
if (level == 1 && parLevel > OMP_ACTIVE_PARALLEL_LEVEL) {
|
||||
rc = threadsInTeam;
|
||||
} else if (level == 0 ||
|
||||
(level > 0 && parLevel < OMP_ACTIVE_PARALLEL_LEVEL &&
|
||||
level <= parLevel) ||
|
||||
(level > 1 && parLevel > OMP_ACTIVE_PARALLEL_LEVEL &&
|
||||
level <= (parLevel - OMP_ACTIVE_PARALLEL_LEVEL))) {
|
||||
rc = 1;
|
||||
} else if (level > 0) {
|
||||
int totLevel = omp_get_level();
|
||||
if (level <= totLevel) {
|
||||
omptarget_nvptx_TaskDescr *currTaskDescr =
|
||||
getMyTopTaskDescriptor(isSPMDMode());
|
||||
int steps = totLevel - level;
|
||||
ASSERT0(LT_FUSSY, currTaskDescr,
|
||||
"do not expect fct to be called in a non-active thread");
|
||||
do {
|
||||
if (currTaskDescr->IsParallelConstruct()) {
|
||||
if (!steps) {
|
||||
// found the level
|
||||
rc = currTaskDescr->ThreadsInTeam();
|
||||
break;
|
||||
}
|
||||
steps--;
|
||||
}
|
||||
currTaskDescr = currTaskDescr->GetPrevTaskDescr();
|
||||
} while (currTaskDescr);
|
||||
ASSERT0(LT_FUSSY, !steps, "expected to find all steps");
|
||||
}
|
||||
}
|
||||
PRINT(LD_IO, "call omp_get_team_size(level %d) returns %d\n", level, rc)
|
||||
return rc;
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
//===------------ loop.cu - NVPTX OpenMP loop constructs --------- CUDA -*-===//
|
||||
//
|
||||
// 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
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
@@ -96,17 +95,13 @@ public:
|
||||
INLINE static void for_static_init(int32_t gtid, int32_t schedtype,
|
||||
int32_t *plastiter, T *plower, T *pupper,
|
||||
ST *pstride, ST chunk,
|
||||
bool IsSPMDExecutionMode,
|
||||
bool IsRuntimeUninitialized) {
|
||||
bool IsSPMDExecutionMode) {
|
||||
// When IsRuntimeUninitialized is true, we assume that the caller is
|
||||
// in an L0 parallel region and that all worker threads participate.
|
||||
|
||||
int tid = GetLogicalThreadIdInBlock(IsSPMDExecutionMode);
|
||||
|
||||
// Assume we are in teams region or that we use a single block
|
||||
// per target region
|
||||
ST numberOfActiveOMPThreads = GetNumberOfOmpThreads(
|
||||
tid, IsSPMDExecutionMode, IsRuntimeUninitialized);
|
||||
ST numberOfActiveOMPThreads = GetNumberOfOmpThreads(IsSPMDExecutionMode);
|
||||
|
||||
// All warps that are in excess of the maximum requested, do
|
||||
// not execute the loop
|
||||
@@ -206,11 +201,15 @@ public:
|
||||
INLINE static void dispatch_init(kmp_Ident *loc, int32_t threadId,
|
||||
kmp_sched_t schedule, T lb, T ub, ST st,
|
||||
ST chunk) {
|
||||
ASSERT0(LT_FUSSY, checkRuntimeInitialized(loc),
|
||||
"Expected non-SPMD mode + initialized runtime.");
|
||||
if (checkRuntimeUninitialized(loc)) {
|
||||
// In SPMD mode no need to check parallelism level - dynamic scheduling
|
||||
// may appear only in L2 parallel regions with lightweight runtime.
|
||||
ASSERT0(LT_FUSSY, checkSPMDMode(loc), "Expected non-SPMD mode.");
|
||||
return;
|
||||
}
|
||||
int tid = GetLogicalThreadIdInBlock(checkSPMDMode(loc));
|
||||
omptarget_nvptx_TaskDescr *currTaskDescr = getMyTopTaskDescriptor(tid);
|
||||
T tnum = currTaskDescr->ThreadsInTeam();
|
||||
T tnum = GetNumberOfOmpThreads(checkSPMDMode(loc));
|
||||
T tripCount = ub - lb + 1; // +1 because ub is inclusive
|
||||
ASSERT0(LT_FUSSY, threadId < tnum,
|
||||
"current thread is not needed here; error");
|
||||
@@ -440,15 +439,20 @@ public:
|
||||
|
||||
INLINE static int dispatch_next(kmp_Ident *loc, int32_t gtid, int32_t *plast,
|
||||
T *plower, T *pupper, ST *pstride) {
|
||||
ASSERT0(LT_FUSSY, checkRuntimeInitialized(loc),
|
||||
"Expected non-SPMD mode + initialized runtime.");
|
||||
if (checkRuntimeUninitialized(loc)) {
|
||||
// In SPMD mode no need to check parallelism level - dynamic scheduling
|
||||
// may appear only in L2 parallel regions with lightweight runtime.
|
||||
ASSERT0(LT_FUSSY, checkSPMDMode(loc), "Expected non-SPMD mode.");
|
||||
if (*plast)
|
||||
return DISPATCH_FINISHED;
|
||||
*plast = 1;
|
||||
return DISPATCH_NOTFINISHED;
|
||||
}
|
||||
// ID of a thread in its own warp
|
||||
|
||||
// automatically selects thread or warp ID based on selected implementation
|
||||
int tid = GetLogicalThreadIdInBlock(checkSPMDMode(loc));
|
||||
ASSERT0(LT_FUSSY,
|
||||
gtid < GetNumberOfOmpThreads(tid, checkSPMDMode(loc),
|
||||
checkRuntimeUninitialized(loc)),
|
||||
ASSERT0(LT_FUSSY, gtid < GetNumberOfOmpThreads(checkSPMDMode(loc)),
|
||||
"current thread is not needed here; error");
|
||||
// retrieve schedule
|
||||
kmp_sched_t schedule =
|
||||
@@ -499,13 +503,12 @@ public:
|
||||
*pupper = myUb;
|
||||
*pstride = 1;
|
||||
|
||||
PRINT(
|
||||
LD_LOOP,
|
||||
"Got sched: active %d, total %d: lb %lld, ub %lld, stride = %lld, "
|
||||
"last %d\n",
|
||||
(int)GetNumberOfOmpThreads(tid, isSPMDMode(), isRuntimeUninitialized()),
|
||||
(int)GetNumberOfWorkersInTeam(), (long long)*plower, (long long)*pupper,
|
||||
(long long)*pstride, (int)*plast);
|
||||
PRINT(LD_LOOP,
|
||||
"Got sched: active %d, total %d: lb %lld, ub %lld, stride = %lld, "
|
||||
"last %d\n",
|
||||
(int)GetNumberOfOmpThreads(isSPMDMode()),
|
||||
(int)GetNumberOfWorkersInTeam(), (long long)*plower,
|
||||
(long long)*pupper, (long long)*pstride, (int)*plast);
|
||||
return DISPATCH_NOTFINISHED;
|
||||
}
|
||||
|
||||
@@ -619,7 +622,7 @@ EXTERN void __kmpc_for_static_init_4(kmp_Ident *loc, int32_t global_tid,
|
||||
PRINT0(LD_IO, "call kmpc_for_static_init_4\n");
|
||||
omptarget_nvptx_LoopSupport<int32_t, int32_t>::for_static_init(
|
||||
global_tid, schedtype, plastiter, plower, pupper, pstride, chunk,
|
||||
checkSPMDMode(loc), checkRuntimeUninitialized(loc));
|
||||
checkSPMDMode(loc));
|
||||
}
|
||||
|
||||
EXTERN void __kmpc_for_static_init_4u(kmp_Ident *loc, int32_t global_tid,
|
||||
@@ -630,7 +633,7 @@ EXTERN void __kmpc_for_static_init_4u(kmp_Ident *loc, int32_t global_tid,
|
||||
PRINT0(LD_IO, "call kmpc_for_static_init_4u\n");
|
||||
omptarget_nvptx_LoopSupport<uint32_t, int32_t>::for_static_init(
|
||||
global_tid, schedtype, plastiter, plower, pupper, pstride, chunk,
|
||||
checkSPMDMode(loc), checkRuntimeUninitialized(loc));
|
||||
checkSPMDMode(loc));
|
||||
}
|
||||
|
||||
EXTERN void __kmpc_for_static_init_8(kmp_Ident *loc, int32_t global_tid,
|
||||
@@ -641,7 +644,7 @@ EXTERN void __kmpc_for_static_init_8(kmp_Ident *loc, int32_t global_tid,
|
||||
PRINT0(LD_IO, "call kmpc_for_static_init_8\n");
|
||||
omptarget_nvptx_LoopSupport<int64_t, int64_t>::for_static_init(
|
||||
global_tid, schedtype, plastiter, plower, pupper, pstride, chunk,
|
||||
checkSPMDMode(loc), checkRuntimeUninitialized(loc));
|
||||
checkSPMDMode(loc));
|
||||
}
|
||||
|
||||
EXTERN void __kmpc_for_static_init_8u(kmp_Ident *loc, int32_t global_tid,
|
||||
@@ -652,7 +655,7 @@ EXTERN void __kmpc_for_static_init_8u(kmp_Ident *loc, int32_t global_tid,
|
||||
PRINT0(LD_IO, "call kmpc_for_static_init_8u\n");
|
||||
omptarget_nvptx_LoopSupport<uint64_t, int64_t>::for_static_init(
|
||||
global_tid, schedtype, plastiter, plower, pupper, pstride, chunk,
|
||||
checkSPMDMode(loc), checkRuntimeUninitialized(loc));
|
||||
checkSPMDMode(loc));
|
||||
}
|
||||
|
||||
EXTERN
|
||||
@@ -664,7 +667,7 @@ void __kmpc_for_static_init_4_simple_spmd(kmp_Ident *loc, int32_t global_tid,
|
||||
PRINT0(LD_IO, "call kmpc_for_static_init_4_simple_spmd\n");
|
||||
omptarget_nvptx_LoopSupport<int32_t, int32_t>::for_static_init(
|
||||
global_tid, schedtype, plastiter, plower, pupper, pstride, chunk,
|
||||
/*IsSPMDExecutionMode=*/true, /*IsRuntimeUninitialized=*/true);
|
||||
/*IsSPMDExecutionMode=*/true);
|
||||
}
|
||||
|
||||
EXTERN
|
||||
@@ -676,7 +679,7 @@ void __kmpc_for_static_init_4u_simple_spmd(kmp_Ident *loc, int32_t global_tid,
|
||||
PRINT0(LD_IO, "call kmpc_for_static_init_4u_simple_spmd\n");
|
||||
omptarget_nvptx_LoopSupport<uint32_t, int32_t>::for_static_init(
|
||||
global_tid, schedtype, plastiter, plower, pupper, pstride, chunk,
|
||||
/*IsSPMDExecutionMode=*/true, /*IsRuntimeUninitialized=*/true);
|
||||
/*IsSPMDExecutionMode=*/true);
|
||||
}
|
||||
|
||||
EXTERN
|
||||
@@ -688,7 +691,7 @@ void __kmpc_for_static_init_8_simple_spmd(kmp_Ident *loc, int32_t global_tid,
|
||||
PRINT0(LD_IO, "call kmpc_for_static_init_8_simple_spmd\n");
|
||||
omptarget_nvptx_LoopSupport<int64_t, int64_t>::for_static_init(
|
||||
global_tid, schedtype, plastiter, plower, pupper, pstride, chunk,
|
||||
/*IsSPMDExecutionMode=*/true, /*IsRuntimeUninitialized=*/true);
|
||||
/*IsSPMDExecutionMode=*/true);
|
||||
}
|
||||
|
||||
EXTERN
|
||||
@@ -700,7 +703,7 @@ void __kmpc_for_static_init_8u_simple_spmd(kmp_Ident *loc, int32_t global_tid,
|
||||
PRINT0(LD_IO, "call kmpc_for_static_init_8u_simple_spmd\n");
|
||||
omptarget_nvptx_LoopSupport<uint64_t, int64_t>::for_static_init(
|
||||
global_tid, schedtype, plastiter, plower, pupper, pstride, chunk,
|
||||
/*IsSPMDExecutionMode=*/true, /*IsRuntimeUninitialized=*/true);
|
||||
/*IsSPMDExecutionMode=*/true);
|
||||
}
|
||||
|
||||
EXTERN
|
||||
@@ -711,7 +714,7 @@ void __kmpc_for_static_init_4_simple_generic(
|
||||
PRINT0(LD_IO, "call kmpc_for_static_init_4_simple_generic\n");
|
||||
omptarget_nvptx_LoopSupport<int32_t, int32_t>::for_static_init(
|
||||
global_tid, schedtype, plastiter, plower, pupper, pstride, chunk,
|
||||
/*IsSPMDExecutionMode=*/false, /*IsRuntimeUninitialized=*/true);
|
||||
/*IsSPMDExecutionMode=*/false);
|
||||
}
|
||||
|
||||
EXTERN
|
||||
@@ -722,7 +725,7 @@ void __kmpc_for_static_init_4u_simple_generic(
|
||||
PRINT0(LD_IO, "call kmpc_for_static_init_4u_simple_generic\n");
|
||||
omptarget_nvptx_LoopSupport<uint32_t, int32_t>::for_static_init(
|
||||
global_tid, schedtype, plastiter, plower, pupper, pstride, chunk,
|
||||
/*IsSPMDExecutionMode=*/false, /*IsRuntimeUninitialized=*/true);
|
||||
/*IsSPMDExecutionMode=*/false);
|
||||
}
|
||||
|
||||
EXTERN
|
||||
@@ -733,7 +736,7 @@ void __kmpc_for_static_init_8_simple_generic(
|
||||
PRINT0(LD_IO, "call kmpc_for_static_init_8_simple_generic\n");
|
||||
omptarget_nvptx_LoopSupport<int64_t, int64_t>::for_static_init(
|
||||
global_tid, schedtype, plastiter, plower, pupper, pstride, chunk,
|
||||
/*IsSPMDExecutionMode=*/false, /*IsRuntimeUninitialized=*/true);
|
||||
/*IsSPMDExecutionMode=*/false);
|
||||
}
|
||||
|
||||
EXTERN
|
||||
@@ -744,7 +747,7 @@ void __kmpc_for_static_init_8u_simple_generic(
|
||||
PRINT0(LD_IO, "call kmpc_for_static_init_8u_simple_generic\n");
|
||||
omptarget_nvptx_LoopSupport<uint64_t, int64_t>::for_static_init(
|
||||
global_tid, schedtype, plastiter, plower, pupper, pstride, chunk,
|
||||
/*IsSPMDExecutionMode=*/false, /*IsRuntimeUninitialized=*/true);
|
||||
/*IsSPMDExecutionMode=*/false);
|
||||
}
|
||||
|
||||
EXTERN void __kmpc_for_static_fini(kmp_Ident *loc, int32_t global_tid) {
|
||||
@@ -776,9 +779,7 @@ EXTERN void __kmpc_reduce_conditional_lastprivate(kmp_Ident *loc, int32_t gtid,
|
||||
"Expected non-SPMD mode + initialized runtime.");
|
||||
|
||||
omptarget_nvptx_TeamDescr &teamDescr = getMyTeamDescriptor();
|
||||
int tid = GetLogicalThreadIdInBlock(checkSPMDMode(loc));
|
||||
uint32_t NumThreads = GetNumberOfOmpThreads(tid, checkSPMDMode(loc),
|
||||
checkRuntimeUninitialized(loc));
|
||||
uint32_t NumThreads = GetNumberOfOmpThreads(checkSPMDMode(loc));
|
||||
uint64_t *Buffer = teamDescr.getLastprivateIterBuffer();
|
||||
for (unsigned i = 0; i < varNum; i++) {
|
||||
// Reset buffer.
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
//===------------ omp_data.cu - NVPTX OpenMP GPU objects --------- CUDA -*-===//
|
||||
//
|
||||
// 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
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
@@ -32,8 +31,10 @@ __device__ omptarget_nvptx_SimpleMemoryManager
|
||||
__device__ __shared__ uint32_t usedMemIdx;
|
||||
__device__ __shared__ uint32_t usedSlotIdx;
|
||||
|
||||
__device__ __shared__ uint8_t parallelLevel;
|
||||
|
||||
__device__ __shared__ uint8_t parallelLevel[MAX_THREADS_PER_TEAM / WARPSIZE];
|
||||
__device__ __shared__ uint16_t threadLimit;
|
||||
__device__ __shared__ uint16_t threadsInTeam;
|
||||
__device__ __shared__ uint16_t nThreads;
|
||||
// Pointer to this team's OpenMP state object
|
||||
__device__ __shared__
|
||||
omptarget_nvptx_ThreadPrivateContext *omptarget_nvptx_threadPrivateContext;
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
//===--- omptarget-nvptx.cu - NVPTX OpenMP GPU initialization ---- CUDA -*-===//
|
||||
//
|
||||
// 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
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
@@ -44,6 +43,8 @@ EXTERN void __kmpc_kernel_init(int ThreadLimit, int16_t RequiresOMPRuntime) {
|
||||
ASSERT0(LT_FUSSY, RequiresOMPRuntime,
|
||||
"Generic always requires initialized runtime.");
|
||||
setExecutionParameters(Generic, RuntimeInitialized);
|
||||
for (int I = 0; I < MAX_THREADS_PER_TEAM / WARPSIZE; ++I)
|
||||
parallelLevel[I] = 0;
|
||||
|
||||
int threadIdInBlock = GetThreadIdInBlock();
|
||||
ASSERT0(LT_FUSSY, threadIdInBlock == GetMasterThreadID(),
|
||||
@@ -62,7 +63,7 @@ EXTERN void __kmpc_kernel_init(int ThreadLimit, int16_t RequiresOMPRuntime) {
|
||||
|
||||
// init team context
|
||||
omptarget_nvptx_TeamDescr &currTeamDescr = getMyTeamDescriptor();
|
||||
currTeamDescr.InitTeamDescr(/*isSPMDExecutionMode=*/false);
|
||||
currTeamDescr.InitTeamDescr();
|
||||
// this thread will start execution... has to update its task ICV
|
||||
// to point to the level zero task ICV. That ICV was init in
|
||||
// InitTeamDescr()
|
||||
@@ -72,8 +73,8 @@ EXTERN void __kmpc_kernel_init(int ThreadLimit, int16_t RequiresOMPRuntime) {
|
||||
// set number of threads and thread limit in team to started value
|
||||
omptarget_nvptx_TaskDescr *currTaskDescr =
|
||||
omptarget_nvptx_threadPrivateContext->GetTopLevelTaskDescr(threadId);
|
||||
currTaskDescr->NThreads() = GetNumberOfWorkersInTeam();
|
||||
currTaskDescr->ThreadLimit() = ThreadLimit;
|
||||
nThreads = GetNumberOfWorkersInTeam();
|
||||
threadLimit = ThreadLimit;
|
||||
}
|
||||
|
||||
EXTERN void __kmpc_kernel_deinit(int16_t IsOMPRuntimeInitialized) {
|
||||
@@ -92,35 +93,37 @@ EXTERN void __kmpc_spmd_kernel_init(int ThreadLimit, int16_t RequiresOMPRuntime,
|
||||
int16_t RequiresDataSharing) {
|
||||
PRINT0(LD_IO, "call to __kmpc_spmd_kernel_init\n");
|
||||
|
||||
setExecutionParameters(Spmd, RequiresOMPRuntime ? RuntimeInitialized
|
||||
: RuntimeUninitialized);
|
||||
int threadId = GetThreadIdInBlock();
|
||||
if (threadId == 0) {
|
||||
usedSlotIdx = smid() % MAX_SM;
|
||||
parallelLevel[0] =
|
||||
1 + (GetNumberOfThreadsInBlock() > 1 ? OMP_ACTIVE_PARALLEL_LEVEL : 0);
|
||||
} else if (GetLaneId() == 0) {
|
||||
parallelLevel[GetWarpId()] =
|
||||
1 + (GetNumberOfThreadsInBlock() > 1 ? OMP_ACTIVE_PARALLEL_LEVEL : 0);
|
||||
}
|
||||
if (!RequiresOMPRuntime) {
|
||||
// If OMP runtime is not required don't initialize OMP state.
|
||||
setExecutionParameters(Spmd, RuntimeUninitialized);
|
||||
if (GetThreadIdInBlock() == 0) {
|
||||
parallelLevel = 0;
|
||||
usedSlotIdx = smid() % MAX_SM;
|
||||
}
|
||||
// Runtime is not required - exit.
|
||||
__SYNCTHREADS();
|
||||
return;
|
||||
}
|
||||
setExecutionParameters(Spmd, RuntimeInitialized);
|
||||
|
||||
//
|
||||
// Team Context Initialization.
|
||||
//
|
||||
// In SPMD mode there is no master thread so use any cuda thread for team
|
||||
// context initialization.
|
||||
int threadId = GetThreadIdInBlock();
|
||||
if (threadId == 0) {
|
||||
// Get a state object from the queue.
|
||||
int slot = smid() % MAX_SM;
|
||||
usedSlotIdx = slot;
|
||||
omptarget_nvptx_threadPrivateContext =
|
||||
omptarget_nvptx_device_State[slot].Dequeue();
|
||||
omptarget_nvptx_device_State[usedSlotIdx].Dequeue();
|
||||
|
||||
omptarget_nvptx_TeamDescr &currTeamDescr = getMyTeamDescriptor();
|
||||
omptarget_nvptx_WorkDescr &workDescr = getMyWorkDescriptor();
|
||||
// init team context
|
||||
currTeamDescr.InitTeamDescr(/*isSPMDExecutionMode=*/true);
|
||||
currTeamDescr.InitTeamDescr();
|
||||
}
|
||||
// FIXME: use __syncthreads instead when the function copy is fixed in LLVM.
|
||||
__SYNCTHREADS();
|
||||
@@ -134,9 +137,7 @@ EXTERN void __kmpc_spmd_kernel_init(int ThreadLimit, int16_t RequiresOMPRuntime,
|
||||
omptarget_nvptx_TaskDescr *newTaskDescr =
|
||||
omptarget_nvptx_threadPrivateContext->Level1TaskDescr(threadId);
|
||||
ASSERT0(LT_FUSSY, newTaskDescr, "expected a task descr");
|
||||
newTaskDescr->InitLevelOneTaskDescr(ThreadLimit,
|
||||
currTeamDescr.LevelZeroTaskDescr());
|
||||
newTaskDescr->ThreadLimit() = ThreadLimit;
|
||||
newTaskDescr->InitLevelOneTaskDescr(currTeamDescr.LevelZeroTaskDescr());
|
||||
// install new top descriptor
|
||||
omptarget_nvptx_threadPrivateContext->SetTopLevelTaskDescr(threadId,
|
||||
newTaskDescr);
|
||||
@@ -145,9 +146,9 @@ EXTERN void __kmpc_spmd_kernel_init(int ThreadLimit, int16_t RequiresOMPRuntime,
|
||||
PRINT(LD_PAR,
|
||||
"thread will execute parallel region with id %d in a team of "
|
||||
"%d threads\n",
|
||||
(int)newTaskDescr->ThreadId(), (int)newTaskDescr->ThreadsInTeam());
|
||||
(int)newTaskDescr->ThreadId(), (int)ThreadLimit);
|
||||
|
||||
if (RequiresDataSharing && threadId % WARPSIZE == 0) {
|
||||
if (RequiresDataSharing && GetLaneId() == 0) {
|
||||
// Warp master innitializes data sharing environment.
|
||||
unsigned WID = threadId / WARPSIZE;
|
||||
__kmpc_data_sharing_slot *RootS = currTeamDescr.RootS(
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
//===---- omptarget-nvptx.h - NVPTX OpenMP GPU initialization ---- CUDA -*-===//
|
||||
//
|
||||
// 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,7 +48,9 @@
|
||||
// Macros for Cuda intrinsics
|
||||
// In Cuda 9.0, the *_sync() version takes an extra argument 'mask'.
|
||||
// Also, __ballot(1) in Cuda 8.0 is replaced with __activemask().
|
||||
#if defined(CUDART_VERSION) && CUDART_VERSION >= 9000
|
||||
#ifndef CUDA_VERSION
|
||||
#error CUDA_VERSION macro is undefined, something wrong with cuda.
|
||||
#elif CUDA_VERSION >= 9000
|
||||
#define __SHFL_SYNC(mask, var, srcLane) __shfl_sync((mask), (var), (srcLane))
|
||||
#define __SHFL_DOWN_SYNC(mask, var, delta, width) \
|
||||
__shfl_down_sync((mask), (var), (delta), (width))
|
||||
@@ -59,10 +60,15 @@
|
||||
#define __SHFL_DOWN_SYNC(mask, var, delta, width) \
|
||||
__shfl_down((var), (delta), (width))
|
||||
#define __ACTIVEMASK() __ballot(1)
|
||||
#endif
|
||||
#endif // CUDA_VERSION
|
||||
|
||||
#define __SYNCTHREADS_N(n) asm volatile("bar.sync %0;" : : "r"(n) : "memory");
|
||||
// Use original __syncthreads if compiled by nvcc or clang >= 9.0.
|
||||
#if !defined(__clang__) || __clang_major__ >= 9
|
||||
#define __SYNCTHREADS() __syncthreads()
|
||||
#else
|
||||
#define __SYNCTHREADS() __SYNCTHREADS_N(0)
|
||||
#endif
|
||||
|
||||
// arguments needed for L0 parallelism only.
|
||||
class omptarget_nvptx_SharedArgs {
|
||||
@@ -165,25 +171,20 @@ public:
|
||||
}
|
||||
INLINE int IsTaskConstruct() const { return !IsParallelConstruct(); }
|
||||
// methods for other fields
|
||||
INLINE uint16_t &NThreads() { return items.nthreads; }
|
||||
INLINE uint16_t &ThreadLimit() { return items.threadlimit; }
|
||||
INLINE uint16_t &ThreadId() { return items.threadId; }
|
||||
INLINE uint16_t &ThreadsInTeam() { return items.threadsInTeam; }
|
||||
INLINE uint64_t &RuntimeChunkSize() { return items.runtimeChunkSize; }
|
||||
INLINE omptarget_nvptx_TaskDescr *GetPrevTaskDescr() const { return prev; }
|
||||
INLINE void SetPrevTaskDescr(omptarget_nvptx_TaskDescr *taskDescr) {
|
||||
prev = taskDescr;
|
||||
}
|
||||
// init & copy
|
||||
INLINE void InitLevelZeroTaskDescr(bool isSPMDExecutionMode);
|
||||
INLINE void InitLevelOneTaskDescr(uint16_t tnum,
|
||||
omptarget_nvptx_TaskDescr *parentTaskDescr);
|
||||
INLINE void InitLevelZeroTaskDescr();
|
||||
INLINE void InitLevelOneTaskDescr(omptarget_nvptx_TaskDescr *parentTaskDescr);
|
||||
INLINE void Copy(omptarget_nvptx_TaskDescr *sourceTaskDescr);
|
||||
INLINE void CopyData(omptarget_nvptx_TaskDescr *sourceTaskDescr);
|
||||
INLINE void CopyParent(omptarget_nvptx_TaskDescr *parentTaskDescr);
|
||||
INLINE void CopyForExplicitTask(omptarget_nvptx_TaskDescr *parentTaskDescr);
|
||||
INLINE void CopyToWorkDescr(omptarget_nvptx_TaskDescr *masterTaskDescr,
|
||||
uint16_t tnum);
|
||||
INLINE void CopyToWorkDescr(omptarget_nvptx_TaskDescr *masterTaskDescr);
|
||||
INLINE void CopyFromWorkDescr(omptarget_nvptx_TaskDescr *workTaskDescr);
|
||||
INLINE void CopyConvergentParent(omptarget_nvptx_TaskDescr *parentTaskDescr,
|
||||
uint16_t tid, uint16_t tnum);
|
||||
@@ -213,10 +214,7 @@ private:
|
||||
struct TaskDescr_items {
|
||||
uint8_t flags; // 6 bit used (see flag above)
|
||||
uint8_t unused;
|
||||
uint16_t nthreads; // thread num for subsequent parallel regions
|
||||
uint16_t threadlimit; // thread limit ICV
|
||||
uint16_t threadId; // thread id
|
||||
uint16_t threadsInTeam; // threads in current team
|
||||
uint64_t runtimeChunkSize; // runtime chunk size
|
||||
} items;
|
||||
omptarget_nvptx_TaskDescr *prev;
|
||||
@@ -256,7 +254,7 @@ public:
|
||||
INLINE uint64_t *getLastprivateIterBuffer() { return &lastprivateIterBuffer; }
|
||||
|
||||
// init
|
||||
INLINE void InitTeamDescr(bool isSPMDExecutionMode);
|
||||
INLINE void InitTeamDescr();
|
||||
|
||||
INLINE __kmpc_data_sharing_slot *RootS(int wid, bool IsMasterThread) {
|
||||
// If this is invoked by the master thread of the master warp then intialize
|
||||
@@ -407,7 +405,11 @@ extern __device__ omptarget_nvptx_SimpleMemoryManager
|
||||
omptarget_nvptx_simpleMemoryManager;
|
||||
extern __device__ __shared__ uint32_t usedMemIdx;
|
||||
extern __device__ __shared__ uint32_t usedSlotIdx;
|
||||
extern __device__ __shared__ uint8_t parallelLevel;
|
||||
extern __device__ __shared__ uint8_t
|
||||
parallelLevel[MAX_THREADS_PER_TEAM / WARPSIZE];
|
||||
extern __device__ __shared__ uint16_t threadLimit;
|
||||
extern __device__ __shared__ uint16_t threadsInTeam;
|
||||
extern __device__ __shared__ uint16_t nThreads;
|
||||
extern __device__ __shared__
|
||||
omptarget_nvptx_ThreadPrivateContext *omptarget_nvptx_threadPrivateContext;
|
||||
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
//===---- omptarget-nvptxi.h - NVPTX OpenMP GPU initialization --- CUDA -*-===//
|
||||
//
|
||||
// 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
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
@@ -32,7 +31,7 @@ INLINE void omptarget_nvptx_TaskDescr::SetRuntimeSched(omp_sched_t sched) {
|
||||
}
|
||||
|
||||
INLINE void
|
||||
omptarget_nvptx_TaskDescr::InitLevelZeroTaskDescr(bool isSPMDExecutionMode) {
|
||||
omptarget_nvptx_TaskDescr::InitLevelZeroTaskDescr() {
|
||||
// slow method
|
||||
// flag:
|
||||
// default sched is static,
|
||||
@@ -40,17 +39,14 @@ omptarget_nvptx_TaskDescr::InitLevelZeroTaskDescr(bool isSPMDExecutionMode) {
|
||||
// not in parallel
|
||||
|
||||
items.flags = 0;
|
||||
items.nthreads = GetNumberOfProcsInTeam(isSPMDExecutionMode);
|
||||
; // threads: whatever was alloc by kernel
|
||||
items.threadId = 0; // is master
|
||||
items.threadsInTeam = 1; // sequential
|
||||
items.runtimeChunkSize = 1; // prefered chunking statik with chunk 1
|
||||
}
|
||||
|
||||
// This is called when all threads are started together in SPMD mode.
|
||||
// OMP directives include target parallel, target distribute parallel for, etc.
|
||||
INLINE void omptarget_nvptx_TaskDescr::InitLevelOneTaskDescr(
|
||||
uint16_t tnum, omptarget_nvptx_TaskDescr *parentTaskDescr) {
|
||||
omptarget_nvptx_TaskDescr *parentTaskDescr) {
|
||||
// slow method
|
||||
// flag:
|
||||
// default sched is static,
|
||||
@@ -59,10 +55,8 @@ INLINE void omptarget_nvptx_TaskDescr::InitLevelOneTaskDescr(
|
||||
|
||||
items.flags =
|
||||
TaskDescr_InPar | TaskDescr_IsParConstr; // set flag to parallel
|
||||
items.nthreads = 0; // # threads for subsequent parallel region
|
||||
items.threadId =
|
||||
GetThreadIdInBlock(); // get ids from cuda (only called for 1st level)
|
||||
items.threadsInTeam = tnum;
|
||||
items.runtimeChunkSize = 1; // prefered chunking statik with chunk 1
|
||||
prev = parentTaskDescr;
|
||||
}
|
||||
@@ -92,12 +86,11 @@ INLINE void omptarget_nvptx_TaskDescr::CopyForExplicitTask(
|
||||
}
|
||||
|
||||
INLINE void omptarget_nvptx_TaskDescr::CopyToWorkDescr(
|
||||
omptarget_nvptx_TaskDescr *masterTaskDescr, uint16_t tnum) {
|
||||
omptarget_nvptx_TaskDescr *masterTaskDescr) {
|
||||
CopyParent(masterTaskDescr);
|
||||
// overrwrite specific items;
|
||||
items.flags |=
|
||||
TaskDescr_InPar | TaskDescr_IsParConstr; // set flag to parallel
|
||||
items.threadsInTeam = tnum; // set number of threads
|
||||
}
|
||||
|
||||
INLINE void omptarget_nvptx_TaskDescr::CopyFromWorkDescr(
|
||||
@@ -122,7 +115,6 @@ INLINE void omptarget_nvptx_TaskDescr::CopyConvergentParent(
|
||||
omptarget_nvptx_TaskDescr *parentTaskDescr, uint16_t tid, uint16_t tnum) {
|
||||
CopyParent(parentTaskDescr);
|
||||
items.flags |= TaskDescr_InParL2P; // In L2+ parallelism
|
||||
items.threadsInTeam = tnum; // set number of threads
|
||||
items.threadId = tid;
|
||||
}
|
||||
|
||||
@@ -178,8 +170,8 @@ omptarget_nvptx_ThreadPrivateContext::InitThreadPrivateContext(int tid) {
|
||||
// Team Descriptor
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
INLINE void omptarget_nvptx_TeamDescr::InitTeamDescr(bool isSPMDExecutionMode) {
|
||||
levelZeroTaskDescr.InitLevelZeroTaskDescr(isSPMDExecutionMode);
|
||||
INLINE void omptarget_nvptx_TeamDescr::InitTeamDescr() {
|
||||
levelZeroTaskDescr.InitLevelZeroTaskDescr();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
//===------------ option.h - NVPTX OpenMP GPU options ------------ CUDA -*-===//
|
||||
//
|
||||
// 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,6 +44,8 @@
|
||||
#define MAX_SM 16
|
||||
#endif
|
||||
|
||||
#define OMP_ACTIVE_PARALLEL_LEVEL 128
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// algo options
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
//===---- parallel.cu - NVPTX OpenMP parallel implementation ----- CUDA -*-===//
|
||||
//
|
||||
// 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
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
@@ -251,8 +250,7 @@ EXTERN void __kmpc_kernel_prepare_parallel(void *WorkFn,
|
||||
omptarget_nvptx_threadPrivateContext->NumThreadsForNextParallel(threadId);
|
||||
|
||||
uint16_t NumThreads =
|
||||
determineNumberOfThreads(NumThreadsClause, currTaskDescr->NThreads(),
|
||||
currTaskDescr->ThreadLimit());
|
||||
determineNumberOfThreads(NumThreadsClause, nThreads, threadLimit);
|
||||
|
||||
if (NumThreadsClause != 0) {
|
||||
// Reset request to avoid propagating to successive #parallel
|
||||
@@ -266,7 +264,8 @@ EXTERN void __kmpc_kernel_prepare_parallel(void *WorkFn,
|
||||
|
||||
// Set number of threads on work descriptor.
|
||||
omptarget_nvptx_WorkDescr &workDescr = getMyWorkDescriptor();
|
||||
workDescr.WorkTaskDescr()->CopyToWorkDescr(currTaskDescr, NumThreads);
|
||||
workDescr.WorkTaskDescr()->CopyToWorkDescr(currTaskDescr);
|
||||
threadsInTeam = NumThreads;
|
||||
}
|
||||
|
||||
// All workers call this function. Deactivate those not needed.
|
||||
@@ -296,7 +295,7 @@ EXTERN bool __kmpc_kernel_parallel(void **WorkFn,
|
||||
// Set to true for workers participating in the parallel region.
|
||||
bool isActive = false;
|
||||
// Initialize state for active threads.
|
||||
if (threadId < workDescr.WorkTaskDescr()->ThreadsInTeam()) {
|
||||
if (threadId < threadsInTeam) {
|
||||
// init work descriptor from workdesccr
|
||||
omptarget_nvptx_TaskDescr *newTaskDescr =
|
||||
omptarget_nvptx_threadPrivateContext->Level1TaskDescr(threadId);
|
||||
@@ -309,9 +308,10 @@ EXTERN bool __kmpc_kernel_parallel(void **WorkFn,
|
||||
PRINT(LD_PAR,
|
||||
"thread will execute parallel region with id %d in a team of "
|
||||
"%d threads\n",
|
||||
(int)newTaskDescr->ThreadId(), (int)newTaskDescr->NThreads());
|
||||
(int)newTaskDescr->ThreadId(), (int)nThreads);
|
||||
|
||||
isActive = true;
|
||||
IncParallelLevel(threadsInTeam != 1);
|
||||
}
|
||||
|
||||
return isActive;
|
||||
@@ -328,6 +328,8 @@ EXTERN void __kmpc_kernel_end_parallel() {
|
||||
omptarget_nvptx_TaskDescr *currTaskDescr = getMyTopTaskDescriptor(threadId);
|
||||
omptarget_nvptx_threadPrivateContext->SetTopLevelTaskDescr(
|
||||
threadId, currTaskDescr->GetPrevTaskDescr());
|
||||
|
||||
DecParallelLevel(threadsInTeam != 1);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -337,14 +339,11 @@ EXTERN void __kmpc_kernel_end_parallel() {
|
||||
EXTERN void __kmpc_serialized_parallel(kmp_Ident *loc, uint32_t global_tid) {
|
||||
PRINT0(LD_IO, "call to __kmpc_serialized_parallel\n");
|
||||
|
||||
IncParallelLevel(/*ActiveParallel=*/false);
|
||||
|
||||
if (checkRuntimeUninitialized(loc)) {
|
||||
ASSERT0(LT_FUSSY, checkSPMDMode(loc),
|
||||
"Expected SPMD mode with uninitialized runtime.");
|
||||
__SYNCTHREADS();
|
||||
if (GetThreadIdInBlock() == 0)
|
||||
++parallelLevel;
|
||||
__SYNCTHREADS();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -369,7 +368,6 @@ EXTERN void __kmpc_serialized_parallel(kmp_Ident *loc, uint32_t global_tid) {
|
||||
// - each thread becomes ID 0 in its serialized parallel, and
|
||||
// - there is only one thread per team
|
||||
newTaskDescr->ThreadId() = 0;
|
||||
newTaskDescr->ThreadsInTeam() = 1;
|
||||
|
||||
// set new task descriptor as top
|
||||
omptarget_nvptx_threadPrivateContext->SetTopLevelTaskDescr(threadId,
|
||||
@@ -380,13 +378,11 @@ EXTERN void __kmpc_end_serialized_parallel(kmp_Ident *loc,
|
||||
uint32_t global_tid) {
|
||||
PRINT0(LD_IO, "call to __kmpc_end_serialized_parallel\n");
|
||||
|
||||
DecParallelLevel(/*ActiveParallel=*/false);
|
||||
|
||||
if (checkRuntimeUninitialized(loc)) {
|
||||
ASSERT0(LT_FUSSY, checkSPMDMode(loc),
|
||||
"Expected SPMD mode with uninitialized runtime.");
|
||||
__SYNCTHREADS();
|
||||
if (GetThreadIdInBlock() == 0)
|
||||
--parallelLevel;
|
||||
__SYNCTHREADS();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -405,21 +401,7 @@ EXTERN void __kmpc_end_serialized_parallel(kmp_Ident *loc,
|
||||
EXTERN uint16_t __kmpc_parallel_level(kmp_Ident *loc, uint32_t global_tid) {
|
||||
PRINT0(LD_IO, "call to __kmpc_parallel_level\n");
|
||||
|
||||
if (checkRuntimeUninitialized(loc)) {
|
||||
ASSERT0(LT_FUSSY, checkSPMDMode(loc),
|
||||
"Expected SPMD mode with uninitialized runtime.");
|
||||
return parallelLevel;
|
||||
}
|
||||
|
||||
int threadId = GetLogicalThreadIdInBlock(checkSPMDMode(loc));
|
||||
omptarget_nvptx_TaskDescr *currTaskDescr =
|
||||
omptarget_nvptx_threadPrivateContext->GetTopLevelTaskDescr(threadId);
|
||||
if (currTaskDescr->InL2OrHigherParallelRegion())
|
||||
return 2;
|
||||
else if (currTaskDescr->InParallelRegion())
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
return parallelLevel[GetWarpId()] & (OMP_ACTIVE_PARALLEL_LEVEL - 1);
|
||||
}
|
||||
|
||||
// This kmpc call returns the thread id across all teams. It's value is
|
||||
@@ -428,8 +410,7 @@ EXTERN uint16_t __kmpc_parallel_level(kmp_Ident *loc, uint32_t global_tid) {
|
||||
// of this call.
|
||||
EXTERN int32_t __kmpc_global_thread_num(kmp_Ident *loc) {
|
||||
int tid = GetLogicalThreadIdInBlock(checkSPMDMode(loc));
|
||||
return GetOmpThreadId(tid, checkSPMDMode(loc),
|
||||
checkRuntimeUninitialized(loc));
|
||||
return GetOmpThreadId(tid, checkSPMDMode(loc));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
//===---- reduction.cu - NVPTX OpenMP reduction implementation ---- CUDA
|
||||
//-*-===//
|
||||
//
|
||||
// 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
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
@@ -17,56 +16,6 @@
|
||||
|
||||
#include "omptarget-nvptx.h"
|
||||
|
||||
// may eventually remove this
|
||||
EXTERN
|
||||
int32_t __gpu_block_reduce() {
|
||||
bool isSPMDExecutionMode = isSPMDMode();
|
||||
int tid = GetLogicalThreadIdInBlock(isSPMDExecutionMode);
|
||||
int nt =
|
||||
GetNumberOfOmpThreads(tid, isSPMDExecutionMode, isRuntimeUninitialized());
|
||||
if (nt != blockDim.x)
|
||||
return 0;
|
||||
unsigned tnum = __ACTIVEMASK();
|
||||
if (tnum != (~0x0)) // assume swapSize is 32
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
EXTERN
|
||||
int32_t __kmpc_reduce_gpu(kmp_Ident *loc, int32_t global_tid, int32_t num_vars,
|
||||
size_t reduce_size, void *reduce_data,
|
||||
void *reduce_array_size, kmp_ReductFctPtr *reductFct,
|
||||
kmp_CriticalName *lck) {
|
||||
int threadId = GetLogicalThreadIdInBlock(checkSPMDMode(loc));
|
||||
omptarget_nvptx_TaskDescr *currTaskDescr = getMyTopTaskDescriptor(threadId);
|
||||
int numthread;
|
||||
if (currTaskDescr->IsParallelConstruct()) {
|
||||
numthread =
|
||||
GetNumberOfOmpThreads(threadId, checkSPMDMode(loc),
|
||||
checkRuntimeUninitialized(loc));
|
||||
} else {
|
||||
numthread = GetNumberOfOmpTeams();
|
||||
}
|
||||
|
||||
if (numthread == 1)
|
||||
return 1;
|
||||
if (!__gpu_block_reduce())
|
||||
return 2;
|
||||
if (threadIdx.x == 0)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
EXTERN
|
||||
int32_t __kmpc_reduce_combined(kmp_Ident *loc) {
|
||||
return threadIdx.x == 0 ? 2 : 0;
|
||||
}
|
||||
|
||||
EXTERN
|
||||
int32_t __kmpc_reduce_simd(kmp_Ident *loc) {
|
||||
return (threadIdx.x % 32 == 0) ? 1 : 0;
|
||||
}
|
||||
|
||||
EXTERN
|
||||
void __kmpc_nvptx_end_reduce(int32_t global_tid) {}
|
||||
|
||||
@@ -151,8 +100,7 @@ static int32_t nvptx_parallel_reduce_nowait(
|
||||
kmp_ShuffleReductFctPtr shflFct, kmp_InterWarpCopyFctPtr cpyFct,
|
||||
bool isSPMDExecutionMode, bool isRuntimeUninitialized) {
|
||||
uint32_t BlockThreadId = GetLogicalThreadIdInBlock(isSPMDExecutionMode);
|
||||
uint32_t NumThreads = GetNumberOfOmpThreads(
|
||||
BlockThreadId, isSPMDExecutionMode, isRuntimeUninitialized);
|
||||
uint32_t NumThreads = GetNumberOfOmpThreads(isSPMDExecutionMode);
|
||||
if (NumThreads == 1)
|
||||
return 1;
|
||||
/*
|
||||
@@ -237,10 +185,9 @@ static int32_t nvptx_parallel_reduce_nowait(
|
||||
EXTERN __attribute__((deprecated)) int32_t __kmpc_nvptx_parallel_reduce_nowait(
|
||||
int32_t global_tid, int32_t num_vars, size_t reduce_size, void *reduce_data,
|
||||
kmp_ShuffleReductFctPtr shflFct, kmp_InterWarpCopyFctPtr cpyFct) {
|
||||
return nvptx_parallel_reduce_nowait(
|
||||
global_tid, num_vars, reduce_size, reduce_data, shflFct, cpyFct,
|
||||
/*isSPMDExecutionMode=*/isSPMDMode(),
|
||||
/*isRuntimeUninitialized=*/isRuntimeUninitialized());
|
||||
return nvptx_parallel_reduce_nowait(global_tid, num_vars, reduce_size,
|
||||
reduce_data, shflFct, cpyFct,
|
||||
isSPMDMode(), isRuntimeUninitialized());
|
||||
}
|
||||
|
||||
EXTERN
|
||||
@@ -257,37 +204,35 @@ EXTERN
|
||||
int32_t __kmpc_nvptx_parallel_reduce_nowait_simple_spmd(
|
||||
int32_t global_tid, int32_t num_vars, size_t reduce_size, void *reduce_data,
|
||||
kmp_ShuffleReductFctPtr shflFct, kmp_InterWarpCopyFctPtr cpyFct) {
|
||||
return nvptx_parallel_reduce_nowait(global_tid, num_vars, reduce_size,
|
||||
reduce_data, shflFct, cpyFct,
|
||||
/*isSPMDExecutionMode=*/true,
|
||||
/*isRuntimeUninitialized=*/true);
|
||||
return nvptx_parallel_reduce_nowait(
|
||||
global_tid, num_vars, reduce_size, reduce_data, shflFct, cpyFct,
|
||||
/*isSPMDExecutionMode=*/true, /*isRuntimeUninitialized=*/true);
|
||||
}
|
||||
|
||||
EXTERN
|
||||
int32_t __kmpc_nvptx_parallel_reduce_nowait_simple_generic(
|
||||
int32_t global_tid, int32_t num_vars, size_t reduce_size, void *reduce_data,
|
||||
kmp_ShuffleReductFctPtr shflFct, kmp_InterWarpCopyFctPtr cpyFct) {
|
||||
return nvptx_parallel_reduce_nowait(global_tid, num_vars, reduce_size,
|
||||
reduce_data, shflFct, cpyFct,
|
||||
/*isSPMDExecutionMode=*/false,
|
||||
/*isRuntimeUninitialized=*/true);
|
||||
return nvptx_parallel_reduce_nowait(
|
||||
global_tid, num_vars, reduce_size, reduce_data, shflFct, cpyFct,
|
||||
/*isSPMDExecutionMode=*/false, /*isRuntimeUninitialized=*/true);
|
||||
}
|
||||
|
||||
INLINE
|
||||
static int32_t nvptx_teams_reduce_nowait(
|
||||
int32_t global_tid, int32_t num_vars, size_t reduce_size, void *reduce_data,
|
||||
kmp_ShuffleReductFctPtr shflFct, kmp_InterWarpCopyFctPtr cpyFct,
|
||||
kmp_CopyToScratchpadFctPtr scratchFct, kmp_LoadReduceFctPtr ldFct,
|
||||
bool isSPMDExecutionMode, bool isRuntimeUninitialized) {
|
||||
static int32_t nvptx_teams_reduce_nowait(int32_t global_tid, int32_t num_vars,
|
||||
size_t reduce_size, void *reduce_data,
|
||||
kmp_ShuffleReductFctPtr shflFct,
|
||||
kmp_InterWarpCopyFctPtr cpyFct,
|
||||
kmp_CopyToScratchpadFctPtr scratchFct,
|
||||
kmp_LoadReduceFctPtr ldFct,
|
||||
bool isSPMDExecutionMode) {
|
||||
uint32_t ThreadId = GetLogicalThreadIdInBlock(isSPMDExecutionMode);
|
||||
// In non-generic mode all workers participate in the teams reduction.
|
||||
// In generic mode only the team master participates in the teams
|
||||
// reduction because the workers are waiting for parallel work.
|
||||
uint32_t NumThreads =
|
||||
isSPMDExecutionMode
|
||||
? GetNumberOfOmpThreads(ThreadId, /*isSPMDExecutionMode=*/true,
|
||||
isRuntimeUninitialized)
|
||||
: /*Master thread only*/ 1;
|
||||
isSPMDExecutionMode ? GetNumberOfOmpThreads(/*isSPMDExecutionMode=*/true)
|
||||
: /*Master thread only*/ 1;
|
||||
uint32_t TeamId = GetBlockIdInKernel();
|
||||
uint32_t NumTeams = GetNumberOfBlocksInKernel();
|
||||
__shared__ volatile bool IsLastTeam;
|
||||
@@ -407,10 +352,9 @@ int32_t __kmpc_nvptx_teams_reduce_nowait(int32_t global_tid, int32_t num_vars,
|
||||
kmp_InterWarpCopyFctPtr cpyFct,
|
||||
kmp_CopyToScratchpadFctPtr scratchFct,
|
||||
kmp_LoadReduceFctPtr ldFct) {
|
||||
return nvptx_teams_reduce_nowait(
|
||||
global_tid, num_vars, reduce_size, reduce_data, shflFct, cpyFct,
|
||||
scratchFct, ldFct, /*isSPMDExecutionMode=*/isSPMDMode(),
|
||||
/*isRuntimeUninitialized=*/isRuntimeUninitialized());
|
||||
return nvptx_teams_reduce_nowait(global_tid, num_vars, reduce_size,
|
||||
reduce_data, shflFct, cpyFct, scratchFct,
|
||||
ldFct, isSPMDMode());
|
||||
}
|
||||
|
||||
EXTERN
|
||||
@@ -420,9 +364,7 @@ int32_t __kmpc_nvptx_teams_reduce_nowait_simple_spmd(
|
||||
kmp_CopyToScratchpadFctPtr scratchFct, kmp_LoadReduceFctPtr ldFct) {
|
||||
return nvptx_teams_reduce_nowait(global_tid, num_vars, reduce_size,
|
||||
reduce_data, shflFct, cpyFct, scratchFct,
|
||||
ldFct,
|
||||
/*isSPMDExecutionMode=*/true,
|
||||
/*isRuntimeUninitialized=*/true);
|
||||
ldFct, /*isSPMDExecutionMode=*/true);
|
||||
}
|
||||
|
||||
EXTERN
|
||||
@@ -432,9 +374,7 @@ int32_t __kmpc_nvptx_teams_reduce_nowait_simple_generic(
|
||||
kmp_CopyToScratchpadFctPtr scratchFct, kmp_LoadReduceFctPtr ldFct) {
|
||||
return nvptx_teams_reduce_nowait(global_tid, num_vars, reduce_size,
|
||||
reduce_data, shflFct, cpyFct, scratchFct,
|
||||
ldFct,
|
||||
/*isSPMDExecutionMode=*/false,
|
||||
/*isRuntimeUninitialized=*/true);
|
||||
ldFct, /*isSPMDExecutionMode=*/false);
|
||||
}
|
||||
|
||||
EXTERN int32_t __kmpc_nvptx_teams_reduce_nowait_simple(kmp_Ident *loc,
|
||||
@@ -455,3 +395,142 @@ __kmpc_nvptx_teams_end_reduce_nowait_simple(kmp_Ident *loc, int32_t global_tid,
|
||||
(void)atomicExch((uint32_t *)crit, 0);
|
||||
}
|
||||
|
||||
INLINE static bool isMaster(kmp_Ident *loc, uint32_t ThreadId) {
|
||||
return checkGenericMode(loc) || IsTeamMaster(ThreadId);
|
||||
}
|
||||
|
||||
INLINE static uint32_t roundToWarpsize(uint32_t s) {
|
||||
if (s < WARPSIZE)
|
||||
return 1;
|
||||
return (s & ~(unsigned)(WARPSIZE - 1));
|
||||
}
|
||||
|
||||
__device__ static volatile uint32_t IterCnt = 0;
|
||||
__device__ static volatile uint32_t Cnt = 0;
|
||||
EXTERN int32_t __kmpc_nvptx_teams_reduce_nowait_v2(
|
||||
kmp_Ident *loc, int32_t global_tid, void *global_buffer,
|
||||
int32_t num_of_records, void *reduce_data, kmp_ShuffleReductFctPtr shflFct,
|
||||
kmp_InterWarpCopyFctPtr cpyFct, kmp_ListGlobalFctPtr lgcpyFct,
|
||||
kmp_ListGlobalFctPtr lgredFct, kmp_ListGlobalFctPtr glcpyFct,
|
||||
kmp_ListGlobalFctPtr glredFct) {
|
||||
|
||||
// Terminate all threads in non-SPMD mode except for the master thread.
|
||||
if (checkGenericMode(loc) && GetThreadIdInBlock() != GetMasterThreadID())
|
||||
return 0;
|
||||
|
||||
uint32_t ThreadId = GetLogicalThreadIdInBlock(checkSPMDMode(loc));
|
||||
|
||||
// In non-generic mode all workers participate in the teams reduction.
|
||||
// In generic mode only the team master participates in the teams
|
||||
// reduction because the workers are waiting for parallel work.
|
||||
uint32_t NumThreads =
|
||||
checkSPMDMode(loc) ? GetNumberOfOmpThreads(/*isSPMDExecutionMode=*/true)
|
||||
: /*Master thread only*/ 1;
|
||||
uint32_t TeamId = GetBlockIdInKernel();
|
||||
uint32_t NumTeams = GetNumberOfBlocksInKernel();
|
||||
__shared__ unsigned Bound;
|
||||
__shared__ unsigned ChunkTeamCount;
|
||||
|
||||
// Block progress for teams greater than the current upper
|
||||
// limit. We always only allow a number of teams less or equal
|
||||
// to the number of slots in the buffer.
|
||||
bool IsMaster = isMaster(loc, ThreadId);
|
||||
while (IsMaster) {
|
||||
// Atomic read
|
||||
Bound = atomicAdd((uint32_t *)&IterCnt, 0);
|
||||
if (TeamId < Bound + num_of_records)
|
||||
break;
|
||||
}
|
||||
|
||||
if (IsMaster) {
|
||||
int ModBockId = TeamId % num_of_records;
|
||||
if (TeamId < num_of_records)
|
||||
lgcpyFct(global_buffer, ModBockId, reduce_data);
|
||||
else
|
||||
lgredFct(global_buffer, ModBockId, reduce_data);
|
||||
__threadfence_system();
|
||||
|
||||
// Increment team counter.
|
||||
// This counter is incremented by all teams in the current
|
||||
// BUFFER_SIZE chunk.
|
||||
ChunkTeamCount = atomicInc((uint32_t *)&Cnt, num_of_records - 1);
|
||||
}
|
||||
// Synchronize
|
||||
if (checkSPMDMode(loc))
|
||||
__kmpc_barrier(loc, global_tid);
|
||||
|
||||
// reduce_data is global or shared so before being reduced within the
|
||||
// warp we need to bring it in local memory:
|
||||
// local_reduce_data = reduce_data[i]
|
||||
//
|
||||
// Example for 3 reduction variables a, b, c (of potentially different
|
||||
// types):
|
||||
//
|
||||
// buffer layout (struct of arrays):
|
||||
// a, a, ..., a, b, b, ... b, c, c, ... c
|
||||
// |__________|
|
||||
// num_of_records
|
||||
//
|
||||
// local_data_reduce layout (struct):
|
||||
// a, b, c
|
||||
//
|
||||
// Each thread will have a local struct containing the values to be
|
||||
// reduced:
|
||||
// 1. do reduction within each warp.
|
||||
// 2. do reduction across warps.
|
||||
// 3. write the final result to the main reduction variable
|
||||
// by returning 1 in the thread holding the reduction result.
|
||||
|
||||
// Check if this is the very last team.
|
||||
unsigned NumRecs = min(NumTeams, num_of_records);
|
||||
if (ChunkTeamCount == NumTeams - Bound - 1) {
|
||||
//
|
||||
// Last team processing.
|
||||
//
|
||||
if (ThreadId >= NumRecs)
|
||||
return 0;
|
||||
NumThreads = roundToWarpsize(min(NumThreads, NumRecs));
|
||||
if (ThreadId >= NumThreads)
|
||||
return 0;
|
||||
|
||||
// Load from buffer and reduce.
|
||||
glcpyFct(global_buffer, ThreadId, reduce_data);
|
||||
for (uint32_t i = NumThreads + ThreadId; i < NumRecs; i += NumThreads)
|
||||
glredFct(global_buffer, i, reduce_data);
|
||||
|
||||
// Reduce across warps to the warp master.
|
||||
if (NumThreads > 1) {
|
||||
gpu_regular_warp_reduce(reduce_data, shflFct);
|
||||
|
||||
// When we have more than [warpsize] number of threads
|
||||
// a block reduction is performed here.
|
||||
uint32_t ActiveThreads = min(NumRecs, NumThreads);
|
||||
if (ActiveThreads > WARPSIZE) {
|
||||
uint32_t WarpsNeeded = (ActiveThreads + WARPSIZE - 1) / WARPSIZE;
|
||||
// Gather all the reduced values from each warp
|
||||
// to the first warp.
|
||||
cpyFct(reduce_data, WarpsNeeded);
|
||||
|
||||
uint32_t WarpId = ThreadId / WARPSIZE;
|
||||
if (WarpId == 0)
|
||||
gpu_irregular_warp_reduce(reduce_data, shflFct, WarpsNeeded,
|
||||
ThreadId);
|
||||
}
|
||||
}
|
||||
|
||||
if (IsMaster) {
|
||||
Cnt = 0;
|
||||
IterCnt = 0;
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
if (IsMaster && ChunkTeamCount == num_of_records - 1) {
|
||||
// Allow SIZE number of teams to proceed writing their
|
||||
// intermediate results to the global buffer.
|
||||
atomicAdd((uint32_t *)&IterCnt, num_of_records);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
//===--------- statequeue.h - NVPTX OpenMP GPU State Queue ------- CUDA -*-===//
|
||||
//
|
||||
// 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
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
//===------- state-queue.cu - NVPTX OpenMP GPU State Queue ------- CUDA -*-===//
|
||||
//
|
||||
// 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
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
//===--------- support.h - NVPTX OpenMP support functions -------- CUDA -*-===//
|
||||
//
|
||||
// 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
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
@@ -41,6 +40,8 @@ INLINE int GetThreadIdInBlock();
|
||||
INLINE int GetBlockIdInKernel();
|
||||
INLINE int GetNumberOfBlocksInKernel();
|
||||
INLINE int GetNumberOfThreadsInBlock();
|
||||
INLINE unsigned GetWarpId();
|
||||
INLINE unsigned GetLaneId();
|
||||
|
||||
// get global ids to locate tread/team info (constant regardless of OMP)
|
||||
INLINE int GetLogicalThreadIdInBlock(bool isSPMDExecutionMode);
|
||||
@@ -48,15 +49,13 @@ INLINE int GetMasterThreadID();
|
||||
INLINE int GetNumberOfWorkersInTeam();
|
||||
|
||||
// get OpenMP thread and team ids
|
||||
INLINE int GetOmpThreadId(int threadId, bool isSPMDExecutionMode,
|
||||
bool isRuntimeUninitialized); // omp_thread_num
|
||||
INLINE int GetOmpThreadId(int threadId,
|
||||
bool isSPMDExecutionMode); // omp_thread_num
|
||||
INLINE int GetOmpTeamId(); // omp_team_num
|
||||
|
||||
// get OpenMP number of threads and team
|
||||
INLINE int
|
||||
GetNumberOfOmpThreads(int threadId, bool isSPMDExecutionMode,
|
||||
bool isRuntimeUninitialized); // omp_num_threads
|
||||
INLINE int GetNumberOfOmpTeams(); // omp_num_teams
|
||||
INLINE int GetNumberOfOmpThreads(bool isSPMDExecutionMode); // omp_num_threads
|
||||
INLINE int GetNumberOfOmpTeams(); // omp_num_teams
|
||||
|
||||
// get OpenMP number of procs
|
||||
INLINE int GetNumberOfProcsInTeam(bool isSPMDExecutionMode);
|
||||
@@ -65,6 +64,10 @@ INLINE int GetNumberOfProcsInDevice(bool isSPMDExecutionMode);
|
||||
// masters
|
||||
INLINE int IsTeamMaster(int ompThreadId);
|
||||
|
||||
// Parallel level
|
||||
INLINE void IncParallelLevel(bool ActiveParallel);
|
||||
INLINE void DecParallelLevel(bool ActiveParallel);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Memory
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
//===--------- supporti.h - NVPTX OpenMP support functions ------- CUDA -*-===//
|
||||
//
|
||||
// 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
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
@@ -103,6 +102,10 @@ INLINE int GetNumberOfBlocksInKernel() { return gridDim.x; }
|
||||
|
||||
INLINE int GetNumberOfThreadsInBlock() { return blockDim.x; }
|
||||
|
||||
INLINE unsigned GetWarpId() { return threadIdx.x / WARPSIZE; }
|
||||
|
||||
INLINE unsigned GetLaneId() { return threadIdx.x & (WARPSIZE - 1); }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Calls to the Generic Scheme Implementation Layer (assuming 1D layout)
|
||||
@@ -146,45 +149,32 @@ INLINE int GetLogicalThreadIdInBlock(bool isSPMDExecutionMode) {
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
INLINE int GetOmpThreadId(int threadId, bool isSPMDExecutionMode,
|
||||
bool isRuntimeUninitialized) {
|
||||
INLINE int GetOmpThreadId(int threadId, bool isSPMDExecutionMode) {
|
||||
// omp_thread_num
|
||||
int rc;
|
||||
|
||||
if (isRuntimeUninitialized) {
|
||||
ASSERT0(LT_FUSSY, isSPMDExecutionMode,
|
||||
"Uninitialized runtime with non-SPMD mode.");
|
||||
// For level 2 parallelism all parallel regions are executed sequentially.
|
||||
if (parallelLevel > 0)
|
||||
rc = 0;
|
||||
else
|
||||
rc = GetThreadIdInBlock();
|
||||
if ((parallelLevel[GetWarpId()] & (OMP_ACTIVE_PARALLEL_LEVEL - 1)) > 1) {
|
||||
rc = 0;
|
||||
} else if (isSPMDExecutionMode) {
|
||||
rc = GetThreadIdInBlock();
|
||||
} else {
|
||||
omptarget_nvptx_TaskDescr *currTaskDescr =
|
||||
omptarget_nvptx_threadPrivateContext->GetTopLevelTaskDescr(threadId);
|
||||
ASSERT0(LT_FUSSY, currTaskDescr, "expected a top task descr");
|
||||
rc = currTaskDescr->ThreadId();
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
INLINE int GetNumberOfOmpThreads(int threadId, bool isSPMDExecutionMode,
|
||||
bool isRuntimeUninitialized) {
|
||||
INLINE int GetNumberOfOmpThreads(bool isSPMDExecutionMode) {
|
||||
// omp_num_threads
|
||||
int rc;
|
||||
|
||||
if (isRuntimeUninitialized) {
|
||||
ASSERT0(LT_FUSSY, isSPMDExecutionMode,
|
||||
"Uninitialized runtime with non-SPMD mode.");
|
||||
// For level 2 parallelism all parallel regions are executed sequentially.
|
||||
if (parallelLevel > 0)
|
||||
rc = 1;
|
||||
else
|
||||
rc = GetNumberOfThreadsInBlock();
|
||||
int Level = parallelLevel[GetWarpId()];
|
||||
if (Level != OMP_ACTIVE_PARALLEL_LEVEL + 1) {
|
||||
rc = 1;
|
||||
} else if (isSPMDExecutionMode) {
|
||||
rc = GetNumberOfThreadsInBlock();
|
||||
} else {
|
||||
omptarget_nvptx_TaskDescr *currTaskDescr =
|
||||
omptarget_nvptx_threadPrivateContext->GetTopLevelTaskDescr(threadId);
|
||||
ASSERT0(LT_FUSSY, currTaskDescr, "expected a top task descr");
|
||||
rc = currTaskDescr->ThreadsInTeam();
|
||||
rc = threadsInTeam;
|
||||
}
|
||||
|
||||
return rc;
|
||||
@@ -208,6 +198,31 @@ INLINE int GetNumberOfOmpTeams() {
|
||||
|
||||
INLINE int IsTeamMaster(int ompThreadId) { return (ompThreadId == 0); }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Parallel level
|
||||
|
||||
INLINE void IncParallelLevel(bool ActiveParallel) {
|
||||
unsigned tnum = __ACTIVEMASK();
|
||||
int leader = __ffs(tnum) - 1;
|
||||
__SHFL_SYNC(tnum, leader, leader);
|
||||
if (GetLaneId() == leader) {
|
||||
parallelLevel[GetWarpId()] +=
|
||||
(1 + (ActiveParallel ? OMP_ACTIVE_PARALLEL_LEVEL : 0));
|
||||
}
|
||||
__SHFL_SYNC(tnum, leader, leader);
|
||||
}
|
||||
|
||||
INLINE void DecParallelLevel(bool ActiveParallel) {
|
||||
unsigned tnum = __ACTIVEMASK();
|
||||
int leader = __ffs(tnum) - 1;
|
||||
__SHFL_SYNC(tnum, leader, leader);
|
||||
if (GetLaneId() == leader) {
|
||||
parallelLevel[GetWarpId()] -=
|
||||
(1 + (ActiveParallel ? OMP_ACTIVE_PARALLEL_LEVEL : 0));
|
||||
}
|
||||
__SHFL_SYNC(tnum, leader, leader);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// get OpenMP number of procs
|
||||
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
//===------------ sync.h - NVPTX OpenMP synchronizations --------- CUDA -*-===//
|
||||
//
|
||||
// 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,10 +46,8 @@ EXTERN void __kmpc_barrier(kmp_Ident *loc_ref, int32_t tid) {
|
||||
__kmpc_barrier_simple_spmd(loc_ref, tid);
|
||||
} else {
|
||||
tid = GetLogicalThreadIdInBlock(checkSPMDMode(loc_ref));
|
||||
omptarget_nvptx_TaskDescr *currTaskDescr =
|
||||
omptarget_nvptx_threadPrivateContext->GetTopLevelTaskDescr(tid);
|
||||
int numberOfActiveOMPThreads = GetNumberOfOmpThreads(
|
||||
tid, checkSPMDMode(loc_ref), /*isRuntimeUninitialized=*/false);
|
||||
int numberOfActiveOMPThreads =
|
||||
GetNumberOfOmpThreads(checkSPMDMode(loc_ref));
|
||||
if (numberOfActiveOMPThreads > 1) {
|
||||
if (checkSPMDMode(loc_ref)) {
|
||||
__kmpc_barrier_simple_spmd(loc_ref, tid);
|
||||
@@ -133,7 +130,7 @@ EXTERN void __kmpc_end_single(kmp_Ident *loc, int32_t global_tid) {
|
||||
|
||||
EXTERN void __kmpc_flush(kmp_Ident *loc) {
|
||||
PRINT0(LD_IO, "call kmpc_flush\n");
|
||||
__threadfence_system();
|
||||
__threadfence();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
//===------------- task.h - NVPTX OpenMP tasks support ----------- CUDA -*-===//
|
||||
//
|
||||
// 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
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
// RUN: %compile-run-and-check
|
||||
|
||||
#include <omp.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
int MaxThreadsL1 = -1, MaxThreadsL2 = -1;
|
||||
|
||||
#pragma omp declare reduction(unique:int \
|
||||
: omp_out = (omp_in == 1 ? omp_in : omp_out)) \
|
||||
initializer(omp_priv = -1)
|
||||
|
||||
// Non-SPMD mode.
|
||||
#pragma omp target teams map(MaxThreadsL1, MaxThreadsL2) thread_limit(32) \
|
||||
num_teams(1)
|
||||
{
|
||||
MaxThreadsL1 = omp_get_max_threads();
|
||||
#pragma omp parallel reduction(unique : MaxThreadsL2)
|
||||
{ MaxThreadsL2 = omp_get_max_threads(); }
|
||||
}
|
||||
|
||||
// CHECK: Non-SPMD MaxThreadsL1 = 32
|
||||
printf("Non-SPMD MaxThreadsL1 = %d\n", MaxThreadsL1);
|
||||
// CHECK: Non-SPMD MaxThreadsL2 = 1
|
||||
printf("Non-SPMD MaxThreadsL2 = %d\n", MaxThreadsL2);
|
||||
|
||||
// SPMD mode with full runtime
|
||||
MaxThreadsL2 = -1;
|
||||
#pragma omp target parallel reduction(unique : MaxThreadsL2)
|
||||
{ MaxThreadsL2 = omp_get_max_threads(); }
|
||||
|
||||
// CHECK: SPMD with full runtime MaxThreadsL2 = 1
|
||||
printf("SPMD with full runtime MaxThreadsL2 = %d\n", MaxThreadsL2);
|
||||
|
||||
// SPMD mode without runtime
|
||||
MaxThreadsL2 = -1;
|
||||
#pragma omp target parallel for reduction(unique : MaxThreadsL2)
|
||||
for (int I = 0; I < 2; ++I) {
|
||||
MaxThreadsL2 = omp_get_max_threads();
|
||||
}
|
||||
|
||||
// CHECK: SPMD without runtime MaxThreadsL2 = 1
|
||||
printf("SPMD without runtime MaxThreadsL2 = %d\n", MaxThreadsL2);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
// RUN: %compile-run-and-check
|
||||
|
||||
#include <omp.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
int ThreadLimitL0 = -1, ThreadLimitL1 = -1, ThreadLimitL2 = -1;
|
||||
|
||||
#pragma omp declare reduction(unique64:int \
|
||||
: omp_out = (omp_in == 64 ? omp_in : omp_out)) \
|
||||
initializer(omp_priv = -1)
|
||||
#pragma omp declare reduction(unique32:int \
|
||||
: omp_out = (omp_in == 32 ? omp_in : omp_out)) \
|
||||
initializer(omp_priv = -1)
|
||||
|
||||
// Non-SPMD mode.
|
||||
#pragma omp target teams map(ThreadLimitL0, ThreadLimitL1, ThreadLimitL2) \
|
||||
thread_limit(64) num_teams(1)
|
||||
{
|
||||
ThreadLimitL0 = omp_get_thread_limit();
|
||||
#pragma omp parallel reduction(unique64 \
|
||||
: ThreadLimitL1, ThreadLimitL2) num_threads(32)
|
||||
{
|
||||
ThreadLimitL1 = omp_get_thread_limit();
|
||||
#pragma omp parallel reduction(unique64 : ThreadLimitL2)
|
||||
{ ThreadLimitL2 = omp_get_thread_limit(); }
|
||||
}
|
||||
}
|
||||
|
||||
// CHECK: Non-SPMD ThreadLimitL0 = 64
|
||||
printf("Non-SPMD ThreadLimitL0 = %d\n", ThreadLimitL0);
|
||||
// CHECK: Non-SPMD ThreadLimitL1 = 64
|
||||
printf("Non-SPMD ThreadLimitL1 = %d\n", ThreadLimitL1);
|
||||
// CHECK: Non-SPMD ThreadLimitL2 = 64
|
||||
printf("Non-SPMD ThreadLimitL2 = %d\n", ThreadLimitL2);
|
||||
|
||||
// SPMD mode with full runtime
|
||||
ThreadLimitL1 = -1;
|
||||
ThreadLimitL2 = -1;
|
||||
#pragma omp target parallel reduction(unique32 \
|
||||
: ThreadLimitL1, ThreadLimitL2) \
|
||||
num_threads(32)
|
||||
{
|
||||
ThreadLimitL1 = omp_get_thread_limit();
|
||||
#pragma omp parallel reduction(unique32 : ThreadLimitL2)
|
||||
{ ThreadLimitL2 = omp_get_thread_limit(); }
|
||||
}
|
||||
|
||||
// CHECK: SPMD with full runtime ThreadLimitL1 = 32
|
||||
printf("SPMD with full runtime ThreadLimitL1 = %d\n", ThreadLimitL1);
|
||||
// CHECK: SPMD with full runtime ThreadLimitL2 = 32
|
||||
printf("SPMD with full runtime ThreadLimitL2 = %d\n", ThreadLimitL2);
|
||||
|
||||
// SPMD mode without runtime
|
||||
ThreadLimitL1 = -1;
|
||||
ThreadLimitL2 = -1;
|
||||
#pragma omp target parallel for reduction(unique32 \
|
||||
: ThreadLimitL1, ThreadLimitL2) \
|
||||
num_threads(32)
|
||||
for (int I = 0; I < 2; ++I) {
|
||||
ThreadLimitL1 = omp_get_thread_limit();
|
||||
#pragma omp parallel reduction(unique32 : ThreadLimitL2)
|
||||
{ ThreadLimitL2 = omp_get_thread_limit(); }
|
||||
}
|
||||
|
||||
// CHECK: SPMD without runtime ThreadLimitL1 = 32
|
||||
printf("SPMD without runtime ThreadLimitL1 = %d\n", ThreadLimitL1);
|
||||
// CHECK: SPMD without runtime ThreadLimitL2 = 32
|
||||
printf("SPMD without runtime ThreadLimitL2 = %d\n", ThreadLimitL2);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
// RUN: %compile-run-and-check
|
||||
|
||||
#include <omp.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
int data, out, flag = 0;
|
||||
#pragma omp target parallel num_threads(64) map(tofrom \
|
||||
: out, flag) map(to \
|
||||
: data)
|
||||
{
|
||||
if (omp_get_thread_num() == 0) {
|
||||
/* Write to the data buffer that will be read by thread */
|
||||
data = 42;
|
||||
/* Flush data to thread 32 */
|
||||
#pragma omp flush(data)
|
||||
/* Set flag to release thread 32 */
|
||||
#pragma omp atomic write
|
||||
flag = 1;
|
||||
} else if (omp_get_thread_num() == 32) {
|
||||
/* Loop until we see the update to the flag */
|
||||
int val;
|
||||
do {
|
||||
#pragma omp atomic read
|
||||
val = flag;
|
||||
} while (val < 1);
|
||||
out = data;
|
||||
#pragma omp flush(out)
|
||||
}
|
||||
}
|
||||
// CHECK: out=42.
|
||||
/* Value of out will be 42 */
|
||||
printf("out=%d.\n", out);
|
||||
return !(out == 42);
|
||||
}
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
const int MaxThreads = 1024;
|
||||
const int NumThreads = 64;
|
||||
const int NumThreads1 = 1;
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
int inParallel = -1, numThreads = -1, threadNum = -1;
|
||||
@@ -14,20 +15,20 @@ int main(int argc, char *argv[]) {
|
||||
check1[i] = check2[i] = 0;
|
||||
}
|
||||
|
||||
#pragma omp target map(inParallel, numThreads, threadNum, check1[:], check2[:])
|
||||
#pragma omp target map(inParallel, numThreads, threadNum, check1[:], check2[:])
|
||||
{
|
||||
inParallel = omp_in_parallel();
|
||||
numThreads = omp_get_num_threads();
|
||||
threadNum = omp_get_thread_num();
|
||||
|
||||
// Expecting active parallel region.
|
||||
#pragma omp parallel num_threads(NumThreads)
|
||||
// Expecting active parallel region.
|
||||
#pragma omp parallel num_threads(NumThreads)
|
||||
{
|
||||
int id = omp_get_thread_num();
|
||||
check1[id] += omp_get_num_threads() + omp_in_parallel();
|
||||
|
||||
// Expecting serialized parallel region.
|
||||
#pragma omp parallel
|
||||
// Expecting serialized parallel region.
|
||||
#pragma omp parallel
|
||||
{
|
||||
// Expected to be 1.
|
||||
int nestedInParallel = omp_in_parallel();
|
||||
@@ -35,7 +36,7 @@ int main(int argc, char *argv[]) {
|
||||
int nestedNumThreads = omp_get_num_threads();
|
||||
// Expected to be 0.
|
||||
int nestedThreadNum = omp_get_thread_num();
|
||||
#pragma omp atomic
|
||||
#pragma omp atomic
|
||||
check2[id] += nestedInParallel + nestedNumThreads + nestedThreadNum;
|
||||
}
|
||||
}
|
||||
@@ -52,7 +53,8 @@ int main(int argc, char *argv[]) {
|
||||
int Expected = NumThreads + 1;
|
||||
if (i < NumThreads) {
|
||||
if (check1[i] != Expected) {
|
||||
printf("invalid: check1[%d] should be %d, is %d\n", i, Expected, check1[i]);
|
||||
printf("invalid: check1[%d] should be %d, is %d\n", i, Expected,
|
||||
check1[i]);
|
||||
}
|
||||
} else if (check1[i] != 0) {
|
||||
printf("invalid: check1[%d] should be 0, is %d\n", i, check1[i]);
|
||||
@@ -68,5 +70,67 @@ int main(int argc, char *argv[]) {
|
||||
}
|
||||
}
|
||||
|
||||
inParallel = -1;
|
||||
numThreads = -1;
|
||||
threadNum = -1;
|
||||
for (int i = 0; i < MaxThreads; i++) {
|
||||
check1[i] = check2[i] = 0;
|
||||
}
|
||||
|
||||
#pragma omp target map(inParallel, numThreads, threadNum, check1[:], check2[:])
|
||||
{
|
||||
inParallel = omp_in_parallel();
|
||||
numThreads = omp_get_num_threads();
|
||||
threadNum = omp_get_thread_num();
|
||||
|
||||
// Expecting active parallel region.
|
||||
#pragma omp parallel num_threads(NumThreads1)
|
||||
{
|
||||
int id = omp_get_thread_num();
|
||||
check1[id] += omp_get_num_threads() + omp_in_parallel();
|
||||
|
||||
// Expecting serialized parallel region.
|
||||
#pragma omp parallel
|
||||
{
|
||||
// Expected to be 0.
|
||||
int nestedInParallel = omp_in_parallel();
|
||||
// Expected to be 1.
|
||||
int nestedNumThreads = omp_get_num_threads();
|
||||
// Expected to be 0.
|
||||
int nestedThreadNum = omp_get_thread_num();
|
||||
#pragma omp atomic
|
||||
check2[id] += nestedInParallel + nestedNumThreads + nestedThreadNum;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// CHECK: target: inParallel = 0, numThreads = 1, threadNum = 0
|
||||
printf("target: inParallel = %d, numThreads = %d, threadNum = %d\n",
|
||||
inParallel, numThreads, threadNum);
|
||||
|
||||
// CHECK-NOT: invalid
|
||||
for (int i = 0; i < MaxThreads; i++) {
|
||||
// Check that all threads reported
|
||||
// omp_get_num_threads() = 1, omp_in_parallel() = 0.
|
||||
int Expected = 1;
|
||||
if (i < NumThreads1) {
|
||||
if (check1[i] != Expected) {
|
||||
printf("invalid: check1[%d] should be %d, is %d\n", i, Expected,
|
||||
check1[i]);
|
||||
}
|
||||
} else if (check1[i] != 0) {
|
||||
printf("invalid: check1[%d] should be 0, is %d\n", i, check1[i]);
|
||||
}
|
||||
|
||||
// Check serialized parallel region.
|
||||
if (i < NumThreads1) {
|
||||
if (check2[i] != 1) {
|
||||
printf("invalid: check2[%d] should be 1, is %d\n", i, check2[i]);
|
||||
}
|
||||
} else if (check2[i] != 0) {
|
||||
printf("invalid: check2[%d] should be 0, is %d\n", i, check2[i]);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
// RUN: %compilexx-run-and-check
|
||||
|
||||
#include <stdio.h>
|
||||
#include <omp.h>
|
||||
|
||||
int main(void) {
|
||||
int isHost = -1;
|
||||
int ParallelLevel1 = -1, ParallelLevel2 = -1;
|
||||
int Count = 0;
|
||||
|
||||
#pragma omp target parallel for map(tofrom \
|
||||
: isHost, ParallelLevel1, ParallelLevel2), reduction(+: Count) schedule(static, 1)
|
||||
for (int J = 0; J < 10; ++J) {
|
||||
#pragma omp critical
|
||||
{
|
||||
isHost = (isHost < 0 || isHost == 0) ? omp_is_initial_device() : isHost;
|
||||
ParallelLevel1 = (ParallelLevel1 < 0 || ParallelLevel1 == 1)
|
||||
? omp_get_level()
|
||||
: ParallelLevel1;
|
||||
}
|
||||
if (omp_get_thread_num() > 5) {
|
||||
int L2;
|
||||
#pragma omp parallel for schedule(dynamic) lastprivate(L2) reduction(+: Count)
|
||||
for (int I = 0; I < 10; ++I) {
|
||||
L2 = omp_get_level();
|
||||
Count += omp_get_level(); // (10-6)*10*2 = 80
|
||||
}
|
||||
#pragma omp critical
|
||||
ParallelLevel2 =
|
||||
(ParallelLevel2 < 0 || ParallelLevel2 == 2) ? L2 : ParallelLevel2;
|
||||
} else {
|
||||
Count += omp_get_level(); // 6 * 1 = 6
|
||||
}
|
||||
}
|
||||
|
||||
if (isHost < 0) {
|
||||
printf("Runtime error, isHost=%d\n", isHost);
|
||||
}
|
||||
|
||||
// CHECK: Target region executed on the device
|
||||
printf("Target region executed on the %s\n", isHost ? "host" : "device");
|
||||
// CHECK: Parallel level in SPMD mode: L1 is 1, L2 is 2
|
||||
printf("Parallel level in SPMD mode: L1 is %d, L2 is %d\n", ParallelLevel1,
|
||||
ParallelLevel2);
|
||||
// Final result of Count is (10-6)(num of loops)*10(num of iterations)*2(par
|
||||
// level) + 6(num of iterations) * 1(par level)
|
||||
// CHECK: Expected count = 86
|
||||
printf("Expected count = %d\n", Count);
|
||||
|
||||
return isHost;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
// RUN: %compile-run-and-check
|
||||
|
||||
#include <omp.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main() {
|
||||
int res = 0;
|
||||
|
||||
#pragma omp parallel num_threads(2) reduction(+:res)
|
||||
{
|
||||
int tid = omp_get_thread_num();
|
||||
#pragma omp target teams distribute reduction(+:res)
|
||||
for (int i = tid; i < 2; i++)
|
||||
++res;
|
||||
}
|
||||
// The first thread makes 2 iterations, the second - 1. Expected result of the
|
||||
// reduction res is 3.
|
||||
|
||||
// CHECK: res = 3.
|
||||
printf("res = %d.\n", res);
|
||||
return 0;
|
||||
}
|
||||
@@ -1,9 +1,8 @@
|
||||
//===-------- omptarget.h - Target independent OpenMP target RTL -- C++ -*-===//
|
||||
//
|
||||
// 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
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
@@ -61,6 +60,21 @@ enum OpenMPOffloadingDeclareTargetFlags {
|
||||
OMP_DECLARE_TARGET_DTOR = 0x04
|
||||
};
|
||||
|
||||
enum OpenMPOffloadingRequiresDirFlags {
|
||||
/// flag undefined.
|
||||
OMP_REQ_UNDEFINED = 0x000,
|
||||
/// no requires directive present.
|
||||
OMP_REQ_NONE = 0x001,
|
||||
/// reverse_offload clause.
|
||||
OMP_REQ_REVERSE_OFFLOAD = 0x002,
|
||||
/// unified_address clause.
|
||||
OMP_REQ_UNIFIED_ADDRESS = 0x004,
|
||||
/// unified_shared_memory clause.
|
||||
OMP_REQ_UNIFIED_SHARED_MEMORY = 0x008,
|
||||
/// dynamic_allocators clause.
|
||||
OMP_REQ_DYNAMIC_ALLOCATORS = 0x010
|
||||
};
|
||||
|
||||
/// This struct is a record of an entry point or global. For a function
|
||||
/// entry point the size is expected to be zero
|
||||
struct __tgt_offload_entry {
|
||||
@@ -114,6 +128,9 @@ int omp_target_associate_ptr(void *host_ptr, void *device_ptr, size_t size,
|
||||
size_t device_offset, int device_num);
|
||||
int omp_target_disassociate_ptr(void *host_ptr, int device_num);
|
||||
|
||||
/// add the clauses of the requires directives in a given file
|
||||
void __tgt_register_requires(int64_t flags);
|
||||
|
||||
/// adds a target shared library to the target execution image
|
||||
void __tgt_register_lib(__tgt_bin_desc *desc);
|
||||
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
//===-- omptargetplugin.h - Target dependent OpenMP Plugin API --*- C++ -*-===//
|
||||
//
|
||||
// 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
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
@@ -32,6 +31,9 @@ int32_t __tgt_rtl_number_of_devices(void);
|
||||
// having to load the library, which can be expensive.
|
||||
int32_t __tgt_rtl_is_valid_binary(__tgt_device_image *Image);
|
||||
|
||||
// Initialize the requires flags for the device.
|
||||
int64_t __tgt_rtl_init_requires(int64_t RequiresFlags);
|
||||
|
||||
// Initialize the specified device. In case of success return 0; otherwise
|
||||
// return an error code.
|
||||
int32_t __tgt_rtl_init_device(int32_t ID);
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
##===----------------------------------------------------------------------===##
|
||||
#
|
||||
# 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
|
||||
#
|
||||
##===----------------------------------------------------------------------===##
|
||||
#
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
##===----------------------------------------------------------------------===##
|
||||
#
|
||||
# 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
|
||||
#
|
||||
##===----------------------------------------------------------------------===##
|
||||
#
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
//===-- elf_common.c - Common ELF functionality -------------------*- C -*-===//
|
||||
//
|
||||
// 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
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
##===----------------------------------------------------------------------===##
|
||||
#
|
||||
# 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
|
||||
#
|
||||
##===----------------------------------------------------------------------===##
|
||||
#
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
//===----RTLs/cuda/src/rtl.cpp - Target RTLs Implementation ------- C++ -*-===//
|
||||
//
|
||||
// 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
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
@@ -112,6 +111,9 @@ public:
|
||||
int EnvNumTeams;
|
||||
int EnvTeamLimit;
|
||||
|
||||
// OpenMP Requires Flags
|
||||
int64_t RequiresFlags;
|
||||
|
||||
//static int EnvNumThreads;
|
||||
static const int HardTeamLimit = 1<<16; // 64k
|
||||
static const int HardThreadLimit = 1024;
|
||||
@@ -228,6 +230,9 @@ public:
|
||||
} else {
|
||||
EnvNumTeams = -1;
|
||||
}
|
||||
|
||||
// Default state.
|
||||
RequiresFlags = OMP_REQ_UNDEFINED;
|
||||
}
|
||||
|
||||
~RTLDeviceInfoTy() {
|
||||
@@ -265,6 +270,12 @@ int32_t __tgt_rtl_is_valid_binary(__tgt_device_image *image) {
|
||||
|
||||
int32_t __tgt_rtl_number_of_devices() { return DeviceInfo.NumberOfDevices; }
|
||||
|
||||
int64_t __tgt_rtl_init_requires(int64_t RequiresFlags) {
|
||||
DP("Init requires flags to %ld\n", RequiresFlags);
|
||||
DeviceInfo.RequiresFlags = RequiresFlags;
|
||||
return RequiresFlags;
|
||||
}
|
||||
|
||||
int32_t __tgt_rtl_init_device(int32_t device_id) {
|
||||
|
||||
CUdevice cuDevice;
|
||||
@@ -437,6 +448,26 @@ __tgt_target_table *__tgt_rtl_load_binary(int32_t device_id,
|
||||
DPxPTR(e - HostBegin), e->name, DPxPTR(cuptr));
|
||||
entry.addr = (void *)cuptr;
|
||||
|
||||
// Note: In the current implementation declare target variables
|
||||
// can either be link or to. This means that once unified
|
||||
// memory is activated via the requires directive, the variable
|
||||
// can be used directly from the host in both cases.
|
||||
// TODO: when variables types other than to or link are added,
|
||||
// the below condition should be changed to explicitely
|
||||
// check for to and link variables types:
|
||||
// (DeviceInfo.RequiresFlags & OMP_REQ_UNIFIED_SHARED_MEMORY &&
|
||||
// (e->flags & OMP_DECLARE_TARGET_LINK ||
|
||||
// e->flags == OMP_DECLARE_TARGET_TO))
|
||||
if (DeviceInfo.RequiresFlags & OMP_REQ_UNIFIED_SHARED_MEMORY) {
|
||||
// If unified memory is present any target link or to variables
|
||||
// can access host addresses directly. There is no longer a
|
||||
// need for device copies.
|
||||
cuMemcpyHtoD(cuptr, e->addr, sizeof(void *));
|
||||
DP("Copy linked variable host address (" DPxMOD ")"
|
||||
"to device address (" DPxMOD ")\n",
|
||||
DPxPTR(*((void**)e->addr)), DPxPTR(cuptr));
|
||||
}
|
||||
|
||||
DeviceInfo.addOffloadEntry(device_id, entry);
|
||||
|
||||
continue;
|
||||
|
||||
@@ -2,6 +2,7 @@ VERS1.0 {
|
||||
global:
|
||||
__tgt_rtl_is_valid_binary;
|
||||
__tgt_rtl_number_of_devices;
|
||||
__tgt_rtl_init_requires;
|
||||
__tgt_rtl_init_device;
|
||||
__tgt_rtl_load_binary;
|
||||
__tgt_rtl_data_alloc;
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
//===-RTLs/generic-64bit/src/rtl.cpp - Target RTLs Implementation - C++ -*-===//
|
||||
//
|
||||
// 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
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
##===----------------------------------------------------------------------===##
|
||||
#
|
||||
# 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
|
||||
#
|
||||
##===----------------------------------------------------------------------===##
|
||||
#
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
##===----------------------------------------------------------------------===##
|
||||
#
|
||||
# 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
|
||||
#
|
||||
##===----------------------------------------------------------------------===##
|
||||
#
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
##===----------------------------------------------------------------------===##
|
||||
#
|
||||
# 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
|
||||
#
|
||||
##===----------------------------------------------------------------------===##
|
||||
#
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
##===----------------------------------------------------------------------===##
|
||||
#
|
||||
# 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
|
||||
#
|
||||
##===----------------------------------------------------------------------===##
|
||||
#
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
//===----------- api.cpp - Target independent OpenMP target RTL -----------===//
|
||||
//
|
||||
// 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
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
//===--------- device.cpp - Target independent OpenMP target RTL ----------===//
|
||||
//
|
||||
// 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
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
@@ -153,7 +152,7 @@ LookupResult DeviceTy::lookupMapping(void *HstPtrBegin, int64_t Size) {
|
||||
|
||||
// Used by target_data_begin
|
||||
// Return the target pointer begin (where the data will be moved).
|
||||
// Allocate memory if this is the first occurrence if this mapping.
|
||||
// Allocate memory if this is the first occurrence of this mapping.
|
||||
// Increment the reference counter.
|
||||
// If NULL is returned, then either data allocation failed or the user tried
|
||||
// to do an illegal mapping.
|
||||
@@ -276,6 +275,9 @@ int DeviceTy::deallocTgtPtr(void *HstPtrBegin, int64_t Size, bool ForceDelete) {
|
||||
|
||||
/// Init device, should not be called directly.
|
||||
void DeviceTy::init() {
|
||||
// Make call to init_requires if it exists for this plugin.
|
||||
if (RTL->init_requires)
|
||||
RTL->init_requires(RTLRequiresFlags);
|
||||
int32_t rc = RTL->init_device(RTLDeviceID);
|
||||
if (rc == OFFLOAD_SUCCESS) {
|
||||
IsInit = true;
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
//===----------- device.h - Target independent OpenMP target RTL ----------===//
|
||||
//
|
||||
// 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
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
@@ -97,13 +96,17 @@ struct DeviceTy {
|
||||
|
||||
std::mutex DataMapMtx, PendingGlobalsMtx, ShadowMtx;
|
||||
|
||||
uint64_t loopTripCnt;
|
||||
// NOTE: Once libomp gains full target-task support, this state should be
|
||||
// moved into the target task in libomp.
|
||||
std::map<int32_t, uint64_t> LoopTripCnt;
|
||||
|
||||
int64_t RTLRequiresFlags;
|
||||
|
||||
DeviceTy(RTLInfoTy *RTL)
|
||||
: DeviceID(-1), RTL(RTL), RTLDeviceID(-1), IsInit(false), InitFlag(),
|
||||
HasPendingGlobals(false), HostDataToTargetMap(),
|
||||
PendingCtorsDtors(), ShadowPtrMap(), DataMapMtx(), PendingGlobalsMtx(),
|
||||
ShadowMtx(), loopTripCnt(0) {}
|
||||
ShadowMtx(), RTLRequiresFlags(0) {}
|
||||
|
||||
// The existence of mutexes makes DeviceTy non-copyable. We need to
|
||||
// provide a copy constructor and an assignment operator explicitly.
|
||||
@@ -113,7 +116,8 @@ struct DeviceTy {
|
||||
HostDataToTargetMap(d.HostDataToTargetMap),
|
||||
PendingCtorsDtors(d.PendingCtorsDtors), ShadowPtrMap(d.ShadowPtrMap),
|
||||
DataMapMtx(), PendingGlobalsMtx(),
|
||||
ShadowMtx(), loopTripCnt(d.loopTripCnt) {}
|
||||
ShadowMtx(), LoopTripCnt(d.LoopTripCnt),
|
||||
RTLRequiresFlags(d.RTLRequiresFlags) {}
|
||||
|
||||
DeviceTy& operator=(const DeviceTy &d) {
|
||||
DeviceID = d.DeviceID;
|
||||
@@ -124,7 +128,8 @@ struct DeviceTy {
|
||||
HostDataToTargetMap = d.HostDataToTargetMap;
|
||||
PendingCtorsDtors = d.PendingCtorsDtors;
|
||||
ShadowPtrMap = d.ShadowPtrMap;
|
||||
loopTripCnt = d.loopTripCnt;
|
||||
LoopTripCnt = d.LoopTripCnt;
|
||||
RTLRequiresFlags = d.RTLRequiresFlags;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
VERS1.0 {
|
||||
global:
|
||||
__tgt_register_requires;
|
||||
__tgt_register_lib;
|
||||
__tgt_unregister_lib;
|
||||
__tgt_target_data_begin;
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
//===-------- interface.cpp - Target independent OpenMP target RTL --------===//
|
||||
//
|
||||
// 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,11 +33,11 @@ static void HandleDefaultTargetOffload() {
|
||||
if (TargetOffloadPolicy == tgt_default) {
|
||||
if (omp_get_num_devices() > 0) {
|
||||
DP("Default TARGET OFFLOAD policy is now mandatory "
|
||||
"(devicew were found)\n");
|
||||
"(devices were found)\n");
|
||||
TargetOffloadPolicy = tgt_mandatory;
|
||||
} else {
|
||||
DP("Default TARGET OFFLOAD policy is now disabled "
|
||||
"(devices were not found)\n");
|
||||
"(no devices were found)\n");
|
||||
TargetOffloadPolicy = tgt_disabled;
|
||||
}
|
||||
}
|
||||
@@ -58,8 +57,8 @@ static void HandleTargetOutcome(bool success) {
|
||||
}
|
||||
break;
|
||||
case tgt_default:
|
||||
FATAL_MESSAGE0(1, "default offloading policy must switched to "
|
||||
"mandatory or disabled");
|
||||
FATAL_MESSAGE0(1, "default offloading policy must be switched to "
|
||||
"mandatory or disabled");
|
||||
break;
|
||||
case tgt_mandatory:
|
||||
if (!success) {
|
||||
@@ -69,6 +68,12 @@ static void HandleTargetOutcome(bool success) {
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// adds requires flags
|
||||
EXTERN void __tgt_register_requires(int64_t flags) {
|
||||
RTLs.RegisterRequires(flags);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// adds a target shared library to the target execution image
|
||||
EXTERN void __tgt_register_lib(__tgt_bin_desc *desc) {
|
||||
@@ -123,7 +128,7 @@ EXTERN void __tgt_target_data_begin_nowait(int64_t device_id, int32_t arg_num,
|
||||
int32_t depNum, void *depList, int32_t noAliasDepNum,
|
||||
void *noAliasDepList) {
|
||||
if (depNum + noAliasDepNum > 0)
|
||||
__kmpc_omp_taskwait(NULL, 0);
|
||||
__kmpc_omp_taskwait(NULL, __kmpc_global_thread_num(NULL));
|
||||
|
||||
__tgt_target_data_begin(device_id, arg_num, args_base, args, arg_sizes,
|
||||
arg_types);
|
||||
@@ -176,7 +181,7 @@ EXTERN void __tgt_target_data_end_nowait(int64_t device_id, int32_t arg_num,
|
||||
int32_t depNum, void *depList, int32_t noAliasDepNum,
|
||||
void *noAliasDepList) {
|
||||
if (depNum + noAliasDepNum > 0)
|
||||
__kmpc_omp_taskwait(NULL, 0);
|
||||
__kmpc_omp_taskwait(NULL, __kmpc_global_thread_num(NULL));
|
||||
|
||||
__tgt_target_data_end(device_id, arg_num, args_base, args, arg_sizes,
|
||||
arg_types);
|
||||
@@ -209,7 +214,7 @@ EXTERN void __tgt_target_data_update_nowait(
|
||||
int64_t *arg_sizes, int64_t *arg_types, int32_t depNum, void *depList,
|
||||
int32_t noAliasDepNum, void *noAliasDepList) {
|
||||
if (depNum + noAliasDepNum > 0)
|
||||
__kmpc_omp_taskwait(NULL, 0);
|
||||
__kmpc_omp_taskwait(NULL, __kmpc_global_thread_num(NULL));
|
||||
|
||||
__tgt_target_data_update(device_id, arg_num, args_base, args, arg_sizes,
|
||||
arg_types);
|
||||
@@ -250,7 +255,7 @@ EXTERN int __tgt_target_nowait(int64_t device_id, void *host_ptr,
|
||||
int64_t *arg_types, int32_t depNum, void *depList, int32_t noAliasDepNum,
|
||||
void *noAliasDepList) {
|
||||
if (depNum + noAliasDepNum > 0)
|
||||
__kmpc_omp_taskwait(NULL, 0);
|
||||
__kmpc_omp_taskwait(NULL, __kmpc_global_thread_num(NULL));
|
||||
|
||||
return __tgt_target(device_id, host_ptr, arg_num, args_base, args, arg_sizes,
|
||||
arg_types);
|
||||
@@ -293,14 +298,12 @@ EXTERN int __tgt_target_teams_nowait(int64_t device_id, void *host_ptr,
|
||||
int64_t *arg_types, int32_t team_num, int32_t thread_limit, int32_t depNum,
|
||||
void *depList, int32_t noAliasDepNum, void *noAliasDepList) {
|
||||
if (depNum + noAliasDepNum > 0)
|
||||
__kmpc_omp_taskwait(NULL, 0);
|
||||
__kmpc_omp_taskwait(NULL, __kmpc_global_thread_num(NULL));
|
||||
|
||||
return __tgt_target_teams(device_id, host_ptr, arg_num, args_base, args,
|
||||
arg_sizes, arg_types, team_num, thread_limit);
|
||||
}
|
||||
|
||||
|
||||
// The trip count mechanism will be revised - this scheme is not thread-safe.
|
||||
EXTERN void __kmpc_push_target_tripcount(int64_t device_id,
|
||||
uint64_t loop_tripcount) {
|
||||
if (device_id == OFFLOAD_DEVICE_DEFAULT) {
|
||||
@@ -315,5 +318,8 @@ EXTERN void __kmpc_push_target_tripcount(int64_t device_id,
|
||||
|
||||
DP("__kmpc_push_target_tripcount(%" PRId64 ", %" PRIu64 ")\n", device_id,
|
||||
loop_tripcount);
|
||||
Devices[device_id].loopTripCnt = loop_tripcount;
|
||||
TblMapMtx.lock();
|
||||
Devices[device_id].LoopTripCnt.emplace(__kmpc_global_thread_num(NULL),
|
||||
loop_tripcount);
|
||||
TblMapMtx.unlock();
|
||||
}
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
//===------ omptarget.cpp - Target independent OpenMP target RTL -- C++ -*-===//
|
||||
//
|
||||
// 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
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
@@ -730,8 +729,15 @@ int target(int64_t device_id, void *host_ptr, int32_t arg_num,
|
||||
"Size mismatch in arguments and offsets");
|
||||
|
||||
// Pop loop trip count
|
||||
uint64_t ltc = Device.loopTripCnt;
|
||||
Device.loopTripCnt = 0;
|
||||
uint64_t ltc = 0;
|
||||
TblMapMtx.lock();
|
||||
auto I = Device.LoopTripCnt.find(__kmpc_global_thread_num(NULL));
|
||||
if (I != Device.LoopTripCnt.end()) {
|
||||
ltc = I->second;
|
||||
Device.LoopTripCnt.erase(I);
|
||||
DP("loop trip count is %lu.\n", ltc);
|
||||
}
|
||||
TblMapMtx.unlock();
|
||||
|
||||
// Launch device execution.
|
||||
DP("Launching target execution %s with pointer " DPxMOD " (index=%d).\n",
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
//===---------- private.h - Target independent OpenMP target RTL ----------===//
|
||||
//
|
||||
// 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
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
@@ -66,6 +65,7 @@ extern "C" {
|
||||
// functions that extract info from libomp; keep in sync
|
||||
int omp_get_default_device(void) __attribute__((weak));
|
||||
int32_t __kmpc_omp_taskwait(void *loc_ref, int32_t gtid) __attribute__((weak));
|
||||
int32_t __kmpc_global_thread_num(void *) __attribute__((weak));
|
||||
int __kmpc_get_target_offload(void) __attribute__((weak));
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
//===----------- rtl.cpp - Target independent OpenMP target RTL -----------===//
|
||||
//
|
||||
// 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
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
@@ -108,6 +107,10 @@ void RTLsTy::LoadRTLs() {
|
||||
dynlib_handle, "__tgt_rtl_run_target_team_region")))
|
||||
continue;
|
||||
|
||||
// Optional functions
|
||||
*((void**) &R.init_requires) = dlsym(
|
||||
dynlib_handle, "__tgt_rtl_init_requires");
|
||||
|
||||
// No devices are supported by this RTL?
|
||||
if (!(R.NumberOfDevices = R.number_of_devices())) {
|
||||
DP("No devices supported in this RTL\n");
|
||||
@@ -187,6 +190,46 @@ static void RegisterGlobalCtorsDtorsForImage(__tgt_bin_desc *desc,
|
||||
}
|
||||
}
|
||||
|
||||
void RTLsTy::RegisterRequires(int64_t flags) {
|
||||
// TODO: add more elaborate check.
|
||||
// Minimal check: only set requires flags if previous value
|
||||
// is undefined. This ensures that only the first call to this
|
||||
// function will set the requires flags. All subsequent calls
|
||||
// will be checked for compatibility.
|
||||
assert(flags != OMP_REQ_UNDEFINED &&
|
||||
"illegal undefined flag for requires directive!");
|
||||
if (RequiresFlags == OMP_REQ_UNDEFINED) {
|
||||
RequiresFlags = flags;
|
||||
return;
|
||||
}
|
||||
|
||||
// If multiple compilation units are present enforce
|
||||
// consistency across all of them for require clauses:
|
||||
// - reverse_offload
|
||||
// - unified_address
|
||||
// - unified_shared_memory
|
||||
if ((RequiresFlags & OMP_REQ_REVERSE_OFFLOAD) !=
|
||||
(flags & OMP_REQ_REVERSE_OFFLOAD)) {
|
||||
FATAL_MESSAGE0(1,
|
||||
"'#pragma omp requires reverse_offload' not used consistently!");
|
||||
}
|
||||
if ((RequiresFlags & OMP_REQ_UNIFIED_ADDRESS) !=
|
||||
(flags & OMP_REQ_UNIFIED_ADDRESS)) {
|
||||
FATAL_MESSAGE0(1,
|
||||
"'#pragma omp requires unified_address' not used consistently!");
|
||||
}
|
||||
if ((RequiresFlags & OMP_REQ_UNIFIED_SHARED_MEMORY) !=
|
||||
(flags & OMP_REQ_UNIFIED_SHARED_MEMORY)) {
|
||||
FATAL_MESSAGE0(1,
|
||||
"'#pragma omp requires unified_shared_memory' not used consistently!");
|
||||
}
|
||||
|
||||
// TODO: insert any other missing checks
|
||||
|
||||
DP("New requires flags %ld compatible with existing %ld!\n",
|
||||
flags, RequiresFlags);
|
||||
}
|
||||
|
||||
void RTLsTy::RegisterLib(__tgt_bin_desc *desc) {
|
||||
// Attempt to load all plugins available in the system.
|
||||
std::call_once(initFlag, &RTLsTy::LoadRTLs, this);
|
||||
@@ -223,6 +266,8 @@ void RTLsTy::RegisterLib(__tgt_bin_desc *desc) {
|
||||
Devices[start + device_id].DeviceID = start + device_id;
|
||||
// RTL local device ID
|
||||
Devices[start + device_id].RTLDeviceID = device_id;
|
||||
// RTL requires flags
|
||||
Devices[start + device_id].RTLRequiresFlags = RequiresFlags;
|
||||
}
|
||||
|
||||
// Initialize the index of this RTL and save it in the used RTLs.
|
||||
|
||||
+13
-6
@@ -1,9 +1,8 @@
|
||||
//===------------ rtl.h - Target independent OpenMP target RTL ------------===//
|
||||
//
|
||||
// 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
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
@@ -37,6 +36,7 @@ struct RTLInfoTy {
|
||||
int32_t);
|
||||
typedef int32_t(run_team_region_ty)(int32_t, void *, void **, ptrdiff_t *,
|
||||
int32_t, int32_t, int32_t, uint64_t);
|
||||
typedef int64_t(init_requires_ty)(int64_t);
|
||||
|
||||
int32_t Idx; // RTL index, index is the number of devices
|
||||
// of other RTLs that were registered before,
|
||||
@@ -61,6 +61,7 @@ struct RTLInfoTy {
|
||||
data_delete_ty *data_delete;
|
||||
run_region_ty *run_region;
|
||||
run_team_region_ty *run_team_region;
|
||||
init_requires_ty *init_requires;
|
||||
|
||||
// Are there images associated with this RTL.
|
||||
bool isUsed;
|
||||
@@ -79,8 +80,8 @@ struct RTLInfoTy {
|
||||
#endif
|
||||
is_valid_binary(0), number_of_devices(0), init_device(0),
|
||||
load_binary(0), data_alloc(0), data_submit(0), data_retrieve(0),
|
||||
data_delete(0), run_region(0), run_team_region(0), isUsed(false),
|
||||
Mtx() {}
|
||||
data_delete(0), run_region(0), run_team_region(0),
|
||||
init_requires(0), isUsed(false), Mtx() {}
|
||||
|
||||
RTLInfoTy(const RTLInfoTy &r) : Mtx() {
|
||||
Idx = r.Idx;
|
||||
@@ -99,6 +100,7 @@ struct RTLInfoTy {
|
||||
data_delete = r.data_delete;
|
||||
run_region = r.run_region;
|
||||
run_team_region = r.run_team_region;
|
||||
init_requires = r.init_requires;
|
||||
isUsed = r.isUsed;
|
||||
}
|
||||
};
|
||||
@@ -119,8 +121,13 @@ public:
|
||||
// binaries.
|
||||
std::vector<RTLInfoTy *> UsedRTLs;
|
||||
|
||||
int64_t RequiresFlags;
|
||||
|
||||
explicit RTLsTy() {}
|
||||
|
||||
// Register the clauses of the requires directive.
|
||||
void RegisterRequires(int64_t flags);
|
||||
|
||||
// Register a shared library with all (compatible) RTLs.
|
||||
void RegisterLib(__tgt_bin_desc *desc);
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ if(NOT OPENMP_TEST_COMPILER_ID STREQUAL "Clang" OR
|
||||
return()
|
||||
endif()
|
||||
|
||||
if(LIBOMPTARGET_CMAKE_BUILD_TYPE MATCHES debug)
|
||||
if(LIBOMPTARGET_ENABLE_DEBUG)
|
||||
set(LIBOMPTARGET_DEBUG True)
|
||||
else()
|
||||
set(LIBOMPTARGET_DEBUG False)
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
// RUN: %libomptarget-compile-aarch64-unknown-linux-gnu && env LIBOMPTARGET_DEBUG=1 %libomptarget-run-aarch64-unknown-linux-gnu 2>&1 | %fcheck-aarch64-unknown-linux-gnu -allow-empty -check-prefix=DEBUG
|
||||
// RUN: %libomptarget-compile-powerpc64-ibm-linux-gnu && env LIBOMPTARGET_DEBUG=1 %libomptarget-run-powerpc64-ibm-linux-gnu 2>&1 | %fcheck-powerpc64-ibm-linux-gnu -allow-empty -check-prefix=DEBUG
|
||||
// RUN: %libomptarget-compile-powerpc64le-ibm-linux-gnu && env LIBOMPTARGET_DEBUG=1 %libomptarget-run-powerpc64le-ibm-linux-gnu 2>&1 | %fcheck-powerpc64le-ibm-linux-gnu -allow-empty -check-prefix=DEBUG
|
||||
// RUN: %libomptarget-compile-x86_64-pc-linux-gnu && env LIBOMPTARGET_DEBUG=1 %libomptarget-run-x86_64-pc-linux-gnu 2>&1 | %fcheck-x86_64-pc-linux-gnu -allow-empty -check-prefix=DEBUG
|
||||
// REQUIRES: libomptarget-debug
|
||||
|
||||
/*
|
||||
Test for looptripcount being popped from runtime stack.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <omp.h>
|
||||
int main()
|
||||
{
|
||||
int N = 128;
|
||||
int NN = 1024;
|
||||
int num_teams[NN];
|
||||
int num_threads[NN];
|
||||
|
||||
printf("#pragma omp target teams distribute parallel for thread_limit(4)\n");
|
||||
#pragma omp target teams distribute parallel for thread_limit(4)
|
||||
for (int j = 0; j< N; j++) {
|
||||
num_threads[j] = omp_get_num_threads();
|
||||
num_teams[j] = omp_get_num_teams();
|
||||
}
|
||||
printf("num_threads %d num_teams %d\n", num_threads[0], num_teams[0]);
|
||||
// DEBUG: loop trip count is 128
|
||||
printf("#pragma omp target teams distribute parallel for\n");
|
||||
#pragma omp target teams distribute parallel for
|
||||
for (int j = 0; j< N; j++) {
|
||||
num_threads[j] = omp_get_num_threads();
|
||||
num_teams[j] = omp_get_num_teams();
|
||||
}
|
||||
printf("num_threads %d num_teams %d\n", num_threads[0], num_teams[0]);
|
||||
// DEBUG: loop trip count is 128
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
// RUN: %libomptarget-compile-aarch64-unknown-linux-gnu && env LIBOMPTARGET_DEBUG=1 %libomptarget-run-aarch64-unknown-linux-gnu 2>&1 | %fcheck-aarch64-unknown-linux-gnu -allow-empty -check-prefix=DEBUG
|
||||
// RUN: %libomptarget-compile-powerpc64-ibm-linux-gnu && env LIBOMPTARGET_DEBUG=1 %libomptarget-run-powerpc64-ibm-linux-gnu 2>&1 | %fcheck-powerpc64-ibm-linux-gnu -allow-empty -check-prefix=DEBUG
|
||||
// RUN: %libomptarget-compile-powerpc64le-ibm-linux-gnu && env LIBOMPTARGET_DEBUG=1 %libomptarget-run-powerpc64le-ibm-linux-gnu 2>&1 | %fcheck-powerpc64le-ibm-linux-gnu -allow-empty -check-prefix=DEBUG
|
||||
// RUN: %libomptarget-compile-x86_64-pc-linux-gnu && env LIBOMPTARGET_DEBUG=1 %libomptarget-run-x86_64-pc-linux-gnu 2>&1 | %fcheck-x86_64-pc-linux-gnu -allow-empty -check-prefix=DEBUG
|
||||
// REQUIRES: libomptarget-debug
|
||||
|
||||
/*
|
||||
Test for the 'requires' clause check.
|
||||
When a target region is used, the requires flags are set in the
|
||||
runtime for the entire compilation unit. If the flags are set again,
|
||||
(for whatever reason) the set must be consistent with previously
|
||||
set values.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <omp.h>
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Various definitions copied from OpenMP RTL
|
||||
|
||||
extern void __tgt_register_requires(int64_t);
|
||||
|
||||
// End of definitions copied from OpenMP RTL.
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
void run_reg_requires() {
|
||||
// Before the target region is registered, the requires registers the status
|
||||
// of the requires clauses. Since there are no requires clauses in this file
|
||||
// the flags state can only be OMP_REQ_NONE i.e. 1.
|
||||
|
||||
// This is the 2nd time this function is called so it should print the debug
|
||||
// info belonging to the check.
|
||||
__tgt_register_requires(1);
|
||||
__tgt_register_requires(1);
|
||||
// DEBUG: New requires flags 1 compatible with existing 1!
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
int main() {
|
||||
run_reg_requires();
|
||||
|
||||
// This also runs reg requires for the first time.
|
||||
#pragma omp target
|
||||
{}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
// RUN: %libomptarget-compilexx-run-and-check-aarch64-unknown-linux-gnu
|
||||
// RUN: %libomptarget-compilexx-run-and-check-powerpc64-ibm-linux-gnu
|
||||
// RUN: %libomptarget-compilexx-run-and-check-powerpc64le-ibm-linux-gnu
|
||||
// RUN: %libomptarget-compilexx-run-and-check-x86_64-pc-linux-gnu
|
||||
|
||||
#include <omp.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#define N 1024
|
||||
|
||||
int A[N];
|
||||
int B[N];
|
||||
int C[N];
|
||||
int main() {
|
||||
for (int i = 0; i < N; i++)
|
||||
A[i] = B[i] = i;
|
||||
|
||||
#pragma omp parallel num_threads(2)
|
||||
{
|
||||
if (omp_get_thread_num() == 1) {
|
||||
// map data A & B and move to
|
||||
#pragma omp target enter data map(to : A, B) depend(out : A[0]) nowait
|
||||
|
||||
// no data move since already mapped
|
||||
#pragma omp target map(A, B) depend(out : A[0]) nowait
|
||||
{
|
||||
for (int i = 0; i < N; i++)
|
||||
++A[i];
|
||||
for (int i = 0; i < N; i++)
|
||||
++B[i];
|
||||
}
|
||||
|
||||
// no data move since already mapped
|
||||
#pragma omp target teams num_teams(1) map(A, B) depend(out : A[0]) nowait
|
||||
{
|
||||
for (int i = 0; i < N; i++)
|
||||
++A[i];
|
||||
for (int i = 0; i < N; i++)
|
||||
++B[i];
|
||||
}
|
||||
|
||||
// A updated via update
|
||||
#pragma omp target update from(A) depend(out : A[0]) nowait
|
||||
|
||||
// B updated via exit, A just released
|
||||
#pragma omp target exit data map(release \
|
||||
: A) map(from \
|
||||
: B) depend(out \
|
||||
: A[0]) nowait
|
||||
} // if
|
||||
} // parallel
|
||||
|
||||
int Sum = 0;
|
||||
for (int i = 0; i < N; i++)
|
||||
Sum += A[i] + B[i];
|
||||
// Sum is 2 * N * (2 + N - 1 + 2) / 2
|
||||
// CHECK: Sum = 1051648.
|
||||
printf("Sum = %d.\n", Sum);
|
||||
|
||||
return Sum != 2 * N * (2 + N - 1 + 2) / 2;
|
||||
}
|
||||
|
||||
+6
-24
@@ -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
|
||||
#//
|
||||
#//===----------------------------------------------------------------------===//
|
||||
#
|
||||
@@ -70,21 +69,8 @@ libomp_check_variable(LIBOMP_ARCH 32e x86_64 32 i386 arm ppc64 ppc64le aarch64 m
|
||||
set(LIBOMP_LIB_TYPE normal CACHE STRING
|
||||
"Performance,Profiling,Stubs library (normal/profile/stubs)")
|
||||
libomp_check_variable(LIBOMP_LIB_TYPE normal profile stubs)
|
||||
set(LIBOMP_OMP_VERSION 50 CACHE STRING
|
||||
"The OpenMP version (50/45/40/30)")
|
||||
libomp_check_variable(LIBOMP_OMP_VERSION 50 45 40 30)
|
||||
# Set the OpenMP Year and Month assiociated with version
|
||||
if(${LIBOMP_OMP_VERSION} GREATER 50 OR ${LIBOMP_OMP_VERSION} EQUAL 50)
|
||||
set(LIBOMP_OMP_YEAR_MONTH 201611)
|
||||
elseif(${LIBOMP_OMP_VERSION} GREATER 45 OR ${LIBOMP_OMP_VERSION} EQUAL 45)
|
||||
set(LIBOMP_OMP_YEAR_MONTH 201511)
|
||||
elseif(${LIBOMP_OMP_VERSION} GREATER 40 OR ${LIBOMP_OMP_VERSION} EQUAL 40)
|
||||
set(LIBOMP_OMP_YEAR_MONTH 201307)
|
||||
elseif(${LIBOMP_OMP_VERSION} GREATER 30 OR ${LIBOMP_OMP_VERSION} EQUAL 30)
|
||||
set(LIBOMP_OMP_YEAR_MONTH 201107)
|
||||
else()
|
||||
set(LIBOMP_OMP_YEAR_MONTH 200505)
|
||||
endif()
|
||||
set(LIBOMP_OMP_YEAR_MONTH 201611)
|
||||
set(LIBOMP_MIC_ARCH knc CACHE STRING
|
||||
"Intel(R) Many Integrated Core Architecture (Intel(R) MIC Architecture) (knf/knc). Ignored if not Intel(R) MIC Architecture build.")
|
||||
if("${LIBOMP_ARCH}" STREQUAL "mic")
|
||||
@@ -214,7 +200,7 @@ endif()
|
||||
set(LIBOMP_BASE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
set(LIBOMP_SRC_DIR ${LIBOMP_BASE_DIR}/src)
|
||||
set(LIBOMP_TOOLS_DIR ${LIBOMP_BASE_DIR}/tools)
|
||||
set(LIBOMP_INC_DIR ${LIBOMP_SRC_DIR}/include/${LIBOMP_OMP_VERSION})
|
||||
set(LIBOMP_INC_DIR ${LIBOMP_SRC_DIR}/include)
|
||||
set(LIBOMP_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
# Enabling Fortran if it is needed
|
||||
@@ -302,7 +288,7 @@ endif()
|
||||
# OMPT-support defaults to ON for OpenMP 5.0+ and if the requirements in
|
||||
# cmake/config-ix.cmake are fulfilled.
|
||||
set(OMPT_DEFAULT FALSE)
|
||||
if ((${LIBOMP_OMP_VERSION} GREATER 49) AND (LIBOMP_HAVE_OMPT_SUPPORT) AND (NOT WIN32))
|
||||
if ((LIBOMP_HAVE_OMPT_SUPPORT) AND (NOT WIN32))
|
||||
set(OMPT_DEFAULT TRUE)
|
||||
endif()
|
||||
set(LIBOMP_OMPT_SUPPORT ${OMPT_DEFAULT} CACHE BOOL
|
||||
@@ -315,9 +301,6 @@ set(LIBOMP_OMPT_OPTIONAL TRUE CACHE BOOL
|
||||
if(LIBOMP_OMPT_SUPPORT AND (NOT LIBOMP_HAVE_OMPT_SUPPORT))
|
||||
libomp_error_say("OpenMP Tools Interface requested but not available in this implementation")
|
||||
endif()
|
||||
if(LIBOMP_OMPT_SUPPORT AND (${LIBOMP_OMP_VERSION} LESS 50))
|
||||
libomp_error_say("OpenMP Tools Interface only available with OpenMP 5.0, LIBOMP_OMP_VERSION is ${LIBOMP_OMP_VERSION}")
|
||||
endif()
|
||||
|
||||
# TSAN-support
|
||||
set(LIBOMP_TSAN_SUPPORT FALSE CACHE BOOL
|
||||
@@ -369,7 +352,6 @@ if(${OPENMP_STANDALONE_BUILD})
|
||||
libomp_say("Intel(R) MIC Architecture -- ${LIBOMP_MIC_ARCH}")
|
||||
endif()
|
||||
libomp_say("Build Type -- ${CMAKE_BUILD_TYPE}")
|
||||
libomp_say("OpenMP Version -- ${LIBOMP_OMP_VERSION}")
|
||||
libomp_say("Library Kind -- ${LIBOMP_LIBRARY_KIND}")
|
||||
libomp_say("Library Type -- ${LIBOMP_LIB_TYPE}")
|
||||
libomp_say("Fortran Modules -- ${LIBOMP_FORTRAN_MODULES}")
|
||||
|
||||
@@ -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
|
||||
#//
|
||||
#//===----------------------------------------------------------------------===//
|
||||
#
|
||||
|
||||
@@ -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
|
||||
#//
|
||||
#//===----------------------------------------------------------------------===//
|
||||
#
|
||||
|
||||
@@ -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
|
||||
#//
|
||||
#//===----------------------------------------------------------------------===//
|
||||
#
|
||||
@@ -29,4 +28,3 @@ function(libomp_get_definitions_flags cppflags)
|
||||
# CMake doesn't include CPPFLAGS from environment, but we will.
|
||||
set(${cppflags} ${cppflags_local} ${LIBOMP_CPPFLAGS} $ENV{CPPFLAGS} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
|
||||
@@ -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
|
||||
#//
|
||||
#//===----------------------------------------------------------------------===//
|
||||
#
|
||||
@@ -14,16 +13,13 @@
|
||||
|
||||
# Create the suffix for the export directory
|
||||
# - Only add to suffix when not a default value
|
||||
# - Example suffix: .deb.30.s1
|
||||
# final export directory: exports/lin_32e.deb.30.s1/lib
|
||||
# - These suffixes imply the build is a Debug, OpenMP 3.0, Stats-Gathering version of the library
|
||||
# - Example suffix: .deb.s1
|
||||
# final export directory: exports/lin_32e.deb.s1/lib
|
||||
# - These suffixes imply the build is a Debug, Stats-Gathering version of the library
|
||||
set(libomp_suffix)
|
||||
libomp_append(libomp_suffix .deb DEBUG_BUILD)
|
||||
libomp_append(libomp_suffix .dia RELWITHDEBINFO_BUILD)
|
||||
libomp_append(libomp_suffix .min MINSIZEREL_BUILD)
|
||||
if(NOT "${LIBOMP_OMP_VERSION}" STREQUAL "45")
|
||||
libomp_append(libomp_suffix .${LIBOMP_OMP_VERSION})
|
||||
endif()
|
||||
libomp_append(libomp_suffix .s1 LIBOMP_STATS)
|
||||
libomp_append(libomp_suffix .ompt LIBOMP_OMPT_SUPPORT)
|
||||
if(${LIBOMP_OMPT_SUPPORT})
|
||||
@@ -96,4 +92,3 @@ if(WIN32)
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBOMPIMP_OUTPUT_DIRECTORY}/${LIBOMP_IMP_LIB_FILE} ${LIBOMP_EXPORTS_LIB_DIR}
|
||||
)
|
||||
endif()
|
||||
|
||||
|
||||
@@ -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
|
||||
#//
|
||||
#//===----------------------------------------------------------------------===//
|
||||
#
|
||||
|
||||
@@ -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,14 +158,13 @@ function(libomp_get_libflags libflags)
|
||||
if(${IA32})
|
||||
libomp_append(libflags_local -lirc_pic LIBOMP_HAVE_IRC_PIC_LIBRARY)
|
||||
endif()
|
||||
IF(${CMAKE_SYSTEM_NAME} MATCHES "DragonFly")
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "DragonFly")
|
||||
libomp_append(libflags_local "-Wl,--no-as-needed" LIBOMP_HAVE_AS_NEEDED_FLAG)
|
||||
libomp_append(libflags_local "-lm")
|
||||
libomp_append(libflags_local "-Wl,--as-needed" LIBOMP_HAVE_AS_NEEDED_FLAG)
|
||||
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "DragonFly")
|
||||
IF(${CMAKE_SYSTEM_NAME} MATCHES "NetBSD")
|
||||
elseif(${CMAKE_SYSTEM_NAME} MATCHES "(Free|Net)BSD")
|
||||
libomp_append(libflags_local -lm)
|
||||
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "NetBSD")
|
||||
endif()
|
||||
set(libflags_local ${libflags_local} ${LIBOMP_LIBFLAGS})
|
||||
libomp_setup_flags(libflags_local)
|
||||
set(${libflags} ${libflags_local} PARENT_SCOPE)
|
||||
@@ -200,18 +198,6 @@ function(libomp_get_gdflags gdflags)
|
||||
libomp_append(gdflags_local "-D stub" STUBS_LIBRARY)
|
||||
libomp_append(gdflags_local "-D HAVE_QUAD" LIBOMP_USE_QUAD_PRECISION)
|
||||
libomp_append(gdflags_local "-D USE_DEBUGGER" LIBOMP_USE_DEBUGGER)
|
||||
if(${LIBOMP_OMP_VERSION} GREATER 50 OR ${LIBOMP_OMP_VERSION} EQUAL 50)
|
||||
libomp_append(gdflags_local "-D OMP_50")
|
||||
endif()
|
||||
if(${LIBOMP_OMP_VERSION} GREATER 45 OR ${LIBOMP_OMP_VERSION} EQUAL 45)
|
||||
libomp_append(gdflags_local "-D OMP_45")
|
||||
endif()
|
||||
if(${LIBOMP_OMP_VERSION} GREATER 40 OR ${LIBOMP_OMP_VERSION} EQUAL 40)
|
||||
libomp_append(gdflags_local "-D OMP_40")
|
||||
endif()
|
||||
if(${LIBOMP_OMP_VERSION} GREATER 30 OR ${LIBOMP_OMP_VERSION} EQUAL 30)
|
||||
libomp_append(gdflags_local "-D OMP_30")
|
||||
endif()
|
||||
if(${DEBUG_BUILD} OR ${RELWITHDEBINFO_BUILD})
|
||||
libomp_append(gdflags_local "-D KMP_DEBUG")
|
||||
endif()
|
||||
|
||||
@@ -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
|
||||
#//
|
||||
#//===----------------------------------------------------------------------===//
|
||||
#
|
||||
@@ -171,7 +170,7 @@ add_custom_command(
|
||||
add_custom_target(libomp-test-deps DEPENDS test-deps/.success)
|
||||
set(libomp_expected_library_deps)
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
|
||||
set(libomp_expected_library_deps libc.so.7 libthr.so.3)
|
||||
set(libomp_expected_library_deps libc.so.7 libthr.so.3 libm.so.5)
|
||||
libomp_append(libomp_expected_library_deps libhwloc.so.5 LIBOMP_USE_HWLOC)
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES "NetBSD")
|
||||
set(libomp_expected_library_deps libc.so.12 libpthread.so.1 libm.so.0)
|
||||
|
||||
@@ -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
|
||||
#//
|
||||
#//===----------------------------------------------------------------------===//
|
||||
#
|
||||
|
||||
@@ -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
|
||||
#//
|
||||
#//===----------------------------------------------------------------------===//
|
||||
#
|
||||
|
||||
@@ -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
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
|
||||
+13
-12
@@ -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
|
||||
#//
|
||||
#//===----------------------------------------------------------------------===//
|
||||
#
|
||||
@@ -74,7 +73,6 @@ else()
|
||||
kmp_settings.cpp
|
||||
kmp_str.cpp
|
||||
kmp_tasking.cpp
|
||||
kmp_taskq.cpp
|
||||
kmp_threadprivate.cpp
|
||||
kmp_utility.cpp
|
||||
kmp_barrier.cpp
|
||||
@@ -99,10 +97,8 @@ else()
|
||||
libomp_append(LIBOMP_CXXFILES kmp_debugger.cpp LIBOMP_USE_DEBUGGER)
|
||||
libomp_append(LIBOMP_CXXFILES kmp_stats.cpp LIBOMP_STATS)
|
||||
libomp_append(LIBOMP_CXXFILES kmp_stats_timing.cpp LIBOMP_STATS)
|
||||
if(${LIBOMP_OMP_VERSION} GREATER 40 OR ${LIBOMP_OMP_VERSION} EQUAL 40)
|
||||
libomp_append(LIBOMP_CXXFILES kmp_taskdeps.cpp)
|
||||
libomp_append(LIBOMP_CXXFILES kmp_cancel.cpp)
|
||||
endif()
|
||||
libomp_append(LIBOMP_CXXFILES kmp_taskdeps.cpp)
|
||||
libomp_append(LIBOMP_CXXFILES kmp_cancel.cpp)
|
||||
endif()
|
||||
# Files common to stubs and normal library
|
||||
libomp_append(LIBOMP_CXXFILES kmp_ftn_cdecl.cpp)
|
||||
@@ -241,6 +237,11 @@ if(${LIBOMP_FORTRAN_MODULES})
|
||||
configure_file(${LIBOMP_INC_DIR}/omp_lib.h.var omp_lib.h @ONLY)
|
||||
configure_file(${LIBOMP_INC_DIR}/omp_lib.f.var omp_lib.f @ONLY)
|
||||
configure_file(${LIBOMP_INC_DIR}/omp_lib.f90.var omp_lib.f90 @ONLY)
|
||||
# Workaround for gfortran to build modules with the
|
||||
# omp_sched_monotonic integer parameter
|
||||
if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
|
||||
set(ADDITIONAL_Fortran_FLAGS "-fno-range-check")
|
||||
endif()
|
||||
add_custom_target(libomp-mod ALL DEPENDS omp_lib.mod omp_lib_kinds.mod)
|
||||
libomp_get_fflags(LIBOMP_CONFIGURED_FFLAGS)
|
||||
if(CMAKE_Fortran_COMPILER_SUPPORTS_F90)
|
||||
@@ -250,7 +251,8 @@ if(${LIBOMP_FORTRAN_MODULES})
|
||||
endif()
|
||||
add_custom_command(
|
||||
OUTPUT omp_lib.mod omp_lib_kinds.mod
|
||||
COMMAND ${CMAKE_Fortran_COMPILER} -c ${LIBOMP_CONFIGURED_FFLAGS} ${LIBOMP_FORTRAN_SOURCE_FILE}
|
||||
COMMAND ${CMAKE_Fortran_COMPILER} -c ${ADDITIONAL_Fortran_FLAGS}
|
||||
${LIBOMP_CONFIGURED_FFLAGS} ${LIBOMP_FORTRAN_SOURCE_FILE}
|
||||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${LIBOMP_FORTRAN_SOURCE_FILE}
|
||||
${CMAKE_CURRENT_BINARY_DIR}/omp_lib.h
|
||||
)
|
||||
@@ -297,7 +299,7 @@ if(WIN32)
|
||||
install(CODE "execute_process(COMMAND \"\${CMAKE_COMMAND}\" -E copy \"${LIBOMP_LIB_FILE}\"
|
||||
\"${alias}${LIBOMP_LIBRARY_SUFFIX}\" WORKING_DIRECTORY \${CMAKE_INSTALL_PREFIX}/bin)")
|
||||
install(CODE "execute_process(COMMAND \"\${CMAKE_COMMAND}\" -E copy \"${LIBOMP_IMP_LIB_FILE}\"
|
||||
\"${alias}${LIBOMP_LIBRARY_SUFFIX}\" WORKING_DIRECTORY \${CMAKE_INSTALL_PREFIX}/${OPENMP_INSTALL_LIBDIR})")
|
||||
\"${alias}${CMAKE_STATIC_LIBRARY_SUFFIX}\" WORKING_DIRECTORY \${CMAKE_INSTALL_PREFIX}/${OPENMP_INSTALL_LIBDIR})")
|
||||
endforeach()
|
||||
else()
|
||||
|
||||
@@ -331,4 +333,3 @@ if(${LIBOMP_FORTRAN_MODULES})
|
||||
DESTINATION ${LIBOMP_HEADERS_INSTALL_PATH}
|
||||
)
|
||||
endif()
|
||||
|
||||
|
||||
+39
-59
@@ -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
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
|
||||
@@ -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 #
|
||||
# --------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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 */
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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) (
|
||||
@@ -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;
|
||||
typedef uintptr_t omp_uintptr_t;
|
||||
|
||||
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 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
|
||||
|
||||
@@ -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 (kind=omp_allocator_kind) svar
|
||||
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 (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
|
||||
@@ -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_kind), value :: svar
|
||||
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_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)
|
||||
@@ -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 (kind=omp_allocator_kind), value :: svar
|
||||
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 (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 )
|
||||
+374
-471
File diff suppressed because it is too large
Load Diff
@@ -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,
|
||||
|
||||
@@ -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
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
|
||||
+325
-70
@@ -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);
|
||||
al = desc.allocator;
|
||||
oal = (omp_allocator_handle_t)al; // cast to void* for comparisons
|
||||
KMP_DEBUG_ASSERT(al);
|
||||
|
||||
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);
|
||||
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. */
|
||||
|
||||
+44
-51
@@ -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;
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user