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
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_get_cancellation ()
449 logical (4) :: omp_get_cancellation
450 end function omp_get_cancellation
454 function omp_get_proc_bind ()
456 integer (omp_proc_bind_kind
) :: omp_get_proc_bind
457 end function omp_get_proc_bind
461 function omp_get_num_places ()
462 integer (4) :: omp_get_num_places
463 end function omp_get_num_places
466 interface omp_get_place_num_procs
467 function omp_get_place_num_procs (place_num
)
468 integer (4), intent(in
) :: place_num
469 integer (4) :: omp_get_place_num_procs
470 end function omp_get_place_num_procs
472 function omp_get_place_num_procs_8 (place_num
)
473 integer (8), intent(in
) :: place_num
474 integer (4) :: omp_get_place_num_procs_8
475 end function omp_get_place_num_procs_8
478 interface omp_get_place_proc_ids
479 subroutine omp_get_place_proc_ids (place_num
, ids
)
480 integer (4), intent(in
) :: place_num
481 integer (4), intent(out
) :: ids(*)
482 end subroutine omp_get_place_proc_ids
484 subroutine omp_get_place_proc_ids_8 (place_num
, ids
)
485 integer (8), intent(in
) :: place_num
486 integer (8), intent(out
) :: ids(*)
487 end subroutine omp_get_place_proc_ids_8
491 function omp_get_place_num ()
492 integer (4) :: omp_get_place_num
493 end function omp_get_place_num
497 function omp_get_partition_num_places ()
498 integer (4) :: omp_get_partition_num_places
499 end function omp_get_partition_num_places
502 interface omp_get_partition_place_nums
503 subroutine omp_get_partition_place_nums (place_nums
)
504 integer (4), intent(out
) :: place_nums(*)
505 end subroutine omp_get_partition_place_nums
507 subroutine omp_get_partition_place_nums_8 (place_nums
)
508 integer (8), intent(out
) :: place_nums(*)
509 end subroutine omp_get_partition_place_nums_8
512 interface omp_set_default_device
513 subroutine omp_set_default_device (device_num
)
514 integer (4), intent (in
) :: device_num
515 end subroutine omp_set_default_device
516 subroutine omp_set_default_device_8 (device_num
)
517 integer (8), intent (in
) :: device_num
518 end subroutine omp_set_default_device_8
522 function omp_get_default_device ()
523 integer (4) :: omp_get_default_device
524 end function omp_get_default_device
528 function omp_get_num_devices ()
529 integer (4) :: omp_get_num_devices
530 end function omp_get_num_devices
534 function omp_get_num_teams ()
535 integer (4) :: omp_get_num_teams
536 end function omp_get_num_teams
540 function omp_get_team_num ()
541 integer (4) :: omp_get_team_num
542 end function omp_get_team_num
546 function omp_is_initial_device ()
547 logical (4) :: omp_is_initial_device
548 end function omp_is_initial_device
552 function omp_get_initial_device ()
553 integer (4) :: omp_get_initial_device
554 end function omp_get_initial_device
558 function omp_get_device_num ()
559 integer (4) :: omp_get_device_num
560 end function omp_get_device_num
564 function omp_get_max_task_priority ()
565 integer (4) :: omp_get_max_task_priority
566 end function omp_get_max_task_priority
569 interface omp_set_num_teams
570 subroutine omp_set_num_teams (num_teams
)
571 integer (4), intent (in
) :: num_teams
572 end subroutine omp_set_num_teams
573 subroutine omp_set_num_teams_8 (num_teams
)
574 integer (8), intent (in
) :: num_teams
575 end subroutine omp_set_num_teams_8
579 function omp_get_max_teams ()
580 integer (4) :: omp_get_max_teams
581 end function omp_get_max_teams
584 interface omp_set_teams_thread_limit
585 subroutine omp_set_teams_thread_limit (thread_limit
)
586 integer (4), intent (in
) :: thread_limit
587 end subroutine omp_set_teams_thread_limit
588 subroutine omp_set_teams_thread_limit_8 (thread_limit
)
589 integer (8), intent (in
) :: thread_limit
590 end subroutine omp_set_teams_thread_limit_8
594 function omp_get_teams_thread_limit ()
595 integer (4) :: omp_get_teams_thread_limit
596 end function omp_get_teams_thread_limit
600 subroutine omp_fulfill_event (event
)
602 integer (kind
=omp_event_handle_kind
), &
603 value
, intent(in
) :: event
604 end subroutine omp_fulfill_event
608 subroutine omp_set_affinity_format (format)
609 character(len
=*), intent(in
) :: format
610 end subroutine omp_set_affinity_format
614 function omp_get_affinity_format (buffer
)
615 integer (4) :: omp_get_affinity_format
616 character(len
=*), intent(out
) :: buffer
617 end function omp_get_affinity_format
621 subroutine omp_display_affinity (format)
622 character(len
=*), intent(in
) :: format
623 end subroutine omp_display_affinity
627 function omp_capture_affinity (buffer
, format)
628 integer (4) :: omp_capture_affinity
629 character(len
=*), intent(out
) :: buffer
630 character(len
=*), intent(in
) :: format
631 end function omp_capture_affinity
635 function omp_pause_resource (kind
, device_num
)
637 integer (4) :: omp_pause_resource
638 integer (kind
=omp_pause_resource_kind
), &
640 integer (4) :: device_num
645 function omp_pause_resource_all (kind
)
647 integer (4) :: omp_pause_resource_all
648 integer (kind
=omp_pause_resource_kind
), &
653 interface omp_init_allocator
654 function omp_init_allocator (memspace
, ntraits
, traits
)
656 integer (kind
=omp_allocator_handle_kind
) omp_init_allocator
657 integer (kind
=omp_memspace_handle_kind
), &
658 intent(in
) :: memspace
659 integer (4), intent(in
) :: ntraits
660 type (omp_alloctrait
), intent(in
) :: traits(*)
662 function omp_init_allocator_8 (memspace
, ntraits
, traits
)
664 integer (kind
=omp_allocator_handle_kind
) omp_init_allocator_8
665 integer (kind
=omp_memspace_handle_kind
), &
666 intent(in
) :: memspace
667 integer (8), intent(in
) :: ntraits
668 type (omp_alloctrait
), intent(in
) :: traits(*)
673 subroutine omp_destroy_allocator (allocator
)
675 integer (kind
=omp_allocator_handle_kind
), &
676 intent(in
) :: allocator
681 subroutine omp_set_default_allocator (allocator
)
683 integer (kind
=omp_allocator_handle_kind
), &
684 intent(in
) :: allocator
689 function omp_get_default_allocator ()
691 integer (kind
=omp_allocator_handle_kind
) &
692 omp_get_default_allocator
696 interface omp_display_env
697 subroutine omp_display_env (verbose
)
698 logical (4),intent (in
) :: verbose
699 end subroutine omp_display_env
700 subroutine omp_display_env_8 (verbose
)
701 logical (8),intent (in
) :: verbose
702 end subroutine omp_display_env_8
706 function omp_alloc (size
, allocator
) bind(c
)
707 use, intrinsic :: iso_c_binding
, only
: c_ptr
, c_size_t
708 import
:: omp_allocator_handle_kind
709 type(c_ptr
) :: omp_alloc
710 integer(c_size_t
), value
:: size
711 integer(omp_allocator_handle_kind
), value
:: allocator
712 end function omp_alloc
716 function omp_aligned_alloc (alignment
, size
, allocator
) bind(c
)
717 use, intrinsic :: iso_c_binding
, only
: c_ptr
, c_size_t
718 import
:: omp_allocator_handle_kind
719 type(c_ptr
) :: omp_aligned_alloc
720 integer(c_size_t
), value
:: alignment
, size
721 integer(omp_allocator_handle_kind
), value
:: allocator
722 end function omp_aligned_alloc
726 subroutine omp_free(ptr
, allocator
) bind(c
)
727 use, intrinsic :: iso_c_binding
, only
: c_ptr
728 import
:: omp_allocator_handle_kind
729 type(c_ptr
), value
:: ptr
730 integer(omp_allocator_handle_kind
), value
:: allocator
731 end subroutine omp_free
735 function omp_calloc (nmemb
, size
, allocator
) bind(c
)
736 use, intrinsic :: iso_c_binding
, only
: c_ptr
, c_size_t
737 import
:: omp_allocator_handle_kind
738 type(c_ptr
) :: omp_calloc
739 integer(c_size_t
), value
:: nmemb
, size
740 integer(omp_allocator_handle_kind
), value
:: allocator
741 end function omp_calloc
745 function omp_aligned_calloc (alignment
, nmemb
, size
, allocator
) bind(c
)
746 use, intrinsic :: iso_c_binding
, only
: c_ptr
, c_size_t
747 import
:: omp_allocator_handle_kind
748 type(c_ptr
) :: omp_aligned_calloc
749 integer(c_size_t
), value
:: alignment
, nmemb
, size
750 integer(omp_allocator_handle_kind
), value
:: allocator
751 end function omp_aligned_calloc
755 function omp_realloc (ptr
, size
, allocator
, free_allocator
) bind(c
)
756 use, intrinsic :: iso_c_binding
, only
: c_ptr
, c_size_t
757 import
:: omp_allocator_handle_kind
758 type(c_ptr
) :: omp_realloc
759 type(c_ptr
), value
:: ptr
760 integer(c_size_t
), value
:: size
761 integer(omp_allocator_handle_kind
), value
:: allocator
, free_allocator
762 end function omp_realloc
766 function omp_target_alloc (size
, device_num
) bind(c
)
767 use, intrinsic :: iso_c_binding
, only
: c_ptr
, c_size_t
, c_int
768 type(c_ptr
) :: omp_target_alloc
769 integer(c_size_t
), value
:: size
770 integer(c_int
), value
:: device_num
771 end function omp_target_alloc
775 subroutine omp_target_free (device_ptr
, device_num
) bind(c
)
776 use, intrinsic :: iso_c_binding
, only
: c_ptr
, c_int
777 type(c_ptr
), value
:: device_ptr
778 integer(c_int
), value
:: device_num
779 end subroutine omp_target_free
783 function omp_target_is_present (ptr
, device_num
) bind(c
)
784 use, intrinsic :: iso_c_binding
, only
: c_ptr
, c_int
785 integer(c_int
) :: omp_target_is_present
786 type(c_ptr
), value
:: ptr
787 integer(c_int
), value
:: device_num
788 end function omp_target_is_present
792 function omp_target_memcpy (dst
, src
, length
, dst_offset
, &
793 src_offset
, dst_device_num
, &
794 src_device_num
) bind(c
)
795 use, intrinsic :: iso_c_binding
, only
: c_ptr
, c_int
, c_size_t
796 integer(c_int
) :: omp_target_memcpy
797 type(c_ptr
), value
:: dst
, src
798 integer(c_size_t
), value
:: length
, dst_offset
, src_offset
799 integer(c_int
), value
:: dst_device_num
, src_device_num
800 end function omp_target_memcpy
804 function omp_target_memcpy_async (dst
, src
, length
, dst_offset
, &
805 src_offset
, dst_device_num
, &
806 src_device_num
, depobj_count
, &
808 use, intrinsic :: iso_c_binding
, only
: c_ptr
, c_int
, c_size_t
809 import
:: omp_depend_kind
810 integer(c_int
) :: omp_target_memcpy_async
811 type(c_ptr
), value
:: dst
, src
812 integer(c_size_t
), value
:: length
, dst_offset
, src_offset
813 integer(c_int
), value
:: dst_device_num
, src_device_num
, &
815 integer(omp_depend_kind
), optional
:: depobj_list(*)
816 end function omp_target_memcpy_async
820 function omp_target_memcpy_rect (dst
,src
,element_size
, num_dims
, &
821 volume
, dst_offsets
, src_offsets
, &
822 dst_dimensions
, src_dimensions
, &
823 dst_device_num
, src_device_num
) &
825 use, intrinsic :: iso_c_binding
, only
: c_ptr
, c_int
, c_size_t
826 integer(c_int
) :: omp_target_memcpy_rect
827 type(c_ptr
), value
:: dst
, src
828 integer(c_size_t
), value
:: element_size
829 integer(c_int
), value
:: num_dims
, dst_device_num
, src_device_num
830 integer(c_size_t
), intent(in
) :: volume(*), dst_offsets(*), &
831 src_offsets(*), dst_dimensions(*), &
833 end function omp_target_memcpy_rect
837 function omp_target_memcpy_rect_async (dst
,src
,element_size
, &
839 dst_offsets
, src_offsets
, &
846 use, intrinsic :: iso_c_binding
, only
: c_ptr
, c_int
, c_size_t
847 import
:: omp_depend_kind
848 integer(c_int
) :: omp_target_memcpy_rect_async
849 type(c_ptr
), value
:: dst
, src
850 integer(c_size_t
), value
:: element_size
851 integer(c_int
), value
:: num_dims
, dst_device_num
, src_device_num
, &
853 integer(c_size_t
), intent(in
) :: volume(*), dst_offsets(*), &
854 src_offsets(*), dst_dimensions(*), &
856 integer(omp_depend_kind
), optional
:: depobj_list(*)
857 end function omp_target_memcpy_rect_async
861 function omp_target_associate_ptr (host_ptr
, device_ptr
, size
, &
862 device_offset
, device_num
) bind(c
)
863 use, intrinsic :: iso_c_binding
, only
: c_ptr
, c_size_t
, c_int
864 integer(c_int
) :: omp_target_associate_ptr
865 type(c_ptr
), value
:: host_ptr
, device_ptr
866 integer(c_size_t
), value
:: size
, device_offset
867 integer(c_int
), value
:: device_num
868 end function omp_target_associate_ptr
872 function omp_target_disassociate_ptr (ptr
, device_num
) bind(c
)
873 use, intrinsic :: iso_c_binding
, only
: c_ptr
, c_int
874 integer(c_int
) :: omp_target_disassociate_ptr
875 type(c_ptr
), value
:: ptr
876 integer(c_int
), value
:: device_num
877 end function omp_target_disassociate_ptr
881 function omp_get_mapped_ptr (ptr
, device_num
) bind(c
)
882 use, intrinsic :: iso_c_binding
, only
: c_ptr
, c_int
883 type(c_ptr
) :: omp_get_mapped_ptr
884 type(c_ptr
), value
:: ptr
885 integer(c_int
), value
:: device_num
886 end function omp_get_mapped_ptr
890 function omp_target_is_accessible (ptr
, size
, device_num
) bind(c
)
891 use, intrinsic :: iso_c_binding
, only
: c_ptr
, c_size_t
, c_int
892 integer(c_int
) :: omp_target_is_accessible
893 type(c_ptr
), value
:: ptr
894 integer(c_size_t
), value
:: size
895 integer(c_int
), value
:: device_num
896 end function omp_target_is_accessible
899 #
if _OPENMP
>= 201811
900 !GCC$ ATTRIBUTES DEPRECATED :: omp_get_nested, omp_set_nested
903 #
if _OPENMP
>= 202011
904 !GCC$ ATTRIBUTES DEPRECATED :: omp_proc_bind_master, omp_atv_sequential