blob: 93c022894ab58290f73712e7795b7086a45e33b2 [file] [log] [blame]
Jim Cownie5e8470a2013-09-27 10:38:44 +00001/*
2 * kmp_ftn_os.h -- KPTS Fortran defines header file.
Jim Cownie5e8470a2013-09-27 10:38:44 +00003 */
4
Jim Cownie5e8470a2013-09-27 10:38:44 +00005//===----------------------------------------------------------------------===//
6//
7// The LLVM Compiler Infrastructure
8//
9// This file is dual licensed under the MIT and the University of Illinois Open
10// Source Licenses. See LICENSE.txt for details.
11//
12//===----------------------------------------------------------------------===//
13
Jim Cownie5e8470a2013-09-27 10:38:44 +000014#ifndef KMP_FTN_OS_H
15#define KMP_FTN_OS_H
16
Jonathan Peyton30419822017-05-12 18:01:32 +000017// KMP_FNT_ENTRIES may be one of: KMP_FTN_PLAIN, KMP_FTN_UPPER, KMP_FTN_APPEND,
18// KMP_FTN_UAPPEND.
Jim Cownie5e8470a2013-09-27 10:38:44 +000019
20/* -------------------------- External definitions ------------------------ */
21
22#if KMP_FTN_ENTRIES == KMP_FTN_PLAIN
23
Jonathan Peyton30419822017-05-12 18:01:32 +000024#define FTN_SET_STACKSIZE kmp_set_stacksize
25#define FTN_SET_STACKSIZE_S kmp_set_stacksize_s
26#define FTN_GET_STACKSIZE kmp_get_stacksize
27#define FTN_GET_STACKSIZE_S kmp_get_stacksize_s
28#define FTN_SET_BLOCKTIME kmp_set_blocktime
29#define FTN_GET_BLOCKTIME kmp_get_blocktime
30#define FTN_SET_LIBRARY_SERIAL kmp_set_library_serial
31#define FTN_SET_LIBRARY_TURNAROUND kmp_set_library_turnaround
32#define FTN_SET_LIBRARY_THROUGHPUT kmp_set_library_throughput
33#define FTN_SET_LIBRARY kmp_set_library
34#define FTN_GET_LIBRARY kmp_get_library
35#define FTN_SET_DEFAULTS kmp_set_defaults
36#define FTN_SET_DISP_NUM_BUFFERS kmp_set_disp_num_buffers
37#define FTN_SET_AFFINITY kmp_set_affinity
38#define FTN_GET_AFFINITY kmp_get_affinity
39#define FTN_GET_AFFINITY_MAX_PROC kmp_get_affinity_max_proc
40#define FTN_CREATE_AFFINITY_MASK kmp_create_affinity_mask
41#define FTN_DESTROY_AFFINITY_MASK kmp_destroy_affinity_mask
42#define FTN_SET_AFFINITY_MASK_PROC kmp_set_affinity_mask_proc
43#define FTN_UNSET_AFFINITY_MASK_PROC kmp_unset_affinity_mask_proc
44#define FTN_GET_AFFINITY_MASK_PROC kmp_get_affinity_mask_proc
Jim Cownie5e8470a2013-09-27 10:38:44 +000045
Jonathan Peyton30419822017-05-12 18:01:32 +000046#define FTN_MALLOC kmp_malloc
47#define FTN_ALIGNED_MALLOC kmp_aligned_malloc
48#define FTN_CALLOC kmp_calloc
49#define FTN_REALLOC kmp_realloc
50#define FTN_FREE kmp_free
Jim Cownie5e8470a2013-09-27 10:38:44 +000051
Jonathan Peyton30419822017-05-12 18:01:32 +000052#define FTN_GET_NUM_KNOWN_THREADS kmp_get_num_known_threads
Jim Cownie5e8470a2013-09-27 10:38:44 +000053
Jonathan Peyton30419822017-05-12 18:01:32 +000054#define FTN_SET_NUM_THREADS omp_set_num_threads
55#define FTN_GET_NUM_THREADS omp_get_num_threads
56#define FTN_GET_MAX_THREADS omp_get_max_threads
57#define FTN_GET_THREAD_NUM omp_get_thread_num
58#define FTN_GET_NUM_PROCS omp_get_num_procs
59#define FTN_SET_DYNAMIC omp_set_dynamic
60#define FTN_GET_DYNAMIC omp_get_dynamic
61#define FTN_SET_NESTED omp_set_nested
62#define FTN_GET_NESTED omp_get_nested
63#define FTN_IN_PARALLEL omp_in_parallel
64#define FTN_GET_THREAD_LIMIT omp_get_thread_limit
65#define FTN_SET_SCHEDULE omp_set_schedule
66#define FTN_GET_SCHEDULE omp_get_schedule
67#define FTN_SET_MAX_ACTIVE_LEVELS omp_set_max_active_levels
68#define FTN_GET_MAX_ACTIVE_LEVELS omp_get_max_active_levels
69#define FTN_GET_ACTIVE_LEVEL omp_get_active_level
70#define FTN_GET_LEVEL omp_get_level
71#define FTN_GET_ANCESTOR_THREAD_NUM omp_get_ancestor_thread_num
72#define FTN_GET_TEAM_SIZE omp_get_team_size
73#define FTN_IN_FINAL omp_in_final
Jim Cownie5e8470a2013-09-27 10:38:44 +000074// #define FTN_SET_PROC_BIND omp_set_proc_bind
Jonathan Peyton30419822017-05-12 18:01:32 +000075#define FTN_GET_PROC_BIND omp_get_proc_bind
Jim Cownie5e8470a2013-09-27 10:38:44 +000076// #define FTN_CURR_PROC_BIND omp_curr_proc_bind
77#if OMP_40_ENABLED
Jonathan Peyton30419822017-05-12 18:01:32 +000078#define FTN_GET_NUM_TEAMS omp_get_num_teams
79#define FTN_GET_TEAM_NUM omp_get_team_num
Jim Cownie5e8470a2013-09-27 10:38:44 +000080#endif
Jonathan Peyton30419822017-05-12 18:01:32 +000081#define FTN_INIT_LOCK omp_init_lock
Andrey Churbanov5c56fb52015-02-20 18:05:17 +000082#if KMP_USE_DYNAMIC_LOCK
Jonathan Peyton30419822017-05-12 18:01:32 +000083#define FTN_INIT_LOCK_WITH_HINT omp_init_lock_with_hint
84#define FTN_INIT_NEST_LOCK_WITH_HINT omp_init_nest_lock_with_hint
Andrey Churbanov5c56fb52015-02-20 18:05:17 +000085#endif
Jonathan Peyton30419822017-05-12 18:01:32 +000086#define FTN_DESTROY_LOCK omp_destroy_lock
87#define FTN_SET_LOCK omp_set_lock
88#define FTN_UNSET_LOCK omp_unset_lock
89#define FTN_TEST_LOCK omp_test_lock
90#define FTN_INIT_NEST_LOCK omp_init_nest_lock
91#define FTN_DESTROY_NEST_LOCK omp_destroy_nest_lock
92#define FTN_SET_NEST_LOCK omp_set_nest_lock
93#define FTN_UNSET_NEST_LOCK omp_unset_nest_lock
94#define FTN_TEST_NEST_LOCK omp_test_nest_lock
Jim Cownie5e8470a2013-09-27 10:38:44 +000095
Jonathan Peyton30419822017-05-12 18:01:32 +000096#define FTN_SET_WARNINGS_ON kmp_set_warnings_on
97#define FTN_SET_WARNINGS_OFF kmp_set_warnings_off
Jim Cownie5e8470a2013-09-27 10:38:44 +000098
Jonathan Peyton30419822017-05-12 18:01:32 +000099#define FTN_GET_WTIME omp_get_wtime
100#define FTN_GET_WTICK omp_get_wtick
Jim Cownie5e8470a2013-09-27 10:38:44 +0000101
102#if OMP_40_ENABLED
Jonathan Peyton50eae7f2016-05-27 15:51:14 +0000103#if KMP_MIC || KMP_OS_DARWIN || defined(KMP_STUB)
Jonathan Peyton30419822017-05-12 18:01:32 +0000104#define FTN_GET_NUM_DEVICES omp_get_num_devices
Jim Cownie5e8470a2013-09-27 10:38:44 +0000105#endif
Jonathan Peyton30419822017-05-12 18:01:32 +0000106#define FTN_GET_DEFAULT_DEVICE omp_get_default_device
107#define FTN_SET_DEFAULT_DEVICE omp_set_default_device
108#define FTN_IS_INITIAL_DEVICE omp_is_initial_device
Jim Cownie5e8470a2013-09-27 10:38:44 +0000109#endif
110
Jim Cownie181b4bb2013-12-23 17:28:57 +0000111#if OMP_40_ENABLED
Jonathan Peyton30419822017-05-12 18:01:32 +0000112#define FTN_GET_CANCELLATION omp_get_cancellation
113#define FTN_GET_CANCELLATION_STATUS kmp_get_cancellation_status
Jim Cownie181b4bb2013-12-23 17:28:57 +0000114#endif
115
Jonathan Peytondf6818b2016-06-14 17:57:47 +0000116#if OMP_45_ENABLED
Jonathan Peyton30419822017-05-12 18:01:32 +0000117#define FTN_GET_MAX_TASK_PRIORITY omp_get_max_task_priority
118#define FTN_GET_NUM_PLACES omp_get_num_places
119#define FTN_GET_PLACE_NUM_PROCS omp_get_place_num_procs
120#define FTN_GET_PLACE_PROC_IDS omp_get_place_proc_ids
121#define FTN_GET_PLACE_NUM omp_get_place_num
122#define FTN_GET_PARTITION_NUM_PLACES omp_get_partition_num_places
123#define FTN_GET_PARTITION_PLACE_NUMS omp_get_partition_place_nums
124#ifdef KMP_STUB
125#define FTN_GET_INITIAL_DEVICE omp_get_initial_device
126#define FTN_TARGET_ALLOC omp_target_alloc
127#define FTN_TARGET_FREE omp_target_free
128#define FTN_TARGET_IS_PRESENT omp_target_is_present
129#define FTN_TARGET_MEMCPY omp_target_memcpy
130#define FTN_TARGET_MEMCPY_RECT omp_target_memcpy_rect
131#define FTN_TARGET_ASSOCIATE_PTR omp_target_associate_ptr
132#define FTN_TARGET_DISASSOCIATE_PTR omp_target_disassociate_ptr
133#endif
Jonathan Peyton28510722016-02-25 18:04:09 +0000134#endif
135
Jim Cownie5e8470a2013-09-27 10:38:44 +0000136#endif /* KMP_FTN_PLAIN */
137
138/* ------------------------------------------------------------------------ */
139
140#if KMP_FTN_ENTRIES == KMP_FTN_APPEND
141
Jonathan Peyton30419822017-05-12 18:01:32 +0000142#define FTN_SET_STACKSIZE kmp_set_stacksize_
143#define FTN_SET_STACKSIZE_S kmp_set_stacksize_s_
144#define FTN_GET_STACKSIZE kmp_get_stacksize_
145#define FTN_GET_STACKSIZE_S kmp_get_stacksize_s_
146#define FTN_SET_BLOCKTIME kmp_set_blocktime_
147#define FTN_GET_BLOCKTIME kmp_get_blocktime_
148#define FTN_SET_LIBRARY_SERIAL kmp_set_library_serial_
149#define FTN_SET_LIBRARY_TURNAROUND kmp_set_library_turnaround_
150#define FTN_SET_LIBRARY_THROUGHPUT kmp_set_library_throughput_
151#define FTN_SET_LIBRARY kmp_set_library_
152#define FTN_GET_LIBRARY kmp_get_library_
153#define FTN_SET_DEFAULTS kmp_set_defaults_
154#define FTN_SET_DISP_NUM_BUFFERS kmp_set_disp_num_buffers_
155#define FTN_SET_AFFINITY kmp_set_affinity_
156#define FTN_GET_AFFINITY kmp_get_affinity_
157#define FTN_GET_AFFINITY_MAX_PROC kmp_get_affinity_max_proc_
158#define FTN_CREATE_AFFINITY_MASK kmp_create_affinity_mask_
159#define FTN_DESTROY_AFFINITY_MASK kmp_destroy_affinity_mask_
160#define FTN_SET_AFFINITY_MASK_PROC kmp_set_affinity_mask_proc_
161#define FTN_UNSET_AFFINITY_MASK_PROC kmp_unset_affinity_mask_proc_
162#define FTN_GET_AFFINITY_MASK_PROC kmp_get_affinity_mask_proc_
Jim Cownie5e8470a2013-09-27 10:38:44 +0000163
Jonathan Peyton30419822017-05-12 18:01:32 +0000164#define FTN_MALLOC kmp_malloc_
165#define FTN_ALIGNED_MALLOC kmp_aligned_malloc_
166#define FTN_CALLOC kmp_calloc_
167#define FTN_REALLOC kmp_realloc_
168#define FTN_FREE kmp_free_
Jim Cownie5e8470a2013-09-27 10:38:44 +0000169
Jonathan Peyton30419822017-05-12 18:01:32 +0000170#define FTN_GET_NUM_KNOWN_THREADS kmp_get_num_known_threads_
Jim Cownie5e8470a2013-09-27 10:38:44 +0000171
Jonathan Peyton30419822017-05-12 18:01:32 +0000172#define FTN_SET_NUM_THREADS omp_set_num_threads_
173#define FTN_GET_NUM_THREADS omp_get_num_threads_
174#define FTN_GET_MAX_THREADS omp_get_max_threads_
175#define FTN_GET_THREAD_NUM omp_get_thread_num_
176#define FTN_GET_NUM_PROCS omp_get_num_procs_
177#define FTN_SET_DYNAMIC omp_set_dynamic_
178#define FTN_GET_DYNAMIC omp_get_dynamic_
179#define FTN_SET_NESTED omp_set_nested_
180#define FTN_GET_NESTED omp_get_nested_
181#define FTN_IN_PARALLEL omp_in_parallel_
182#define FTN_GET_THREAD_LIMIT omp_get_thread_limit_
183#define FTN_SET_SCHEDULE omp_set_schedule_
184#define FTN_GET_SCHEDULE omp_get_schedule_
185#define FTN_SET_MAX_ACTIVE_LEVELS omp_set_max_active_levels_
186#define FTN_GET_MAX_ACTIVE_LEVELS omp_get_max_active_levels_
187#define FTN_GET_ACTIVE_LEVEL omp_get_active_level_
188#define FTN_GET_LEVEL omp_get_level_
189#define FTN_GET_ANCESTOR_THREAD_NUM omp_get_ancestor_thread_num_
190#define FTN_GET_TEAM_SIZE omp_get_team_size_
191#define FTN_IN_FINAL omp_in_final_
Jim Cownie5e8470a2013-09-27 10:38:44 +0000192// #define FTN_SET_PROC_BIND omp_set_proc_bind_
Jonathan Peyton30419822017-05-12 18:01:32 +0000193#define FTN_GET_PROC_BIND omp_get_proc_bind_
Jim Cownie5e8470a2013-09-27 10:38:44 +0000194// #define FTN_CURR_PROC_BIND omp_curr_proc_bind_
195#if OMP_40_ENABLED
Jonathan Peyton30419822017-05-12 18:01:32 +0000196#define FTN_GET_NUM_TEAMS omp_get_num_teams_
197#define FTN_GET_TEAM_NUM omp_get_team_num_
Jim Cownie5e8470a2013-09-27 10:38:44 +0000198#endif
Jonathan Peyton30419822017-05-12 18:01:32 +0000199#define FTN_INIT_LOCK omp_init_lock_
Andrey Churbanov5c56fb52015-02-20 18:05:17 +0000200#if KMP_USE_DYNAMIC_LOCK
Jonathan Peyton30419822017-05-12 18:01:32 +0000201#define FTN_INIT_LOCK_WITH_HINT omp_init_lock_with_hint_
202#define FTN_INIT_NEST_LOCK_WITH_HINT omp_init_nest_lock_with_hint_
Andrey Churbanov5c56fb52015-02-20 18:05:17 +0000203#endif
Jonathan Peyton30419822017-05-12 18:01:32 +0000204#define FTN_DESTROY_LOCK omp_destroy_lock_
205#define FTN_SET_LOCK omp_set_lock_
206#define FTN_UNSET_LOCK omp_unset_lock_
207#define FTN_TEST_LOCK omp_test_lock_
208#define FTN_INIT_NEST_LOCK omp_init_nest_lock_
209#define FTN_DESTROY_NEST_LOCK omp_destroy_nest_lock_
210#define FTN_SET_NEST_LOCK omp_set_nest_lock_
211#define FTN_UNSET_NEST_LOCK omp_unset_nest_lock_
212#define FTN_TEST_NEST_LOCK omp_test_nest_lock_
Jim Cownie5e8470a2013-09-27 10:38:44 +0000213
Jonathan Peyton30419822017-05-12 18:01:32 +0000214#define FTN_SET_WARNINGS_ON kmp_set_warnings_on_
215#define FTN_SET_WARNINGS_OFF kmp_set_warnings_off_
Jim Cownie5e8470a2013-09-27 10:38:44 +0000216
Jonathan Peyton30419822017-05-12 18:01:32 +0000217#define FTN_GET_WTIME omp_get_wtime_
218#define FTN_GET_WTICK omp_get_wtick_
Jim Cownie5e8470a2013-09-27 10:38:44 +0000219
220#if OMP_40_ENABLED
Jonathan Peyton50eae7f2016-05-27 15:51:14 +0000221#if KMP_MIC || KMP_OS_DARWIN || defined(KMP_STUB)
Jonathan Peyton30419822017-05-12 18:01:32 +0000222#define FTN_GET_NUM_DEVICES omp_get_num_devices_
Jim Cownie5e8470a2013-09-27 10:38:44 +0000223#endif
Jonathan Peyton30419822017-05-12 18:01:32 +0000224#define FTN_GET_DEFAULT_DEVICE omp_get_default_device_
225#define FTN_SET_DEFAULT_DEVICE omp_set_default_device_
226#define FTN_IS_INITIAL_DEVICE omp_is_initial_device_
Jim Cownie5e8470a2013-09-27 10:38:44 +0000227#endif
228
Jim Cownie181b4bb2013-12-23 17:28:57 +0000229#if OMP_40_ENABLED
Jonathan Peyton30419822017-05-12 18:01:32 +0000230#define FTN_GET_CANCELLATION omp_get_cancellation_
231#define FTN_GET_CANCELLATION_STATUS kmp_get_cancellation_status_
Jim Cownie181b4bb2013-12-23 17:28:57 +0000232#endif
233
Jonathan Peytondf6818b2016-06-14 17:57:47 +0000234#if OMP_45_ENABLED
Jonathan Peyton30419822017-05-12 18:01:32 +0000235#define FTN_GET_MAX_TASK_PRIORITY omp_get_max_task_priority_
236#define FTN_GET_NUM_PLACES omp_get_num_places_
237#define FTN_GET_PLACE_NUM_PROCS omp_get_place_num_procs_
238#define FTN_GET_PLACE_PROC_IDS omp_get_place_proc_ids_
239#define FTN_GET_PLACE_NUM omp_get_place_num_
240#define FTN_GET_PARTITION_NUM_PLACES omp_get_partition_num_places_
241#define FTN_GET_PARTITION_PLACE_NUMS omp_get_partition_place_nums_
242#ifdef KMP_STUB
243#define FTN_GET_INITIAL_DEVICE omp_get_initial_device_
244#define FTN_TARGET_ALLOC omp_target_alloc_
245#define FTN_TARGET_FREE omp_target_free_
246#define FTN_TARGET_IS_PRESENT omp_target_is_present_
247#define FTN_TARGET_MEMCPY omp_target_memcpy_
248#define FTN_TARGET_MEMCPY_RECT omp_target_memcpy_rect_
249#define FTN_TARGET_ASSOCIATE_PTR omp_target_associate_ptr_
250#define FTN_TARGET_DISASSOCIATE_PTR omp_target_disassociate_ptr_
251#endif
Jonathan Peyton28510722016-02-25 18:04:09 +0000252#endif
253
Jim Cownie5e8470a2013-09-27 10:38:44 +0000254#endif /* KMP_FTN_APPEND */
255
256/* ------------------------------------------------------------------------ */
257
258#if KMP_FTN_ENTRIES == KMP_FTN_UPPER
259
Jonathan Peyton30419822017-05-12 18:01:32 +0000260#define FTN_SET_STACKSIZE KMP_SET_STACKSIZE
261#define FTN_SET_STACKSIZE_S KMP_SET_STACKSIZE_S
262#define FTN_GET_STACKSIZE KMP_GET_STACKSIZE
263#define FTN_GET_STACKSIZE_S KMP_GET_STACKSIZE_S
264#define FTN_SET_BLOCKTIME KMP_SET_BLOCKTIME
265#define FTN_GET_BLOCKTIME KMP_GET_BLOCKTIME
266#define FTN_SET_LIBRARY_SERIAL KMP_SET_LIBRARY_SERIAL
267#define FTN_SET_LIBRARY_TURNAROUND KMP_SET_LIBRARY_TURNAROUND
268#define FTN_SET_LIBRARY_THROUGHPUT KMP_SET_LIBRARY_THROUGHPUT
269#define FTN_SET_LIBRARY KMP_SET_LIBRARY
270#define FTN_GET_LIBRARY KMP_GET_LIBRARY
271#define FTN_SET_DEFAULTS KMP_SET_DEFAULTS
272#define FTN_SET_DISP_NUM_BUFFERS KMP_SET_DISP_NUM_BUFFERS
273#define FTN_SET_AFFINITY KMP_SET_AFFINITY
274#define FTN_GET_AFFINITY KMP_GET_AFFINITY
275#define FTN_GET_AFFINITY_MAX_PROC KMP_GET_AFFINITY_MAX_PROC
276#define FTN_CREATE_AFFINITY_MASK KMP_CREATE_AFFINITY_MASK
277#define FTN_DESTROY_AFFINITY_MASK KMP_DESTROY_AFFINITY_MASK
278#define FTN_SET_AFFINITY_MASK_PROC KMP_SET_AFFINITY_MASK_PROC
279#define FTN_UNSET_AFFINITY_MASK_PROC KMP_UNSET_AFFINITY_MASK_PROC
280#define FTN_GET_AFFINITY_MASK_PROC KMP_GET_AFFINITY_MASK_PROC
Jim Cownie5e8470a2013-09-27 10:38:44 +0000281
Jonathan Peyton30419822017-05-12 18:01:32 +0000282#define FTN_MALLOC KMP_MALLOC
283#define FTN_ALIGNED_MALLOC KMP_ALIGNED_MALLOC
284#define FTN_CALLOC KMP_CALLOC
285#define FTN_REALLOC KMP_REALLOC
286#define FTN_FREE KMP_FREE
Jim Cownie5e8470a2013-09-27 10:38:44 +0000287
Jonathan Peyton30419822017-05-12 18:01:32 +0000288#define FTN_GET_NUM_KNOWN_THREADS KMP_GET_NUM_KNOWN_THREADS
Jim Cownie5e8470a2013-09-27 10:38:44 +0000289
Jonathan Peyton30419822017-05-12 18:01:32 +0000290#define FTN_SET_NUM_THREADS OMP_SET_NUM_THREADS
291#define FTN_GET_NUM_THREADS OMP_GET_NUM_THREADS
292#define FTN_GET_MAX_THREADS OMP_GET_MAX_THREADS
293#define FTN_GET_THREAD_NUM OMP_GET_THREAD_NUM
294#define FTN_GET_NUM_PROCS OMP_GET_NUM_PROCS
295#define FTN_SET_DYNAMIC OMP_SET_DYNAMIC
296#define FTN_GET_DYNAMIC OMP_GET_DYNAMIC
297#define FTN_SET_NESTED OMP_SET_NESTED
298#define FTN_GET_NESTED OMP_GET_NESTED
299#define FTN_IN_PARALLEL OMP_IN_PARALLEL
300#define FTN_GET_THREAD_LIMIT OMP_GET_THREAD_LIMIT
301#define FTN_SET_SCHEDULE OMP_SET_SCHEDULE
302#define FTN_GET_SCHEDULE OMP_GET_SCHEDULE
303#define FTN_SET_MAX_ACTIVE_LEVELS OMP_SET_MAX_ACTIVE_LEVELS
304#define FTN_GET_MAX_ACTIVE_LEVELS OMP_GET_MAX_ACTIVE_LEVELS
305#define FTN_GET_ACTIVE_LEVEL OMP_GET_ACTIVE_LEVEL
306#define FTN_GET_LEVEL OMP_GET_LEVEL
307#define FTN_GET_ANCESTOR_THREAD_NUM OMP_GET_ANCESTOR_THREAD_NUM
308#define FTN_GET_TEAM_SIZE OMP_GET_TEAM_SIZE
309#define FTN_IN_FINAL OMP_IN_FINAL
Jim Cownie5e8470a2013-09-27 10:38:44 +0000310// #define FTN_SET_PROC_BIND OMP_SET_PROC_BIND
Jonathan Peyton30419822017-05-12 18:01:32 +0000311#define FTN_GET_PROC_BIND OMP_GET_PROC_BIND
Jim Cownie5e8470a2013-09-27 10:38:44 +0000312// #define FTN_CURR_PROC_BIND OMP_CURR_PROC_BIND
313#if OMP_40_ENABLED
Jonathan Peyton30419822017-05-12 18:01:32 +0000314#define FTN_GET_NUM_TEAMS OMP_GET_NUM_TEAMS
315#define FTN_GET_TEAM_NUM OMP_GET_TEAM_NUM
Jim Cownie5e8470a2013-09-27 10:38:44 +0000316#endif
Jonathan Peyton30419822017-05-12 18:01:32 +0000317#define FTN_INIT_LOCK OMP_INIT_LOCK
Andrey Churbanov5c56fb52015-02-20 18:05:17 +0000318#if KMP_USE_DYNAMIC_LOCK
Jonathan Peyton30419822017-05-12 18:01:32 +0000319#define FTN_INIT_LOCK_WITH_HINT OMP_INIT_LOCK_WITH_HINT
320#define FTN_INIT_NEST_LOCK_WITH_HINT OMP_INIT_NEST_LOCK_WITH_HINT
Andrey Churbanov5c56fb52015-02-20 18:05:17 +0000321#endif
Jonathan Peyton30419822017-05-12 18:01:32 +0000322#define FTN_DESTROY_LOCK OMP_DESTROY_LOCK
323#define FTN_SET_LOCK OMP_SET_LOCK
324#define FTN_UNSET_LOCK OMP_UNSET_LOCK
325#define FTN_TEST_LOCK OMP_TEST_LOCK
326#define FTN_INIT_NEST_LOCK OMP_INIT_NEST_LOCK
327#define FTN_DESTROY_NEST_LOCK OMP_DESTROY_NEST_LOCK
328#define FTN_SET_NEST_LOCK OMP_SET_NEST_LOCK
329#define FTN_UNSET_NEST_LOCK OMP_UNSET_NEST_LOCK
330#define FTN_TEST_NEST_LOCK OMP_TEST_NEST_LOCK
Jim Cownie5e8470a2013-09-27 10:38:44 +0000331
Jonathan Peyton30419822017-05-12 18:01:32 +0000332#define FTN_SET_WARNINGS_ON KMP_SET_WARNINGS_ON
333#define FTN_SET_WARNINGS_OFF KMP_SET_WARNINGS_OFF
Jim Cownie5e8470a2013-09-27 10:38:44 +0000334
Jonathan Peyton30419822017-05-12 18:01:32 +0000335#define FTN_GET_WTIME OMP_GET_WTIME
336#define FTN_GET_WTICK OMP_GET_WTICK
Jim Cownie5e8470a2013-09-27 10:38:44 +0000337
338#if OMP_40_ENABLED
Jonathan Peyton50eae7f2016-05-27 15:51:14 +0000339#if KMP_MIC || KMP_OS_DARWIN || defined(KMP_STUB)
Jonathan Peyton30419822017-05-12 18:01:32 +0000340#define FTN_GET_NUM_DEVICES OMP_GET_NUM_DEVICES
Jim Cownie5e8470a2013-09-27 10:38:44 +0000341#endif
Jonathan Peyton30419822017-05-12 18:01:32 +0000342#define FTN_GET_DEFAULT_DEVICE OMP_GET_DEFAULT_DEVICE
343#define FTN_SET_DEFAULT_DEVICE OMP_SET_DEFAULT_DEVICE
344#define FTN_IS_INITIAL_DEVICE OMP_IS_INITIAL_DEVICE
Jim Cownie5e8470a2013-09-27 10:38:44 +0000345#endif
346
Jim Cownie181b4bb2013-12-23 17:28:57 +0000347#if OMP_40_ENABLED
Jonathan Peyton30419822017-05-12 18:01:32 +0000348#define FTN_GET_CANCELLATION OMP_GET_CANCELLATION
349#define FTN_GET_CANCELLATION_STATUS KMP_GET_CANCELLATION_STATUS
Jim Cownie181b4bb2013-12-23 17:28:57 +0000350#endif
351
Jonathan Peytondf6818b2016-06-14 17:57:47 +0000352#if OMP_45_ENABLED
Jonathan Peyton30419822017-05-12 18:01:32 +0000353#define FTN_GET_MAX_TASK_PRIORITY OMP_GET_MAX_TASK_PRIORITY
354#define FTN_GET_NUM_PLACES OMP_GET_NUM_PLACES
355#define FTN_GET_PLACE_NUM_PROCS OMP_GET_PLACE_NUM_PROCS
356#define FTN_GET_PLACE_PROC_IDS OMP_GET_PLACE_PROC_IDS
357#define FTN_GET_PLACE_NUM OMP_GET_PLACE_NUM
358#define FTN_GET_PARTITION_NUM_PLACES OMP_GET_PARTITION_NUM_PLACES
359#define FTN_GET_PARTITION_PLACE_NUMS OMP_GET_PARTITION_PLACE_NUMS
360#ifdef KMP_STUB
361#define FTN_GET_INITIAL_DEVICE OMP_GET_INITIAL_DEVICE
362#define FTN_TARGET_ALLOC OMP_TARGET_ALLOC
363#define FTN_TARGET_FREE OMP_TARGET_FREE
364#define FTN_TARGET_IS_PRESENT OMP_TARGET_IS_PRESENT
365#define FTN_TARGET_MEMCPY OMP_TARGET_MEMCPY
366#define FTN_TARGET_MEMCPY_RECT OMP_TARGET_MEMCPY_RECT
367#define FTN_TARGET_ASSOCIATE_PTR OMP_TARGET_ASSOCIATE_PTR
368#define FTN_TARGET_DISASSOCIATE_PTR OMP_TARGET_DISASSOCIATE_PTR
369#endif
Jonathan Peyton28510722016-02-25 18:04:09 +0000370#endif
371
Jim Cownie5e8470a2013-09-27 10:38:44 +0000372#endif /* KMP_FTN_UPPER */
373
374/* ------------------------------------------------------------------------ */
375
376#if KMP_FTN_ENTRIES == KMP_FTN_UAPPEND
377
Jonathan Peyton30419822017-05-12 18:01:32 +0000378#define FTN_SET_STACKSIZE KMP_SET_STACKSIZE_
379#define FTN_SET_STACKSIZE_S KMP_SET_STACKSIZE_S_
380#define FTN_GET_STACKSIZE KMP_GET_STACKSIZE_
381#define FTN_GET_STACKSIZE_S KMP_GET_STACKSIZE_S_
382#define FTN_SET_BLOCKTIME KMP_SET_BLOCKTIME_
383#define FTN_GET_BLOCKTIME KMP_GET_BLOCKTIME_
384#define FTN_SET_LIBRARY_SERIAL KMP_SET_LIBRARY_SERIAL_
385#define FTN_SET_LIBRARY_TURNAROUND KMP_SET_LIBRARY_TURNAROUND_
386#define FTN_SET_LIBRARY_THROUGHPUT KMP_SET_LIBRARY_THROUGHPUT_
387#define FTN_SET_LIBRARY KMP_SET_LIBRARY_
388#define FTN_GET_LIBRARY KMP_GET_LIBRARY_
389#define FTN_SET_DEFAULTS KMP_SET_DEFAULTS_
390#define FTN_SET_DISP_NUM_BUFFERS KMP_SET_DISP_NUM_BUFFERS_
391#define FTN_SET_AFFINITY KMP_SET_AFFINITY_
392#define FTN_GET_AFFINITY KMP_GET_AFFINITY_
393#define FTN_GET_AFFINITY_MAX_PROC KMP_GET_AFFINITY_MAX_PROC_
394#define FTN_CREATE_AFFINITY_MASK KMP_CREATE_AFFINITY_MASK_
395#define FTN_DESTROY_AFFINITY_MASK KMP_DESTROY_AFFINITY_MASK_
396#define FTN_SET_AFFINITY_MASK_PROC KMP_SET_AFFINITY_MASK_PROC_
397#define FTN_UNSET_AFFINITY_MASK_PROC KMP_UNSET_AFFINITY_MASK_PROC_
398#define FTN_GET_AFFINITY_MASK_PROC KMP_GET_AFFINITY_MASK_PROC_
Jim Cownie5e8470a2013-09-27 10:38:44 +0000399
Jonathan Peyton30419822017-05-12 18:01:32 +0000400#define FTN_MALLOC KMP_MALLOC_
401#define FTN_ALIGNED_MALLOC KMP_ALIGNED_MALLOC_
402#define FTN_CALLOC KMP_CALLOC_
403#define FTN_REALLOC KMP_REALLOC_
404#define FTN_FREE KMP_FREE_
Jim Cownie5e8470a2013-09-27 10:38:44 +0000405
Jonathan Peyton30419822017-05-12 18:01:32 +0000406#define FTN_GET_NUM_KNOWN_THREADS KMP_GET_NUM_KNOWN_THREADS_
Jim Cownie5e8470a2013-09-27 10:38:44 +0000407
Jonathan Peyton30419822017-05-12 18:01:32 +0000408#define FTN_SET_NUM_THREADS OMP_SET_NUM_THREADS_
409#define FTN_GET_NUM_THREADS OMP_GET_NUM_THREADS_
410#define FTN_GET_MAX_THREADS OMP_GET_MAX_THREADS_
411#define FTN_GET_THREAD_NUM OMP_GET_THREAD_NUM_
412#define FTN_GET_NUM_PROCS OMP_GET_NUM_PROCS_
413#define FTN_SET_DYNAMIC OMP_SET_DYNAMIC_
414#define FTN_GET_DYNAMIC OMP_GET_DYNAMIC_
415#define FTN_SET_NESTED OMP_SET_NESTED_
416#define FTN_GET_NESTED OMP_GET_NESTED_
417#define FTN_IN_PARALLEL OMP_IN_PARALLEL_
418#define FTN_GET_THREAD_LIMIT OMP_GET_THREAD_LIMIT_
419#define FTN_SET_SCHEDULE OMP_SET_SCHEDULE_
420#define FTN_GET_SCHEDULE OMP_GET_SCHEDULE_
421#define FTN_SET_MAX_ACTIVE_LEVELS OMP_SET_MAX_ACTIVE_LEVELS_
422#define FTN_GET_MAX_ACTIVE_LEVELS OMP_GET_MAX_ACTIVE_LEVELS_
423#define FTN_GET_ACTIVE_LEVEL OMP_GET_ACTIVE_LEVEL_
424#define FTN_GET_LEVEL OMP_GET_LEVEL_
425#define FTN_GET_ANCESTOR_THREAD_NUM OMP_GET_ANCESTOR_THREAD_NUM_
426#define FTN_GET_TEAM_SIZE OMP_GET_TEAM_SIZE_
427#define FTN_IN_FINAL OMP_IN_FINAL_
Jim Cownie5e8470a2013-09-27 10:38:44 +0000428// #define FTN_SET_PROC_BIND OMP_SET_PROC_BIND_
Jonathan Peyton30419822017-05-12 18:01:32 +0000429#define FTN_GET_PROC_BIND OMP_GET_PROC_BIND_
Jim Cownie5e8470a2013-09-27 10:38:44 +0000430// #define FTN_CURR_PROC_BIND OMP_CURR_PROC_BIND_
431#if OMP_40_ENABLED
Jonathan Peyton30419822017-05-12 18:01:32 +0000432#define FTN_GET_NUM_TEAMS OMP_GET_NUM_TEAMS_
433#define FTN_GET_TEAM_NUM OMP_GET_TEAM_NUM_
Jim Cownie5e8470a2013-09-27 10:38:44 +0000434#endif
Jonathan Peyton30419822017-05-12 18:01:32 +0000435#define FTN_INIT_LOCK OMP_INIT_LOCK_
Andrey Churbanov5c56fb52015-02-20 18:05:17 +0000436#if KMP_USE_DYNAMIC_LOCK
Jonathan Peyton30419822017-05-12 18:01:32 +0000437#define FTN_INIT_LOCK_WITH_HINT OMP_INIT_LOCK_WITH_HINT_
438#define FTN_INIT_NEST_LOCK_WITH_HINT OMP_INIT_NEST_LOCK_WITH_HINT_
Andrey Churbanov5c56fb52015-02-20 18:05:17 +0000439#endif
Jonathan Peyton30419822017-05-12 18:01:32 +0000440#define FTN_DESTROY_LOCK OMP_DESTROY_LOCK_
441#define FTN_SET_LOCK OMP_SET_LOCK_
442#define FTN_UNSET_LOCK OMP_UNSET_LOCK_
443#define FTN_TEST_LOCK OMP_TEST_LOCK_
444#define FTN_INIT_NEST_LOCK OMP_INIT_NEST_LOCK_
445#define FTN_DESTROY_NEST_LOCK OMP_DESTROY_NEST_LOCK_
446#define FTN_SET_NEST_LOCK OMP_SET_NEST_LOCK_
447#define FTN_UNSET_NEST_LOCK OMP_UNSET_NEST_LOCK_
448#define FTN_TEST_NEST_LOCK OMP_TEST_NEST_LOCK_
Jim Cownie5e8470a2013-09-27 10:38:44 +0000449
Jonathan Peyton30419822017-05-12 18:01:32 +0000450#define FTN_SET_WARNINGS_ON KMP_SET_WARNINGS_ON_
451#define FTN_SET_WARNINGS_OFF KMP_SET_WARNINGS_OFF_
Jim Cownie5e8470a2013-09-27 10:38:44 +0000452
Jonathan Peyton30419822017-05-12 18:01:32 +0000453#define FTN_GET_WTIME OMP_GET_WTIME_
454#define FTN_GET_WTICK OMP_GET_WTICK_
Jim Cownie5e8470a2013-09-27 10:38:44 +0000455
456#if OMP_40_ENABLED
Jonathan Peyton50eae7f2016-05-27 15:51:14 +0000457#if KMP_MIC || KMP_OS_DARWIN || defined(KMP_STUB)
Jonathan Peyton30419822017-05-12 18:01:32 +0000458#define FTN_GET_NUM_DEVICES OMP_GET_NUM_DEVICES_
Jim Cownie5e8470a2013-09-27 10:38:44 +0000459#endif
Jonathan Peyton30419822017-05-12 18:01:32 +0000460#define FTN_GET_DEFAULT_DEVICE OMP_GET_DEFAULT_DEVICE_
461#define FTN_SET_DEFAULT_DEVICE OMP_SET_DEFAULT_DEVICE_
462#define FTN_IS_INITIAL_DEVICE OMP_IS_INITIAL_DEVICE_
Jim Cownie5e8470a2013-09-27 10:38:44 +0000463#endif
464
Jim Cownie181b4bb2013-12-23 17:28:57 +0000465#if OMP_40_ENABLED
Jonathan Peyton30419822017-05-12 18:01:32 +0000466#define FTN_GET_CANCELLATION OMP_GET_CANCELLATION_
467#define FTN_GET_CANCELLATION_STATUS KMP_GET_CANCELLATION_STATUS_
Jim Cownie181b4bb2013-12-23 17:28:57 +0000468#endif
469
Jonathan Peytondf6818b2016-06-14 17:57:47 +0000470#if OMP_45_ENABLED
Jonathan Peyton30419822017-05-12 18:01:32 +0000471#define FTN_GET_MAX_TASK_PRIORITY OMP_GET_MAX_TASK_PRIORITY_
472#define FTN_GET_NUM_PLACES OMP_GET_NUM_PLACES_
473#define FTN_GET_PLACE_NUM_PROCS OMP_GET_PLACE_NUM_PROCS_
474#define FTN_GET_PLACE_PROC_IDS OMP_GET_PLACE_PROC_IDS_
475#define FTN_GET_PLACE_NUM OMP_GET_PLACE_NUM_
476#define FTN_GET_PARTITION_NUM_PLACES OMP_GET_PARTITION_NUM_PLACES_
477#define FTN_GET_PARTITION_PLACE_NUMS OMP_GET_PARTITION_PLACE_NUMS_
478#ifdef KMP_STUB
479#define FTN_GET_INITIAL_DEVICE OMP_GET_INITIAL_DEVICE_
480#define FTN_TARGET_ALLOC OMP_TARGET_ALLOC_
481#define FTN_TARGET_FREE OMP_TARGET_FREE_
482#define FTN_TARGET_IS_PRESENT OMP_TARGET_IS_PRESENT_
483#define FTN_TARGET_MEMCPY OMP_TARGET_MEMCPY_
484#define FTN_TARGET_MEMCPY_RECT OMP_TARGET_MEMCPY_RECT_
485#define FTN_TARGET_ASSOCIATE_PTR OMP_TARGET_ASSOCIATE_PTR_
486#define FTN_TARGET_DISASSOCIATE_PTR OMP_TARGET_DISASSOCIATE_PTR_
487#endif
Jonathan Peyton28510722016-02-25 18:04:09 +0000488#endif
489
Jim Cownie5e8470a2013-09-27 10:38:44 +0000490#endif /* KMP_FTN_UAPPEND */
491
Jim Cownie181b4bb2013-12-23 17:28:57 +0000492/* -------------------------- GOMP API NAMES ------------------------ */
493// All GOMP_1.0 symbols
Jonathan Peyton30419822017-05-12 18:01:32 +0000494#define KMP_API_NAME_GOMP_ATOMIC_END GOMP_atomic_end
495#define KMP_API_NAME_GOMP_ATOMIC_START GOMP_atomic_start
496#define KMP_API_NAME_GOMP_BARRIER GOMP_barrier
497#define KMP_API_NAME_GOMP_CRITICAL_END GOMP_critical_end
498#define KMP_API_NAME_GOMP_CRITICAL_NAME_END GOMP_critical_name_end
499#define KMP_API_NAME_GOMP_CRITICAL_NAME_START GOMP_critical_name_start
500#define KMP_API_NAME_GOMP_CRITICAL_START GOMP_critical_start
501#define KMP_API_NAME_GOMP_LOOP_DYNAMIC_NEXT GOMP_loop_dynamic_next
502#define KMP_API_NAME_GOMP_LOOP_DYNAMIC_START GOMP_loop_dynamic_start
503#define KMP_API_NAME_GOMP_LOOP_END GOMP_loop_end
504#define KMP_API_NAME_GOMP_LOOP_END_NOWAIT GOMP_loop_end_nowait
505#define KMP_API_NAME_GOMP_LOOP_GUIDED_NEXT GOMP_loop_guided_next
506#define KMP_API_NAME_GOMP_LOOP_GUIDED_START GOMP_loop_guided_start
507#define KMP_API_NAME_GOMP_LOOP_ORDERED_DYNAMIC_NEXT \
508 GOMP_loop_ordered_dynamic_next
509#define KMP_API_NAME_GOMP_LOOP_ORDERED_DYNAMIC_START \
510 GOMP_loop_ordered_dynamic_start
511#define KMP_API_NAME_GOMP_LOOP_ORDERED_GUIDED_NEXT GOMP_loop_ordered_guided_next
512#define KMP_API_NAME_GOMP_LOOP_ORDERED_GUIDED_START \
513 GOMP_loop_ordered_guided_start
514#define KMP_API_NAME_GOMP_LOOP_ORDERED_RUNTIME_NEXT \
515 GOMP_loop_ordered_runtime_next
516#define KMP_API_NAME_GOMP_LOOP_ORDERED_RUNTIME_START \
517 GOMP_loop_ordered_runtime_start
518#define KMP_API_NAME_GOMP_LOOP_ORDERED_STATIC_NEXT GOMP_loop_ordered_static_next
519#define KMP_API_NAME_GOMP_LOOP_ORDERED_STATIC_START \
520 GOMP_loop_ordered_static_start
521#define KMP_API_NAME_GOMP_LOOP_RUNTIME_NEXT GOMP_loop_runtime_next
522#define KMP_API_NAME_GOMP_LOOP_RUNTIME_START GOMP_loop_runtime_start
523#define KMP_API_NAME_GOMP_LOOP_STATIC_NEXT GOMP_loop_static_next
524#define KMP_API_NAME_GOMP_LOOP_STATIC_START GOMP_loop_static_start
525#define KMP_API_NAME_GOMP_ORDERED_END GOMP_ordered_end
526#define KMP_API_NAME_GOMP_ORDERED_START GOMP_ordered_start
527#define KMP_API_NAME_GOMP_PARALLEL_END GOMP_parallel_end
528#define KMP_API_NAME_GOMP_PARALLEL_LOOP_DYNAMIC_START \
529 GOMP_parallel_loop_dynamic_start
530#define KMP_API_NAME_GOMP_PARALLEL_LOOP_GUIDED_START \
531 GOMP_parallel_loop_guided_start
532#define KMP_API_NAME_GOMP_PARALLEL_LOOP_RUNTIME_START \
533 GOMP_parallel_loop_runtime_start
534#define KMP_API_NAME_GOMP_PARALLEL_LOOP_STATIC_START \
535 GOMP_parallel_loop_static_start
536#define KMP_API_NAME_GOMP_PARALLEL_SECTIONS_START GOMP_parallel_sections_start
537#define KMP_API_NAME_GOMP_PARALLEL_START GOMP_parallel_start
538#define KMP_API_NAME_GOMP_SECTIONS_END GOMP_sections_end
539#define KMP_API_NAME_GOMP_SECTIONS_END_NOWAIT GOMP_sections_end_nowait
540#define KMP_API_NAME_GOMP_SECTIONS_NEXT GOMP_sections_next
541#define KMP_API_NAME_GOMP_SECTIONS_START GOMP_sections_start
542#define KMP_API_NAME_GOMP_SINGLE_COPY_END GOMP_single_copy_end
543#define KMP_API_NAME_GOMP_SINGLE_COPY_START GOMP_single_copy_start
544#define KMP_API_NAME_GOMP_SINGLE_START GOMP_single_start
Jim Cownie181b4bb2013-12-23 17:28:57 +0000545
546// All GOMP_2.0 symbols
Jonathan Peyton30419822017-05-12 18:01:32 +0000547#define KMP_API_NAME_GOMP_TASK GOMP_task
548#define KMP_API_NAME_GOMP_TASKWAIT GOMP_taskwait
549#define KMP_API_NAME_GOMP_LOOP_ULL_DYNAMIC_NEXT GOMP_loop_ull_dynamic_next
550#define KMP_API_NAME_GOMP_LOOP_ULL_DYNAMIC_START GOMP_loop_ull_dynamic_start
551#define KMP_API_NAME_GOMP_LOOP_ULL_GUIDED_NEXT GOMP_loop_ull_guided_next
552#define KMP_API_NAME_GOMP_LOOP_ULL_GUIDED_START GOMP_loop_ull_guided_start
553#define KMP_API_NAME_GOMP_LOOP_ULL_ORDERED_DYNAMIC_NEXT \
554 GOMP_loop_ull_ordered_dynamic_next
555#define KMP_API_NAME_GOMP_LOOP_ULL_ORDERED_DYNAMIC_START \
556 GOMP_loop_ull_ordered_dynamic_start
557#define KMP_API_NAME_GOMP_LOOP_ULL_ORDERED_GUIDED_NEXT \
558 GOMP_loop_ull_ordered_guided_next
559#define KMP_API_NAME_GOMP_LOOP_ULL_ORDERED_GUIDED_START \
560 GOMP_loop_ull_ordered_guided_start
561#define KMP_API_NAME_GOMP_LOOP_ULL_ORDERED_RUNTIME_NEXT \
562 GOMP_loop_ull_ordered_runtime_next
563#define KMP_API_NAME_GOMP_LOOP_ULL_ORDERED_RUNTIME_START \
564 GOMP_loop_ull_ordered_runtime_start
565#define KMP_API_NAME_GOMP_LOOP_ULL_ORDERED_STATIC_NEXT \
566 GOMP_loop_ull_ordered_static_next
567#define KMP_API_NAME_GOMP_LOOP_ULL_ORDERED_STATIC_START \
568 GOMP_loop_ull_ordered_static_start
569#define KMP_API_NAME_GOMP_LOOP_ULL_RUNTIME_NEXT GOMP_loop_ull_runtime_next
570#define KMP_API_NAME_GOMP_LOOP_ULL_RUNTIME_START GOMP_loop_ull_runtime_start
571#define KMP_API_NAME_GOMP_LOOP_ULL_STATIC_NEXT GOMP_loop_ull_static_next
572#define KMP_API_NAME_GOMP_LOOP_ULL_STATIC_START GOMP_loop_ull_static_start
Jim Cownie181b4bb2013-12-23 17:28:57 +0000573
574// All GOMP_3.0 symbols
Jonathan Peyton30419822017-05-12 18:01:32 +0000575#define KMP_API_NAME_GOMP_TASKYIELD GOMP_taskyield
Jim Cownie181b4bb2013-12-23 17:28:57 +0000576
Jonathan Peyton61118492016-05-20 19:03:38 +0000577// All GOMP_4.0 symbols
Jonathan Peyton30419822017-05-12 18:01:32 +0000578// TODO: As of 2013-10-14, none of the GOMP_4.0 functions are implemented in
579// libomp
580#define KMP_API_NAME_GOMP_BARRIER_CANCEL GOMP_barrier_cancel
581#define KMP_API_NAME_GOMP_CANCEL GOMP_cancel
582#define KMP_API_NAME_GOMP_CANCELLATION_POINT GOMP_cancellation_point
583#define KMP_API_NAME_GOMP_LOOP_END_CANCEL GOMP_loop_end_cancel
584#define KMP_API_NAME_GOMP_PARALLEL_LOOP_DYNAMIC GOMP_parallel_loop_dynamic
585#define KMP_API_NAME_GOMP_PARALLEL_LOOP_GUIDED GOMP_parallel_loop_guided
586#define KMP_API_NAME_GOMP_PARALLEL_LOOP_RUNTIME GOMP_parallel_loop_runtime
587#define KMP_API_NAME_GOMP_PARALLEL_LOOP_STATIC GOMP_parallel_loop_static
588#define KMP_API_NAME_GOMP_PARALLEL_SECTIONS GOMP_parallel_sections
589#define KMP_API_NAME_GOMP_PARALLEL GOMP_parallel
590#define KMP_API_NAME_GOMP_SECTIONS_END_CANCEL GOMP_sections_end_cancel
591#define KMP_API_NAME_GOMP_TASKGROUP_START GOMP_taskgroup_start
592#define KMP_API_NAME_GOMP_TASKGROUP_END GOMP_taskgroup_end
Jim Cownie181b4bb2013-12-23 17:28:57 +0000593/* Target functions should be taken care of by liboffload */
Jonathan Peyton30419822017-05-12 18:01:32 +0000594#define KMP_API_NAME_GOMP_TARGET GOMP_target
595#define KMP_API_NAME_GOMP_TARGET_DATA GOMP_target_data
596#define KMP_API_NAME_GOMP_TARGET_END_DATA GOMP_target_end_data
597#define KMP_API_NAME_GOMP_TARGET_UPDATE GOMP_target_update
598#define KMP_API_NAME_GOMP_TEAMS GOMP_teams
Jim Cownie181b4bb2013-12-23 17:28:57 +0000599
Jim Cownie4cc4bb42014-10-07 16:25:50 +0000600#ifdef KMP_USE_VERSION_SYMBOLS
Jonathan Peyton30419822017-05-12 18:01:32 +0000601#define xstr(x) str(x)
602#define str(x) #x
Jim Cownie181b4bb2013-12-23 17:28:57 +0000603
Jonathan Peyton30419822017-05-12 18:01:32 +0000604// If Linux, xexpand prepends __kmp_api_ to the real API name
605#define xexpand(api_name) expand(api_name)
606#define expand(api_name) __kmp_api_##api_name
Jim Cownie181b4bb2013-12-23 17:28:57 +0000607
Jonathan Peyton30419822017-05-12 18:01:32 +0000608#define xaliasify(api_name, ver) aliasify(api_name, ver)
609#define aliasify(api_name, ver) \
610 __typeof__(__kmp_api_##api_name) __kmp_api_##api_name##_##ver##_alias \
611 __attribute__((alias(xstr(__kmp_api_##api_name))))
Jim Cownie181b4bb2013-12-23 17:28:57 +0000612
Jonathan Peyton30419822017-05-12 18:01:32 +0000613#define xversionify(api_name, version_num, version_str) \
614 versionify(api_name, version_num, version_str, "VERSION")
615#define versionify(api_name, version_num, version_str, default_ver) \
616 __asm__( \
617 ".symver " xstr(__kmp_api_##api_name##_##version_num##_alias) "," xstr( \
618 api_name) "@" version_str "\n\t"); \
619 __asm__(".symver " xstr(__kmp_api_##api_name) "," xstr( \
620 api_name) "@@" default_ver "\n\t")
Jim Cownie181b4bb2013-12-23 17:28:57 +0000621
Jim Cownie4cc4bb42014-10-07 16:25:50 +0000622#else // KMP_USE_VERSION_SYMBOLS
Jonathan Peyton30419822017-05-12 18:01:32 +0000623#define xstr(x) /* Nothing */
624#define str(x) /* Nothing */
Jim Cownie181b4bb2013-12-23 17:28:57 +0000625
Jonathan Peyton30419822017-05-12 18:01:32 +0000626// if Windows or Mac, xexpand does no name transformation
627#define xexpand(api_name) expand(api_name)
628#define expand(api_name) api_name
Jim Cownie181b4bb2013-12-23 17:28:57 +0000629
Jonathan Peyton30419822017-05-12 18:01:32 +0000630#define xaliasify(api_name, ver) /* Nothing */
631#define aliasify(api_name, ver) /* Nothing */
Jim Cownie181b4bb2013-12-23 17:28:57 +0000632
Jonathan Peyton30419822017-05-12 18:01:32 +0000633#define xversionify(api_name, version_num, version_str) /* Nothing */
634#define versionify(api_name, version_num, version_str, \
635 default_ver) /* Nothing */
Jim Cownie181b4bb2013-12-23 17:28:57 +0000636
Jim Cownie4cc4bb42014-10-07 16:25:50 +0000637#endif // KMP_USE_VERSION_SYMBOLS
Jim Cownie181b4bb2013-12-23 17:28:57 +0000638
Jim Cownie5e8470a2013-09-27 10:38:44 +0000639#endif /* KMP_FTN_OS_H */