Improve atomic store implementation on hppa-linux.
[official-gcc.git] / libgomp / omp_lib.h.in
blobd5c02605dd70f2583accf6194b024e8ce9c27f10
1 ! Copyright (C) 2005-2021 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
5 ! (libgomp).
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)
10 ! any later version.
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
15 ! more details.
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/>.
26 integer omp_lock_kind, omp_nest_lock_kind, openmp_version
27 parameter (omp_lock_kind = @OMP_LOCK_KIND@)
28 parameter (omp_nest_lock_kind = @OMP_NEST_LOCK_KIND@)
29 integer omp_depend_kind
30 parameter (omp_depend_kind = @OMP_DEPEND_KIND@)
31 integer omp_sched_kind
32 parameter (omp_sched_kind = 4)
33 integer (omp_sched_kind) omp_sched_static, omp_sched_dynamic
34 integer (omp_sched_kind) omp_sched_guided, omp_sched_auto
35 parameter (omp_sched_static = 1)
36 parameter (omp_sched_dynamic = 2)
37 parameter (omp_sched_guided = 3)
38 parameter (omp_sched_auto = 4)
39 integer omp_proc_bind_kind
40 parameter (omp_proc_bind_kind = 4)
41 integer (omp_proc_bind_kind) omp_proc_bind_false
42 integer (omp_proc_bind_kind) omp_proc_bind_true
43 integer (omp_proc_bind_kind) omp_proc_bind_primary
44 integer (omp_proc_bind_kind) omp_proc_bind_master
45 integer (omp_proc_bind_kind) omp_proc_bind_close
46 integer (omp_proc_bind_kind) omp_proc_bind_spread
47 parameter (omp_proc_bind_false = 0)
48 parameter (omp_proc_bind_true = 1)
49 parameter (omp_proc_bind_primary = 2)
50 parameter (omp_proc_bind_master = 2)
51 parameter (omp_proc_bind_close = 3)
52 parameter (omp_proc_bind_spread = 4)
53 integer omp_sync_hint_kind
54 integer omp_lock_hint_kind
55 parameter (omp_sync_hint_kind = 4)
56 parameter (omp_lock_hint_kind = omp_sync_hint_kind)
57 integer (omp_sync_hint_kind) omp_sync_hint_none
58 integer (omp_lock_hint_kind) omp_lock_hint_none
59 integer (omp_sync_hint_kind) omp_sync_hint_uncontended
60 integer (omp_lock_hint_kind) omp_lock_hint_uncontended
61 integer (omp_sync_hint_kind) omp_sync_hint_contended
62 integer (omp_sync_hint_kind) omp_lock_hint_contended
63 integer (omp_lock_hint_kind) omp_sync_hint_nonspeculative
64 integer (omp_lock_hint_kind) omp_lock_hint_nonspeculative
65 integer (omp_sync_hint_kind) omp_sync_hint_speculative
66 integer (omp_lock_hint_kind) omp_lock_hint_speculative
67 parameter (omp_sync_hint_none = 0)
68 parameter (omp_lock_hint_none = 0)
69 parameter (omp_sync_hint_uncontended = 1)
70 parameter (omp_lock_hint_uncontended = 1)
71 parameter (omp_sync_hint_contended = 2)
72 parameter (omp_lock_hint_contended = 2)
73 parameter (omp_sync_hint_nonspeculative = 4)
74 parameter (omp_lock_hint_nonspeculative = 4)
75 parameter (omp_sync_hint_speculative = 8)
76 parameter (omp_lock_hint_speculative = 8)
77 parameter (openmp_version = 201511)
78 integer omp_pause_resource_kind
79 parameter (omp_pause_resource_kind = 4)
80 integer (omp_pause_resource_kind) omp_pause_soft
81 integer (omp_pause_resource_kind) omp_pause_hard
82 parameter (omp_pause_soft = 1)
83 parameter (omp_pause_hard = 2)
85 integer omp_allocator_handle_kind, omp_alloctrait_key_kind
86 integer omp_alloctrait_val_kind, omp_memspace_handle_kind
87 integer omp_event_handle_kind
88 parameter (omp_allocator_handle_kind = @INTPTR_T_KIND@)
89 parameter (omp_alloctrait_key_kind = 4)
90 parameter (omp_alloctrait_val_kind = @INTPTR_T_KIND@)
91 parameter (omp_memspace_handle_kind = @INTPTR_T_KIND@)
92 parameter (omp_event_handle_kind = @INTPTR_T_KIND@)
93 integer (omp_alloctrait_key_kind) omp_atk_sync_hint
94 integer (omp_alloctrait_key_kind) omp_atk_alignment
95 integer (omp_alloctrait_key_kind) omp_atk_access
96 integer (omp_alloctrait_key_kind) omp_atk_pool_size
97 integer (omp_alloctrait_key_kind) omp_atk_fallback
98 integer (omp_alloctrait_key_kind) omp_atk_fb_data
99 integer (omp_alloctrait_key_kind) omp_atk_pinned
100 integer (omp_alloctrait_key_kind) omp_atk_partition
101 parameter (omp_atk_sync_hint = 1)
102 parameter (omp_atk_alignment = 2)
103 parameter (omp_atk_access = 3)
104 parameter (omp_atk_pool_size = 4)
105 parameter (omp_atk_fallback = 5)
106 parameter (omp_atk_fb_data = 6)
107 parameter (omp_atk_pinned = 7)
108 parameter (omp_atk_partition = 8)
109 integer (omp_alloctrait_val_kind) omp_atv_false
110 integer (omp_alloctrait_val_kind) omp_atv_true
111 integer (omp_alloctrait_val_kind) omp_atv_default
112 integer (omp_alloctrait_val_kind) omp_atv_contended
113 integer (omp_alloctrait_val_kind) omp_atv_uncontended
114 integer (omp_alloctrait_val_kind) omp_atv_serialized
115 integer (omp_alloctrait_val_kind) omp_atv_sequential
116 integer (omp_alloctrait_val_kind) omp_atv_private
117 integer (omp_alloctrait_val_kind) omp_atv_all
118 integer (omp_alloctrait_val_kind) omp_atv_thread
119 integer (omp_alloctrait_val_kind) omp_atv_pteam
120 integer (omp_alloctrait_val_kind) omp_atv_cgroup
121 integer (omp_alloctrait_val_kind) omp_atv_default_mem_fb
122 integer (omp_alloctrait_val_kind) omp_atv_null_fb
123 integer (omp_alloctrait_val_kind) omp_atv_abort_fb
124 integer (omp_alloctrait_val_kind) omp_atv_allocator_fb
125 integer (omp_alloctrait_val_kind) omp_atv_environment
126 integer (omp_alloctrait_val_kind) omp_atv_nearest
127 integer (omp_alloctrait_val_kind) omp_atv_blocked
128 integer (omp_alloctrait_val_kind) omp_atv_interleaved
129 parameter (omp_atv_default = -1)
130 parameter (omp_atv_false = 0)
131 parameter (omp_atv_true = 1)
132 parameter (omp_atv_contended = 3)
133 parameter (omp_atv_uncontended = 4)
134 parameter (omp_atv_serialized = 5)
135 parameter (omp_atv_sequential = omp_atv_serialized)
136 parameter (omp_atv_private = 6)
137 parameter (omp_atv_all = 7)
138 parameter (omp_atv_thread = 8)
139 parameter (omp_atv_pteam = 9)
140 parameter (omp_atv_cgroup = 10)
141 parameter (omp_atv_default_mem_fb = 11)
142 parameter (omp_atv_null_fb = 12)
143 parameter (omp_atv_abort_fb = 13)
144 parameter (omp_atv_allocator_fb = 14)
145 parameter (omp_atv_environment = 15)
146 parameter (omp_atv_nearest = 16)
147 parameter (omp_atv_blocked = 17)
148 parameter (omp_atv_interleaved = 18)
149 integer (omp_allocator_handle_kind) omp_null_allocator
150 integer (omp_allocator_handle_kind) omp_default_mem_alloc
151 integer (omp_allocator_handle_kind) omp_large_cap_mem_alloc
152 integer (omp_allocator_handle_kind) omp_const_mem_alloc
153 integer (omp_allocator_handle_kind) omp_high_bw_mem_alloc
154 integer (omp_allocator_handle_kind) omp_low_lat_mem_alloc
155 integer (omp_allocator_handle_kind) omp_cgroup_mem_alloc
156 integer (omp_allocator_handle_kind) omp_pteam_mem_alloc
157 integer (omp_allocator_handle_kind) omp_thread_mem_alloc
158 parameter (omp_null_allocator = 0)
159 parameter (omp_default_mem_alloc = 1)
160 parameter (omp_large_cap_mem_alloc = 2)
161 parameter (omp_const_mem_alloc = 3)
162 parameter (omp_high_bw_mem_alloc = 4)
163 parameter (omp_low_lat_mem_alloc = 5)
164 parameter (omp_cgroup_mem_alloc = 6)
165 parameter (omp_pteam_mem_alloc = 7)
166 parameter (omp_thread_mem_alloc = 8)
167 integer (omp_memspace_handle_kind) omp_default_mem_space
168 integer (omp_memspace_handle_kind) omp_large_cap_mem_space
169 integer (omp_memspace_handle_kind) omp_const_mem_space
170 integer (omp_memspace_handle_kind) omp_high_bw_mem_space
171 integer (omp_memspace_handle_kind) omp_low_lat_mem_space
172 parameter (omp_default_mem_space = 0)
173 parameter (omp_large_cap_mem_space = 1)
174 parameter (omp_const_mem_space = 2)
175 parameter (omp_high_bw_mem_space = 3)
176 parameter (omp_low_lat_mem_space = 4)
178 type omp_alloctrait
179 integer (omp_alloctrait_key_kind) key
180 integer (omp_alloctrait_val_kind) value
181 end type omp_alloctrait
183 external omp_init_lock, omp_init_nest_lock
184 external omp_init_lock_with_hint
185 external omp_init_nest_lock_with_hint
186 external omp_destroy_lock, omp_destroy_nest_lock
187 external omp_set_lock, omp_set_nest_lock
188 external omp_unset_lock, omp_unset_nest_lock
189 external omp_set_dynamic, omp_set_nested
190 external omp_set_num_threads
192 external omp_get_dynamic, omp_get_nested
193 logical(4) omp_get_dynamic, omp_get_nested
194 external omp_test_lock, omp_in_parallel
195 logical(4) omp_test_lock, omp_in_parallel
197 external omp_get_max_threads, omp_get_num_procs
198 integer(4) omp_get_max_threads, omp_get_num_procs
199 external omp_get_num_threads, omp_get_thread_num
200 integer(4) omp_get_num_threads, omp_get_thread_num
201 external omp_test_nest_lock
202 integer(4) omp_test_nest_lock
204 external omp_get_wtick, omp_get_wtime
205 double precision omp_get_wtick, omp_get_wtime
207 external omp_set_schedule, omp_get_schedule
208 external omp_get_thread_limit, omp_set_max_active_levels
209 external omp_get_max_active_levels, omp_get_level
210 external omp_get_ancestor_thread_num, omp_get_team_size
211 external omp_get_active_level
212 external omp_get_supported_active_levels
213 integer(4) omp_get_thread_limit, omp_get_max_active_levels
214 integer(4) omp_get_level, omp_get_ancestor_thread_num
215 integer(4) omp_get_team_size, omp_get_active_level
216 integer(4) omp_get_supported_active_levels
218 external omp_in_final
219 logical(4) omp_in_final
221 external omp_get_cancellation
222 logical(4) omp_get_cancellation
224 external omp_get_proc_bind
225 integer(omp_proc_bind_kind) omp_get_proc_bind
227 integer(4) omp_get_num_places
228 external omp_get_num_places
229 integer(4) omp_get_place_num_procs
230 external omp_get_place_num_procs
231 external omp_get_place_proc_ids
232 integer(4) omp_get_place_num
233 external omp_get_place_num
234 integer(4) omp_get_partition_num_places
235 external omp_get_partition_num_places
236 external omp_get_partition_place_nums
238 external omp_set_default_device, omp_get_default_device
239 external omp_get_num_devices, omp_get_num_teams
240 external omp_get_team_num
241 integer(4) omp_get_default_device, omp_get_num_devices
242 integer(4) omp_get_num_teams, omp_get_team_num
244 external omp_is_initial_device
245 logical(4) omp_is_initial_device
246 external omp_get_initial_device
247 integer(4) omp_get_initial_device
249 external omp_get_device_num
250 integer(4) omp_get_device_num
252 external omp_get_max_task_priority
253 integer(4) omp_get_max_task_priority
255 external omp_set_num_teams, omp_set_teams_thread_limit
256 external omp_get_max_teams, omp_get_teams_thread_limit
257 integer(4) omp_get_max_teams, omp_get_teams_thread_limit
259 external omp_fulfill_event
261 external omp_set_affinity_format, omp_get_affinity_format
262 external omp_display_affinity, omp_capture_affinity
263 integer(4) omp_get_affinity_format
264 integer(4) omp_capture_affinity
266 external omp_pause_resource, omp_pause_resource_all
267 integer(4) omp_pause_resource
268 integer(4) omp_pause_resource_all
270 external omp_init_allocator
271 integer (omp_allocator_handle_kind) omp_init_allocator
272 external omp_destroy_allocator
273 external omp_set_default_allocator
274 external omp_get_default_allocator
275 integer (omp_allocator_handle_kind) omp_get_default_allocator
277 external omp_display_env
279 interface
280 function omp_alloc (size, allocator) bind(c)
281 use, intrinsic :: iso_c_binding, only : c_ptr, c_size_t
282 use, intrinsic :: omp_lib_kinds
283 type(c_ptr) :: omp_alloc
284 integer(c_size_t), value :: size
285 integer(omp_allocator_handle_kind), value :: allocator
286 end function omp_alloc
287 end interface
289 interface
290 function omp_aligned_alloc (alignment, size, allocator) bind(c)
291 use, intrinsic :: iso_c_binding, only : c_ptr, c_size_t
292 use, intrinsic :: omp_lib_kinds
293 type(c_ptr) :: omp_aligned_alloc
294 integer(c_size_t), value :: alignment, size
295 integer(omp_allocator_handle_kind), value :: allocator
296 end function omp_aligned_alloc
297 end interface
299 interface
300 subroutine omp_free(ptr, allocator) bind(c)
301 use, intrinsic :: iso_c_binding, only : c_ptr
302 use, intrinsic :: omp_lib_kinds
303 type(c_ptr), value :: ptr
304 integer(omp_allocator_handle_kind), value :: allocator
305 end subroutine omp_free
306 end interface
308 interface
309 function omp_calloc (nmemb, size, allocator) bind(c)
310 use, intrinsic :: iso_c_binding, only : c_ptr, c_size_t
311 use, intrinsic :: omp_lib_kinds
312 type(c_ptr) :: omp_calloc
313 integer(c_size_t), value :: nmemb, size
314 integer(omp_allocator_handle_kind), value :: allocator
315 end function omp_calloc
316 end interface
318 interface
319 function omp_aligned_calloc (alignment, nmemb, size, allocator) &
320 & bind(c)
321 use, intrinsic :: iso_c_binding, only : c_ptr, c_size_t
322 use, intrinsic :: omp_lib_kinds
323 type(c_ptr) :: omp_aligned_calloc
324 integer(c_size_t), value :: alignment, nmemb, size
325 integer(omp_allocator_handle_kind), value :: allocator
326 end function omp_aligned_calloc
327 end interface
329 interface
330 function omp_realloc (ptr, size, allocator, free_allocator) &
331 & bind(c)
332 use, intrinsic :: iso_c_binding, only : c_ptr, c_size_t
333 use, intrinsic :: omp_lib_kinds
334 type(c_ptr) :: omp_realloc
335 type(c_ptr), value :: ptr
336 integer(c_size_t), value :: size
337 integer(omp_allocator_handle_kind), value :: allocator
338 integer(omp_allocator_handle_kind), value :: free_allocator
339 end function omp_realloc
340 end interface
342 interface
343 function omp_target_alloc (size, device_num) bind(c)
344 use, intrinsic :: iso_c_binding, only : c_ptr, c_size_t, c_int
345 type(c_ptr) :: omp_target_alloc
346 integer(c_size_t), value :: size
347 integer(c_int), value :: device_num
348 end function omp_target_alloc
349 end interface
351 interface
352 subroutine omp_target_free (device_ptr, device_num) bind(c)
353 use, intrinsic :: iso_c_binding, only : c_ptr, c_int
354 type(c_ptr), value :: device_ptr
355 integer(c_int), value :: device_num
356 end subroutine omp_target_free
357 end interface
359 interface
360 function omp_target_is_present (ptr, device_num) bind(c)
361 use, intrinsic :: iso_c_binding, only : c_ptr, c_int
362 integer(c_int) :: omp_target_is_present
363 type(c_ptr), value :: ptr
364 integer(c_int), value :: device_num
365 end function omp_target_is_present
366 end interface
368 interface
369 function omp_target_memcpy (dst, src, length, dst_offset, &
370 & src_offset, dst_device_num, &
371 & src_device_num) bind(c)
372 use, intrinsic :: iso_c_binding, only : c_ptr, c_int, c_size_t
373 integer(c_int) :: omp_target_memcpy
374 type(c_ptr), value :: dst, src
375 integer(c_size_t), value :: length, dst_offset, src_offset
376 integer(c_int), value :: dst_device_num, src_device_num
377 end function omp_target_memcpy
378 end interface
380 interface
381 function omp_target_memcpy_rect (dst,src,element_size, num_dims, &
382 & volume, dst_offsets, &
383 & src_offsets, dst_dimensions, &
384 & src_dimensions, dst_device_num, &
385 & src_device_num) bind(c)
386 use, intrinsic :: iso_c_binding, only : c_ptr, c_int, c_size_t
387 integer(c_int) :: omp_target_memcpy_rect
388 type(c_ptr), value :: dst, src
389 integer(c_size_t), value :: element_size
390 integer(c_int), value :: num_dims
391 integer(c_int), value :: dst_device_num, src_device_num
392 integer(c_size_t), intent(in) :: volume(*), dst_offsets(*)
393 integer(c_size_t), intent(in) :: src_offsets(*)
394 integer(c_size_t), intent(in) :: dst_dimensions(*)
395 integer(c_size_t), intent(in) :: src_dimensions(*)
396 end function omp_target_memcpy_rect
397 end interface
399 interface
400 function omp_target_associate_ptr (host_ptr, device_ptr, size, &
401 & device_offset, device_num) &
402 & bind(c)
403 use, intrinsic :: iso_c_binding, only : c_ptr, c_size_t, c_int
404 integer(c_int) :: omp_target_associate_ptr
405 type(c_ptr), value :: host_ptr, device_ptr
406 integer(c_size_t), value :: size, device_offset
407 integer(c_int), value :: device_num
408 end function omp_target_associate_ptr
409 end interface
411 interface
412 function omp_target_disassociate_ptr (ptr, device_num) bind(c)
413 use, intrinsic :: iso_c_binding, only : c_ptr, c_int
414 integer(c_int) :: omp_target_disassociate_ptr
415 type(c_ptr), value :: ptr
416 integer(c_int), value :: device_num
417 end function omp_target_disassociate_ptr
418 end interface