1 ! include/omp_lib.f90.var
4 !//===----------------------------------------------------------------------===//
6 !// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
7 !// See https://llvm.org/LICENSE.txt for license information.
8 !// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
10 !//===----------------------------------------------------------------------===//
15 use, intrinsic :: iso_c_binding
17 ! Set PRIVATE by default to explicitly only export what is meant
18 ! to be exported by this MODULE.
21 integer, parameter, public :: omp_integer_kind = c_int
22 integer, parameter, public :: omp_logical_kind = 4
23 integer, parameter, public :: omp_real_kind = c_float
24 integer, parameter, public :: kmp_double_kind = c_double
25 integer, parameter, public :: omp_lock_kind = c_intptr_t
26 integer, parameter, public :: omp_nest_lock_kind = c_intptr_t
27 integer, parameter, public :: omp_sched_kind = omp_integer_kind
28 integer, parameter, public :: omp_proc_bind_kind = omp_integer_kind
29 integer, parameter, public :: kmp_pointer_kind = c_intptr_t
30 integer, parameter, public :: kmp_size_t_kind = c_size_t
31 integer, parameter, public :: kmp_affinity_mask_kind = c_intptr_t
32 integer, parameter, public :: kmp_cancel_kind = omp_integer_kind
33 integer, parameter, public :: omp_sync_hint_kind = omp_integer_kind
34 integer, parameter, public :: omp_lock_hint_kind = omp_sync_hint_kind
35 integer, parameter, public :: omp_control_tool_kind = omp_integer_kind
36 integer, parameter, public :: omp_control_tool_result_kind = omp_integer_kind
37 integer, parameter, public :: omp_allocator_handle_kind = c_intptr_t
38 integer, parameter, public :: omp_memspace_handle_kind = c_intptr_t
39 integer, parameter, public :: omp_alloctrait_key_kind = omp_integer_kind
40 integer, parameter, public :: omp_alloctrait_val_kind = c_intptr_t
41 integer, parameter, public :: omp_interop_kind = c_intptr_t
42 integer, parameter, public :: omp_interop_fr_kind = omp_integer_kind
45 integer(kind=omp_alloctrait_key_kind) key
46 integer(kind=omp_alloctrait_val_kind) value
47 end type omp_alloctrait
48 public :: omp_alloctrait
50 integer, parameter, public :: omp_pause_resource_kind = omp_integer_kind
51 integer, parameter, public :: omp_depend_kind = c_intptr_t
52 integer, parameter, public :: omp_event_handle_kind = c_intptr_t
54 end module omp_lib_kinds
60 ! Set PRIVATE by default to explicitly only export what is meant
61 ! to be exported by this MODULE.
64 ! Re-export definitions in omp_lib_kinds
65 public :: omp_integer_kind
66 public :: omp_logical_kind
67 public :: omp_real_kind
68 public :: kmp_double_kind
69 public :: omp_lock_kind
70 public :: omp_nest_lock_kind
71 public :: omp_sched_kind
72 public :: omp_proc_bind_kind
73 public :: kmp_pointer_kind
74 public :: kmp_size_t_kind
75 public :: kmp_affinity_mask_kind
76 public :: kmp_cancel_kind
77 public :: omp_sync_hint_kind
78 public :: omp_lock_hint_kind
79 public :: omp_control_tool_kind
80 public :: omp_control_tool_result_kind
81 public :: omp_allocator_handle_kind
82 public :: omp_memspace_handle_kind
83 public :: omp_alloctrait_key_kind
84 public :: omp_alloctrait_val_kind
85 public :: omp_interop_kind
86 public :: omp_interop_fr_kind
87 public :: omp_alloctrait
88 public :: omp_pause_resource_kind
89 public :: omp_depend_kind
90 public :: omp_event_handle_kind
92 integer (kind=omp_integer_kind), parameter, public :: openmp_version = @LIBOMP_OMP_YEAR_MONTH@
93 integer (kind=omp_integer_kind), parameter, public :: kmp_version_major = @LIBOMP_VERSION_MAJOR@
94 integer (kind=omp_integer_kind), parameter, public :: kmp_version_minor = @LIBOMP_VERSION_MINOR@
95 integer (kind=omp_integer_kind), parameter, public :: kmp_version_build = @LIBOMP_VERSION_BUILD@
96 character(*) kmp_build_date
97 parameter( kmp_build_date = '@LIBOMP_BUILD_DATE@' )
99 integer(kind=omp_sched_kind), parameter, public :: omp_sched_static = 1
100 integer(kind=omp_sched_kind), parameter, public :: omp_sched_dynamic = 2
101 integer(kind=omp_sched_kind), parameter, public :: omp_sched_guided = 3
102 integer(kind=omp_sched_kind), parameter, public :: omp_sched_auto = 4
103 integer(kind=omp_sched_kind), parameter, public :: omp_sched_monotonic = int(Z'80000000', kind=omp_sched_kind)
105 integer (kind=omp_proc_bind_kind), parameter, public :: omp_proc_bind_false = 0
106 integer (kind=omp_proc_bind_kind), parameter, public :: omp_proc_bind_true = 1
107 integer (kind=omp_proc_bind_kind), parameter, public :: omp_proc_bind_master = 2
108 integer (kind=omp_proc_bind_kind), parameter, public :: omp_proc_bind_close = 3
109 integer (kind=omp_proc_bind_kind), parameter, public :: omp_proc_bind_spread = 4
111 integer (kind=kmp_cancel_kind), parameter, public :: kmp_cancel_parallel = 1
112 integer (kind=kmp_cancel_kind), parameter, public :: kmp_cancel_loop = 2
113 integer (kind=kmp_cancel_kind), parameter, public :: kmp_cancel_sections = 3
114 integer (kind=kmp_cancel_kind), parameter, public :: kmp_cancel_taskgroup = 4
116 integer (kind=omp_sync_hint_kind), parameter, public :: omp_sync_hint_none = 0
117 integer (kind=omp_sync_hint_kind), parameter, public :: omp_sync_hint_uncontended = 1
118 integer (kind=omp_sync_hint_kind), parameter, public :: omp_sync_hint_contended = 2
119 integer (kind=omp_sync_hint_kind), parameter, public :: omp_sync_hint_nonspeculative = 4
120 integer (kind=omp_sync_hint_kind), parameter, public :: omp_sync_hint_speculative = 8
121 integer (kind=omp_lock_hint_kind), parameter, public :: omp_lock_hint_none = omp_sync_hint_none
122 integer (kind=omp_lock_hint_kind), parameter, public :: omp_lock_hint_uncontended = omp_sync_hint_uncontended
123 integer (kind=omp_lock_hint_kind), parameter, public :: omp_lock_hint_contended = omp_sync_hint_contended
124 integer (kind=omp_lock_hint_kind), parameter, public :: omp_lock_hint_nonspeculative = omp_sync_hint_nonspeculative
125 integer (kind=omp_lock_hint_kind), parameter, public :: omp_lock_hint_speculative = omp_sync_hint_speculative
126 integer (kind=omp_lock_hint_kind), parameter, public :: kmp_lock_hint_hle = 65536
127 integer (kind=omp_lock_hint_kind), parameter, public :: kmp_lock_hint_rtm = 131072
128 integer (kind=omp_lock_hint_kind), parameter, public :: kmp_lock_hint_adaptive = 262144
130 integer (kind=omp_control_tool_kind), parameter, public :: omp_control_tool_start = 1
131 integer (kind=omp_control_tool_kind), parameter, public :: omp_control_tool_pause = 2
132 integer (kind=omp_control_tool_kind), parameter, public :: omp_control_tool_flush = 3
133 integer (kind=omp_control_tool_kind), parameter, public :: omp_control_tool_end = 4
135 integer (kind=omp_control_tool_result_kind), parameter, public :: omp_control_tool_notool = -2
136 integer (kind=omp_control_tool_result_kind), parameter, public :: omp_control_tool_nocallback = -1
137 integer (kind=omp_control_tool_result_kind), parameter, public :: omp_control_tool_success = 0
138 integer (kind=omp_control_tool_result_kind), parameter, public :: omp_control_tool_ignored = 1
140 integer (kind=omp_alloctrait_key_kind), parameter, public :: omp_atk_sync_hint = 1
141 integer (kind=omp_alloctrait_key_kind), parameter, public :: omp_atk_alignment = 2
142 integer (kind=omp_alloctrait_key_kind), parameter, public :: omp_atk_access = 3
143 integer (kind=omp_alloctrait_key_kind), parameter, public :: omp_atk_pool_size = 4
144 integer (kind=omp_alloctrait_key_kind), parameter, public :: omp_atk_fallback = 5
145 integer (kind=omp_alloctrait_key_kind), parameter, public :: omp_atk_fb_data = 6
146 integer (kind=omp_alloctrait_key_kind), parameter, public :: omp_atk_pinned = 7
147 integer (kind=omp_alloctrait_key_kind), parameter, public :: omp_atk_partition = 8
149 integer (kind=omp_alloctrait_val_kind), parameter, public :: omp_atv_default = -1
150 integer (kind=omp_alloctrait_val_kind), parameter, public :: omp_atv_false = 0
151 integer (kind=omp_alloctrait_val_kind), parameter, public :: omp_atv_true = 1
152 integer (kind=omp_alloctrait_val_kind), parameter, public :: omp_atv_contended = 3
153 integer (kind=omp_alloctrait_val_kind), parameter, public :: omp_atv_uncontended = 4
154 integer (kind=omp_alloctrait_val_kind), parameter, public :: omp_atv_serialized = 5
155 integer (kind=omp_alloctrait_val_kind), parameter, public :: omp_atv_sequential = omp_atv_serialized
156 integer (kind=omp_alloctrait_val_kind), parameter, public :: omp_atv_private = 6
157 integer (kind=omp_alloctrait_val_kind), parameter, public :: omp_atv_all = 7
158 integer (kind=omp_alloctrait_val_kind), parameter, public :: omp_atv_thread = 8
159 integer (kind=omp_alloctrait_val_kind), parameter, public :: omp_atv_pteam = 9
160 integer (kind=omp_alloctrait_val_kind), parameter, public :: omp_atv_cgroup = 10
161 integer (kind=omp_alloctrait_val_kind), parameter, public :: omp_atv_default_mem_fb = 11
162 integer (kind=omp_alloctrait_val_kind), parameter, public :: omp_atv_null_fb = 12
163 integer (kind=omp_alloctrait_val_kind), parameter, public :: omp_atv_abort_fb = 13
164 integer (kind=omp_alloctrait_val_kind), parameter, public :: omp_atv_allocator_fb = 14
165 integer (kind=omp_alloctrait_val_kind), parameter, public :: omp_atv_environment = 15
166 integer (kind=omp_alloctrait_val_kind), parameter, public :: omp_atv_nearest = 16
167 integer (kind=omp_alloctrait_val_kind), parameter, public :: omp_atv_blocked = 17
168 integer (kind=omp_alloctrait_val_kind), parameter, public :: omp_atv_interleaved = 18
170 integer (kind=omp_allocator_handle_kind), parameter, public :: omp_null_allocator = 0
171 integer (kind=omp_allocator_handle_kind), parameter, public :: omp_default_mem_alloc = 1
172 integer (kind=omp_allocator_handle_kind), parameter, public :: omp_large_cap_mem_alloc = 2
173 integer (kind=omp_allocator_handle_kind), parameter, public :: omp_const_mem_alloc = 3
174 integer (kind=omp_allocator_handle_kind), parameter, public :: omp_high_bw_mem_alloc = 4
175 integer (kind=omp_allocator_handle_kind), parameter, public :: omp_low_lat_mem_alloc = 5
176 integer (kind=omp_allocator_handle_kind), parameter, public :: omp_cgroup_mem_alloc = 6
177 integer (kind=omp_allocator_handle_kind), parameter, public :: omp_pteam_mem_alloc = 7
178 integer (kind=omp_allocator_handle_kind), parameter, public :: omp_thread_mem_alloc = 8
179 integer (kind=omp_allocator_handle_kind), parameter, public :: llvm_omp_target_host_mem_alloc = 100
180 integer (kind=omp_allocator_handle_kind), parameter, public :: llvm_omp_target_shared_mem_alloc = 101
181 integer (kind=omp_allocator_handle_kind), parameter, public :: llvm_omp_target_device_mem_alloc = 102
183 integer (kind=omp_memspace_handle_kind), parameter, public :: omp_default_mem_space = 0
184 integer (kind=omp_memspace_handle_kind), parameter, public :: omp_large_cap_mem_space = 1
185 integer (kind=omp_memspace_handle_kind), parameter, public :: omp_const_mem_space = 2
186 integer (kind=omp_memspace_handle_kind), parameter, public :: omp_high_bw_mem_space = 3
187 integer (kind=omp_memspace_handle_kind), parameter, public :: omp_low_lat_mem_space = 4
188 integer (kind=omp_memspace_handle_kind), parameter, public :: llvm_omp_target_host_mem_space = 100
189 integer (kind=omp_memspace_handle_kind), parameter, public :: llvm_omp_target_shared_mem_space = 101
190 integer (kind=omp_memspace_handle_kind), parameter, public :: llvm_omp_target_device_mem_space = 102
192 integer (kind=omp_pause_resource_kind), parameter, public :: omp_pause_resume = 0
193 integer (kind=omp_pause_resource_kind), parameter, public :: omp_pause_soft = 1
194 integer (kind=omp_pause_resource_kind), parameter, public :: omp_pause_hard = 2
195 integer (kind=omp_pause_resource_kind), parameter, public :: omp_pause_stop_tool = 3
197 integer (kind=omp_interop_fr_kind), parameter, public :: omp_ifr_cuda = 1
198 integer (kind=omp_interop_fr_kind), parameter, public :: omp_ifr_cuda_driver = 2
199 integer (kind=omp_interop_fr_kind), parameter, public :: omp_ifr_opencl = 3
200 integer (kind=omp_interop_fr_kind), parameter, public :: omp_ifr_sycl = 4
201 integer (kind=omp_interop_fr_kind), parameter, public :: omp_ifr_hip = 5
202 integer (kind=omp_interop_fr_kind), parameter, public :: omp_ifr_level_zero = 6
203 integer (kind=omp_interop_fr_kind), parameter, public :: omp_ifr_last = 7
205 integer (kind=omp_interop_kind), parameter, public :: omp_interop_none = 0
210 ! *** omp_* entry points
213 subroutine omp_set_num_threads(num_threads) bind(c)
215 integer (kind=omp_integer_kind), value :: num_threads
216 end subroutine omp_set_num_threads
218 subroutine omp_set_dynamic(dynamic_threads) bind(c)
220 logical (kind=omp_logical_kind), value :: dynamic_threads
221 end subroutine omp_set_dynamic
223 subroutine omp_set_nested(nested) bind(c)
225 logical (kind=omp_logical_kind), value :: nested
226 end subroutine omp_set_nested
228 function omp_get_num_threads() bind(c)
230 integer (kind=omp_integer_kind) omp_get_num_threads
231 end function omp_get_num_threads
233 function omp_get_max_threads() bind(c)
235 integer (kind=omp_integer_kind) omp_get_max_threads
236 end function omp_get_max_threads
238 function omp_get_thread_num() bind(c)
240 integer (kind=omp_integer_kind) omp_get_thread_num
241 end function omp_get_thread_num
243 function omp_get_num_procs() bind(c)
245 integer (kind=omp_integer_kind) omp_get_num_procs
246 end function omp_get_num_procs
248 function omp_in_parallel() bind(c)
250 logical (kind=omp_logical_kind) omp_in_parallel
251 end function omp_in_parallel
253 function omp_in_final() bind(c)
255 logical (kind=omp_logical_kind) omp_in_final
256 end function omp_in_final
258 function omp_get_dynamic() bind(c)
260 logical (kind=omp_logical_kind) omp_get_dynamic
261 end function omp_get_dynamic
263 function omp_get_nested() bind(c)
265 logical (kind=omp_logical_kind) omp_get_nested
266 end function omp_get_nested
268 function omp_get_thread_limit() bind(c)
270 integer (kind=omp_integer_kind) omp_get_thread_limit
271 end function omp_get_thread_limit
273 subroutine omp_set_max_active_levels(max_levels) bind(c)
275 integer (kind=omp_integer_kind), value :: max_levels
276 end subroutine omp_set_max_active_levels
278 function omp_get_max_active_levels() bind(c)
280 integer (kind=omp_integer_kind) omp_get_max_active_levels
281 end function omp_get_max_active_levels
283 function omp_get_level() bind(c)
285 integer (kind=omp_integer_kind) omp_get_level
286 end function omp_get_level
288 function omp_get_active_level() bind(c)
290 integer (kind=omp_integer_kind) omp_get_active_level
291 end function omp_get_active_level
293 function omp_get_ancestor_thread_num(level) bind(c)
295 integer (kind=omp_integer_kind) omp_get_ancestor_thread_num
296 integer (kind=omp_integer_kind), value :: level
297 end function omp_get_ancestor_thread_num
299 function omp_get_team_size(level) bind(c)
301 integer (kind=omp_integer_kind) omp_get_team_size
302 integer (kind=omp_integer_kind), value :: level
303 end function omp_get_team_size
305 subroutine omp_set_schedule(kind, chunk_size) bind(c)
307 integer (kind=omp_sched_kind), value :: kind
308 integer (kind=omp_integer_kind), value :: chunk_size
309 end subroutine omp_set_schedule
311 subroutine omp_get_schedule(kind, chunk_size) bind(c)
313 integer (kind=omp_sched_kind) kind
314 integer (kind=omp_integer_kind) chunk_size
315 end subroutine omp_get_schedule
317 function omp_get_proc_bind() bind(c)
319 integer (kind=omp_proc_bind_kind) omp_get_proc_bind
320 end function omp_get_proc_bind
322 function omp_get_num_places() bind(c)
324 integer (kind=omp_integer_kind) omp_get_num_places
325 end function omp_get_num_places
327 function omp_get_place_num_procs(place_num) bind(c)
329 integer (kind=omp_integer_kind), value :: place_num
330 integer (kind=omp_integer_kind) omp_get_place_num_procs
331 end function omp_get_place_num_procs
333 subroutine omp_get_place_proc_ids(place_num, ids) bind(c)
335 integer (kind=omp_integer_kind), value :: place_num
336 integer (kind=omp_integer_kind) ids(*)
337 end subroutine omp_get_place_proc_ids
339 function omp_get_place_num() bind(c)
341 integer (kind=omp_integer_kind) omp_get_place_num
342 end function omp_get_place_num
344 function omp_get_partition_num_places() bind(c)
346 integer (kind=omp_integer_kind) omp_get_partition_num_places
347 end function omp_get_partition_num_places
349 subroutine omp_get_partition_place_nums(place_nums) bind(c)
351 integer (kind=omp_integer_kind) place_nums(*)
352 end subroutine omp_get_partition_place_nums
354 function omp_get_wtime() bind(c)
356 real (kind=kmp_double_kind) omp_get_wtime
357 end function omp_get_wtime
359 function omp_get_wtick() bind(c)
361 real (kind=kmp_double_kind) omp_get_wtick
362 end function omp_get_wtick
364 function omp_get_default_device() bind(c)
366 integer (kind=omp_integer_kind) omp_get_default_device
367 end function omp_get_default_device
369 subroutine omp_set_default_device(device_num) bind(c)
371 integer (kind=omp_integer_kind), value :: device_num
372 end subroutine omp_set_default_device
374 function omp_get_num_devices() bind(c)
376 integer (kind=omp_integer_kind) omp_get_num_devices
377 end function omp_get_num_devices
379 function omp_get_num_teams() bind(c)
381 integer (kind=omp_integer_kind) omp_get_num_teams
382 end function omp_get_num_teams
384 function omp_get_team_num() bind(c)
386 integer (kind=omp_integer_kind) omp_get_team_num
387 end function omp_get_team_num
389 function omp_get_cancellation() bind(c)
391 integer (kind=omp_integer_kind) omp_get_cancellation
392 end function omp_get_cancellation
394 function omp_is_initial_device() bind(c)
396 logical (kind=omp_logical_kind) omp_is_initial_device
397 end function omp_is_initial_device
399 function omp_get_initial_device() bind(c)
401 integer (kind=omp_integer_kind) omp_get_initial_device
402 end function omp_get_initial_device
404 function omp_get_device_num() bind(c)
406 integer (kind=omp_integer_kind) omp_get_device_num
407 end function omp_get_device_num
409 function omp_pause_resource(kind, device_num) bind(c)
411 integer (kind=omp_pause_resource_kind), value :: kind
412 integer (kind=omp_integer_kind), value :: device_num
413 integer (kind=omp_integer_kind) omp_pause_resource
414 end function omp_pause_resource
416 function omp_pause_resource_all(kind) bind(c)
418 integer (kind=omp_pause_resource_kind), value :: kind
419 integer (kind=omp_integer_kind) omp_pause_resource_all
420 end function omp_pause_resource_all
422 function omp_get_supported_active_levels() bind(c)
424 integer (kind=omp_integer_kind) omp_get_supported_active_levels
425 end function omp_get_supported_active_levels
427 subroutine omp_fulfill_event(event) bind(c)
429 integer (kind=omp_event_handle_kind), value :: event
430 end subroutine omp_fulfill_event
432 subroutine omp_init_lock(svar) bind(c)
433 #ifdef __INTEL_COMPILER
434 !DIR$ IF(__INTEL_COMPILER.GE.1400)
435 !DIR$ attributes known_intrinsic :: omp_init_lock
439 integer (kind=omp_lock_kind) svar
440 end subroutine omp_init_lock
442 subroutine omp_destroy_lock(svar) bind(c)
443 #ifdef __INTEL_COMPILER
444 !DIR$ IF(__INTEL_COMPILER.GE.1400)
445 !DIR$ attributes known_intrinsic :: omp_destroy_lock
449 integer (kind=omp_lock_kind) svar
450 end subroutine omp_destroy_lock
452 subroutine omp_set_lock(svar) bind(c)
453 #ifdef __INTEL_COMPILER
454 !DIR$ IF(__INTEL_COMPILER.GE.1400)
455 !DIR$ attributes known_intrinsic :: omp_set_lock
459 integer (kind=omp_lock_kind) svar
460 end subroutine omp_set_lock
462 subroutine omp_unset_lock(svar) bind(c)
463 #ifdef __INTEL_COMPILER
464 !DIR$ IF(__INTEL_COMPILER.GE.1400)
465 !DIR$ attributes known_intrinsic :: omp_unset_lock
469 integer (kind=omp_lock_kind) svar
470 end subroutine omp_unset_lock
472 function omp_test_lock(svar) bind(c)
473 #ifdef __INTEL_COMPILER
474 !DIR$ IF(__INTEL_COMPILER.GE.1400)
475 !DIR$ attributes known_intrinsic :: omp_test_lock
479 logical (kind=omp_logical_kind) omp_test_lock
480 integer (kind=omp_lock_kind) svar
481 end function omp_test_lock
483 subroutine omp_init_nest_lock(nvar) bind(c)
484 #ifdef __INTEL_COMPILER
485 !DIR$ IF(__INTEL_COMPILER.GE.1400)
486 !DIR$ attributes known_intrinsic :: omp_init_nest_lock
490 integer (kind=omp_nest_lock_kind) nvar
491 end subroutine omp_init_nest_lock
493 subroutine omp_destroy_nest_lock(nvar) bind(c)
494 #ifdef __INTEL_COMPILER
495 !DIR$ IF(__INTEL_COMPILER.GE.1400)
496 !DIR$ attributes known_intrinsic :: omp_destroy_nest_lock
500 integer (kind=omp_nest_lock_kind) nvar
501 end subroutine omp_destroy_nest_lock
503 subroutine omp_set_nest_lock(nvar) bind(c)
504 #ifdef __INTEL_COMPILER
505 !DIR$ IF(__INTEL_COMPILER.GE.1400)
506 !DIR$ attributes known_intrinsic :: omp_set_nest_lock
510 integer (kind=omp_nest_lock_kind) nvar
511 end subroutine omp_set_nest_lock
513 subroutine omp_unset_nest_lock(nvar) bind(c)
514 #ifdef __INTEL_COMPILER
515 !DIR$ IF(__INTEL_COMPILER.GE.1400)
516 !DIR$ attributes known_intrinsic :: omp_unset_nest_lock
520 integer (kind=omp_nest_lock_kind) nvar
521 end subroutine omp_unset_nest_lock
523 function omp_test_nest_lock(nvar) bind(c)
524 #ifdef __INTEL_COMPILER
525 !DIR$ IF(__INTEL_COMPILER.GE.1400)
526 !DIR$ attributes known_intrinsic :: omp_test_nest_lock
530 integer (kind=omp_integer_kind) omp_test_nest_lock
531 integer (kind=omp_nest_lock_kind) nvar
532 end function omp_test_nest_lock
534 function omp_get_max_task_priority() bind(c)
536 integer (kind=omp_integer_kind) omp_get_max_task_priority
537 end function omp_get_max_task_priority
539 subroutine omp_init_lock_with_hint(svar, hint) bind(c)
541 integer (kind=omp_lock_kind) svar
542 integer (kind=omp_lock_hint_kind), value :: hint
543 end subroutine omp_init_lock_with_hint
545 subroutine omp_init_nest_lock_with_hint(nvar, hint) bind(c)
547 integer (kind=omp_nest_lock_kind) nvar
548 integer (kind=omp_lock_hint_kind), value :: hint
549 end subroutine omp_init_nest_lock_with_hint
551 function omp_control_tool(command, modifier, arg) bind(c)
553 integer (kind=omp_integer_kind) omp_control_tool
554 integer (kind=omp_control_tool_kind), value :: command
555 integer (kind=omp_control_tool_kind), value :: modifier
556 integer (kind=kmp_pointer_kind), optional :: arg
557 end function omp_control_tool
559 function omp_init_allocator(memspace, ntraits, traits)
561 integer (kind=omp_allocator_handle_kind) omp_init_allocator
562 integer (kind=omp_memspace_handle_kind) :: memspace
563 integer (kind=omp_integer_kind) :: ntraits
564 type(omp_alloctrait), intent(in) :: traits(*)
565 end function omp_init_allocator
567 subroutine omp_destroy_allocator(allocator) bind(c)
569 integer (kind=omp_allocator_handle_kind), value :: allocator
570 end subroutine omp_destroy_allocator
572 subroutine omp_set_default_allocator(allocator) bind(c)
574 integer (kind=omp_allocator_handle_kind), value :: allocator
575 end subroutine omp_set_default_allocator
577 function omp_get_default_allocator() bind(c)
579 integer (kind=omp_allocator_handle_kind) omp_get_default_allocator
580 end function omp_get_default_allocator
582 subroutine omp_set_affinity_format(format)
583 character (len=*) :: format
584 end subroutine omp_set_affinity_format
586 function omp_get_affinity_format(buffer)
588 character (len=*) :: buffer
589 integer (kind=kmp_size_t_kind) :: omp_get_affinity_format
590 end function omp_get_affinity_format
592 subroutine omp_display_affinity(format)
593 character (len=*) :: format
594 end subroutine omp_display_affinity
596 function omp_capture_affinity(buffer, format)
598 character (len=*) :: format
599 character (len=*) :: buffer
600 integer (kind=kmp_size_t_kind) :: omp_capture_affinity
601 end function omp_capture_affinity
603 subroutine omp_set_num_teams(num_teams) bind(c)
605 integer (kind=omp_integer_kind), value :: num_teams
606 end subroutine omp_set_num_teams
608 function omp_get_max_teams() bind(c)
610 integer (kind=omp_integer_kind) omp_get_max_teams
611 end function omp_get_max_teams
613 subroutine omp_set_teams_thread_limit(thread_limit) bind(c)
615 integer (kind=omp_integer_kind), value :: thread_limit
616 end subroutine omp_set_teams_thread_limit
618 function omp_get_teams_thread_limit() bind(c)
620 integer (kind=omp_integer_kind) omp_get_teams_thread_limit
621 end function omp_get_teams_thread_limit
623 subroutine omp_display_env(verbose) bind(c)
625 logical (kind=omp_logical_kind), value :: verbose
626 end subroutine omp_display_env
628 function omp_target_alloc(size, device_num) bind(c)
629 use, intrinsic :: iso_c_binding, only: c_ptr, c_size_t, c_int
630 type(c_ptr) omp_target_alloc
631 integer(c_size_t), value :: size
632 integer(c_int), value :: device_num
633 end function omp_target_alloc
635 subroutine omp_target_free(device_ptr, device_num) bind(c)
636 use, intrinsic :: iso_c_binding, only: c_ptr, c_int
637 type(c_ptr), value :: device_ptr
638 integer(c_int), value :: device_num
639 end subroutine omp_target_free
641 function omp_target_is_present(ptr, device_num) bind(c)
642 use, intrinsic :: iso_c_binding, only: c_ptr, c_int
643 integer(c_int) omp_target_is_present
644 type(c_ptr), value :: ptr
645 integer(c_int), value :: device_num
646 end function omp_target_is_present
648 function omp_target_memcpy(dst, src, length, dst_offset, src_offset, &
649 dst_device_num, src_device_num) bind(c)
650 use, intrinsic :: iso_c_binding, only: c_ptr, c_size_t, c_int
651 integer(c_int) omp_target_memcpy
652 type(c_ptr), value :: dst, src
653 integer(c_size_t), value :: length, dst_offset, src_offset
654 integer(c_int), value :: dst_device_num, src_device_num
655 end function omp_target_memcpy
657 function omp_target_memcpy_rect(dst, src, element_size, num_dims, &
658 volume, dst_offsets, src_offsets, dst_dimensions, &
659 src_dimensions, dst_device_num, src_device_num) bind(c)
660 use, intrinsic :: iso_c_binding, only: c_ptr, c_size_t, c_int
661 integer(c_int) omp_target_memcpy_rect
662 type(c_ptr), value :: dst, src
663 integer(c_size_t), value :: element_size
664 integer(c_int), value :: num_dims, dst_device_num, src_device_num
665 integer(c_size_t), intent(in) :: volume(*), dst_offsets(*), &
666 src_offsets(*), dst_dimensions(*), src_dimensions(*)
667 end function omp_target_memcpy_rect
669 function omp_target_memcpy_async(dst, src, length, dst_offset, &
670 src_offset, dst_device_num, src_device_num, depobj_count, &
673 use, intrinsic :: iso_c_binding, only: c_ptr, c_size_t, c_int
674 integer(c_int) omp_target_memcpy_async
675 type(c_ptr), value :: dst, src
676 integer(c_size_t), value :: length, dst_offset, src_offset
677 integer(c_int), value :: dst_device_num, src_device_num, &
679 integer(omp_depend_kind), optional :: depobj_list(*)
680 end function omp_target_memcpy_async
682 function omp_target_memcpy_rect_async(dst, src, element_size, &
683 num_dims, volume, dst_offsets, src_offsets, dst_dimensions, &
684 src_dimensions, dst_device_num, src_device_num, depobj_count, &
687 use, intrinsic :: iso_c_binding, only: c_ptr, c_size_t, c_int
688 integer(c_int) omp_target_memcpy_rect_async
689 type(c_ptr), value :: dst, src
690 integer(c_size_t), value :: element_size
691 integer(c_int), value :: num_dims, dst_device_num, src_device_num, &
693 integer(c_size_t), intent(in) :: volume(*), dst_offsets(*), &
694 src_offsets(*), dst_dimensions(*), src_dimensions(*)
695 integer (omp_depend_kind), optional :: depobj_list(*)
696 end function omp_target_memcpy_rect_async
698 function omp_target_memset(ptr, val, count, device_num) bind(c)
699 use, intrinsic :: iso_c_binding, only : c_ptr, c_int, c_size_t
700 type(c_ptr) :: omp_target_memset
701 type(c_ptr), value :: ptr
702 integer(c_int), value :: val
703 integer(c_size_t), value :: count
704 integer(c_int), value :: device_num
707 function omp_target_memset_async(ptr, val, count, device_num, &
708 depobj_count, depobj_list) bind(c)
710 use, intrinsic :: iso_c_binding, only : c_ptr, c_int, c_size_t
711 type(c_ptr) :: omp_target_memset_async
712 type(c_ptr), value :: ptr
713 integer(c_int), value :: val
714 integer(c_size_t), value :: count
715 integer(c_int), value :: device_num
716 integer(c_int), value :: depobj_count
717 integer(omp_depend_kind), optional :: depobj_list(*)
720 function omp_target_associate_ptr(host_ptr, device_ptr, size, &
721 device_offset, device_num) bind(c)
722 use, intrinsic :: iso_c_binding, only: c_ptr, c_size_t, c_int
723 integer(c_int) omp_target_associate_ptr
724 type(c_ptr), value :: host_ptr, device_ptr
725 integer(c_size_t), value :: size, device_offset
726 integer(c_int), value :: device_num
727 end function omp_target_associate_ptr
729 function omp_get_mapped_ptr(ptr, device_num) bind(c)
730 use, intrinsic :: iso_c_binding, only: c_ptr, c_int
731 type(c_ptr) omp_get_mapped_ptr
732 type(c_ptr), value :: ptr
733 integer(c_int), value :: device_num
734 end function omp_get_mapped_ptr
736 function omp_target_disassociate_ptr(ptr, device_num) bind(c)
737 use, intrinsic :: iso_c_binding, only: c_ptr, c_int
738 integer(c_int) omp_target_disassociate_ptr
739 type(c_ptr), value :: ptr
740 integer(c_int), value :: device_num
741 end function omp_target_disassociate_ptr
743 function omp_target_is_accessible(ptr, size, device_num) bind(c)
744 use, intrinsic :: iso_c_binding, only : c_ptr, c_size_t, c_int
745 integer(c_int) omp_target_is_accessible
746 type(c_ptr), value :: ptr
747 integer(c_size_t), value :: size
748 integer(c_int), value :: device_num
749 end function omp_target_is_accessible
751 function omp_alloc(size, allocator) bind(c)
753 use, intrinsic :: iso_c_binding, only : c_ptr, c_size_t
754 type(c_ptr) omp_alloc
755 integer(c_size_t), value :: size
756 integer(omp_allocator_handle_kind), value :: allocator
757 end function omp_alloc
759 function omp_aligned_alloc(alignment, size, allocator) bind(c)
761 use, intrinsic :: iso_c_binding, only : c_ptr, c_size_t
762 type(c_ptr) omp_aligned_alloc
763 integer(c_size_t), value :: alignment, size
764 integer(omp_allocator_handle_kind), value :: allocator
765 end function omp_aligned_alloc
767 function omp_calloc(nmemb, size, allocator) bind(c)
769 use, intrinsic :: iso_c_binding, only : c_ptr, c_size_t
770 type(c_ptr) omp_calloc
771 integer(c_size_t), value :: nmemb, size
772 integer(omp_allocator_handle_kind), value :: allocator
773 end function omp_calloc
775 function omp_aligned_calloc(alignment, nmemb, size, allocator) bind(c)
777 use, intrinsic :: iso_c_binding, only : c_ptr, c_size_t
778 type(c_ptr) omp_aligned_calloc
779 integer(c_size_t), value :: alignment, nmemb, size
780 integer(omp_allocator_handle_kind), value :: allocator
781 end function omp_aligned_calloc
783 function omp_realloc(ptr, size, allocator, free_allocator) bind(c)
785 use, intrinsic :: iso_c_binding, only : c_ptr, c_size_t
786 type(c_ptr) omp_realloc
787 type(c_ptr), value :: ptr
788 integer(c_size_t), value :: size
789 integer(omp_allocator_handle_kind), value :: allocator
790 integer(omp_allocator_handle_kind), value :: free_allocator
791 end function omp_realloc
793 subroutine omp_free(ptr, allocator) bind(c)
795 use, intrinsic :: iso_c_binding, only : c_ptr
796 type(c_ptr), value :: ptr
797 integer(omp_allocator_handle_kind), value :: allocator
798 end subroutine omp_free
800 function omp_in_explicit_task() bind(c)
802 logical (kind=omp_logical_kind) omp_in_explicit_task
803 end function omp_in_explicit_task
806 ! *** kmp_* entry points
809 subroutine kmp_set_stacksize(size) bind(c)
811 integer (kind=omp_integer_kind), value :: size
812 end subroutine kmp_set_stacksize
814 subroutine kmp_set_stacksize_s(size) bind(c)
816 integer (kind=kmp_size_t_kind), value :: size
817 end subroutine kmp_set_stacksize_s
819 subroutine kmp_set_blocktime(msec) bind(c)
821 integer (kind=omp_integer_kind), value :: msec
822 end subroutine kmp_set_blocktime
824 subroutine kmp_set_library_serial() bind(c)
825 end subroutine kmp_set_library_serial
827 subroutine kmp_set_library_turnaround() bind(c)
828 end subroutine kmp_set_library_turnaround
830 subroutine kmp_set_library_throughput() bind(c)
831 end subroutine kmp_set_library_throughput
833 subroutine kmp_set_library(libnum) bind(c)
835 integer (kind=omp_integer_kind), value :: libnum
836 end subroutine kmp_set_library
838 subroutine kmp_set_defaults(string) bind(c)
839 use, intrinsic :: iso_c_binding
840 character (kind=c_char) :: string(*)
841 end subroutine kmp_set_defaults
843 function kmp_get_stacksize() bind(c)
845 integer (kind=omp_integer_kind) kmp_get_stacksize
846 end function kmp_get_stacksize
848 function kmp_get_stacksize_s() bind(c)
850 integer (kind=kmp_size_t_kind) kmp_get_stacksize_s
851 end function kmp_get_stacksize_s
853 function kmp_get_blocktime() bind(c)
855 integer (kind=omp_integer_kind) kmp_get_blocktime
856 end function kmp_get_blocktime
858 function kmp_get_library() bind(c)
860 integer (kind=omp_integer_kind) kmp_get_library
861 end function kmp_get_library
863 subroutine kmp_set_disp_num_buffers(num) bind(c)
865 integer (kind=omp_integer_kind), value :: num
866 end subroutine kmp_set_disp_num_buffers
868 function kmp_set_affinity(mask) bind(c)
870 integer (kind=omp_integer_kind) kmp_set_affinity
871 integer (kind=kmp_affinity_mask_kind) mask
872 end function kmp_set_affinity
874 function kmp_get_affinity(mask) bind(c)
876 integer (kind=omp_integer_kind) kmp_get_affinity
877 integer (kind=kmp_affinity_mask_kind) mask
878 end function kmp_get_affinity
880 function kmp_get_affinity_max_proc() bind(c)
882 integer (kind=omp_integer_kind) kmp_get_affinity_max_proc
883 end function kmp_get_affinity_max_proc
885 subroutine kmp_create_affinity_mask(mask) bind(c)
887 integer (kind=kmp_affinity_mask_kind) mask
888 end subroutine kmp_create_affinity_mask
890 subroutine kmp_destroy_affinity_mask(mask) bind(c)
892 integer (kind=kmp_affinity_mask_kind) mask
893 end subroutine kmp_destroy_affinity_mask
895 function kmp_set_affinity_mask_proc(proc, mask) bind(c)
897 integer (kind=omp_integer_kind) kmp_set_affinity_mask_proc
898 integer (kind=omp_integer_kind), value :: proc
899 integer (kind=kmp_affinity_mask_kind) mask
900 end function kmp_set_affinity_mask_proc
902 function kmp_unset_affinity_mask_proc(proc, mask) bind(c)
904 integer (kind=omp_integer_kind) kmp_unset_affinity_mask_proc
905 integer (kind=omp_integer_kind), value :: proc
906 integer (kind=kmp_affinity_mask_kind) mask
907 end function kmp_unset_affinity_mask_proc
909 function kmp_get_affinity_mask_proc(proc, mask) bind(c)
911 integer (kind=omp_integer_kind) kmp_get_affinity_mask_proc
912 integer (kind=omp_integer_kind), value :: proc
913 integer (kind=kmp_affinity_mask_kind) mask
914 end function kmp_get_affinity_mask_proc
916 function kmp_malloc(size) bind(c)
918 integer (kind=kmp_pointer_kind) kmp_malloc
919 integer (kind=kmp_size_t_kind), value :: size
920 end function kmp_malloc
922 function kmp_aligned_malloc(size, alignment) bind(c)
924 integer (kind=kmp_pointer_kind) kmp_aligned_malloc
925 integer (kind=kmp_size_t_kind), value :: size
926 integer (kind=kmp_size_t_kind), value :: alignment
927 end function kmp_aligned_malloc
929 function kmp_calloc(nelem, elsize) bind(c)
931 integer (kind=kmp_pointer_kind) kmp_calloc
932 integer (kind=kmp_size_t_kind), value :: nelem
933 integer (kind=kmp_size_t_kind), value :: elsize
934 end function kmp_calloc
936 function kmp_realloc(ptr, size) bind(c)
938 integer (kind=kmp_pointer_kind) kmp_realloc
939 integer (kind=kmp_pointer_kind), value :: ptr
940 integer (kind=kmp_size_t_kind), value :: size
941 end function kmp_realloc
943 subroutine kmp_free(ptr) bind(c)
945 integer (kind=kmp_pointer_kind), value :: ptr
946 end subroutine kmp_free
948 subroutine kmp_set_warnings_on() bind(c)
949 end subroutine kmp_set_warnings_on
951 subroutine kmp_set_warnings_off() bind(c)
952 end subroutine kmp_set_warnings_off
954 function kmp_get_cancellation_status(cancelkind) bind(c)
956 integer (kind=kmp_cancel_kind), value :: cancelkind
957 logical (kind=omp_logical_kind) kmp_get_cancellation_status
958 end function kmp_get_cancellation_status
962 ! make the above routine definitions public
963 public :: omp_set_num_threads
964 public :: omp_set_dynamic
965 public :: omp_set_nested
966 public :: omp_get_num_threads
967 public :: omp_get_max_threads
968 public :: omp_get_thread_num
969 public :: omp_get_num_procs
970 public :: omp_in_parallel
971 public :: omp_in_final
972 public :: omp_get_dynamic
973 public :: omp_get_nested
974 public :: omp_get_thread_limit
975 public :: omp_set_max_active_levels
976 public :: omp_get_max_active_levels
977 public :: omp_get_level
978 public :: omp_get_active_level
979 public :: omp_get_ancestor_thread_num
980 public :: omp_get_team_size
981 public :: omp_set_schedule
982 public :: omp_get_schedule
983 public :: omp_get_proc_bind
984 public :: omp_get_num_places
985 public :: omp_get_place_num_procs
986 public :: omp_get_place_proc_ids
987 public :: omp_get_place_num
988 public :: omp_get_partition_num_places
989 public :: omp_get_partition_place_nums
990 public :: omp_get_wtime
991 public :: omp_get_wtick
992 public :: omp_get_default_device
993 public :: omp_set_default_device
994 public :: omp_get_num_devices
995 public :: omp_get_num_teams
996 public :: omp_get_team_num
997 public :: omp_get_cancellation
998 public :: omp_is_initial_device
999 public :: omp_get_initial_device
1000 public :: omp_get_device_num
1001 public :: omp_pause_resource
1002 public :: omp_pause_resource_all
1003 public :: omp_get_supported_active_levels
1004 public :: omp_fulfill_event
1005 public :: omp_init_lock
1006 public :: omp_destroy_lock
1007 public :: omp_set_lock
1008 public :: omp_unset_lock
1009 public :: omp_test_lock
1010 public :: omp_init_nest_lock
1011 public :: omp_destroy_nest_lock
1012 public :: omp_set_nest_lock
1013 public :: omp_unset_nest_lock
1014 public :: omp_test_nest_lock
1015 public :: omp_get_max_task_priority
1016 public :: omp_init_lock_with_hint
1017 public :: omp_init_nest_lock_with_hint
1018 public :: omp_control_tool
1019 public :: omp_init_allocator
1020 public :: omp_destroy_allocator
1021 public :: omp_set_default_allocator
1022 public :: omp_get_default_allocator
1023 public :: omp_set_affinity_format
1024 public :: omp_get_affinity_format
1025 public :: omp_display_affinity
1026 public :: omp_capture_affinity
1027 public :: omp_set_num_teams
1028 public :: omp_get_max_teams
1029 public :: omp_set_teams_thread_limit
1030 public :: omp_get_teams_thread_limit
1031 public :: omp_display_env
1032 public :: omp_target_alloc
1033 public :: omp_target_free
1034 public :: omp_target_is_present
1035 public :: omp_target_memcpy
1036 public :: omp_target_memcpy_rect
1037 public :: omp_target_memcpy_async
1038 public :: omp_target_memcpy_rect_async
1039 public :: omp_target_memset
1040 public :: omp_target_memset_async
1041 public :: omp_target_associate_ptr
1042 public :: omp_get_mapped_ptr
1043 public :: omp_target_disassociate_ptr
1044 public :: omp_target_is_accessible
1046 public :: omp_aligned_alloc
1047 public :: omp_calloc
1048 public :: omp_aligned_calloc
1049 public :: omp_realloc
1051 public :: omp_in_explicit_task
1052 public :: kmp_set_stacksize
1053 public :: kmp_set_stacksize_s
1054 public :: kmp_set_blocktime
1055 public :: kmp_set_library_serial
1056 public :: kmp_set_library_turnaround
1057 public :: kmp_set_library_throughput
1058 public :: kmp_set_library
1059 public :: kmp_set_defaults
1060 public :: kmp_get_stacksize
1061 public :: kmp_get_stacksize_s
1062 public :: kmp_get_blocktime
1063 public :: kmp_get_library
1064 public :: kmp_set_disp_num_buffers
1065 public :: kmp_set_affinity
1066 public :: kmp_get_affinity
1067 public :: kmp_get_affinity_max_proc
1068 public :: kmp_create_affinity_mask
1069 public :: kmp_destroy_affinity_mask
1070 public :: kmp_set_affinity_mask_proc
1071 public :: kmp_unset_affinity_mask_proc
1072 public :: kmp_get_affinity_mask_proc
1073 public :: kmp_malloc
1074 public :: kmp_aligned_malloc
1075 public :: kmp_calloc
1076 public :: kmp_realloc
1078 public :: kmp_set_warnings_on
1079 public :: kmp_set_warnings_off
1080 public :: kmp_get_cancellation_status