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 integer, parameter :: omp_integer_kind = c_int
18 integer, parameter :: omp_logical_kind = 4
19 integer, parameter :: omp_real_kind = c_float
20 integer, parameter :: kmp_double_kind = c_double
21 integer, parameter :: omp_lock_kind = c_intptr_t
22 integer, parameter :: omp_nest_lock_kind = c_intptr_t
23 integer, parameter :: omp_sched_kind = omp_integer_kind
24 integer, parameter :: omp_proc_bind_kind = omp_integer_kind
25 integer, parameter :: kmp_pointer_kind = c_intptr_t
26 integer, parameter :: kmp_size_t_kind = c_size_t
27 integer, parameter :: kmp_affinity_mask_kind = c_intptr_t
28 integer, parameter :: kmp_cancel_kind = omp_integer_kind
29 integer, parameter :: omp_sync_hint_kind = omp_integer_kind
30 integer, parameter :: omp_lock_hint_kind = omp_sync_hint_kind
31 integer, parameter :: omp_control_tool_kind = omp_integer_kind
32 integer, parameter :: omp_control_tool_result_kind = omp_integer_kind
33 integer, parameter :: omp_allocator_handle_kind = c_intptr_t
34 integer, parameter :: omp_memspace_handle_kind = c_intptr_t
35 integer, parameter :: omp_alloctrait_key_kind = omp_integer_kind
36 integer, parameter :: omp_alloctrait_val_kind = c_intptr_t
37 integer, parameter :: omp_interop_kind = c_intptr_t
38 integer, parameter :: omp_interop_fr_kind = omp_integer_kind
41 integer(kind=omp_alloctrait_key_kind) key
42 integer(kind=omp_alloctrait_val_kind) value
43 end type omp_alloctrait
45 integer, parameter :: omp_pause_resource_kind = omp_integer_kind
46 integer, parameter :: omp_depend_kind = c_intptr_t
47 integer, parameter :: omp_event_handle_kind = c_intptr_t
49 end module omp_lib_kinds
55 integer (kind=omp_integer_kind), parameter :: openmp_version = @LIBOMP_OMP_YEAR_MONTH@
56 integer (kind=omp_integer_kind), parameter :: kmp_version_major = @LIBOMP_VERSION_MAJOR@
57 integer (kind=omp_integer_kind), parameter :: kmp_version_minor = @LIBOMP_VERSION_MINOR@
58 integer (kind=omp_integer_kind), parameter :: kmp_version_build = @LIBOMP_VERSION_BUILD@
59 character(*) kmp_build_date
60 parameter( kmp_build_date = '@LIBOMP_BUILD_DATE@' )
62 integer(kind=omp_sched_kind), parameter :: omp_sched_static = 1
63 integer(kind=omp_sched_kind), parameter :: omp_sched_dynamic = 2
64 integer(kind=omp_sched_kind), parameter :: omp_sched_guided = 3
65 integer(kind=omp_sched_kind), parameter :: omp_sched_auto = 4
66 integer(kind=omp_sched_kind), parameter :: omp_sched_monotonic = int(Z'80000000', kind=omp_sched_kind)
68 integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_false = 0
69 integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_true = 1
70 integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_master = 2
71 integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_close = 3
72 integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_spread = 4
74 integer (kind=kmp_cancel_kind), parameter :: kmp_cancel_parallel = 1
75 integer (kind=kmp_cancel_kind), parameter :: kmp_cancel_loop = 2
76 integer (kind=kmp_cancel_kind), parameter :: kmp_cancel_sections = 3
77 integer (kind=kmp_cancel_kind), parameter :: kmp_cancel_taskgroup = 4
79 integer (kind=omp_sync_hint_kind), parameter :: omp_sync_hint_none = 0
80 integer (kind=omp_sync_hint_kind), parameter :: omp_sync_hint_uncontended = 1
81 integer (kind=omp_sync_hint_kind), parameter :: omp_sync_hint_contended = 2
82 integer (kind=omp_sync_hint_kind), parameter :: omp_sync_hint_nonspeculative = 4
83 integer (kind=omp_sync_hint_kind), parameter :: omp_sync_hint_speculative = 8
84 integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_none = omp_sync_hint_none
85 integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_uncontended = omp_sync_hint_uncontended
86 integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_contended = omp_sync_hint_contended
87 integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_nonspeculative = omp_sync_hint_nonspeculative
88 integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_speculative = omp_sync_hint_speculative
89 integer (kind=omp_lock_hint_kind), parameter :: kmp_lock_hint_hle = 65536
90 integer (kind=omp_lock_hint_kind), parameter :: kmp_lock_hint_rtm = 131072
91 integer (kind=omp_lock_hint_kind), parameter :: kmp_lock_hint_adaptive = 262144
93 integer (kind=omp_control_tool_kind), parameter :: omp_control_tool_start = 1
94 integer (kind=omp_control_tool_kind), parameter :: omp_control_tool_pause = 2
95 integer (kind=omp_control_tool_kind), parameter :: omp_control_tool_flush = 3
96 integer (kind=omp_control_tool_kind), parameter :: omp_control_tool_end = 4
98 integer (kind=omp_control_tool_result_kind), parameter :: omp_control_tool_notool = -2
99 integer (kind=omp_control_tool_result_kind), parameter :: omp_control_tool_nocallback = -1
100 integer (kind=omp_control_tool_result_kind), parameter :: omp_control_tool_success = 0
101 integer (kind=omp_control_tool_result_kind), parameter :: omp_control_tool_ignored = 1
103 integer (kind=omp_alloctrait_key_kind), parameter :: omp_atk_sync_hint = 1
104 integer (kind=omp_alloctrait_key_kind), parameter :: omp_atk_alignment = 2
105 integer (kind=omp_alloctrait_key_kind), parameter :: omp_atk_access = 3
106 integer (kind=omp_alloctrait_key_kind), parameter :: omp_atk_pool_size = 4
107 integer (kind=omp_alloctrait_key_kind), parameter :: omp_atk_fallback = 5
108 integer (kind=omp_alloctrait_key_kind), parameter :: omp_atk_fb_data = 6
109 integer (kind=omp_alloctrait_key_kind), parameter :: omp_atk_pinned = 7
110 integer (kind=omp_alloctrait_key_kind), parameter :: omp_atk_partition = 8
112 integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_default = -1
113 integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_false = 0
114 integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_true = 1
115 integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_contended = 3
116 integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_uncontended = 4
117 integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_serialized = 5
118 integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_sequential = omp_atv_serialized
119 integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_private = 6
120 integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_all = 7
121 integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_thread = 8
122 integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_pteam = 9
123 integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_cgroup = 10
124 integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_default_mem_fb = 11
125 integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_null_fb = 12
126 integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_abort_fb = 13
127 integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_allocator_fb = 14
128 integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_environment = 15
129 integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_nearest = 16
130 integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_blocked = 17
131 integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_interleaved = 18
133 integer (kind=omp_allocator_handle_kind), parameter :: omp_null_allocator = 0
134 integer (kind=omp_allocator_handle_kind), parameter :: omp_default_mem_alloc = 1
135 integer (kind=omp_allocator_handle_kind), parameter :: omp_large_cap_mem_alloc = 2
136 integer (kind=omp_allocator_handle_kind), parameter :: omp_const_mem_alloc = 3
137 integer (kind=omp_allocator_handle_kind), parameter :: omp_high_bw_mem_alloc = 4
138 integer (kind=omp_allocator_handle_kind), parameter :: omp_low_lat_mem_alloc = 5
139 integer (kind=omp_allocator_handle_kind), parameter :: omp_cgroup_mem_alloc = 6
140 integer (kind=omp_allocator_handle_kind), parameter :: omp_pteam_mem_alloc = 7
141 integer (kind=omp_allocator_handle_kind), parameter :: omp_thread_mem_alloc = 8
142 integer (kind=omp_allocator_handle_kind), parameter :: llvm_omp_target_host_mem_alloc = 100
143 integer (kind=omp_allocator_handle_kind), parameter :: llvm_omp_target_shared_mem_alloc = 101
144 integer (kind=omp_allocator_handle_kind), parameter :: llvm_omp_target_device_mem_alloc = 102
146 integer (kind=omp_memspace_handle_kind), parameter :: omp_default_mem_space = 0
147 integer (kind=omp_memspace_handle_kind), parameter :: omp_large_cap_mem_space = 1
148 integer (kind=omp_memspace_handle_kind), parameter :: omp_const_mem_space = 2
149 integer (kind=omp_memspace_handle_kind), parameter :: omp_high_bw_mem_space = 3
150 integer (kind=omp_memspace_handle_kind), parameter :: omp_low_lat_mem_space = 4
151 integer (kind=omp_memspace_handle_kind), parameter :: llvm_omp_target_host_mem_space = 100
152 integer (kind=omp_memspace_handle_kind), parameter :: llvm_omp_target_shared_mem_space = 101
153 integer (kind=omp_memspace_handle_kind), parameter :: llvm_omp_target_device_mem_space = 102
155 integer (kind=omp_pause_resource_kind), parameter :: omp_pause_resume = 0
156 integer (kind=omp_pause_resource_kind), parameter :: omp_pause_soft = 1
157 integer (kind=omp_pause_resource_kind), parameter :: omp_pause_hard = 2
159 integer (kind=omp_interop_fr_kind), parameter :: omp_ifr_cuda = 1
160 integer (kind=omp_interop_fr_kind), parameter :: omp_ifr_cuda_driver = 2
161 integer (kind=omp_interop_fr_kind), parameter :: omp_ifr_opencl = 3
162 integer (kind=omp_interop_fr_kind), parameter :: omp_ifr_sycl = 4
163 integer (kind=omp_interop_fr_kind), parameter :: omp_ifr_hip = 5
164 integer (kind=omp_interop_fr_kind), parameter :: omp_ifr_level_zero = 6
165 integer (kind=omp_interop_fr_kind), parameter :: omp_ifr_last = 7
167 integer (kind=omp_interop_kind), parameter :: omp_interop_none = 0
172 ! *** omp_* entry points
175 subroutine omp_set_num_threads(num_threads) bind(c)
177 integer (kind=omp_integer_kind), value :: num_threads
178 end subroutine omp_set_num_threads
180 subroutine omp_set_dynamic(dynamic_threads) bind(c)
182 logical (kind=omp_logical_kind), value :: dynamic_threads
183 end subroutine omp_set_dynamic
185 subroutine omp_set_nested(nested) bind(c)
187 logical (kind=omp_logical_kind), value :: nested
188 end subroutine omp_set_nested
190 function omp_get_num_threads() bind(c)
192 integer (kind=omp_integer_kind) omp_get_num_threads
193 end function omp_get_num_threads
195 function omp_get_max_threads() bind(c)
197 integer (kind=omp_integer_kind) omp_get_max_threads
198 end function omp_get_max_threads
200 function omp_get_thread_num() bind(c)
202 integer (kind=omp_integer_kind) omp_get_thread_num
203 end function omp_get_thread_num
205 function omp_get_num_procs() bind(c)
207 integer (kind=omp_integer_kind) omp_get_num_procs
208 end function omp_get_num_procs
210 function omp_in_parallel() bind(c)
212 logical (kind=omp_logical_kind) omp_in_parallel
213 end function omp_in_parallel
215 function omp_in_final() bind(c)
217 logical (kind=omp_logical_kind) omp_in_final
218 end function omp_in_final
220 function omp_get_dynamic() bind(c)
222 logical (kind=omp_logical_kind) omp_get_dynamic
223 end function omp_get_dynamic
225 function omp_get_nested() bind(c)
227 logical (kind=omp_logical_kind) omp_get_nested
228 end function omp_get_nested
230 function omp_get_thread_limit() bind(c)
232 integer (kind=omp_integer_kind) omp_get_thread_limit
233 end function omp_get_thread_limit
235 subroutine omp_set_max_active_levels(max_levels) bind(c)
237 integer (kind=omp_integer_kind), value :: max_levels
238 end subroutine omp_set_max_active_levels
240 function omp_get_max_active_levels() bind(c)
242 integer (kind=omp_integer_kind) omp_get_max_active_levels
243 end function omp_get_max_active_levels
245 function omp_get_level() bind(c)
247 integer (kind=omp_integer_kind) omp_get_level
248 end function omp_get_level
250 function omp_get_active_level() bind(c)
252 integer (kind=omp_integer_kind) omp_get_active_level
253 end function omp_get_active_level
255 function omp_get_ancestor_thread_num(level) bind(c)
257 integer (kind=omp_integer_kind) omp_get_ancestor_thread_num
258 integer (kind=omp_integer_kind), value :: level
259 end function omp_get_ancestor_thread_num
261 function omp_get_team_size(level) bind(c)
263 integer (kind=omp_integer_kind) omp_get_team_size
264 integer (kind=omp_integer_kind), value :: level
265 end function omp_get_team_size
267 subroutine omp_set_schedule(kind, chunk_size) bind(c)
269 integer (kind=omp_sched_kind), value :: kind
270 integer (kind=omp_integer_kind), value :: chunk_size
271 end subroutine omp_set_schedule
273 subroutine omp_get_schedule(kind, chunk_size) bind(c)
275 integer (kind=omp_sched_kind) kind
276 integer (kind=omp_integer_kind) chunk_size
277 end subroutine omp_get_schedule
279 function omp_get_proc_bind() bind(c)
281 integer (kind=omp_proc_bind_kind) omp_get_proc_bind
282 end function omp_get_proc_bind
284 function omp_get_num_places() bind(c)
286 integer (kind=omp_integer_kind) omp_get_num_places
287 end function omp_get_num_places
289 function omp_get_place_num_procs(place_num) bind(c)
291 integer (kind=omp_integer_kind), value :: place_num
292 integer (kind=omp_integer_kind) omp_get_place_num_procs
293 end function omp_get_place_num_procs
295 subroutine omp_get_place_proc_ids(place_num, ids) bind(c)
297 integer (kind=omp_integer_kind), value :: place_num
298 integer (kind=omp_integer_kind) ids(*)
299 end subroutine omp_get_place_proc_ids
301 function omp_get_place_num() bind(c)
303 integer (kind=omp_integer_kind) omp_get_place_num
304 end function omp_get_place_num
306 function omp_get_partition_num_places() bind(c)
308 integer (kind=omp_integer_kind) omp_get_partition_num_places
309 end function omp_get_partition_num_places
311 subroutine omp_get_partition_place_nums(place_nums) bind(c)
313 integer (kind=omp_integer_kind) place_nums(*)
314 end subroutine omp_get_partition_place_nums
316 function omp_get_wtime() bind(c)
318 real (kind=kmp_double_kind) omp_get_wtime
319 end function omp_get_wtime
321 function omp_get_wtick() bind(c)
323 real (kind=kmp_double_kind) omp_get_wtick
324 end function omp_get_wtick
326 function omp_get_default_device() bind(c)
328 integer (kind=omp_integer_kind) omp_get_default_device
329 end function omp_get_default_device
331 subroutine omp_set_default_device(device_num) bind(c)
333 integer (kind=omp_integer_kind), value :: device_num
334 end subroutine omp_set_default_device
336 function omp_get_num_devices() bind(c)
338 integer (kind=omp_integer_kind) omp_get_num_devices
339 end function omp_get_num_devices
341 function omp_get_num_teams() bind(c)
343 integer (kind=omp_integer_kind) omp_get_num_teams
344 end function omp_get_num_teams
346 function omp_get_team_num() bind(c)
348 integer (kind=omp_integer_kind) omp_get_team_num
349 end function omp_get_team_num
351 function omp_get_cancellation() bind(c)
353 integer (kind=omp_integer_kind) omp_get_cancellation
354 end function omp_get_cancellation
356 function omp_is_initial_device() bind(c)
358 logical (kind=omp_logical_kind) omp_is_initial_device
359 end function omp_is_initial_device
361 function omp_get_initial_device() bind(c)
363 integer (kind=omp_integer_kind) omp_get_initial_device
364 end function omp_get_initial_device
366 function omp_get_device_num() bind(c)
368 integer (kind=omp_integer_kind) omp_get_device_num
369 end function omp_get_device_num
371 function omp_pause_resource(kind, device_num) bind(c)
373 integer (kind=omp_pause_resource_kind), value :: kind
374 integer (kind=omp_integer_kind), value :: device_num
375 integer (kind=omp_integer_kind) omp_pause_resource
376 end function omp_pause_resource
378 function omp_pause_resource_all(kind) bind(c)
380 integer (kind=omp_pause_resource_kind), value :: kind
381 integer (kind=omp_integer_kind) omp_pause_resource_all
382 end function omp_pause_resource_all
384 function omp_get_supported_active_levels() bind(c)
386 integer (kind=omp_integer_kind) omp_get_supported_active_levels
387 end function omp_get_supported_active_levels
389 subroutine omp_fulfill_event(event) bind(c)
391 integer (kind=omp_event_handle_kind), value :: event
392 end subroutine omp_fulfill_event
394 subroutine omp_init_lock(svar) bind(c)
395 !DIR$ IF(__INTEL_COMPILER.GE.1400)
396 !DIR$ attributes known_intrinsic :: omp_init_lock
399 integer (kind=omp_lock_kind) svar
400 end subroutine omp_init_lock
402 subroutine omp_destroy_lock(svar) bind(c)
403 !DIR$ IF(__INTEL_COMPILER.GE.1400)
404 !DIR$ attributes known_intrinsic :: omp_destroy_lock
407 integer (kind=omp_lock_kind) svar
408 end subroutine omp_destroy_lock
410 subroutine omp_set_lock(svar) bind(c)
411 !DIR$ IF(__INTEL_COMPILER.GE.1400)
412 !DIR$ attributes known_intrinsic :: omp_set_lock
415 integer (kind=omp_lock_kind) svar
416 end subroutine omp_set_lock
418 subroutine omp_unset_lock(svar) bind(c)
419 !DIR$ IF(__INTEL_COMPILER.GE.1400)
420 !DIR$ attributes known_intrinsic :: omp_unset_lock
423 integer (kind=omp_lock_kind) svar
424 end subroutine omp_unset_lock
426 function omp_test_lock(svar) bind(c)
427 !DIR$ IF(__INTEL_COMPILER.GE.1400)
428 !DIR$ attributes known_intrinsic :: omp_test_lock
431 logical (kind=omp_logical_kind) omp_test_lock
432 integer (kind=omp_lock_kind) svar
433 end function omp_test_lock
435 subroutine omp_init_nest_lock(nvar) bind(c)
436 !DIR$ IF(__INTEL_COMPILER.GE.1400)
437 !DIR$ attributes known_intrinsic :: omp_init_nest_lock
440 integer (kind=omp_nest_lock_kind) nvar
441 end subroutine omp_init_nest_lock
443 subroutine omp_destroy_nest_lock(nvar) bind(c)
444 !DIR$ IF(__INTEL_COMPILER.GE.1400)
445 !DIR$ attributes known_intrinsic :: omp_destroy_nest_lock
448 integer (kind=omp_nest_lock_kind) nvar
449 end subroutine omp_destroy_nest_lock
451 subroutine omp_set_nest_lock(nvar) bind(c)
452 !DIR$ IF(__INTEL_COMPILER.GE.1400)
453 !DIR$ attributes known_intrinsic :: omp_set_nest_lock
456 integer (kind=omp_nest_lock_kind) nvar
457 end subroutine omp_set_nest_lock
459 subroutine omp_unset_nest_lock(nvar) bind(c)
460 !DIR$ IF(__INTEL_COMPILER.GE.1400)
461 !DIR$ attributes known_intrinsic :: omp_unset_nest_lock
464 integer (kind=omp_nest_lock_kind) nvar
465 end subroutine omp_unset_nest_lock
467 function omp_test_nest_lock(nvar) bind(c)
468 !DIR$ IF(__INTEL_COMPILER.GE.1400)
469 !DIR$ attributes known_intrinsic :: omp_test_nest_lock
472 integer (kind=omp_integer_kind) omp_test_nest_lock
473 integer (kind=omp_nest_lock_kind) nvar
474 end function omp_test_nest_lock
476 function omp_get_max_task_priority() bind(c)
478 integer (kind=omp_integer_kind) omp_get_max_task_priority
479 end function omp_get_max_task_priority
481 subroutine omp_init_lock_with_hint(svar, hint) bind(c)
483 integer (kind=omp_lock_kind) svar
484 integer (kind=omp_lock_hint_kind), value :: hint
485 end subroutine omp_init_lock_with_hint
487 subroutine omp_init_nest_lock_with_hint(nvar, hint) bind(c)
489 integer (kind=omp_nest_lock_kind) nvar
490 integer (kind=omp_lock_hint_kind), value :: hint
491 end subroutine omp_init_nest_lock_with_hint
493 function omp_control_tool(command, modifier, arg) bind(c)
495 integer (kind=omp_integer_kind) omp_control_tool
496 integer (kind=omp_control_tool_kind), value :: command
497 integer (kind=omp_control_tool_kind), value :: modifier
498 integer (kind=kmp_pointer_kind), optional :: arg
499 end function omp_control_tool
501 function omp_init_allocator(memspace, ntraits, traits)
503 integer (kind=omp_allocator_handle_kind) omp_init_allocator
504 integer (kind=omp_memspace_handle_kind) :: memspace
505 integer (kind=omp_integer_kind) :: ntraits
506 type(omp_alloctrait), intent(in) :: traits(*)
507 end function omp_init_allocator
509 subroutine omp_destroy_allocator(allocator) bind(c)
511 integer (kind=omp_allocator_handle_kind), value :: allocator
512 end subroutine omp_destroy_allocator
514 subroutine omp_set_default_allocator(allocator) bind(c)
516 integer (kind=omp_allocator_handle_kind), value :: allocator
517 end subroutine omp_set_default_allocator
519 function omp_get_default_allocator() bind(c)
521 integer (kind=omp_allocator_handle_kind) omp_get_default_allocator
522 end function omp_get_default_allocator
524 subroutine omp_set_affinity_format(format)
525 character (len=*) :: format
526 end subroutine omp_set_affinity_format
528 function omp_get_affinity_format(buffer)
530 character (len=*) :: buffer
531 integer (kind=kmp_size_t_kind) :: omp_get_affinity_format
532 end function omp_get_affinity_format
534 subroutine omp_display_affinity(format)
535 character (len=*) :: format
536 end subroutine omp_display_affinity
538 function omp_capture_affinity(buffer, format)
540 character (len=*) :: format
541 character (len=*) :: buffer
542 integer (kind=kmp_size_t_kind) :: omp_capture_affinity
543 end function omp_capture_affinity
545 subroutine omp_set_num_teams(num_teams) bind(c)
547 integer (kind=omp_integer_kind), value :: num_teams
548 end subroutine omp_set_num_teams
550 function omp_get_max_teams() bind(c)
552 integer (kind=omp_integer_kind) omp_get_max_teams
553 end function omp_get_max_teams
555 subroutine omp_set_teams_thread_limit(thread_limit) bind(c)
557 integer (kind=omp_integer_kind), value :: thread_limit
558 end subroutine omp_set_teams_thread_limit
560 function omp_get_teams_thread_limit() bind(c)
562 integer (kind=omp_integer_kind) omp_get_teams_thread_limit
563 end function omp_get_teams_thread_limit
565 subroutine omp_display_env(verbose) bind(c)
567 logical (kind=omp_logical_kind), value :: verbose
568 end subroutine omp_display_env
570 function omp_target_alloc(size, device_num) bind(c)
572 type(c_ptr) omp_target_alloc
573 integer(c_size_t), value :: size
574 integer(c_int), value :: device_num
575 end function omp_target_alloc
577 subroutine omp_target_free(device_ptr, device_num) bind(c)
579 type(c_ptr), value :: device_ptr
580 integer(c_int), value :: device_num
581 end subroutine omp_target_free
583 function omp_target_is_present(ptr, device_num) bind(c)
585 integer(c_int) omp_target_is_present
586 type(c_ptr), value :: ptr
587 integer(c_int), value :: device_num
588 end function omp_target_is_present
590 function omp_target_memcpy(dst, src, length, dst_offset, src_offset, &
591 dst_device_num, src_device_num) bind(c)
593 integer(c_int) omp_target_memcpy
594 type(c_ptr), value :: dst, src
595 integer(c_size_t), value :: length, dst_offset, src_offset
596 integer(c_int), value :: dst_device_num, src_device_num
597 end function omp_target_memcpy
599 function omp_target_memcpy_rect(dst, src, element_size, num_dims, &
600 volume, dst_offsets, src_offsets, dst_dimensions, &
601 src_dimensions, dst_device_num, src_device_num) bind(c)
603 integer(c_int) omp_target_memcpy_rect
604 type(c_ptr), value :: dst, src
605 integer(c_size_t), value :: element_size
606 integer(c_int), value :: num_dims, dst_device_num, src_device_num
607 integer(c_size_t), intent(in) :: volume(*), dst_offsets(*), &
608 src_offsets(*), dst_dimensions(*), src_dimensions(*)
609 end function omp_target_memcpy_rect
611 function omp_target_memcpy_async(dst, src, length, dst_offset, &
612 src_offset, dst_device_num, src_device_num, depobj_count, &
615 integer(c_int) omp_target_memcpy_async
616 type(c_ptr), value :: dst, src
617 integer(c_size_t), value :: length, dst_offset, src_offset
618 integer(c_int), value :: dst_device_num, src_device_num, &
620 integer(omp_depend_kind), optional :: depobj_list(*)
621 end function omp_target_memcpy_async
623 function omp_target_memcpy_rect_async(dst, src, element_size, &
624 num_dims, volume, dst_offsets, src_offsets, dst_dimensions, &
625 src_dimensions, dst_device_num, src_device_num, depobj_count, &
628 integer(c_int) omp_target_memcpy_rect_async
629 type(c_ptr), value :: dst, src
630 integer(c_size_t), value :: element_size
631 integer(c_int), value :: num_dims, dst_device_num, src_device_num, &
633 integer(c_size_t), intent(in) :: volume(*), dst_offsets(*), &
634 src_offsets(*), dst_dimensions(*), src_dimensions(*)
635 integer (omp_depend_kind), optional :: depobj_list(*)
636 end function omp_target_memcpy_rect_async
638 function omp_target_memset(ptr, val, count, device_num) bind(c)
639 use, intrinsic :: iso_c_binding, only : c_ptr, c_int, c_size_t
640 type(c_ptr) :: omp_target_memset
641 type(c_ptr), value :: ptr
642 integer(c_int), value :: val
643 integer(c_size_t), value :: count
644 integer(c_int), value :: device_num
647 function omp_target_memset_async(ptr, val, count, device_num, &
648 depobj_count, depobj_list) bind(c)
649 use, intrinsic :: iso_c_binding, only : c_ptr, c_int, c_size_t
651 type(c_ptr) :: omp_target_memset_async
652 type(c_ptr), value :: ptr
653 integer(c_int), value :: val
654 integer(c_size_t), value :: count
655 integer(c_int), value :: device_num
656 integer(c_int), value :: depobj_count
657 integer(omp_depend_kind), optional :: depobj_list(*)
660 function omp_target_associate_ptr(host_ptr, device_ptr, size, &
661 device_offset, device_num) bind(c)
663 integer(c_int) omp_target_associate_ptr
664 type(c_ptr), value :: host_ptr, device_ptr
665 integer(c_size_t), value :: size, device_offset
666 integer(c_int), value :: device_num
667 end function omp_target_associate_ptr
669 function omp_get_mapped_ptr(ptr, device_num) bind(c)
671 type(c_ptr) omp_get_mapped_ptr
672 type(c_ptr), value :: ptr
673 integer(c_int), value :: device_num
674 end function omp_get_mapped_ptr
676 function omp_target_disassociate_ptr(ptr, device_num) bind(c)
678 integer(c_int) omp_target_disassociate_ptr
679 type(c_ptr), value :: ptr
680 integer(c_int), value :: device_num
681 end function omp_target_disassociate_ptr
683 function omp_target_is_accessible(ptr, size, device_num) bind(c)
685 use, intrinsic :: iso_c_binding, only : c_ptr, c_size_t, c_int
686 integer(c_int) omp_target_is_accessible
687 type(c_ptr), value :: ptr
688 integer(c_size_t), value :: size
689 integer(c_int), value :: device_num
690 end function omp_target_is_accessible
692 function omp_alloc(size, allocator) bind(c)
694 use, intrinsic :: iso_c_binding, only : c_ptr, c_size_t
695 type(c_ptr) omp_alloc
696 integer(c_size_t), value :: size
697 integer(omp_allocator_handle_kind), value :: allocator
698 end function omp_alloc
700 function omp_aligned_alloc(alignment, size, allocator) bind(c)
702 use, intrinsic :: iso_c_binding, only : c_ptr, c_size_t
703 type(c_ptr) omp_aligned_alloc
704 integer(c_size_t), value :: alignment, size
705 integer(omp_allocator_handle_kind), value :: allocator
706 end function omp_aligned_alloc
708 function omp_calloc(nmemb, size, allocator) bind(c)
710 use, intrinsic :: iso_c_binding, only : c_ptr, c_size_t
711 type(c_ptr) omp_calloc
712 integer(c_size_t), value :: nmemb, size
713 integer(omp_allocator_handle_kind), value :: allocator
714 end function omp_calloc
716 function omp_aligned_calloc(alignment, nmemb, size, allocator) bind(c)
718 use, intrinsic :: iso_c_binding, only : c_ptr, c_size_t
719 type(c_ptr) omp_aligned_calloc
720 integer(c_size_t), value :: alignment, nmemb, size
721 integer(omp_allocator_handle_kind), value :: allocator
722 end function omp_aligned_calloc
724 function omp_realloc(ptr, size, allocator, free_allocator) bind(c)
726 use, intrinsic :: iso_c_binding, only : c_ptr, c_size_t
727 type(c_ptr) omp_realloc
728 type(c_ptr), value :: ptr
729 integer(c_size_t), value :: size
730 integer(omp_allocator_handle_kind), value :: allocator
731 integer(omp_allocator_handle_kind), value :: free_allocator
732 end function omp_realloc
734 subroutine omp_free(ptr, allocator) bind(c)
736 use, intrinsic :: iso_c_binding, only : c_ptr
737 type(c_ptr), value :: ptr
738 integer(omp_allocator_handle_kind), value :: allocator
739 end subroutine omp_free
741 function omp_in_explicit_task() bind(c)
743 logical (kind=omp_logical_kind) omp_in_explicit_task
744 end function omp_in_explicit_task
747 ! *** kmp_* entry points
750 subroutine kmp_set_stacksize(size) bind(c)
752 integer (kind=omp_integer_kind), value :: size
753 end subroutine kmp_set_stacksize
755 subroutine kmp_set_stacksize_s(size) bind(c)
757 integer (kind=kmp_size_t_kind), value :: size
758 end subroutine kmp_set_stacksize_s
760 subroutine kmp_set_blocktime(msec) bind(c)
762 integer (kind=omp_integer_kind), value :: msec
763 end subroutine kmp_set_blocktime
765 subroutine kmp_set_library_serial() bind(c)
766 end subroutine kmp_set_library_serial
768 subroutine kmp_set_library_turnaround() bind(c)
769 end subroutine kmp_set_library_turnaround
771 subroutine kmp_set_library_throughput() bind(c)
772 end subroutine kmp_set_library_throughput
774 subroutine kmp_set_library(libnum) bind(c)
776 integer (kind=omp_integer_kind), value :: libnum
777 end subroutine kmp_set_library
779 subroutine kmp_set_defaults(string) bind(c)
780 use, intrinsic :: iso_c_binding
781 character (kind=c_char) :: string(*)
782 end subroutine kmp_set_defaults
784 function kmp_get_stacksize() bind(c)
786 integer (kind=omp_integer_kind) kmp_get_stacksize
787 end function kmp_get_stacksize
789 function kmp_get_stacksize_s() bind(c)
791 integer (kind=kmp_size_t_kind) kmp_get_stacksize_s
792 end function kmp_get_stacksize_s
794 function kmp_get_blocktime() bind(c)
796 integer (kind=omp_integer_kind) kmp_get_blocktime
797 end function kmp_get_blocktime
799 function kmp_get_library() bind(c)
801 integer (kind=omp_integer_kind) kmp_get_library
802 end function kmp_get_library
804 subroutine kmp_set_disp_num_buffers(num) bind(c)
806 integer (kind=omp_integer_kind), value :: num
807 end subroutine kmp_set_disp_num_buffers
809 function kmp_set_affinity(mask) bind(c)
811 integer (kind=omp_integer_kind) kmp_set_affinity
812 integer (kind=kmp_affinity_mask_kind) mask
813 end function kmp_set_affinity
815 function kmp_get_affinity(mask) bind(c)
817 integer (kind=omp_integer_kind) kmp_get_affinity
818 integer (kind=kmp_affinity_mask_kind) mask
819 end function kmp_get_affinity
821 function kmp_get_affinity_max_proc() bind(c)
823 integer (kind=omp_integer_kind) kmp_get_affinity_max_proc
824 end function kmp_get_affinity_max_proc
826 subroutine kmp_create_affinity_mask(mask) bind(c)
828 integer (kind=kmp_affinity_mask_kind) mask
829 end subroutine kmp_create_affinity_mask
831 subroutine kmp_destroy_affinity_mask(mask) bind(c)
833 integer (kind=kmp_affinity_mask_kind) mask
834 end subroutine kmp_destroy_affinity_mask
836 function kmp_set_affinity_mask_proc(proc, mask) bind(c)
838 integer (kind=omp_integer_kind) kmp_set_affinity_mask_proc
839 integer (kind=omp_integer_kind), value :: proc
840 integer (kind=kmp_affinity_mask_kind) mask
841 end function kmp_set_affinity_mask_proc
843 function kmp_unset_affinity_mask_proc(proc, mask) bind(c)
845 integer (kind=omp_integer_kind) kmp_unset_affinity_mask_proc
846 integer (kind=omp_integer_kind), value :: proc
847 integer (kind=kmp_affinity_mask_kind) mask
848 end function kmp_unset_affinity_mask_proc
850 function kmp_get_affinity_mask_proc(proc, mask) bind(c)
852 integer (kind=omp_integer_kind) kmp_get_affinity_mask_proc
853 integer (kind=omp_integer_kind), value :: proc
854 integer (kind=kmp_affinity_mask_kind) mask
855 end function kmp_get_affinity_mask_proc
857 function kmp_malloc(size) bind(c)
859 integer (kind=kmp_pointer_kind) kmp_malloc
860 integer (kind=kmp_size_t_kind), value :: size
861 end function kmp_malloc
863 function kmp_aligned_malloc(size, alignment) bind(c)
865 integer (kind=kmp_pointer_kind) kmp_aligned_malloc
866 integer (kind=kmp_size_t_kind), value :: size
867 integer (kind=kmp_size_t_kind), value :: alignment
868 end function kmp_aligned_malloc
870 function kmp_calloc(nelem, elsize) bind(c)
872 integer (kind=kmp_pointer_kind) kmp_calloc
873 integer (kind=kmp_size_t_kind), value :: nelem
874 integer (kind=kmp_size_t_kind), value :: elsize
875 end function kmp_calloc
877 function kmp_realloc(ptr, size) bind(c)
879 integer (kind=kmp_pointer_kind) kmp_realloc
880 integer (kind=kmp_pointer_kind), value :: ptr
881 integer (kind=kmp_size_t_kind), value :: size
882 end function kmp_realloc
884 subroutine kmp_free(ptr) bind(c)
886 integer (kind=kmp_pointer_kind), value :: ptr
887 end subroutine kmp_free
889 subroutine kmp_set_warnings_on() bind(c)
890 end subroutine kmp_set_warnings_on
892 subroutine kmp_set_warnings_off() bind(c)
893 end subroutine kmp_set_warnings_off
895 function kmp_get_cancellation_status(cancelkind) bind(c)
897 integer (kind=kmp_cancel_kind), value :: cancelkind
898 logical (kind=omp_logical_kind) kmp_get_cancellation_status
899 end function kmp_get_cancellation_status