PR target/37878
[official-gcc.git] / libgomp / omp_lib.f90.in
blob07a57997b280c964ea775354f397b335df18b298
1 ! Copyright (C) 2005, 2007, 2008 Free Software Foundation, Inc.
2 ! Contributed by Jakub Jelinek <jakub@redhat.com>.
4 ! This file is part of the GNU OpenMP Library (libgomp).
6 ! Libgomp is free software; you can redistribute it and/or modify it
7 ! under the terms of the GNU Lesser General Public License as published by
8 ! the Free Software Foundation; either version 2.1 of the License, or
9 ! (at your option) any later version.
11 ! Libgomp is distributed in the hope that it will be useful, but WITHOUT ANY
12 ! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 ! FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
14 ! more details.
16 ! You should have received a copy of the GNU Lesser General Public License
17 ! along with libgomp; see the file COPYING.LIB. If not, write to the
18 ! Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19 ! MA 02110-1301, USA. */
21 ! As a special exception, if you link this library with other files, some
22 ! of which are compiled with GCC, to produce an executable, this library
23 ! does not by itself cause the resulting executable to be covered by the
24 ! GNU General Public License. This exception does not however invalidate
25 ! any other reasons why the executable file might be covered by the GNU
26 ! General Public License.
28 module omp_lib_kinds
29 implicit none
30 integer, parameter :: omp_integer_kind = 4
31 integer, parameter :: omp_logical_kind = 4
32 integer, parameter :: omp_lock_kind = @OMP_LOCK_KIND@
33 integer, parameter :: omp_nest_lock_kind = @OMP_NEST_LOCK_KIND@
34 integer, parameter :: omp_sched_kind = 4
35 end module
37 module omp_lib
38 use omp_lib_kinds
39 implicit none
40 integer, parameter :: openmp_version = 200805
41 integer (omp_sched_kind), parameter :: omp_sched_static = 1
42 integer (omp_sched_kind), parameter :: omp_sched_dynamic = 2
43 integer (omp_sched_kind), parameter :: omp_sched_guided = 3
44 integer (omp_sched_kind), parameter :: omp_sched_auto = 4
46 interface
47 subroutine omp_init_lock (lock)
48 use omp_lib_kinds
49 integer (omp_lock_kind), intent (out) :: lock
50 end subroutine omp_init_lock
51 end interface
53 interface
54 subroutine omp_init_nest_lock (lock)
55 use omp_lib_kinds
56 integer (omp_nest_lock_kind), intent (out) :: lock
57 end subroutine omp_init_nest_lock
58 end interface
60 interface
61 subroutine omp_destroy_lock (lock)
62 use omp_lib_kinds
63 integer (omp_lock_kind), intent (inout) :: lock
64 end subroutine omp_destroy_lock
65 end interface
67 interface
68 subroutine omp_destroy_nest_lock (lock)
69 use omp_lib_kinds
70 integer (omp_nest_lock_kind), intent (inout) :: lock
71 end subroutine omp_destroy_nest_lock
72 end interface
74 interface
75 subroutine omp_set_lock (lock)
76 use omp_lib_kinds
77 integer (omp_lock_kind), intent (inout) :: lock
78 end subroutine omp_set_lock
79 end interface
81 interface
82 subroutine omp_set_nest_lock (lock)
83 use omp_lib_kinds
84 integer (omp_nest_lock_kind), intent (inout) :: lock
85 end subroutine omp_set_nest_lock
86 end interface
88 interface
89 subroutine omp_unset_lock (lock)
90 use omp_lib_kinds
91 integer (omp_lock_kind), intent (inout) :: lock
92 end subroutine omp_unset_lock
93 end interface
95 interface
96 subroutine omp_unset_nest_lock (lock)
97 use omp_lib_kinds
98 integer (omp_nest_lock_kind), intent (inout) :: lock
99 end subroutine omp_unset_nest_lock
100 end interface
102 interface omp_set_dynamic
103 subroutine omp_set_dynamic (set)
104 logical (4), intent (in) :: set
105 end subroutine omp_set_dynamic
106 subroutine omp_set_dynamic_8 (set)
107 logical (8), intent (in) :: set
108 end subroutine omp_set_dynamic_8
109 end interface
111 interface omp_set_nested
112 subroutine omp_set_nested (set)
113 logical (4), intent (in) :: set
114 end subroutine omp_set_nested
115 subroutine omp_set_nested_8 (set)
116 logical (8), intent (in) :: set
117 end subroutine omp_set_nested_8
118 end interface
120 interface omp_set_num_threads
121 subroutine omp_set_num_threads (set)
122 integer (4), intent (in) :: set
123 end subroutine omp_set_num_threads
124 subroutine omp_set_num_threads_8 (set)
125 integer (8), intent (in) :: set
126 end subroutine omp_set_num_threads_8
127 end interface
129 interface
130 function omp_get_dynamic ()
131 use omp_lib_kinds
132 logical (omp_logical_kind) :: omp_get_dynamic
133 end function omp_get_dynamic
134 end interface
136 interface
137 function omp_get_nested ()
138 use omp_lib_kinds
139 logical (omp_logical_kind) :: omp_get_nested
140 end function omp_get_nested
141 end interface
143 interface
144 function omp_in_parallel ()
145 use omp_lib_kinds
146 logical (omp_logical_kind) :: omp_in_parallel
147 end function omp_in_parallel
148 end interface
150 interface
151 function omp_test_lock (lock)
152 use omp_lib_kinds
153 logical (omp_logical_kind) :: omp_test_lock
154 integer (omp_lock_kind), intent (inout) :: lock
155 end function omp_test_lock
156 end interface
158 interface
159 function omp_get_max_threads ()
160 use omp_lib_kinds
161 integer (omp_integer_kind) :: omp_get_max_threads
162 end function omp_get_max_threads
163 end interface
165 interface
166 function omp_get_num_procs ()
167 use omp_lib_kinds
168 integer (omp_integer_kind) :: omp_get_num_procs
169 end function omp_get_num_procs
170 end interface
172 interface
173 function omp_get_num_threads ()
174 use omp_lib_kinds
175 integer (omp_integer_kind) :: omp_get_num_threads
176 end function omp_get_num_threads
177 end interface
179 interface
180 function omp_get_thread_num ()
181 use omp_lib_kinds
182 integer (omp_integer_kind) :: omp_get_thread_num
183 end function omp_get_thread_num
184 end interface
186 interface
187 function omp_test_nest_lock (lock)
188 use omp_lib_kinds
189 integer (omp_integer_kind) :: omp_test_nest_lock
190 integer (omp_nest_lock_kind), intent (inout) :: lock
191 end function omp_test_nest_lock
192 end interface
194 interface
195 function omp_get_wtick ()
196 double precision :: omp_get_wtick
197 end function omp_get_wtick
198 end interface
200 interface
201 function omp_get_wtime ()
202 double precision :: omp_get_wtime
203 end function omp_get_wtime
204 end interface
206 interface omp_set_schedule
207 subroutine omp_set_schedule (kind, modifier)
208 use omp_lib_kinds
209 integer (omp_sched_kind), intent (in) :: kind
210 integer (4), intent (in) :: modifier
211 end subroutine omp_set_schedule
212 subroutine omp_set_schedule_8 (kind, modifier)
213 use omp_lib_kinds
214 integer (omp_sched_kind), intent (in) :: kind
215 integer (8), intent (in) :: modifier
216 end subroutine omp_set_schedule_8
217 end interface
219 interface omp_get_schedule
220 subroutine omp_get_schedule (kind, modifier)
221 use omp_lib_kinds
222 integer (omp_sched_kind), intent (out) :: kind
223 integer (4), intent (out) :: modifier
224 end subroutine omp_get_schedule
225 subroutine omp_get_schedule_8 (kind, modifier)
226 use omp_lib_kinds
227 integer (omp_sched_kind), intent (out) :: kind
228 integer (8), intent (out) :: modifier
229 end subroutine omp_get_schedule_8
230 end interface
232 interface
233 function omp_get_thread_limit ()
234 use omp_lib_kinds
235 integer (omp_integer_kind) :: omp_get_thread_limit
236 end function omp_get_thread_limit
237 end interface
239 interface omp_set_max_active_levels
240 subroutine omp_set_max_active_levels (max_levels)
241 use omp_lib_kinds
242 integer (4), intent (in) :: max_levels
243 end subroutine omp_set_max_active_levels
244 subroutine omp_set_max_active_levels_8 (max_levels)
245 use omp_lib_kinds
246 integer (8), intent (in) :: max_levels
247 end subroutine omp_set_max_active_levels_8
248 end interface
250 interface
251 function omp_get_max_active_levels ()
252 use omp_lib_kinds
253 integer (omp_integer_kind) :: omp_get_max_active_levels
254 end function omp_get_max_active_levels
255 end interface
257 interface
258 function omp_get_level ()
259 use omp_lib_kinds
260 integer (omp_integer_kind) :: omp_get_level
261 end function omp_get_level
262 end interface
264 interface omp_get_ancestor_thread_num
265 function omp_get_ancestor_thread_num (level)
266 use omp_lib_kinds
267 integer (4), intent (in) :: level
268 integer (omp_integer_kind) :: omp_get_ancestor_thread_num
269 end function omp_get_ancestor_thread_num
270 function omp_get_ancestor_thread_num_8 (level)
271 use omp_lib_kinds
272 integer (8), intent (in) :: level
273 integer (omp_integer_kind) :: omp_get_ancestor_thread_num_8
274 end function omp_get_ancestor_thread_num_8
275 end interface
277 interface omp_get_team_size
278 function omp_get_team_size (level)
279 use omp_lib_kinds
280 integer (4), intent (in) :: level
281 integer (omp_integer_kind) :: omp_get_team_size
282 end function omp_get_team_size
283 function omp_get_team_size_8 (level)
284 use omp_lib_kinds
285 integer (8), intent (in) :: level
286 integer (omp_integer_kind) :: omp_get_team_size_8
287 end function omp_get_team_size_8
288 end interface
290 interface
291 function omp_get_active_level ()
292 use omp_lib_kinds
293 integer (omp_integer_kind) :: omp_get_active_level
294 end function omp_get_active_level
295 end interface
297 end module omp_lib