1 ! Copyright (C) 2005-2019 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
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)
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
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/>.
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, parameter :: omp_lock_hint_kind
= 4
33 integer, parameter :: omp_pause_resource_kind
= 4
34 integer (omp_sched_kind
), parameter :: omp_sched_static
= 1
35 integer (omp_sched_kind
), parameter :: omp_sched_dynamic
= 2
36 integer (omp_sched_kind
), parameter :: omp_sched_guided
= 3
37 integer (omp_sched_kind
), parameter :: omp_sched_auto
= 4
38 integer (omp_proc_bind_kind
), &
39 parameter :: omp_proc_bind_false
= 0
40 integer (omp_proc_bind_kind
), &
41 parameter :: omp_proc_bind_true
= 1
42 integer (omp_proc_bind_kind
), &
43 parameter :: omp_proc_bind_master
= 2
44 integer (omp_proc_bind_kind
), &
45 parameter :: omp_proc_bind_close
= 3
46 integer (omp_proc_bind_kind
), &
47 parameter :: omp_proc_bind_spread
= 4
48 integer (omp_lock_hint_kind
), &
49 parameter :: omp_lock_hint_none
= 0
50 integer (omp_lock_hint_kind
), &
51 parameter :: omp_lock_hint_uncontended
= 1
52 integer (omp_lock_hint_kind
), &
53 parameter :: omp_lock_hint_contended
= 2
54 integer (omp_lock_hint_kind
), &
55 parameter :: omp_lock_hint_nonspeculative
= 4
56 integer (omp_lock_hint_kind
), &
57 parameter :: omp_lock_hint_speculative
= 8
58 integer (kind
=omp_pause_resource_kind
), &
59 parameter :: omp_pause_soft
= 1
60 integer (kind
=omp_pause_resource_kind
), &
61 parameter :: omp_pause_hard
= 2
67 integer, parameter :: openmp_version
= 201511
70 subroutine omp_init_lock (svar
)
72 integer (omp_lock_kind
), intent (out
) :: svar
73 end subroutine omp_init_lock
77 subroutine omp_init_lock_with_hint (svar
, hint
)
79 integer (omp_lock_kind
), intent (out
) :: svar
80 integer (omp_lock_hint_kind
), intent (in
) :: hint
81 end subroutine omp_init_lock_with_hint
85 subroutine omp_init_nest_lock (nvar
)
87 integer (omp_nest_lock_kind
), intent (out
) :: nvar
88 end subroutine omp_init_nest_lock
92 subroutine omp_init_nest_lock_with_hint (nvar
, hint
)
94 integer (omp_nest_lock_kind
), intent (out
) :: nvar
95 integer (omp_lock_hint_kind
), intent (in
) :: hint
96 end subroutine omp_init_nest_lock_with_hint
100 subroutine omp_destroy_lock (svar
)
102 integer (omp_lock_kind
), intent (inout
) :: svar
103 end subroutine omp_destroy_lock
107 subroutine omp_destroy_nest_lock (nvar
)
109 integer (omp_nest_lock_kind
), intent (inout
) :: nvar
110 end subroutine omp_destroy_nest_lock
114 subroutine omp_set_lock (svar
)
116 integer (omp_lock_kind
), intent (inout
) :: svar
117 end subroutine omp_set_lock
121 subroutine omp_set_nest_lock (nvar
)
123 integer (omp_nest_lock_kind
), intent (inout
) :: nvar
124 end subroutine omp_set_nest_lock
128 subroutine omp_unset_lock (svar
)
130 integer (omp_lock_kind
), intent (inout
) :: svar
131 end subroutine omp_unset_lock
135 subroutine omp_unset_nest_lock (nvar
)
137 integer (omp_nest_lock_kind
), intent (inout
) :: nvar
138 end subroutine omp_unset_nest_lock
141 interface omp_set_dynamic
142 subroutine omp_set_dynamic (dynamic_threads
)
143 logical (4), intent (in
) :: dynamic_threads
144 end subroutine omp_set_dynamic
145 subroutine omp_set_dynamic_8 (dynamic_threads
)
146 logical (8), intent (in
) :: dynamic_threads
147 end subroutine omp_set_dynamic_8
150 interface omp_set_nested
151 subroutine omp_set_nested (nested
)
152 logical (4), intent (in
) :: nested
153 end subroutine omp_set_nested
154 subroutine omp_set_nested_8 (nested
)
155 logical (8), intent (in
) :: nested
156 end subroutine omp_set_nested_8
159 interface omp_set_num_threads
160 subroutine omp_set_num_threads (num_threads
)
161 integer (4), intent (in
) :: num_threads
162 end subroutine omp_set_num_threads
163 subroutine omp_set_num_threads_8 (num_threads
)
164 integer (8), intent (in
) :: num_threads
165 end subroutine omp_set_num_threads_8
169 function omp_get_dynamic ()
170 logical (4) :: omp_get_dynamic
171 end function omp_get_dynamic
175 function omp_get_nested ()
176 logical (4) :: omp_get_nested
177 end function omp_get_nested
181 function omp_in_parallel ()
182 logical (4) :: omp_in_parallel
183 end function omp_in_parallel
187 function omp_test_lock (svar
)
189 logical (4) :: omp_test_lock
190 integer (omp_lock_kind
), intent (inout
) :: svar
191 end function omp_test_lock
195 function omp_get_max_threads ()
196 integer (4) :: omp_get_max_threads
197 end function omp_get_max_threads
201 function omp_get_num_procs ()
202 integer (4) :: omp_get_num_procs
203 end function omp_get_num_procs
207 function omp_get_num_threads ()
208 integer (4) :: omp_get_num_threads
209 end function omp_get_num_threads
213 function omp_get_thread_num ()
214 integer (4) :: omp_get_thread_num
215 end function omp_get_thread_num
219 function omp_test_nest_lock (nvar
)
221 integer (4) :: omp_test_nest_lock
222 integer (omp_nest_lock_kind
), intent (inout
) :: nvar
223 end function omp_test_nest_lock
227 function omp_get_wtick ()
228 double precision :: omp_get_wtick
229 end function omp_get_wtick
233 function omp_get_wtime ()
234 double precision :: omp_get_wtime
235 end function omp_get_wtime
238 interface omp_set_schedule
239 subroutine omp_set_schedule (kind
, chunk_size
)
241 integer (omp_sched_kind
), intent (in
) :: kind
242 integer (4), intent (in
) :: chunk_size
243 end subroutine omp_set_schedule
244 subroutine omp_set_schedule_8 (kind
, chunk_size
)
246 integer (omp_sched_kind
), intent (in
) :: kind
247 integer (8), intent (in
) :: chunk_size
248 end subroutine omp_set_schedule_8
251 interface omp_get_schedule
252 subroutine omp_get_schedule (kind
, chunk_size
)
254 integer (omp_sched_kind
), intent (out
) :: kind
255 integer (4), intent (out
) :: chunk_size
256 end subroutine omp_get_schedule
257 subroutine omp_get_schedule_8 (kind
, chunk_size
)
259 integer (omp_sched_kind
), intent (out
) :: kind
260 integer (8), intent (out
) :: chunk_size
261 end subroutine omp_get_schedule_8
265 function omp_get_thread_limit ()
266 integer (4) :: omp_get_thread_limit
267 end function omp_get_thread_limit
270 interface omp_set_max_active_levels
271 subroutine omp_set_max_active_levels (max_levels
)
272 integer (4), intent (in
) :: max_levels
273 end subroutine omp_set_max_active_levels
274 subroutine omp_set_max_active_levels_8 (max_levels
)
275 integer (8), intent (in
) :: max_levels
276 end subroutine omp_set_max_active_levels_8
280 function omp_get_max_active_levels ()
281 integer (4) :: omp_get_max_active_levels
282 end function omp_get_max_active_levels
286 function omp_get_level ()
287 integer (4) :: omp_get_level
288 end function omp_get_level
291 interface omp_get_ancestor_thread_num
292 function omp_get_ancestor_thread_num (level
)
293 integer (4), intent (in
) :: level
294 integer (4) :: omp_get_ancestor_thread_num
295 end function omp_get_ancestor_thread_num
296 function omp_get_ancestor_thread_num_8 (level
)
297 integer (8), intent (in
) :: level
298 integer (4) :: omp_get_ancestor_thread_num_8
299 end function omp_get_ancestor_thread_num_8
302 interface omp_get_team_size
303 function omp_get_team_size (level
)
304 integer (4), intent (in
) :: level
305 integer (4) :: omp_get_team_size
306 end function omp_get_team_size
307 function omp_get_team_size_8 (level
)
308 integer (8), intent (in
) :: level
309 integer (4) :: omp_get_team_size_8
310 end function omp_get_team_size_8
314 function omp_get_active_level ()
315 integer (4) :: omp_get_active_level
316 end function omp_get_active_level
320 function omp_in_final ()
321 logical (4) :: omp_in_final
322 end function omp_in_final
326 function omp_get_cancellation ()
327 logical (4) :: omp_get_cancellation
328 end function omp_get_cancellation
332 function omp_get_proc_bind ()
334 integer (omp_proc_bind_kind
) :: omp_get_proc_bind
335 end function omp_get_proc_bind
339 function omp_get_num_places ()
340 integer (4) :: omp_get_num_places
341 end function omp_get_num_places
344 interface omp_get_place_num_procs
345 function omp_get_place_num_procs (place_num
)
346 integer (4), intent(in
) :: place_num
347 integer (4) :: omp_get_place_num_procs
348 end function omp_get_place_num_procs
350 function omp_get_place_num_procs_8 (place_num
)
351 integer (8), intent(in
) :: place_num
352 integer (4) :: omp_get_place_num_procs_8
353 end function omp_get_place_num_procs_8
356 interface omp_get_place_proc_ids
357 subroutine omp_get_place_proc_ids (place_num
, ids
)
358 integer (4), intent(in
) :: place_num
359 integer (4), intent(out
) :: ids(*)
360 end subroutine omp_get_place_proc_ids
362 subroutine omp_get_place_proc_ids_8 (place_num
, ids
)
363 integer (8), intent(in
) :: place_num
364 integer (8), intent(out
) :: ids(*)
365 end subroutine omp_get_place_proc_ids_8
369 function omp_get_place_num ()
370 integer (4) :: omp_get_place_num
371 end function omp_get_place_num
375 function omp_get_partition_num_places ()
376 integer (4) :: omp_get_partition_num_places
377 end function omp_get_partition_num_places
380 interface omp_get_partition_place_nums
381 subroutine omp_get_partition_place_nums (place_nums
)
382 integer (4), intent(out
) :: place_nums(*)
383 end subroutine omp_get_partition_place_nums
385 subroutine omp_get_partition_place_nums_8 (place_nums
)
386 integer (8), intent(out
) :: place_nums(*)
387 end subroutine omp_get_partition_place_nums_8
390 interface omp_set_default_device
391 subroutine omp_set_default_device (device_num
)
392 integer (4), intent (in
) :: device_num
393 end subroutine omp_set_default_device
394 subroutine omp_set_default_device_8 (device_num
)
395 integer (8), intent (in
) :: device_num
396 end subroutine omp_set_default_device_8
400 function omp_get_default_device ()
401 integer (4) :: omp_get_default_device
402 end function omp_get_default_device
406 function omp_get_num_devices ()
407 integer (4) :: omp_get_num_devices
408 end function omp_get_num_devices
412 function omp_get_num_teams ()
413 integer (4) :: omp_get_num_teams
414 end function omp_get_num_teams
418 function omp_get_team_num ()
419 integer (4) :: omp_get_team_num
420 end function omp_get_team_num
424 function omp_is_initial_device ()
425 logical (4) :: omp_is_initial_device
426 end function omp_is_initial_device
430 function omp_get_initial_device ()
431 integer (4) :: omp_get_initial_device
432 end function omp_get_initial_device
436 function omp_get_max_task_priority ()
437 integer (4) :: omp_get_max_task_priority
438 end function omp_get_max_task_priority
442 subroutine omp_set_affinity_format (format)
443 character(len
=*), intent(in
) :: format
444 end subroutine omp_set_affinity_format
448 function omp_get_affinity_format (buffer
)
449 integer (4) :: omp_get_affinity_format
450 character(len
=*), intent(out
) :: buffer
451 end function omp_get_affinity_format
455 subroutine omp_display_affinity (format)
456 character(len
=*), intent(in
) :: format
457 end subroutine omp_display_affinity
461 function omp_capture_affinity (buffer
, format)
462 integer (4) :: omp_capture_affinity
463 character(len
=*), intent(out
) :: buffer
464 character(len
=*), intent(in
) :: format
465 end function omp_capture_affinity
469 function omp_pause_resource (kind
, device_num
)
471 integer (4) :: omp_pause_resource
472 integer (kind
=omp_pause_resource_kind
), &
474 integer (4) :: device_num
479 function omp_pause_resource_all (kind
)
481 integer (4) :: omp_pause_resource_all
482 integer (kind
=omp_pause_resource_kind
), &