1 ! Copyright (C) 2005-2023 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/>.
27 use iso_c_binding
, only
: c_int
, c_intptr_t
29 private
:: c_int
, c_intptr_t
30 integer, parameter :: omp_lock_kind
= @OMP_LOCK_KIND@
31 integer, parameter :: omp_nest_lock_kind
= @OMP_NEST_LOCK_KIND@
32 integer, parameter :: omp_sched_kind
= 4
33 integer, parameter :: omp_proc_bind_kind
= 4
34 integer, parameter :: omp_sync_hint_kind
= 4
35 integer, parameter :: omp_lock_hint_kind
= omp_sync_hint_kind
36 integer, parameter :: omp_pause_resource_kind
= 4
37 integer, parameter :: omp_allocator_handle_kind
= c_intptr_t
38 integer, parameter :: omp_alloctrait_key_kind
= c_int
39 integer, parameter :: omp_alloctrait_val_kind
= c_intptr_t
40 integer, parameter :: omp_memspace_handle_kind
= c_intptr_t
41 integer, parameter :: omp_depend_kind
= @OMP_DEPEND_KIND@
42 integer, parameter :: omp_event_handle_kind
= c_intptr_t
43 integer (omp_sched_kind
), parameter :: omp_sched_static
= 1
44 integer (omp_sched_kind
), parameter :: omp_sched_dynamic
= 2
45 integer (omp_sched_kind
), parameter :: omp_sched_guided
= 3
46 integer (omp_sched_kind
), parameter :: omp_sched_auto
= 4
47 integer (omp_proc_bind_kind
), &
48 parameter :: omp_proc_bind_false
= 0
49 integer (omp_proc_bind_kind
), &
50 parameter :: omp_proc_bind_true
= 1
51 integer (omp_proc_bind_kind
), &
52 parameter :: omp_proc_bind_primary
= 2
53 integer (omp_proc_bind_kind
), &
54 parameter :: omp_proc_bind_master
= 2
55 integer (omp_proc_bind_kind
), &
56 parameter :: omp_proc_bind_close
= 3
57 integer (omp_proc_bind_kind
), &
58 parameter :: omp_proc_bind_spread
= 4
59 integer (omp_lock_hint_kind
), &
60 parameter :: omp_sync_hint_none
= 0
61 integer (omp_lock_hint_kind
), &
62 parameter :: omp_lock_hint_none
= omp_sync_hint_none
63 integer (omp_lock_hint_kind
), &
64 parameter :: omp_sync_hint_uncontended
= 1
65 integer (omp_lock_hint_kind
), &
66 parameter :: omp_lock_hint_uncontended
&
67 = omp_sync_hint_uncontended
68 integer (omp_lock_hint_kind
), &
69 parameter :: omp_sync_hint_contended
= 2
70 integer (omp_lock_hint_kind
), &
71 parameter :: omp_lock_hint_contended
&
72 = omp_sync_hint_contended
73 integer (omp_lock_hint_kind
), &
74 parameter :: omp_sync_hint_nonspeculative
= 4
75 integer (omp_lock_hint_kind
), &
76 parameter :: omp_lock_hint_nonspeculative
&
77 = omp_sync_hint_nonspeculative
78 integer (omp_lock_hint_kind
), &
79 parameter :: omp_sync_hint_speculative
= 8
80 integer (omp_lock_hint_kind
), &
81 parameter :: omp_lock_hint_speculative
&
82 = omp_sync_hint_speculative
83 integer (kind
=omp_pause_resource_kind
), &
84 parameter :: omp_pause_soft
= 1
85 integer (kind
=omp_pause_resource_kind
), &
86 parameter :: omp_pause_hard
= 2
87 integer (kind
=omp_alloctrait_key_kind
), &
88 parameter :: omp_atk_sync_hint
= 1
89 integer (kind
=omp_alloctrait_key_kind
), &
90 parameter :: omp_atk_alignment
= 2
91 integer (kind
=omp_alloctrait_key_kind
), &
92 parameter :: omp_atk_access
= 3
93 integer (kind
=omp_alloctrait_key_kind
), &
94 parameter :: omp_atk_pool_size
= 4
95 integer (kind
=omp_alloctrait_key_kind
), &
96 parameter :: omp_atk_fallback
= 5
97 integer (kind
=omp_alloctrait_key_kind
), &
98 parameter :: omp_atk_fb_data
= 6
99 integer (kind
=omp_alloctrait_key_kind
), &
100 parameter :: omp_atk_pinned
= 7
101 integer (kind
=omp_alloctrait_key_kind
), &
102 parameter :: omp_atk_partition
= 8
103 integer (kind
=omp_alloctrait_val_kind
), &
104 parameter :: omp_atv_default
= -1
105 integer (kind
=omp_alloctrait_val_kind
), &
106 parameter :: omp_atv_false
= 0
107 integer (kind
=omp_alloctrait_val_kind
), &
108 parameter :: omp_atv_true
= 1
109 integer (kind
=omp_alloctrait_val_kind
), &
110 parameter :: omp_atv_contended
= 3
111 integer (kind
=omp_alloctrait_val_kind
), &
112 parameter :: omp_atv_uncontended
= 4
113 integer (kind
=omp_alloctrait_val_kind
), &
114 parameter :: omp_atv_serialized
= 5
115 integer (kind
=omp_alloctrait_val_kind
), &
116 parameter :: omp_atv_sequential
= omp_atv_serialized
117 integer (kind
=omp_alloctrait_val_kind
), &
118 parameter :: omp_atv_private
= 6
119 integer (kind
=omp_alloctrait_val_kind
), &
120 parameter :: omp_atv_all
= 7
121 integer (kind
=omp_alloctrait_val_kind
), &
122 parameter :: omp_atv_thread
= 8
123 integer (kind
=omp_alloctrait_val_kind
), &
124 parameter :: omp_atv_pteam
= 9
125 integer (kind
=omp_alloctrait_val_kind
), &
126 parameter :: omp_atv_cgroup
= 10
127 integer (kind
=omp_alloctrait_val_kind
), &
128 parameter :: omp_atv_default_mem_fb
= 11
129 integer (kind
=omp_alloctrait_val_kind
), &
130 parameter :: omp_atv_null_fb
= 12
131 integer (kind
=omp_alloctrait_val_kind
), &
132 parameter :: omp_atv_abort_fb
= 13
133 integer (kind
=omp_alloctrait_val_kind
), &
134 parameter :: omp_atv_allocator_fb
= 14
135 integer (kind
=omp_alloctrait_val_kind
), &
136 parameter :: omp_atv_environment
= 15
137 integer (kind
=omp_alloctrait_val_kind
), &
138 parameter :: omp_atv_nearest
= 16
139 integer (kind
=omp_alloctrait_val_kind
), &
140 parameter :: omp_atv_blocked
= 17
141 integer (kind
=omp_alloctrait_val_kind
), &
142 parameter :: omp_atv_interleaved
= 18
143 integer (kind
=omp_allocator_handle_kind
), &
144 parameter :: omp_null_allocator
= 0
145 integer (kind
=omp_allocator_handle_kind
), &
146 parameter :: omp_default_mem_alloc
= 1
147 integer (kind
=omp_allocator_handle_kind
), &
148 parameter :: omp_large_cap_mem_alloc
= 2
149 integer (kind
=omp_allocator_handle_kind
), &
150 parameter :: omp_const_mem_alloc
= 3
151 integer (kind
=omp_allocator_handle_kind
), &
152 parameter :: omp_high_bw_mem_alloc
= 4
153 integer (kind
=omp_allocator_handle_kind
), &
154 parameter :: omp_low_lat_mem_alloc
= 5
155 integer (kind
=omp_allocator_handle_kind
), &
156 parameter :: omp_cgroup_mem_alloc
= 6
157 integer (kind
=omp_allocator_handle_kind
), &
158 parameter :: omp_pteam_mem_alloc
= 7
159 integer (kind
=omp_allocator_handle_kind
), &
160 parameter :: omp_thread_mem_alloc
= 8
161 integer (omp_memspace_handle_kind
), &
162 parameter :: omp_default_mem_space
= 0
163 integer (omp_memspace_handle_kind
), &
164 parameter :: omp_large_cap_mem_space
= 1
165 integer (omp_memspace_handle_kind
), &
166 parameter :: omp_const_mem_space
= 2
167 integer (omp_memspace_handle_kind
), &
168 parameter :: omp_high_bw_mem_space
= 3
169 integer (omp_memspace_handle_kind
), &
170 parameter :: omp_low_lat_mem_space
= 4
171 integer, parameter :: omp_initial_device
= -1
172 integer, parameter :: omp_invalid_device
= -4
175 integer (kind
=omp_alloctrait_key_kind
) key
176 integer (kind
=omp_alloctrait_val_kind
) value
177 end type omp_alloctrait
183 integer, parameter :: openmp_version
= 201511
186 subroutine omp_init_lock (svar
)
188 integer (omp_lock_kind
), intent (out
) :: svar
189 end subroutine omp_init_lock
193 subroutine omp_init_lock_with_hint (svar
, hint
)
195 integer (omp_lock_kind
), intent (out
) :: svar
196 integer (omp_lock_hint_kind
), intent (in
) :: hint
197 end subroutine omp_init_lock_with_hint
201 subroutine omp_init_nest_lock (nvar
)
203 integer (omp_nest_lock_kind
), intent (out
) :: nvar
204 end subroutine omp_init_nest_lock
208 subroutine omp_init_nest_lock_with_hint (nvar
, hint
)
210 integer (omp_nest_lock_kind
), intent (out
) :: nvar
211 integer (omp_lock_hint_kind
), intent (in
) :: hint
212 end subroutine omp_init_nest_lock_with_hint
216 subroutine omp_destroy_lock (svar
)
218 integer (omp_lock_kind
), intent (inout
) :: svar
219 end subroutine omp_destroy_lock
223 subroutine omp_destroy_nest_lock (nvar
)
225 integer (omp_nest_lock_kind
), intent (inout
) :: nvar
226 end subroutine omp_destroy_nest_lock
230 subroutine omp_set_lock (svar
)
232 integer (omp_lock_kind
), intent (inout
) :: svar
233 end subroutine omp_set_lock
237 subroutine omp_set_nest_lock (nvar
)
239 integer (omp_nest_lock_kind
), intent (inout
) :: nvar
240 end subroutine omp_set_nest_lock
244 subroutine omp_unset_lock (svar
)
246 integer (omp_lock_kind
), intent (inout
) :: svar
247 end subroutine omp_unset_lock
251 subroutine omp_unset_nest_lock (nvar
)
253 integer (omp_nest_lock_kind
), intent (inout
) :: nvar
254 end subroutine omp_unset_nest_lock
257 interface omp_set_dynamic
258 subroutine omp_set_dynamic (dynamic_threads
)
259 logical (4), intent (in
) :: dynamic_threads
260 end subroutine omp_set_dynamic
261 subroutine omp_set_dynamic_8 (dynamic_threads
)
262 logical (8), intent (in
) :: dynamic_threads
263 end subroutine omp_set_dynamic_8
266 interface omp_set_nested
267 subroutine omp_set_nested (nested
)
268 logical (4), intent (in
) :: nested
269 end subroutine omp_set_nested
270 subroutine omp_set_nested_8 (nested
)
271 logical (8), intent (in
) :: nested
272 end subroutine omp_set_nested_8
275 interface omp_set_num_threads
276 subroutine omp_set_num_threads (num_threads
)
277 integer (4), intent (in
) :: num_threads
278 end subroutine omp_set_num_threads
279 subroutine omp_set_num_threads_8 (num_threads
)
280 integer (8), intent (in
) :: num_threads
281 end subroutine omp_set_num_threads_8
285 function omp_get_dynamic ()
286 logical (4) :: omp_get_dynamic
287 end function omp_get_dynamic
291 function omp_get_nested ()
292 logical (4) :: omp_get_nested
293 end function omp_get_nested
297 function omp_in_parallel ()
298 logical (4) :: omp_in_parallel
299 end function omp_in_parallel
303 function omp_test_lock (svar
)
305 logical (4) :: omp_test_lock
306 integer (omp_lock_kind
), intent (inout
) :: svar
307 end function omp_test_lock
311 function omp_get_max_threads ()
312 integer (4) :: omp_get_max_threads
313 end function omp_get_max_threads
317 function omp_get_num_procs ()
318 integer (4) :: omp_get_num_procs
319 end function omp_get_num_procs
323 function omp_get_num_threads ()
324 integer (4) :: omp_get_num_threads
325 end function omp_get_num_threads
329 function omp_get_thread_num ()
330 integer (4) :: omp_get_thread_num
331 end function omp_get_thread_num
335 function omp_test_nest_lock (nvar
)
337 integer (4) :: omp_test_nest_lock
338 integer (omp_nest_lock_kind
), intent (inout
) :: nvar
339 end function omp_test_nest_lock
343 function omp_get_wtick ()
344 double precision :: omp_get_wtick
345 end function omp_get_wtick
349 function omp_get_wtime ()
350 double precision :: omp_get_wtime
351 end function omp_get_wtime
354 interface omp_set_schedule
355 subroutine omp_set_schedule (kind
, chunk_size
)
357 integer (omp_sched_kind
), intent (in
) :: kind
358 integer (4), intent (in
) :: chunk_size
359 end subroutine omp_set_schedule
360 subroutine omp_set_schedule_8 (kind
, chunk_size
)
362 integer (omp_sched_kind
), intent (in
) :: kind
363 integer (8), intent (in
) :: chunk_size
364 end subroutine omp_set_schedule_8
367 interface omp_get_schedule
368 subroutine omp_get_schedule (kind
, chunk_size
)
370 integer (omp_sched_kind
), intent (out
) :: kind
371 integer (4), intent (out
) :: chunk_size
372 end subroutine omp_get_schedule
373 subroutine omp_get_schedule_8 (kind
, chunk_size
)
375 integer (omp_sched_kind
), intent (out
) :: kind
376 integer (8), intent (out
) :: chunk_size
377 end subroutine omp_get_schedule_8
381 function omp_get_thread_limit ()
382 integer (4) :: omp_get_thread_limit
383 end function omp_get_thread_limit
386 interface omp_set_max_active_levels
387 subroutine omp_set_max_active_levels (max_levels
)
388 integer (4), intent (in
) :: max_levels
389 end subroutine omp_set_max_active_levels
390 subroutine omp_set_max_active_levels_8 (max_levels
)
391 integer (8), intent (in
) :: max_levels
392 end subroutine omp_set_max_active_levels_8
396 function omp_get_max_active_levels ()
397 integer (4) :: omp_get_max_active_levels
398 end function omp_get_max_active_levels
402 function omp_get_supported_active_levels ()
403 integer (4) :: omp_get_supported_active_levels
404 end function omp_get_supported_active_levels
408 function omp_get_level ()
409 integer (4) :: omp_get_level
410 end function omp_get_level
413 interface omp_get_ancestor_thread_num
414 function omp_get_ancestor_thread_num (level
)
415 integer (4), intent (in
) :: level
416 integer (4) :: omp_get_ancestor_thread_num
417 end function omp_get_ancestor_thread_num
418 function omp_get_ancestor_thread_num_8 (level
)
419 integer (8), intent (in
) :: level
420 integer (4) :: omp_get_ancestor_thread_num_8
421 end function omp_get_ancestor_thread_num_8
424 interface omp_get_team_size
425 function omp_get_team_size (level
)
426 integer (4), intent (in
) :: level
427 integer (4) :: omp_get_team_size
428 end function omp_get_team_size
429 function omp_get_team_size_8 (level
)
430 integer (8), intent (in
) :: level
431 integer (4) :: omp_get_team_size_8
432 end function omp_get_team_size_8
436 function omp_get_active_level ()
437 integer (4) :: omp_get_active_level
438 end function omp_get_active_level
442 function omp_in_final ()
443 logical (4) :: omp_in_final
444 end function omp_in_final
448 function omp_in_explicit_task ()
449 logical (4) :: omp_in_explicit_task
450 end function omp_in_explicit_task
454 function omp_get_cancellation ()
455 logical (4) :: omp_get_cancellation
456 end function omp_get_cancellation
460 function omp_get_proc_bind ()
462 integer (omp_proc_bind_kind
) :: omp_get_proc_bind
463 end function omp_get_proc_bind
467 function omp_get_num_places ()
468 integer (4) :: omp_get_num_places
469 end function omp_get_num_places
472 interface omp_get_place_num_procs
473 function omp_get_place_num_procs (place_num
)
474 integer (4), intent(in
) :: place_num
475 integer (4) :: omp_get_place_num_procs
476 end function omp_get_place_num_procs
478 function omp_get_place_num_procs_8 (place_num
)
479 integer (8), intent(in
) :: place_num
480 integer (4) :: omp_get_place_num_procs_8
481 end function omp_get_place_num_procs_8
484 interface omp_get_place_proc_ids
485 subroutine omp_get_place_proc_ids (place_num
, ids
)
486 integer (4), intent(in
) :: place_num
487 integer (4), intent(out
) :: ids(*)
488 end subroutine omp_get_place_proc_ids
490 subroutine omp_get_place_proc_ids_8 (place_num
, ids
)
491 integer (8), intent(in
) :: place_num
492 integer (8), intent(out
) :: ids(*)
493 end subroutine omp_get_place_proc_ids_8
497 function omp_get_place_num ()
498 integer (4) :: omp_get_place_num
499 end function omp_get_place_num
503 function omp_get_partition_num_places ()
504 integer (4) :: omp_get_partition_num_places
505 end function omp_get_partition_num_places
508 interface omp_get_partition_place_nums
509 subroutine omp_get_partition_place_nums (place_nums
)
510 integer (4), intent(out
) :: place_nums(*)
511 end subroutine omp_get_partition_place_nums
513 subroutine omp_get_partition_place_nums_8 (place_nums
)
514 integer (8), intent(out
) :: place_nums(*)
515 end subroutine omp_get_partition_place_nums_8
518 interface omp_set_default_device
519 subroutine omp_set_default_device (device_num
)
520 integer (4), intent (in
) :: device_num
521 end subroutine omp_set_default_device
522 subroutine omp_set_default_device_8 (device_num
)
523 integer (8), intent (in
) :: device_num
524 end subroutine omp_set_default_device_8
528 function omp_get_default_device ()
529 integer (4) :: omp_get_default_device
530 end function omp_get_default_device
534 function omp_get_num_devices ()
535 integer (4) :: omp_get_num_devices
536 end function omp_get_num_devices
540 function omp_get_num_teams ()
541 integer (4) :: omp_get_num_teams
542 end function omp_get_num_teams
546 function omp_get_team_num ()
547 integer (4) :: omp_get_team_num
548 end function omp_get_team_num
552 function omp_is_initial_device ()
553 logical (4) :: omp_is_initial_device
554 end function omp_is_initial_device
558 function omp_get_initial_device ()
559 integer (4) :: omp_get_initial_device
560 end function omp_get_initial_device
564 function omp_get_device_num ()
565 integer (4) :: omp_get_device_num
566 end function omp_get_device_num
570 function omp_get_max_task_priority ()
571 integer (4) :: omp_get_max_task_priority
572 end function omp_get_max_task_priority
575 interface omp_set_num_teams
576 subroutine omp_set_num_teams (num_teams
)
577 integer (4), intent (in
) :: num_teams
578 end subroutine omp_set_num_teams
579 subroutine omp_set_num_teams_8 (num_teams
)
580 integer (8), intent (in
) :: num_teams
581 end subroutine omp_set_num_teams_8
585 function omp_get_max_teams ()
586 integer (4) :: omp_get_max_teams
587 end function omp_get_max_teams
590 interface omp_set_teams_thread_limit
591 subroutine omp_set_teams_thread_limit (thread_limit
)
592 integer (4), intent (in
) :: thread_limit
593 end subroutine omp_set_teams_thread_limit
594 subroutine omp_set_teams_thread_limit_8 (thread_limit
)
595 integer (8), intent (in
) :: thread_limit
596 end subroutine omp_set_teams_thread_limit_8
600 function omp_get_teams_thread_limit ()
601 integer (4) :: omp_get_teams_thread_limit
602 end function omp_get_teams_thread_limit
606 subroutine omp_fulfill_event (event
)
608 integer (kind
=omp_event_handle_kind
), &
609 value
, intent(in
) :: event
610 end subroutine omp_fulfill_event
614 subroutine omp_set_affinity_format (format)
615 character(len
=*), intent(in
) :: format
616 end subroutine omp_set_affinity_format
620 function omp_get_affinity_format (buffer
)
621 integer (4) :: omp_get_affinity_format
622 character(len
=*), intent(out
) :: buffer
623 end function omp_get_affinity_format
627 subroutine omp_display_affinity (format)
628 character(len
=*), intent(in
) :: format
629 end subroutine omp_display_affinity
633 function omp_capture_affinity (buffer
, format)
634 integer (4) :: omp_capture_affinity
635 character(len
=*), intent(out
) :: buffer
636 character(len
=*), intent(in
) :: format
637 end function omp_capture_affinity
641 function omp_pause_resource (kind
, device_num
)
643 integer (4) :: omp_pause_resource
644 integer (kind
=omp_pause_resource_kind
), &
646 integer (4) :: device_num
651 function omp_pause_resource_all (kind
)
653 integer (4) :: omp_pause_resource_all
654 integer (kind
=omp_pause_resource_kind
), &
659 interface omp_init_allocator
660 function omp_init_allocator (memspace
, ntraits
, traits
)
662 integer (kind
=omp_allocator_handle_kind
) omp_init_allocator
663 integer (kind
=omp_memspace_handle_kind
), &
664 intent(in
) :: memspace
665 integer (4), intent(in
) :: ntraits
666 type (omp_alloctrait
), intent(in
) :: traits(*)
668 function omp_init_allocator_8 (memspace
, ntraits
, traits
)
670 integer (kind
=omp_allocator_handle_kind
) omp_init_allocator_8
671 integer (kind
=omp_memspace_handle_kind
), &
672 intent(in
) :: memspace
673 integer (8), intent(in
) :: ntraits
674 type (omp_alloctrait
), intent(in
) :: traits(*)
679 subroutine omp_destroy_allocator (allocator
)
681 integer (kind
=omp_allocator_handle_kind
), &
682 intent(in
) :: allocator
687 subroutine omp_set_default_allocator (allocator
)
689 integer (kind
=omp_allocator_handle_kind
), &
690 intent(in
) :: allocator
695 function omp_get_default_allocator ()
697 integer (kind
=omp_allocator_handle_kind
) &
698 omp_get_default_allocator
702 interface omp_display_env
703 subroutine omp_display_env (verbose
)
704 logical (4),intent (in
) :: verbose
705 end subroutine omp_display_env
706 subroutine omp_display_env_8 (verbose
)
707 logical (8),intent (in
) :: verbose
708 end subroutine omp_display_env_8
712 function omp_alloc (size
, allocator
) bind(c
)
713 use, intrinsic :: iso_c_binding
, only
: c_ptr
, c_size_t
714 import
:: omp_allocator_handle_kind
715 type(c_ptr
) :: omp_alloc
716 integer(c_size_t
), value
:: size
717 integer(omp_allocator_handle_kind
), value
:: allocator
718 end function omp_alloc
722 function omp_aligned_alloc (alignment
, size
, allocator
) bind(c
)
723 use, intrinsic :: iso_c_binding
, only
: c_ptr
, c_size_t
724 import
:: omp_allocator_handle_kind
725 type(c_ptr
) :: omp_aligned_alloc
726 integer(c_size_t
), value
:: alignment
, size
727 integer(omp_allocator_handle_kind
), value
:: allocator
728 end function omp_aligned_alloc
732 subroutine omp_free(ptr
, allocator
) bind(c
)
733 use, intrinsic :: iso_c_binding
, only
: c_ptr
734 import
:: omp_allocator_handle_kind
735 type(c_ptr
), value
:: ptr
736 integer(omp_allocator_handle_kind
), value
:: allocator
737 end subroutine omp_free
741 function omp_calloc (nmemb
, size
, allocator
) bind(c
)
742 use, intrinsic :: iso_c_binding
, only
: c_ptr
, c_size_t
743 import
:: omp_allocator_handle_kind
744 type(c_ptr
) :: omp_calloc
745 integer(c_size_t
), value
:: nmemb
, size
746 integer(omp_allocator_handle_kind
), value
:: allocator
747 end function omp_calloc
751 function omp_aligned_calloc (alignment
, nmemb
, size
, allocator
) bind(c
)
752 use, intrinsic :: iso_c_binding
, only
: c_ptr
, c_size_t
753 import
:: omp_allocator_handle_kind
754 type(c_ptr
) :: omp_aligned_calloc
755 integer(c_size_t
), value
:: alignment
, nmemb
, size
756 integer(omp_allocator_handle_kind
), value
:: allocator
757 end function omp_aligned_calloc
761 function omp_realloc (ptr
, size
, allocator
, free_allocator
) bind(c
)
762 use, intrinsic :: iso_c_binding
, only
: c_ptr
, c_size_t
763 import
:: omp_allocator_handle_kind
764 type(c_ptr
) :: omp_realloc
765 type(c_ptr
), value
:: ptr
766 integer(c_size_t
), value
:: size
767 integer(omp_allocator_handle_kind
), value
:: allocator
, free_allocator
768 end function omp_realloc
772 function omp_target_alloc (size
, device_num
) bind(c
)
773 use, intrinsic :: iso_c_binding
, only
: c_ptr
, c_size_t
, c_int
774 type(c_ptr
) :: omp_target_alloc
775 integer(c_size_t
), value
:: size
776 integer(c_int
), value
:: device_num
777 end function omp_target_alloc
781 subroutine omp_target_free (device_ptr
, device_num
) bind(c
)
782 use, intrinsic :: iso_c_binding
, only
: c_ptr
, c_int
783 type(c_ptr
), value
:: device_ptr
784 integer(c_int
), value
:: device_num
785 end subroutine omp_target_free
789 function omp_target_is_present (ptr
, device_num
) bind(c
)
790 use, intrinsic :: iso_c_binding
, only
: c_ptr
, c_int
791 integer(c_int
) :: omp_target_is_present
792 type(c_ptr
), value
:: ptr
793 integer(c_int
), value
:: device_num
794 end function omp_target_is_present
798 function omp_target_memcpy (dst
, src
, length
, dst_offset
, &
799 src_offset
, dst_device_num
, &
800 src_device_num
) bind(c
)
801 use, intrinsic :: iso_c_binding
, only
: c_ptr
, c_int
, c_size_t
802 integer(c_int
) :: omp_target_memcpy
803 type(c_ptr
), value
:: dst
, src
804 integer(c_size_t
), value
:: length
, dst_offset
, src_offset
805 integer(c_int
), value
:: dst_device_num
, src_device_num
806 end function omp_target_memcpy
810 function omp_target_memcpy_async (dst
, src
, length
, dst_offset
, &
811 src_offset
, dst_device_num
, &
812 src_device_num
, depobj_count
, &
814 use, intrinsic :: iso_c_binding
, only
: c_ptr
, c_int
, c_size_t
815 import
:: omp_depend_kind
816 integer(c_int
) :: omp_target_memcpy_async
817 type(c_ptr
), value
:: dst
, src
818 integer(c_size_t
), value
:: length
, dst_offset
, src_offset
819 integer(c_int
), value
:: dst_device_num
, src_device_num
, &
821 integer(omp_depend_kind
), optional
:: depobj_list(*)
822 end function omp_target_memcpy_async
826 function omp_target_memcpy_rect (dst
,src
,element_size
, num_dims
, &
827 volume
, dst_offsets
, src_offsets
, &
828 dst_dimensions
, src_dimensions
, &
829 dst_device_num
, src_device_num
) &
831 use, intrinsic :: iso_c_binding
, only
: c_ptr
, c_int
, c_size_t
832 integer(c_int
) :: omp_target_memcpy_rect
833 type(c_ptr
), value
:: dst
, src
834 integer(c_size_t
), value
:: element_size
835 integer(c_int
), value
:: num_dims
, dst_device_num
, src_device_num
836 integer(c_size_t
), intent(in
) :: volume(*), dst_offsets(*), &
837 src_offsets(*), dst_dimensions(*), &
839 end function omp_target_memcpy_rect
843 function omp_target_memcpy_rect_async (dst
,src
,element_size
, &
845 dst_offsets
, src_offsets
, &
852 use, intrinsic :: iso_c_binding
, only
: c_ptr
, c_int
, c_size_t
853 import
:: omp_depend_kind
854 integer(c_int
) :: omp_target_memcpy_rect_async
855 type(c_ptr
), value
:: dst
, src
856 integer(c_size_t
), value
:: element_size
857 integer(c_int
), value
:: num_dims
, dst_device_num
, src_device_num
, &
859 integer(c_size_t
), intent(in
) :: volume(*), dst_offsets(*), &
860 src_offsets(*), dst_dimensions(*), &
862 integer(omp_depend_kind
), optional
:: depobj_list(*)
863 end function omp_target_memcpy_rect_async
867 function omp_target_associate_ptr (host_ptr
, device_ptr
, size
, &
868 device_offset
, device_num
) bind(c
)
869 use, intrinsic :: iso_c_binding
, only
: c_ptr
, c_size_t
, c_int
870 integer(c_int
) :: omp_target_associate_ptr
871 type(c_ptr
), value
:: host_ptr
, device_ptr
872 integer(c_size_t
), value
:: size
, device_offset
873 integer(c_int
), value
:: device_num
874 end function omp_target_associate_ptr
878 function omp_target_disassociate_ptr (ptr
, device_num
) bind(c
)
879 use, intrinsic :: iso_c_binding
, only
: c_ptr
, c_int
880 integer(c_int
) :: omp_target_disassociate_ptr
881 type(c_ptr
), value
:: ptr
882 integer(c_int
), value
:: device_num
883 end function omp_target_disassociate_ptr
887 function omp_get_mapped_ptr (ptr
, device_num
) bind(c
)
888 use, intrinsic :: iso_c_binding
, only
: c_ptr
, c_int
889 type(c_ptr
) :: omp_get_mapped_ptr
890 type(c_ptr
), value
:: ptr
891 integer(c_int
), value
:: device_num
892 end function omp_get_mapped_ptr
896 function omp_target_is_accessible (ptr
, size
, device_num
) bind(c
)
897 use, intrinsic :: iso_c_binding
, only
: c_ptr
, c_size_t
, c_int
898 integer(c_int
) :: omp_target_is_accessible
899 type(c_ptr
), value
:: ptr
900 integer(c_size_t
), value
:: size
901 integer(c_int
), value
:: device_num
902 end function omp_target_is_accessible
905 #
if _OPENMP
>= 201811
906 !GCC$ ATTRIBUTES DEPRECATED :: omp_get_nested, omp_set_nested
907 !GCC$ ATTRIBUTES DEPRECATED :: omp_lock_hint_kind, omp_lock_hint_none
908 !GCC$ ATTRIBUTES DEPRECATED :: omp_lock_hint_uncontended, omp_lock_hint_contended
909 !GCC$ ATTRIBUTES DEPRECATED :: omp_lock_hint_nonspeculative
910 !GCC$ ATTRIBUTES DEPRECATED :: omp_lock_hint_speculative
913 #
if _OPENMP
>= 202011
914 !GCC$ ATTRIBUTES DEPRECATED :: omp_proc_bind_master, omp_atv_sequential