PR middle-end/66633
[official-gcc.git] / libgomp / omp_lib.f90.in
blob122563e625a319966b0b748fd97018560008233d
1 ! Copyright (C) 2005-2015 Free Software Foundation, Inc.
2 ! Contributed by Jakub Jelinek <jakub@redhat.com>.
4 ! This file is part of the GNU Offloading and Multi Processing Library
5 ! (libgomp).
7 ! Libgomp is free software; you can redistribute it and/or modify it
8 ! under the terms of the GNU General Public License as published by
9 ! the Free Software Foundation; either version 3, or (at your option)
10 ! any later version.
12 ! Libgomp is distributed in the hope that it will be useful, but WITHOUT ANY
13 ! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14 ! FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15 ! more details.
17 ! Under Section 7 of GPL version 3, you are granted additional
18 ! permissions described in the GCC Runtime Library Exception, version
19 ! 3.1, as published by the Free Software Foundation.
21 ! You should have received a copy of the GNU General Public License and
22 ! a copy of the GCC Runtime Library Exception along with this program;
23 ! see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
24 ! <http://www.gnu.org/licenses/>.
26 module omp_lib_kinds
27 implicit none
28 integer, parameter :: omp_lock_kind = @OMP_LOCK_KIND@
29 integer, parameter :: omp_nest_lock_kind = @OMP_NEST_LOCK_KIND@
30 integer, parameter :: omp_sched_kind = 4
31 integer, parameter :: omp_proc_bind_kind = 4
32 integer (omp_sched_kind), parameter :: omp_sched_static = 1
33 integer (omp_sched_kind), parameter :: omp_sched_dynamic = 2
34 integer (omp_sched_kind), parameter :: omp_sched_guided = 3
35 integer (omp_sched_kind), parameter :: omp_sched_auto = 4
36 integer (omp_proc_bind_kind), parameter :: omp_proc_bind_false = 0
37 integer (omp_proc_bind_kind), parameter :: omp_proc_bind_true = 1
38 integer (omp_proc_bind_kind), parameter :: omp_proc_bind_master = 2
39 integer (omp_proc_bind_kind), parameter :: omp_proc_bind_close = 3
40 integer (omp_proc_bind_kind), parameter :: omp_proc_bind_spread = 4
41 end module
43 module omp_lib
44 use omp_lib_kinds
45 implicit none
46 integer, parameter :: openmp_version = 201307
48 interface
49 subroutine omp_init_lock (svar)
50 use omp_lib_kinds
51 integer (omp_lock_kind), intent (out) :: svar
52 end subroutine omp_init_lock
53 end interface
55 interface
56 subroutine omp_init_nest_lock (nvar)
57 use omp_lib_kinds
58 integer (omp_nest_lock_kind), intent (out) :: nvar
59 end subroutine omp_init_nest_lock
60 end interface
62 interface
63 subroutine omp_destroy_lock (svar)
64 use omp_lib_kinds
65 integer (omp_lock_kind), intent (inout) :: svar
66 end subroutine omp_destroy_lock
67 end interface
69 interface
70 subroutine omp_destroy_nest_lock (nvar)
71 use omp_lib_kinds
72 integer (omp_nest_lock_kind), intent (inout) :: nvar
73 end subroutine omp_destroy_nest_lock
74 end interface
76 interface
77 subroutine omp_set_lock (svar)
78 use omp_lib_kinds
79 integer (omp_lock_kind), intent (inout) :: svar
80 end subroutine omp_set_lock
81 end interface
83 interface
84 subroutine omp_set_nest_lock (nvar)
85 use omp_lib_kinds
86 integer (omp_nest_lock_kind), intent (inout) :: nvar
87 end subroutine omp_set_nest_lock
88 end interface
90 interface
91 subroutine omp_unset_lock (svar)
92 use omp_lib_kinds
93 integer (omp_lock_kind), intent (inout) :: svar
94 end subroutine omp_unset_lock
95 end interface
97 interface
98 subroutine omp_unset_nest_lock (nvar)
99 use omp_lib_kinds
100 integer (omp_nest_lock_kind), intent (inout) :: nvar
101 end subroutine omp_unset_nest_lock
102 end interface
104 interface omp_set_dynamic
105 subroutine omp_set_dynamic (dynamic_threads)
106 logical (4), intent (in) :: dynamic_threads
107 end subroutine omp_set_dynamic
108 subroutine omp_set_dynamic_8 (dynamic_threads)
109 logical (8), intent (in) :: dynamic_threads
110 end subroutine omp_set_dynamic_8
111 end interface
113 interface omp_set_nested
114 subroutine omp_set_nested (nested)
115 logical (4), intent (in) :: nested
116 end subroutine omp_set_nested
117 subroutine omp_set_nested_8 (nested)
118 logical (8), intent (in) :: nested
119 end subroutine omp_set_nested_8
120 end interface
122 interface omp_set_num_threads
123 subroutine omp_set_num_threads (num_threads)
124 integer (4), intent (in) :: num_threads
125 end subroutine omp_set_num_threads
126 subroutine omp_set_num_threads_8 (num_threads)
127 integer (8), intent (in) :: num_threads
128 end subroutine omp_set_num_threads_8
129 end interface
131 interface
132 function omp_get_dynamic ()
133 logical (4) :: omp_get_dynamic
134 end function omp_get_dynamic
135 end interface
137 interface
138 function omp_get_nested ()
139 logical (4) :: omp_get_nested
140 end function omp_get_nested
141 end interface
143 interface
144 function omp_in_parallel ()
145 logical (4) :: omp_in_parallel
146 end function omp_in_parallel
147 end interface
149 interface
150 function omp_test_lock (svar)
151 use omp_lib_kinds
152 logical (4) :: omp_test_lock
153 integer (omp_lock_kind), intent (inout) :: svar
154 end function omp_test_lock
155 end interface
157 interface
158 function omp_get_max_threads ()
159 integer (4) :: omp_get_max_threads
160 end function omp_get_max_threads
161 end interface
163 interface
164 function omp_get_num_procs ()
165 integer (4) :: omp_get_num_procs
166 end function omp_get_num_procs
167 end interface
169 interface
170 function omp_get_num_threads ()
171 integer (4) :: omp_get_num_threads
172 end function omp_get_num_threads
173 end interface
175 interface
176 function omp_get_thread_num ()
177 integer (4) :: omp_get_thread_num
178 end function omp_get_thread_num
179 end interface
181 interface
182 function omp_test_nest_lock (nvar)
183 use omp_lib_kinds
184 integer (4) :: omp_test_nest_lock
185 integer (omp_nest_lock_kind), intent (inout) :: nvar
186 end function omp_test_nest_lock
187 end interface
189 interface
190 function omp_get_wtick ()
191 double precision :: omp_get_wtick
192 end function omp_get_wtick
193 end interface
195 interface
196 function omp_get_wtime ()
197 double precision :: omp_get_wtime
198 end function omp_get_wtime
199 end interface
201 interface omp_set_schedule
202 subroutine omp_set_schedule (kind, modifier)
203 use omp_lib_kinds
204 integer (omp_sched_kind), intent (in) :: kind
205 integer (4), intent (in) :: modifier
206 end subroutine omp_set_schedule
207 subroutine omp_set_schedule_8 (kind, modifier)
208 use omp_lib_kinds
209 integer (omp_sched_kind), intent (in) :: kind
210 integer (8), intent (in) :: modifier
211 end subroutine omp_set_schedule_8
212 end interface
214 interface omp_get_schedule
215 subroutine omp_get_schedule (kind, modifier)
216 use omp_lib_kinds
217 integer (omp_sched_kind), intent (out) :: kind
218 integer (4), intent (out) :: modifier
219 end subroutine omp_get_schedule
220 subroutine omp_get_schedule_8 (kind, modifier)
221 use omp_lib_kinds
222 integer (omp_sched_kind), intent (out) :: kind
223 integer (8), intent (out) :: modifier
224 end subroutine omp_get_schedule_8
225 end interface
227 interface
228 function omp_get_thread_limit ()
229 integer (4) :: omp_get_thread_limit
230 end function omp_get_thread_limit
231 end interface
233 interface omp_set_max_active_levels
234 subroutine omp_set_max_active_levels (max_levels)
235 integer (4), intent (in) :: max_levels
236 end subroutine omp_set_max_active_levels
237 subroutine omp_set_max_active_levels_8 (max_levels)
238 integer (8), intent (in) :: max_levels
239 end subroutine omp_set_max_active_levels_8
240 end interface
242 interface
243 function omp_get_max_active_levels ()
244 integer (4) :: omp_get_max_active_levels
245 end function omp_get_max_active_levels
246 end interface
248 interface
249 function omp_get_level ()
250 integer (4) :: omp_get_level
251 end function omp_get_level
252 end interface
254 interface omp_get_ancestor_thread_num
255 function omp_get_ancestor_thread_num (level)
256 integer (4), intent (in) :: level
257 integer (4) :: omp_get_ancestor_thread_num
258 end function omp_get_ancestor_thread_num
259 function omp_get_ancestor_thread_num_8 (level)
260 integer (8), intent (in) :: level
261 integer (4) :: omp_get_ancestor_thread_num_8
262 end function omp_get_ancestor_thread_num_8
263 end interface
265 interface omp_get_team_size
266 function omp_get_team_size (level)
267 integer (4), intent (in) :: level
268 integer (4) :: omp_get_team_size
269 end function omp_get_team_size
270 function omp_get_team_size_8 (level)
271 integer (8), intent (in) :: level
272 integer (4) :: omp_get_team_size_8
273 end function omp_get_team_size_8
274 end interface
276 interface
277 function omp_get_active_level ()
278 integer (4) :: omp_get_active_level
279 end function omp_get_active_level
280 end interface
282 interface
283 function omp_in_final ()
284 logical (4) :: omp_in_final
285 end function omp_in_final
286 end interface
288 interface
289 function omp_get_cancellation ()
290 logical (4) :: omp_get_cancellation
291 end function omp_get_cancellation
292 end interface
294 interface
295 function omp_get_proc_bind ()
296 use omp_lib_kinds
297 integer (omp_proc_bind_kind) :: omp_get_proc_bind
298 end function omp_get_proc_bind
299 end interface
301 interface omp_set_default_device
302 subroutine omp_set_default_device (device_num)
303 integer (4), intent (in) :: device_num
304 end subroutine omp_set_default_device
305 subroutine omp_set_default_device_8 (device_num)
306 integer (8), intent (in) :: device_num
307 end subroutine omp_set_default_device_8
308 end interface
310 interface
311 function omp_get_default_device ()
312 integer (4) :: omp_get_default_device
313 end function omp_get_default_device
314 end interface
316 interface
317 function omp_get_num_devices ()
318 integer (4) :: omp_get_num_devices
319 end function omp_get_num_devices
320 end interface
322 interface
323 function omp_get_num_teams ()
324 integer (4) :: omp_get_num_teams
325 end function omp_get_num_teams
326 end interface
328 interface
329 function omp_get_team_num ()
330 integer (4) :: omp_get_team_num
331 end function omp_get_team_num
332 end interface
334 interface
335 function omp_is_initial_device ()
336 logical (4) :: omp_is_initial_device
337 end function omp_is_initial_device
338 end interface
340 end module omp_lib