1 ! Copyright (C) 2005-2022 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
173 integer (kind
=omp_alloctrait_key_kind
) key
174 integer (kind
=omp_alloctrait_val_kind
) value
175 end type omp_alloctrait
181 integer, parameter :: openmp_version
= 201511
184 subroutine omp_init_lock (svar
)
186 integer (omp_lock_kind
), intent (out
) :: svar
187 end subroutine omp_init_lock
191 subroutine omp_init_lock_with_hint (svar
, hint
)
193 integer (omp_lock_kind
), intent (out
) :: svar
194 integer (omp_lock_hint_kind
), intent (in
) :: hint
195 end subroutine omp_init_lock_with_hint
199 subroutine omp_init_nest_lock (nvar
)
201 integer (omp_nest_lock_kind
), intent (out
) :: nvar
202 end subroutine omp_init_nest_lock
206 subroutine omp_init_nest_lock_with_hint (nvar
, hint
)
208 integer (omp_nest_lock_kind
), intent (out
) :: nvar
209 integer (omp_lock_hint_kind
), intent (in
) :: hint
210 end subroutine omp_init_nest_lock_with_hint
214 subroutine omp_destroy_lock (svar
)
216 integer (omp_lock_kind
), intent (inout
) :: svar
217 end subroutine omp_destroy_lock
221 subroutine omp_destroy_nest_lock (nvar
)
223 integer (omp_nest_lock_kind
), intent (inout
) :: nvar
224 end subroutine omp_destroy_nest_lock
228 subroutine omp_set_lock (svar
)
230 integer (omp_lock_kind
), intent (inout
) :: svar
231 end subroutine omp_set_lock
235 subroutine omp_set_nest_lock (nvar
)
237 integer (omp_nest_lock_kind
), intent (inout
) :: nvar
238 end subroutine omp_set_nest_lock
242 subroutine omp_unset_lock (svar
)
244 integer (omp_lock_kind
), intent (inout
) :: svar
245 end subroutine omp_unset_lock
249 subroutine omp_unset_nest_lock (nvar
)
251 integer (omp_nest_lock_kind
), intent (inout
) :: nvar
252 end subroutine omp_unset_nest_lock
255 interface omp_set_dynamic
256 subroutine omp_set_dynamic (dynamic_threads
)
257 logical (4), intent (in
) :: dynamic_threads
258 end subroutine omp_set_dynamic
259 subroutine omp_set_dynamic_8 (dynamic_threads
)
260 logical (8), intent (in
) :: dynamic_threads
261 end subroutine omp_set_dynamic_8
264 interface omp_set_nested
265 subroutine omp_set_nested (nested
)
266 logical (4), intent (in
) :: nested
267 end subroutine omp_set_nested
268 subroutine omp_set_nested_8 (nested
)
269 logical (8), intent (in
) :: nested
270 end subroutine omp_set_nested_8
273 interface omp_set_num_threads
274 subroutine omp_set_num_threads (num_threads
)
275 integer (4), intent (in
) :: num_threads
276 end subroutine omp_set_num_threads
277 subroutine omp_set_num_threads_8 (num_threads
)
278 integer (8), intent (in
) :: num_threads
279 end subroutine omp_set_num_threads_8
283 function omp_get_dynamic ()
284 logical (4) :: omp_get_dynamic
285 end function omp_get_dynamic
289 function omp_get_nested ()
290 logical (4) :: omp_get_nested
291 end function omp_get_nested
295 function omp_in_parallel ()
296 logical (4) :: omp_in_parallel
297 end function omp_in_parallel
301 function omp_test_lock (svar
)
303 logical (4) :: omp_test_lock
304 integer (omp_lock_kind
), intent (inout
) :: svar
305 end function omp_test_lock
309 function omp_get_max_threads ()
310 integer (4) :: omp_get_max_threads
311 end function omp_get_max_threads
315 function omp_get_num_procs ()
316 integer (4) :: omp_get_num_procs
317 end function omp_get_num_procs
321 function omp_get_num_threads ()
322 integer (4) :: omp_get_num_threads
323 end function omp_get_num_threads
327 function omp_get_thread_num ()
328 integer (4) :: omp_get_thread_num
329 end function omp_get_thread_num
333 function omp_test_nest_lock (nvar
)
335 integer (4) :: omp_test_nest_lock
336 integer (omp_nest_lock_kind
), intent (inout
) :: nvar
337 end function omp_test_nest_lock
341 function omp_get_wtick ()
342 double precision :: omp_get_wtick
343 end function omp_get_wtick
347 function omp_get_wtime ()
348 double precision :: omp_get_wtime
349 end function omp_get_wtime
352 interface omp_set_schedule
353 subroutine omp_set_schedule (kind
, chunk_size
)
355 integer (omp_sched_kind
), intent (in
) :: kind
356 integer (4), intent (in
) :: chunk_size
357 end subroutine omp_set_schedule
358 subroutine omp_set_schedule_8 (kind
, chunk_size
)
360 integer (omp_sched_kind
), intent (in
) :: kind
361 integer (8), intent (in
) :: chunk_size
362 end subroutine omp_set_schedule_8
365 interface omp_get_schedule
366 subroutine omp_get_schedule (kind
, chunk_size
)
368 integer (omp_sched_kind
), intent (out
) :: kind
369 integer (4), intent (out
) :: chunk_size
370 end subroutine omp_get_schedule
371 subroutine omp_get_schedule_8 (kind
, chunk_size
)
373 integer (omp_sched_kind
), intent (out
) :: kind
374 integer (8), intent (out
) :: chunk_size
375 end subroutine omp_get_schedule_8
379 function omp_get_thread_limit ()
380 integer (4) :: omp_get_thread_limit
381 end function omp_get_thread_limit
384 interface omp_set_max_active_levels
385 subroutine omp_set_max_active_levels (max_levels
)
386 integer (4), intent (in
) :: max_levels
387 end subroutine omp_set_max_active_levels
388 subroutine omp_set_max_active_levels_8 (max_levels
)
389 integer (8), intent (in
) :: max_levels
390 end subroutine omp_set_max_active_levels_8
394 function omp_get_max_active_levels ()
395 integer (4) :: omp_get_max_active_levels
396 end function omp_get_max_active_levels
400 function omp_get_supported_active_levels ()
401 integer (4) :: omp_get_supported_active_levels
402 end function omp_get_supported_active_levels
406 function omp_get_level ()
407 integer (4) :: omp_get_level
408 end function omp_get_level
411 interface omp_get_ancestor_thread_num
412 function omp_get_ancestor_thread_num (level
)
413 integer (4), intent (in
) :: level
414 integer (4) :: omp_get_ancestor_thread_num
415 end function omp_get_ancestor_thread_num
416 function omp_get_ancestor_thread_num_8 (level
)
417 integer (8), intent (in
) :: level
418 integer (4) :: omp_get_ancestor_thread_num_8
419 end function omp_get_ancestor_thread_num_8
422 interface omp_get_team_size
423 function omp_get_team_size (level
)
424 integer (4), intent (in
) :: level
425 integer (4) :: omp_get_team_size
426 end function omp_get_team_size
427 function omp_get_team_size_8 (level
)
428 integer (8), intent (in
) :: level
429 integer (4) :: omp_get_team_size_8
430 end function omp_get_team_size_8
434 function omp_get_active_level ()
435 integer (4) :: omp_get_active_level
436 end function omp_get_active_level
440 function omp_in_final ()
441 logical (4) :: omp_in_final
442 end function omp_in_final
446 function omp_get_cancellation ()
447 logical (4) :: omp_get_cancellation
448 end function omp_get_cancellation
452 function omp_get_proc_bind ()
454 integer (omp_proc_bind_kind
) :: omp_get_proc_bind
455 end function omp_get_proc_bind
459 function omp_get_num_places ()
460 integer (4) :: omp_get_num_places
461 end function omp_get_num_places
464 interface omp_get_place_num_procs
465 function omp_get_place_num_procs (place_num
)
466 integer (4), intent(in
) :: place_num
467 integer (4) :: omp_get_place_num_procs
468 end function omp_get_place_num_procs
470 function omp_get_place_num_procs_8 (place_num
)
471 integer (8), intent(in
) :: place_num
472 integer (4) :: omp_get_place_num_procs_8
473 end function omp_get_place_num_procs_8
476 interface omp_get_place_proc_ids
477 subroutine omp_get_place_proc_ids (place_num
, ids
)
478 integer (4), intent(in
) :: place_num
479 integer (4), intent(out
) :: ids(*)
480 end subroutine omp_get_place_proc_ids
482 subroutine omp_get_place_proc_ids_8 (place_num
, ids
)
483 integer (8), intent(in
) :: place_num
484 integer (8), intent(out
) :: ids(*)
485 end subroutine omp_get_place_proc_ids_8
489 function omp_get_place_num ()
490 integer (4) :: omp_get_place_num
491 end function omp_get_place_num
495 function omp_get_partition_num_places ()
496 integer (4) :: omp_get_partition_num_places
497 end function omp_get_partition_num_places
500 interface omp_get_partition_place_nums
501 subroutine omp_get_partition_place_nums (place_nums
)
502 integer (4), intent(out
) :: place_nums(*)
503 end subroutine omp_get_partition_place_nums
505 subroutine omp_get_partition_place_nums_8 (place_nums
)
506 integer (8), intent(out
) :: place_nums(*)
507 end subroutine omp_get_partition_place_nums_8
510 interface omp_set_default_device
511 subroutine omp_set_default_device (device_num
)
512 integer (4), intent (in
) :: device_num
513 end subroutine omp_set_default_device
514 subroutine omp_set_default_device_8 (device_num
)
515 integer (8), intent (in
) :: device_num
516 end subroutine omp_set_default_device_8
520 function omp_get_default_device ()
521 integer (4) :: omp_get_default_device
522 end function omp_get_default_device
526 function omp_get_num_devices ()
527 integer (4) :: omp_get_num_devices
528 end function omp_get_num_devices
532 function omp_get_num_teams ()
533 integer (4) :: omp_get_num_teams
534 end function omp_get_num_teams
538 function omp_get_team_num ()
539 integer (4) :: omp_get_team_num
540 end function omp_get_team_num
544 function omp_is_initial_device ()
545 logical (4) :: omp_is_initial_device
546 end function omp_is_initial_device
550 function omp_get_initial_device ()
551 integer (4) :: omp_get_initial_device
552 end function omp_get_initial_device
556 function omp_get_device_num ()
557 integer (4) :: omp_get_device_num
558 end function omp_get_device_num
562 function omp_get_max_task_priority ()
563 integer (4) :: omp_get_max_task_priority
564 end function omp_get_max_task_priority
567 interface omp_set_num_teams
568 subroutine omp_set_num_teams (num_teams
)
569 integer (4), intent (in
) :: num_teams
570 end subroutine omp_set_num_teams
571 subroutine omp_set_num_teams_8 (num_teams
)
572 integer (8), intent (in
) :: num_teams
573 end subroutine omp_set_num_teams_8
577 function omp_get_max_teams ()
578 integer (4) :: omp_get_max_teams
579 end function omp_get_max_teams
582 interface omp_set_teams_thread_limit
583 subroutine omp_set_teams_thread_limit (thread_limit
)
584 integer (4), intent (in
) :: thread_limit
585 end subroutine omp_set_teams_thread_limit
586 subroutine omp_set_teams_thread_limit_8 (thread_limit
)
587 integer (8), intent (in
) :: thread_limit
588 end subroutine omp_set_teams_thread_limit_8
592 function omp_get_teams_thread_limit ()
593 integer (4) :: omp_get_teams_thread_limit
594 end function omp_get_teams_thread_limit
598 subroutine omp_fulfill_event (event
)
600 integer (kind
=omp_event_handle_kind
), &
601 value
, intent(in
) :: event
602 end subroutine omp_fulfill_event
606 subroutine omp_set_affinity_format (format)
607 character(len
=*), intent(in
) :: format
608 end subroutine omp_set_affinity_format
612 function omp_get_affinity_format (buffer
)
613 integer (4) :: omp_get_affinity_format
614 character(len
=*), intent(out
) :: buffer
615 end function omp_get_affinity_format
619 subroutine omp_display_affinity (format)
620 character(len
=*), intent(in
) :: format
621 end subroutine omp_display_affinity
625 function omp_capture_affinity (buffer
, format)
626 integer (4) :: omp_capture_affinity
627 character(len
=*), intent(out
) :: buffer
628 character(len
=*), intent(in
) :: format
629 end function omp_capture_affinity
633 function omp_pause_resource (kind
, device_num
)
635 integer (4) :: omp_pause_resource
636 integer (kind
=omp_pause_resource_kind
), &
638 integer (4) :: device_num
643 function omp_pause_resource_all (kind
)
645 integer (4) :: omp_pause_resource_all
646 integer (kind
=omp_pause_resource_kind
), &
651 interface omp_init_allocator
652 function omp_init_allocator (memspace
, ntraits
, traits
)
654 integer (kind
=omp_allocator_handle_kind
) omp_init_allocator
655 integer (kind
=omp_memspace_handle_kind
), &
656 intent(in
) :: memspace
657 integer (4), intent(in
) :: ntraits
658 type (omp_alloctrait
), intent(in
) :: traits(*)
660 function omp_init_allocator_8 (memspace
, ntraits
, traits
)
662 integer (kind
=omp_allocator_handle_kind
) omp_init_allocator_8
663 integer (kind
=omp_memspace_handle_kind
), &
664 intent(in
) :: memspace
665 integer (8), intent(in
) :: ntraits
666 type (omp_alloctrait
), intent(in
) :: traits(*)
671 subroutine omp_destroy_allocator (allocator
)
673 integer (kind
=omp_allocator_handle_kind
), &
674 intent(in
) :: allocator
679 subroutine omp_set_default_allocator (allocator
)
681 integer (kind
=omp_allocator_handle_kind
), &
682 intent(in
) :: allocator
687 function omp_get_default_allocator ()
689 integer (kind
=omp_allocator_handle_kind
) &
690 omp_get_default_allocator
694 interface omp_display_env
695 subroutine omp_display_env (verbose
)
696 logical (4),intent (in
) :: verbose
697 end subroutine omp_display_env
698 subroutine omp_display_env_8 (verbose
)
699 logical (8),intent (in
) :: verbose
700 end subroutine omp_display_env_8
704 function omp_alloc (size
, allocator
) bind(c
)
705 use, intrinsic :: iso_c_binding
, only
: c_ptr
, c_size_t
706 import
:: omp_allocator_handle_kind
707 type(c_ptr
) :: omp_alloc
708 integer(c_size_t
), value
:: size
709 integer(omp_allocator_handle_kind
), value
:: allocator
710 end function omp_alloc
714 function omp_aligned_alloc (alignment
, size
, allocator
) bind(c
)
715 use, intrinsic :: iso_c_binding
, only
: c_ptr
, c_size_t
716 import
:: omp_allocator_handle_kind
717 type(c_ptr
) :: omp_aligned_alloc
718 integer(c_size_t
), value
:: alignment
, size
719 integer(omp_allocator_handle_kind
), value
:: allocator
720 end function omp_aligned_alloc
724 subroutine omp_free(ptr
, allocator
) bind(c
)
725 use, intrinsic :: iso_c_binding
, only
: c_ptr
726 import
:: omp_allocator_handle_kind
727 type(c_ptr
), value
:: ptr
728 integer(omp_allocator_handle_kind
), value
:: allocator
729 end subroutine omp_free
733 function omp_calloc (nmemb
, size
, allocator
) bind(c
)
734 use, intrinsic :: iso_c_binding
, only
: c_ptr
, c_size_t
735 import
:: omp_allocator_handle_kind
736 type(c_ptr
) :: omp_calloc
737 integer(c_size_t
), value
:: nmemb
, size
738 integer(omp_allocator_handle_kind
), value
:: allocator
739 end function omp_calloc
743 function omp_aligned_calloc (alignment
, nmemb
, size
, allocator
) bind(c
)
744 use, intrinsic :: iso_c_binding
, only
: c_ptr
, c_size_t
745 import
:: omp_allocator_handle_kind
746 type(c_ptr
) :: omp_aligned_calloc
747 integer(c_size_t
), value
:: alignment
, nmemb
, size
748 integer(omp_allocator_handle_kind
), value
:: allocator
749 end function omp_aligned_calloc
753 function omp_realloc (ptr
, size
, allocator
, free_allocator
) bind(c
)
754 use, intrinsic :: iso_c_binding
, only
: c_ptr
, c_size_t
755 import
:: omp_allocator_handle_kind
756 type(c_ptr
) :: omp_realloc
757 type(c_ptr
), value
:: ptr
758 integer(c_size_t
), value
:: size
759 integer(omp_allocator_handle_kind
), value
:: allocator
, free_allocator
760 end function omp_realloc
764 function omp_target_alloc (size
, device_num
) bind(c
)
765 use, intrinsic :: iso_c_binding
, only
: c_ptr
, c_size_t
, c_int
766 type(c_ptr
) :: omp_target_alloc
767 integer(c_size_t
), value
:: size
768 integer(c_int
), value
:: device_num
769 end function omp_target_alloc
773 subroutine omp_target_free (device_ptr
, device_num
) bind(c
)
774 use, intrinsic :: iso_c_binding
, only
: c_ptr
, c_int
775 type(c_ptr
), value
:: device_ptr
776 integer(c_int
), value
:: device_num
777 end subroutine omp_target_free
781 function omp_target_is_present (ptr
, device_num
) bind(c
)
782 use, intrinsic :: iso_c_binding
, only
: c_ptr
, c_int
783 integer(c_int
) :: omp_target_is_present
784 type(c_ptr
), value
:: ptr
785 integer(c_int
), value
:: device_num
786 end function omp_target_is_present
790 function omp_target_memcpy (dst
, src
, length
, dst_offset
, &
791 src_offset
, dst_device_num
, &
792 src_device_num
) bind(c
)
793 use, intrinsic :: iso_c_binding
, only
: c_ptr
, c_int
, c_size_t
794 integer(c_int
) :: omp_target_memcpy
795 type(c_ptr
), value
:: dst
, src
796 integer(c_size_t
), value
:: length
, dst_offset
, src_offset
797 integer(c_int
), value
:: dst_device_num
, src_device_num
798 end function omp_target_memcpy
802 function omp_target_memcpy_rect (dst
,src
,element_size
, num_dims
, &
803 volume
, dst_offsets
, src_offsets
, &
804 dst_dimensions
, src_dimensions
, &
805 dst_device_num
, src_device_num
) &
807 use, intrinsic :: iso_c_binding
, only
: c_ptr
, c_int
, c_size_t
808 integer(c_int
) :: omp_target_memcpy_rect
809 type(c_ptr
), value
:: dst
, src
810 integer(c_size_t
), value
:: element_size
811 integer(c_int
), value
:: num_dims
, dst_device_num
, src_device_num
812 integer(c_size_t
), intent(in
) :: volume(*), dst_offsets(*), &
813 src_offsets(*), dst_dimensions(*), &
815 end function omp_target_memcpy_rect
819 function omp_target_associate_ptr (host_ptr
, device_ptr
, size
, &
820 device_offset
, device_num
) bind(c
)
821 use, intrinsic :: iso_c_binding
, only
: c_ptr
, c_size_t
, c_int
822 integer(c_int
) :: omp_target_associate_ptr
823 type(c_ptr
), value
:: host_ptr
, device_ptr
824 integer(c_size_t
), value
:: size
, device_offset
825 integer(c_int
), value
:: device_num
826 end function omp_target_associate_ptr
830 function omp_target_disassociate_ptr (ptr
, device_num
) bind(c
)
831 use, intrinsic :: iso_c_binding
, only
: c_ptr
, c_int
832 integer(c_int
) :: omp_target_disassociate_ptr
833 type(c_ptr
), value
:: ptr
834 integer(c_int
), value
:: device_num
835 end function omp_target_disassociate_ptr
838 #
if _OPENMP
>= 201811
839 !GCC$ ATTRIBUTES DEPRECATED :: omp_get_nested, omp_set_nested
842 #
if _OPENMP
>= 202011
843 !GCC$ ATTRIBUTES DEPRECATED :: omp_proc_bind_master, omp_atv_sequential