blob: a204b2fd1fbbb0b913ef9d411f866570e9423d77 [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
5
6//===----------------------------------------------------------------------===//
7//
8// The LLVM Compiler Infrastructure
9//
10// This file is dual licensed under the MIT and the University of Illinois Open
11// Source Licenses. See LICENSE.txt for details.
12//
13//===----------------------------------------------------------------------===//
14
15
16#ifndef KMP_FTN_OS_H
17#define KMP_FTN_OS_H
18
Jonathan Peyton30419822017-05-12 18:01:32 +000019// KMP_FNT_ENTRIES may be one of: KMP_FTN_PLAIN, KMP_FTN_UPPER, KMP_FTN_APPEND,
20// KMP_FTN_UAPPEND.
Jim Cownie5e8470a2013-09-27 10:38:44 +000021
22/* -------------------------- External definitions ------------------------ */
23
24#if KMP_FTN_ENTRIES == KMP_FTN_PLAIN
25
Jonathan Peyton30419822017-05-12 18:01:32 +000026#define FTN_SET_STACKSIZE kmp_set_stacksize
27#define FTN_SET_STACKSIZE_S kmp_set_stacksize_s
28#define FTN_GET_STACKSIZE kmp_get_stacksize
29#define FTN_GET_STACKSIZE_S kmp_get_stacksize_s
30#define FTN_SET_BLOCKTIME kmp_set_blocktime
31#define FTN_GET_BLOCKTIME kmp_get_blocktime
32#define FTN_SET_LIBRARY_SERIAL kmp_set_library_serial
33#define FTN_SET_LIBRARY_TURNAROUND kmp_set_library_turnaround
34#define FTN_SET_LIBRARY_THROUGHPUT kmp_set_library_throughput
35#define FTN_SET_LIBRARY kmp_set_library
36#define FTN_GET_LIBRARY kmp_get_library
37#define FTN_SET_DEFAULTS kmp_set_defaults
38#define FTN_SET_DISP_NUM_BUFFERS kmp_set_disp_num_buffers
39#define FTN_SET_AFFINITY kmp_set_affinity
40#define FTN_GET_AFFINITY kmp_get_affinity
41#define FTN_GET_AFFINITY_MAX_PROC kmp_get_affinity_max_proc
42#define FTN_CREATE_AFFINITY_MASK kmp_create_affinity_mask
43#define FTN_DESTROY_AFFINITY_MASK kmp_destroy_affinity_mask
44#define FTN_SET_AFFINITY_MASK_PROC kmp_set_affinity_mask_proc
45#define FTN_UNSET_AFFINITY_MASK_PROC kmp_unset_affinity_mask_proc
46#define FTN_GET_AFFINITY_MASK_PROC kmp_get_affinity_mask_proc
Jim Cownie5e8470a2013-09-27 10:38:44 +000047
Jonathan Peyton30419822017-05-12 18:01:32 +000048#define FTN_MALLOC kmp_malloc
49#define FTN_ALIGNED_MALLOC kmp_aligned_malloc
50#define FTN_CALLOC kmp_calloc
51#define FTN_REALLOC kmp_realloc
52#define FTN_FREE kmp_free
Jim Cownie5e8470a2013-09-27 10:38:44 +000053
Jonathan Peyton30419822017-05-12 18:01:32 +000054#define FTN_GET_NUM_KNOWN_THREADS kmp_get_num_known_threads
Jim Cownie5e8470a2013-09-27 10:38:44 +000055
Jonathan Peyton30419822017-05-12 18:01:32 +000056#define FTN_SET_NUM_THREADS omp_set_num_threads
57#define FTN_GET_NUM_THREADS omp_get_num_threads
58#define FTN_GET_MAX_THREADS omp_get_max_threads
59#define FTN_GET_THREAD_NUM omp_get_thread_num
60#define FTN_GET_NUM_PROCS omp_get_num_procs
61#define FTN_SET_DYNAMIC omp_set_dynamic
62#define FTN_GET_DYNAMIC omp_get_dynamic
63#define FTN_SET_NESTED omp_set_nested
64#define FTN_GET_NESTED omp_get_nested
65#define FTN_IN_PARALLEL omp_in_parallel
66#define FTN_GET_THREAD_LIMIT omp_get_thread_limit
67#define FTN_SET_SCHEDULE omp_set_schedule
68#define FTN_GET_SCHEDULE omp_get_schedule
69#define FTN_SET_MAX_ACTIVE_LEVELS omp_set_max_active_levels
70#define FTN_GET_MAX_ACTIVE_LEVELS omp_get_max_active_levels
71#define FTN_GET_ACTIVE_LEVEL omp_get_active_level
72#define FTN_GET_LEVEL omp_get_level
73#define FTN_GET_ANCESTOR_THREAD_NUM omp_get_ancestor_thread_num
74#define FTN_GET_TEAM_SIZE omp_get_team_size
75#define FTN_IN_FINAL omp_in_final
Jim Cownie5e8470a2013-09-27 10:38:44 +000076// #define FTN_SET_PROC_BIND omp_set_proc_bind
Jonathan Peyton30419822017-05-12 18:01:32 +000077#define FTN_GET_PROC_BIND omp_get_proc_bind
Jim Cownie5e8470a2013-09-27 10:38:44 +000078// #define FTN_CURR_PROC_BIND omp_curr_proc_bind
79#if OMP_40_ENABLED
Jonathan Peyton30419822017-05-12 18:01:32 +000080#define FTN_GET_NUM_TEAMS omp_get_num_teams
81#define FTN_GET_TEAM_NUM omp_get_team_num
Jim Cownie5e8470a2013-09-27 10:38:44 +000082#endif
Jonathan Peyton30419822017-05-12 18:01:32 +000083#define FTN_INIT_LOCK omp_init_lock
Andrey Churbanov5c56fb52015-02-20 18:05:17 +000084#if KMP_USE_DYNAMIC_LOCK
Jonathan Peyton30419822017-05-12 18:01:32 +000085#define FTN_INIT_LOCK_WITH_HINT omp_init_lock_with_hint
86#define FTN_INIT_NEST_LOCK_WITH_HINT omp_init_nest_lock_with_hint
Andrey Churbanov5c56fb52015-02-20 18:05:17 +000087#endif
Jonathan Peyton30419822017-05-12 18:01:32 +000088#define FTN_DESTROY_LOCK omp_destroy_lock
89#define FTN_SET_LOCK omp_set_lock
90#define FTN_UNSET_LOCK omp_unset_lock
91#define FTN_TEST_LOCK omp_test_lock
92#define FTN_INIT_NEST_LOCK omp_init_nest_lock
93#define FTN_DESTROY_NEST_LOCK omp_destroy_nest_lock
94#define FTN_SET_NEST_LOCK omp_set_nest_lock
95#define FTN_UNSET_NEST_LOCK omp_unset_nest_lock
96#define FTN_TEST_NEST_LOCK omp_test_nest_lock
Jim Cownie5e8470a2013-09-27 10:38:44 +000097
Jonathan Peyton30419822017-05-12 18:01:32 +000098#define FTN_SET_WARNINGS_ON kmp_set_warnings_on
99#define FTN_SET_WARNINGS_OFF kmp_set_warnings_off
Jim Cownie5e8470a2013-09-27 10:38:44 +0000100
Jonathan Peyton30419822017-05-12 18:01:32 +0000101#define FTN_GET_WTIME omp_get_wtime
102#define FTN_GET_WTICK omp_get_wtick
Jim Cownie5e8470a2013-09-27 10:38:44 +0000103
104#if OMP_40_ENABLED
Jonathan Peyton50eae7f2016-05-27 15:51:14 +0000105#if KMP_MIC || KMP_OS_DARWIN || defined(KMP_STUB)
Jonathan Peyton30419822017-05-12 18:01:32 +0000106#define FTN_GET_NUM_DEVICES omp_get_num_devices
Jim Cownie5e8470a2013-09-27 10:38:44 +0000107#endif
Jonathan Peyton30419822017-05-12 18:01:32 +0000108#define FTN_GET_DEFAULT_DEVICE omp_get_default_device
109#define FTN_SET_DEFAULT_DEVICE omp_set_default_device
110#define FTN_IS_INITIAL_DEVICE omp_is_initial_device
Jim Cownie5e8470a2013-09-27 10:38:44 +0000111#endif
112
Jim Cownie181b4bb2013-12-23 17:28:57 +0000113#if OMP_40_ENABLED
Jonathan Peyton30419822017-05-12 18:01:32 +0000114#define FTN_GET_CANCELLATION omp_get_cancellation
115#define FTN_GET_CANCELLATION_STATUS kmp_get_cancellation_status
Jim Cownie181b4bb2013-12-23 17:28:57 +0000116#endif
117
Jonathan Peytondf6818b2016-06-14 17:57:47 +0000118#if OMP_45_ENABLED
Jonathan Peyton30419822017-05-12 18:01:32 +0000119#define FTN_GET_MAX_TASK_PRIORITY omp_get_max_task_priority
120#define FTN_GET_NUM_PLACES omp_get_num_places
121#define FTN_GET_PLACE_NUM_PROCS omp_get_place_num_procs
122#define FTN_GET_PLACE_PROC_IDS omp_get_place_proc_ids
123#define FTN_GET_PLACE_NUM omp_get_place_num
124#define FTN_GET_PARTITION_NUM_PLACES omp_get_partition_num_places
125#define FTN_GET_PARTITION_PLACE_NUMS omp_get_partition_place_nums
126#ifdef KMP_STUB
127#define FTN_GET_INITIAL_DEVICE omp_get_initial_device
128#define FTN_TARGET_ALLOC omp_target_alloc
129#define FTN_TARGET_FREE omp_target_free
130#define FTN_TARGET_IS_PRESENT omp_target_is_present
131#define FTN_TARGET_MEMCPY omp_target_memcpy
132#define FTN_TARGET_MEMCPY_RECT omp_target_memcpy_rect
133#define FTN_TARGET_ASSOCIATE_PTR omp_target_associate_ptr
134#define FTN_TARGET_DISASSOCIATE_PTR omp_target_disassociate_ptr
135#endif
Jonathan Peyton28510722016-02-25 18:04:09 +0000136#endif
137
Jim Cownie5e8470a2013-09-27 10:38:44 +0000138#endif /* KMP_FTN_PLAIN */
139
140/* ------------------------------------------------------------------------ */
141
142#if KMP_FTN_ENTRIES == KMP_FTN_APPEND
143
Jonathan Peyton30419822017-05-12 18:01:32 +0000144#define FTN_SET_STACKSIZE kmp_set_stacksize_
145#define FTN_SET_STACKSIZE_S kmp_set_stacksize_s_
146#define FTN_GET_STACKSIZE kmp_get_stacksize_
147#define FTN_GET_STACKSIZE_S kmp_get_stacksize_s_
148#define FTN_SET_BLOCKTIME kmp_set_blocktime_
149#define FTN_GET_BLOCKTIME kmp_get_blocktime_
150#define FTN_SET_LIBRARY_SERIAL kmp_set_library_serial_
151#define FTN_SET_LIBRARY_TURNAROUND kmp_set_library_turnaround_
152#define FTN_SET_LIBRARY_THROUGHPUT kmp_set_library_throughput_
153#define FTN_SET_LIBRARY kmp_set_library_
154#define FTN_GET_LIBRARY kmp_get_library_
155#define FTN_SET_DEFAULTS kmp_set_defaults_
156#define FTN_SET_DISP_NUM_BUFFERS kmp_set_disp_num_buffers_
157#define FTN_SET_AFFINITY kmp_set_affinity_
158#define FTN_GET_AFFINITY kmp_get_affinity_
159#define FTN_GET_AFFINITY_MAX_PROC kmp_get_affinity_max_proc_
160#define FTN_CREATE_AFFINITY_MASK kmp_create_affinity_mask_
161#define FTN_DESTROY_AFFINITY_MASK kmp_destroy_affinity_mask_
162#define FTN_SET_AFFINITY_MASK_PROC kmp_set_affinity_mask_proc_
163#define FTN_UNSET_AFFINITY_MASK_PROC kmp_unset_affinity_mask_proc_
164#define FTN_GET_AFFINITY_MASK_PROC kmp_get_affinity_mask_proc_
Jim Cownie5e8470a2013-09-27 10:38:44 +0000165
Jonathan Peyton30419822017-05-12 18:01:32 +0000166#define FTN_MALLOC kmp_malloc_
167#define FTN_ALIGNED_MALLOC kmp_aligned_malloc_
168#define FTN_CALLOC kmp_calloc_
169#define FTN_REALLOC kmp_realloc_
170#define FTN_FREE kmp_free_
Jim Cownie5e8470a2013-09-27 10:38:44 +0000171
Jonathan Peyton30419822017-05-12 18:01:32 +0000172#define FTN_GET_NUM_KNOWN_THREADS kmp_get_num_known_threads_
Jim Cownie5e8470a2013-09-27 10:38:44 +0000173
Jonathan Peyton30419822017-05-12 18:01:32 +0000174#define FTN_SET_NUM_THREADS omp_set_num_threads_
175#define FTN_GET_NUM_THREADS omp_get_num_threads_
176#define FTN_GET_MAX_THREADS omp_get_max_threads_
177#define FTN_GET_THREAD_NUM omp_get_thread_num_
178#define FTN_GET_NUM_PROCS omp_get_num_procs_
179#define FTN_SET_DYNAMIC omp_set_dynamic_
180#define FTN_GET_DYNAMIC omp_get_dynamic_
181#define FTN_SET_NESTED omp_set_nested_
182#define FTN_GET_NESTED omp_get_nested_
183#define FTN_IN_PARALLEL omp_in_parallel_
184#define FTN_GET_THREAD_LIMIT omp_get_thread_limit_
185#define FTN_SET_SCHEDULE omp_set_schedule_
186#define FTN_GET_SCHEDULE omp_get_schedule_
187#define FTN_SET_MAX_ACTIVE_LEVELS omp_set_max_active_levels_
188#define FTN_GET_MAX_ACTIVE_LEVELS omp_get_max_active_levels_
189#define FTN_GET_ACTIVE_LEVEL omp_get_active_level_
190#define FTN_GET_LEVEL omp_get_level_
191#define FTN_GET_ANCESTOR_THREAD_NUM omp_get_ancestor_thread_num_
192#define FTN_GET_TEAM_SIZE omp_get_team_size_
193#define FTN_IN_FINAL omp_in_final_
Jim Cownie5e8470a2013-09-27 10:38:44 +0000194// #define FTN_SET_PROC_BIND omp_set_proc_bind_
Jonathan Peyton30419822017-05-12 18:01:32 +0000195#define FTN_GET_PROC_BIND omp_get_proc_bind_
Jim Cownie5e8470a2013-09-27 10:38:44 +0000196// #define FTN_CURR_PROC_BIND omp_curr_proc_bind_
197#if OMP_40_ENABLED
Jonathan Peyton30419822017-05-12 18:01:32 +0000198#define FTN_GET_NUM_TEAMS omp_get_num_teams_
199#define FTN_GET_TEAM_NUM omp_get_team_num_
Jim Cownie5e8470a2013-09-27 10:38:44 +0000200#endif
Jonathan Peyton30419822017-05-12 18:01:32 +0000201#define FTN_INIT_LOCK omp_init_lock_
Andrey Churbanov5c56fb52015-02-20 18:05:17 +0000202#if KMP_USE_DYNAMIC_LOCK
Jonathan Peyton30419822017-05-12 18:01:32 +0000203#define FTN_INIT_LOCK_WITH_HINT omp_init_lock_with_hint_
204#define FTN_INIT_NEST_LOCK_WITH_HINT omp_init_nest_lock_with_hint_
Andrey Churbanov5c56fb52015-02-20 18:05:17 +0000205#endif
Jonathan Peyton30419822017-05-12 18:01:32 +0000206#define FTN_DESTROY_LOCK omp_destroy_lock_
207#define FTN_SET_LOCK omp_set_lock_
208#define FTN_UNSET_LOCK omp_unset_lock_
209#define FTN_TEST_LOCK omp_test_lock_
210#define FTN_INIT_NEST_LOCK omp_init_nest_lock_
211#define FTN_DESTROY_NEST_LOCK omp_destroy_nest_lock_
212#define FTN_SET_NEST_LOCK omp_set_nest_lock_
213#define FTN_UNSET_NEST_LOCK omp_unset_nest_lock_
214#define FTN_TEST_NEST_LOCK omp_test_nest_lock_
Jim Cownie5e8470a2013-09-27 10:38:44 +0000215
Jonathan Peyton30419822017-05-12 18:01:32 +0000216#define FTN_SET_WARNINGS_ON kmp_set_warnings_on_
217#define FTN_SET_WARNINGS_OFF kmp_set_warnings_off_
Jim Cownie5e8470a2013-09-27 10:38:44 +0000218
Jonathan Peyton30419822017-05-12 18:01:32 +0000219#define FTN_GET_WTIME omp_get_wtime_
220#define FTN_GET_WTICK omp_get_wtick_
Jim Cownie5e8470a2013-09-27 10:38:44 +0000221
222#if OMP_40_ENABLED
Jonathan Peyton50eae7f2016-05-27 15:51:14 +0000223#if KMP_MIC || KMP_OS_DARWIN || defined(KMP_STUB)
Jonathan Peyton30419822017-05-12 18:01:32 +0000224#define FTN_GET_NUM_DEVICES omp_get_num_devices_
Jim Cownie5e8470a2013-09-27 10:38:44 +0000225#endif
Jonathan Peyton30419822017-05-12 18:01:32 +0000226#define FTN_GET_DEFAULT_DEVICE omp_get_default_device_
227#define FTN_SET_DEFAULT_DEVICE omp_set_default_device_
228#define FTN_IS_INITIAL_DEVICE omp_is_initial_device_
Jim Cownie5e8470a2013-09-27 10:38:44 +0000229#endif
230
231
Jim Cownie181b4bb2013-12-23 17:28:57 +0000232#if OMP_40_ENABLED
Jonathan Peyton30419822017-05-12 18:01:32 +0000233#define FTN_GET_CANCELLATION omp_get_cancellation_
234#define FTN_GET_CANCELLATION_STATUS kmp_get_cancellation_status_
Jim Cownie181b4bb2013-12-23 17:28:57 +0000235#endif
236
Jonathan Peytondf6818b2016-06-14 17:57:47 +0000237#if OMP_45_ENABLED
Jonathan Peyton30419822017-05-12 18:01:32 +0000238#define FTN_GET_MAX_TASK_PRIORITY omp_get_max_task_priority_
239#define FTN_GET_NUM_PLACES omp_get_num_places_
240#define FTN_GET_PLACE_NUM_PROCS omp_get_place_num_procs_
241#define FTN_GET_PLACE_PROC_IDS omp_get_place_proc_ids_
242#define FTN_GET_PLACE_NUM omp_get_place_num_
243#define FTN_GET_PARTITION_NUM_PLACES omp_get_partition_num_places_
244#define FTN_GET_PARTITION_PLACE_NUMS omp_get_partition_place_nums_
245#ifdef KMP_STUB
246#define FTN_GET_INITIAL_DEVICE omp_get_initial_device_
247#define FTN_TARGET_ALLOC omp_target_alloc_
248#define FTN_TARGET_FREE omp_target_free_
249#define FTN_TARGET_IS_PRESENT omp_target_is_present_
250#define FTN_TARGET_MEMCPY omp_target_memcpy_
251#define FTN_TARGET_MEMCPY_RECT omp_target_memcpy_rect_
252#define FTN_TARGET_ASSOCIATE_PTR omp_target_associate_ptr_
253#define FTN_TARGET_DISASSOCIATE_PTR omp_target_disassociate_ptr_
254#endif
Jonathan Peyton28510722016-02-25 18:04:09 +0000255#endif
256
Jim Cownie5e8470a2013-09-27 10:38:44 +0000257#endif /* KMP_FTN_APPEND */
258
259/* ------------------------------------------------------------------------ */
260
261#if KMP_FTN_ENTRIES == KMP_FTN_UPPER
262
Jonathan Peyton30419822017-05-12 18:01:32 +0000263#define FTN_SET_STACKSIZE KMP_SET_STACKSIZE
264#define FTN_SET_STACKSIZE_S KMP_SET_STACKSIZE_S
265#define FTN_GET_STACKSIZE KMP_GET_STACKSIZE
266#define FTN_GET_STACKSIZE_S KMP_GET_STACKSIZE_S
267#define FTN_SET_BLOCKTIME KMP_SET_BLOCKTIME
268#define FTN_GET_BLOCKTIME KMP_GET_BLOCKTIME
269#define FTN_SET_LIBRARY_SERIAL KMP_SET_LIBRARY_SERIAL
270#define FTN_SET_LIBRARY_TURNAROUND KMP_SET_LIBRARY_TURNAROUND
271#define FTN_SET_LIBRARY_THROUGHPUT KMP_SET_LIBRARY_THROUGHPUT
272#define FTN_SET_LIBRARY KMP_SET_LIBRARY
273#define FTN_GET_LIBRARY KMP_GET_LIBRARY
274#define FTN_SET_DEFAULTS KMP_SET_DEFAULTS
275#define FTN_SET_DISP_NUM_BUFFERS KMP_SET_DISP_NUM_BUFFERS
276#define FTN_SET_AFFINITY KMP_SET_AFFINITY
277#define FTN_GET_AFFINITY KMP_GET_AFFINITY
278#define FTN_GET_AFFINITY_MAX_PROC KMP_GET_AFFINITY_MAX_PROC
279#define FTN_CREATE_AFFINITY_MASK KMP_CREATE_AFFINITY_MASK
280#define FTN_DESTROY_AFFINITY_MASK KMP_DESTROY_AFFINITY_MASK
281#define FTN_SET_AFFINITY_MASK_PROC KMP_SET_AFFINITY_MASK_PROC
282#define FTN_UNSET_AFFINITY_MASK_PROC KMP_UNSET_AFFINITY_MASK_PROC
283#define FTN_GET_AFFINITY_MASK_PROC KMP_GET_AFFINITY_MASK_PROC
Jim Cownie5e8470a2013-09-27 10:38:44 +0000284
Jonathan Peyton30419822017-05-12 18:01:32 +0000285#define FTN_MALLOC KMP_MALLOC
286#define FTN_ALIGNED_MALLOC KMP_ALIGNED_MALLOC
287#define FTN_CALLOC KMP_CALLOC
288#define FTN_REALLOC KMP_REALLOC
289#define FTN_FREE KMP_FREE
Jim Cownie5e8470a2013-09-27 10:38:44 +0000290
Jonathan Peyton30419822017-05-12 18:01:32 +0000291#define FTN_GET_NUM_KNOWN_THREADS KMP_GET_NUM_KNOWN_THREADS
Jim Cownie5e8470a2013-09-27 10:38:44 +0000292
Jonathan Peyton30419822017-05-12 18:01:32 +0000293#define FTN_SET_NUM_THREADS OMP_SET_NUM_THREADS
294#define FTN_GET_NUM_THREADS OMP_GET_NUM_THREADS
295#define FTN_GET_MAX_THREADS OMP_GET_MAX_THREADS
296#define FTN_GET_THREAD_NUM OMP_GET_THREAD_NUM
297#define FTN_GET_NUM_PROCS OMP_GET_NUM_PROCS
298#define FTN_SET_DYNAMIC OMP_SET_DYNAMIC
299#define FTN_GET_DYNAMIC OMP_GET_DYNAMIC
300#define FTN_SET_NESTED OMP_SET_NESTED
301#define FTN_GET_NESTED OMP_GET_NESTED
302#define FTN_IN_PARALLEL OMP_IN_PARALLEL
303#define FTN_GET_THREAD_LIMIT OMP_GET_THREAD_LIMIT
304#define FTN_SET_SCHEDULE OMP_SET_SCHEDULE
305#define FTN_GET_SCHEDULE OMP_GET_SCHEDULE
306#define FTN_SET_MAX_ACTIVE_LEVELS OMP_SET_MAX_ACTIVE_LEVELS
307#define FTN_GET_MAX_ACTIVE_LEVELS OMP_GET_MAX_ACTIVE_LEVELS
308#define FTN_GET_ACTIVE_LEVEL OMP_GET_ACTIVE_LEVEL
309#define FTN_GET_LEVEL OMP_GET_LEVEL
310#define FTN_GET_ANCESTOR_THREAD_NUM OMP_GET_ANCESTOR_THREAD_NUM
311#define FTN_GET_TEAM_SIZE OMP_GET_TEAM_SIZE
312#define FTN_IN_FINAL OMP_IN_FINAL
Jim Cownie5e8470a2013-09-27 10:38:44 +0000313// #define FTN_SET_PROC_BIND OMP_SET_PROC_BIND
Jonathan Peyton30419822017-05-12 18:01:32 +0000314#define FTN_GET_PROC_BIND OMP_GET_PROC_BIND
Jim Cownie5e8470a2013-09-27 10:38:44 +0000315// #define FTN_CURR_PROC_BIND OMP_CURR_PROC_BIND
316#if OMP_40_ENABLED
Jonathan Peyton30419822017-05-12 18:01:32 +0000317#define FTN_GET_NUM_TEAMS OMP_GET_NUM_TEAMS
318#define FTN_GET_TEAM_NUM OMP_GET_TEAM_NUM
Jim Cownie5e8470a2013-09-27 10:38:44 +0000319#endif
Jonathan Peyton30419822017-05-12 18:01:32 +0000320#define FTN_INIT_LOCK OMP_INIT_LOCK
Andrey Churbanov5c56fb52015-02-20 18:05:17 +0000321#if KMP_USE_DYNAMIC_LOCK
Jonathan Peyton30419822017-05-12 18:01:32 +0000322#define FTN_INIT_LOCK_WITH_HINT OMP_INIT_LOCK_WITH_HINT
323#define FTN_INIT_NEST_LOCK_WITH_HINT OMP_INIT_NEST_LOCK_WITH_HINT
Andrey Churbanov5c56fb52015-02-20 18:05:17 +0000324#endif
Jonathan Peyton30419822017-05-12 18:01:32 +0000325#define FTN_DESTROY_LOCK OMP_DESTROY_LOCK
326#define FTN_SET_LOCK OMP_SET_LOCK
327#define FTN_UNSET_LOCK OMP_UNSET_LOCK
328#define FTN_TEST_LOCK OMP_TEST_LOCK
329#define FTN_INIT_NEST_LOCK OMP_INIT_NEST_LOCK
330#define FTN_DESTROY_NEST_LOCK OMP_DESTROY_NEST_LOCK
331#define FTN_SET_NEST_LOCK OMP_SET_NEST_LOCK
332#define FTN_UNSET_NEST_LOCK OMP_UNSET_NEST_LOCK
333#define FTN_TEST_NEST_LOCK OMP_TEST_NEST_LOCK
Jim Cownie5e8470a2013-09-27 10:38:44 +0000334
Jonathan Peyton30419822017-05-12 18:01:32 +0000335#define FTN_SET_WARNINGS_ON KMP_SET_WARNINGS_ON
336#define FTN_SET_WARNINGS_OFF KMP_SET_WARNINGS_OFF
Jim Cownie5e8470a2013-09-27 10:38:44 +0000337
Jonathan Peyton30419822017-05-12 18:01:32 +0000338#define FTN_GET_WTIME OMP_GET_WTIME
339#define FTN_GET_WTICK OMP_GET_WTICK
Jim Cownie5e8470a2013-09-27 10:38:44 +0000340
341#if OMP_40_ENABLED
Jonathan Peyton50eae7f2016-05-27 15:51:14 +0000342#if KMP_MIC || KMP_OS_DARWIN || defined(KMP_STUB)
Jonathan Peyton30419822017-05-12 18:01:32 +0000343#define FTN_GET_NUM_DEVICES OMP_GET_NUM_DEVICES
Jim Cownie5e8470a2013-09-27 10:38:44 +0000344#endif
Jonathan Peyton30419822017-05-12 18:01:32 +0000345#define FTN_GET_DEFAULT_DEVICE OMP_GET_DEFAULT_DEVICE
346#define FTN_SET_DEFAULT_DEVICE OMP_SET_DEFAULT_DEVICE
347#define FTN_IS_INITIAL_DEVICE OMP_IS_INITIAL_DEVICE
Jim Cownie5e8470a2013-09-27 10:38:44 +0000348#endif
349
350
Jim Cownie181b4bb2013-12-23 17:28:57 +0000351#if OMP_40_ENABLED
Jonathan Peyton30419822017-05-12 18:01:32 +0000352#define FTN_GET_CANCELLATION OMP_GET_CANCELLATION
353#define FTN_GET_CANCELLATION_STATUS KMP_GET_CANCELLATION_STATUS
Jim Cownie181b4bb2013-12-23 17:28:57 +0000354#endif
355
Jonathan Peytondf6818b2016-06-14 17:57:47 +0000356#if OMP_45_ENABLED
Jonathan Peyton30419822017-05-12 18:01:32 +0000357#define FTN_GET_MAX_TASK_PRIORITY OMP_GET_MAX_TASK_PRIORITY
358#define FTN_GET_NUM_PLACES OMP_GET_NUM_PLACES
359#define FTN_GET_PLACE_NUM_PROCS OMP_GET_PLACE_NUM_PROCS
360#define FTN_GET_PLACE_PROC_IDS OMP_GET_PLACE_PROC_IDS
361#define FTN_GET_PLACE_NUM OMP_GET_PLACE_NUM
362#define FTN_GET_PARTITION_NUM_PLACES OMP_GET_PARTITION_NUM_PLACES
363#define FTN_GET_PARTITION_PLACE_NUMS OMP_GET_PARTITION_PLACE_NUMS
364#ifdef KMP_STUB
365#define FTN_GET_INITIAL_DEVICE OMP_GET_INITIAL_DEVICE
366#define FTN_TARGET_ALLOC OMP_TARGET_ALLOC
367#define FTN_TARGET_FREE OMP_TARGET_FREE
368#define FTN_TARGET_IS_PRESENT OMP_TARGET_IS_PRESENT
369#define FTN_TARGET_MEMCPY OMP_TARGET_MEMCPY
370#define FTN_TARGET_MEMCPY_RECT OMP_TARGET_MEMCPY_RECT
371#define FTN_TARGET_ASSOCIATE_PTR OMP_TARGET_ASSOCIATE_PTR
372#define FTN_TARGET_DISASSOCIATE_PTR OMP_TARGET_DISASSOCIATE_PTR
373#endif
Jonathan Peyton28510722016-02-25 18:04:09 +0000374#endif
375
Jim Cownie5e8470a2013-09-27 10:38:44 +0000376#endif /* KMP_FTN_UPPER */
377
378/* ------------------------------------------------------------------------ */
379
380#if KMP_FTN_ENTRIES == KMP_FTN_UAPPEND
381
Jonathan Peyton30419822017-05-12 18:01:32 +0000382#define FTN_SET_STACKSIZE KMP_SET_STACKSIZE_
383#define FTN_SET_STACKSIZE_S KMP_SET_STACKSIZE_S_
384#define FTN_GET_STACKSIZE KMP_GET_STACKSIZE_
385#define FTN_GET_STACKSIZE_S KMP_GET_STACKSIZE_S_
386#define FTN_SET_BLOCKTIME KMP_SET_BLOCKTIME_
387#define FTN_GET_BLOCKTIME KMP_GET_BLOCKTIME_
388#define FTN_SET_LIBRARY_SERIAL KMP_SET_LIBRARY_SERIAL_
389#define FTN_SET_LIBRARY_TURNAROUND KMP_SET_LIBRARY_TURNAROUND_
390#define FTN_SET_LIBRARY_THROUGHPUT KMP_SET_LIBRARY_THROUGHPUT_
391#define FTN_SET_LIBRARY KMP_SET_LIBRARY_
392#define FTN_GET_LIBRARY KMP_GET_LIBRARY_
393#define FTN_SET_DEFAULTS KMP_SET_DEFAULTS_
394#define FTN_SET_DISP_NUM_BUFFERS KMP_SET_DISP_NUM_BUFFERS_
395#define FTN_SET_AFFINITY KMP_SET_AFFINITY_
396#define FTN_GET_AFFINITY KMP_GET_AFFINITY_
397#define FTN_GET_AFFINITY_MAX_PROC KMP_GET_AFFINITY_MAX_PROC_
398#define FTN_CREATE_AFFINITY_MASK KMP_CREATE_AFFINITY_MASK_
399#define FTN_DESTROY_AFFINITY_MASK KMP_DESTROY_AFFINITY_MASK_
400#define FTN_SET_AFFINITY_MASK_PROC KMP_SET_AFFINITY_MASK_PROC_
401#define FTN_UNSET_AFFINITY_MASK_PROC KMP_UNSET_AFFINITY_MASK_PROC_
402#define FTN_GET_AFFINITY_MASK_PROC KMP_GET_AFFINITY_MASK_PROC_
Jim Cownie5e8470a2013-09-27 10:38:44 +0000403
Jonathan Peyton30419822017-05-12 18:01:32 +0000404#define FTN_MALLOC KMP_MALLOC_
405#define FTN_ALIGNED_MALLOC KMP_ALIGNED_MALLOC_
406#define FTN_CALLOC KMP_CALLOC_
407#define FTN_REALLOC KMP_REALLOC_
408#define FTN_FREE KMP_FREE_
Jim Cownie5e8470a2013-09-27 10:38:44 +0000409
Jonathan Peyton30419822017-05-12 18:01:32 +0000410#define FTN_GET_NUM_KNOWN_THREADS KMP_GET_NUM_KNOWN_THREADS_
Jim Cownie5e8470a2013-09-27 10:38:44 +0000411
Jonathan Peyton30419822017-05-12 18:01:32 +0000412#define FTN_SET_NUM_THREADS OMP_SET_NUM_THREADS_
413#define FTN_GET_NUM_THREADS OMP_GET_NUM_THREADS_
414#define FTN_GET_MAX_THREADS OMP_GET_MAX_THREADS_
415#define FTN_GET_THREAD_NUM OMP_GET_THREAD_NUM_
416#define FTN_GET_NUM_PROCS OMP_GET_NUM_PROCS_
417#define FTN_SET_DYNAMIC OMP_SET_DYNAMIC_
418#define FTN_GET_DYNAMIC OMP_GET_DYNAMIC_
419#define FTN_SET_NESTED OMP_SET_NESTED_
420#define FTN_GET_NESTED OMP_GET_NESTED_
421#define FTN_IN_PARALLEL OMP_IN_PARALLEL_
422#define FTN_GET_THREAD_LIMIT OMP_GET_THREAD_LIMIT_
423#define FTN_SET_SCHEDULE OMP_SET_SCHEDULE_
424#define FTN_GET_SCHEDULE OMP_GET_SCHEDULE_
425#define FTN_SET_MAX_ACTIVE_LEVELS OMP_SET_MAX_ACTIVE_LEVELS_
426#define FTN_GET_MAX_ACTIVE_LEVELS OMP_GET_MAX_ACTIVE_LEVELS_
427#define FTN_GET_ACTIVE_LEVEL OMP_GET_ACTIVE_LEVEL_
428#define FTN_GET_LEVEL OMP_GET_LEVEL_
429#define FTN_GET_ANCESTOR_THREAD_NUM OMP_GET_ANCESTOR_THREAD_NUM_
430#define FTN_GET_TEAM_SIZE OMP_GET_TEAM_SIZE_
431#define FTN_IN_FINAL OMP_IN_FINAL_
Jim Cownie5e8470a2013-09-27 10:38:44 +0000432// #define FTN_SET_PROC_BIND OMP_SET_PROC_BIND_
Jonathan Peyton30419822017-05-12 18:01:32 +0000433#define FTN_GET_PROC_BIND OMP_GET_PROC_BIND_
Jim Cownie5e8470a2013-09-27 10:38:44 +0000434// #define FTN_CURR_PROC_BIND OMP_CURR_PROC_BIND_
435#if OMP_40_ENABLED
Jonathan Peyton30419822017-05-12 18:01:32 +0000436#define FTN_GET_NUM_TEAMS OMP_GET_NUM_TEAMS_
437#define FTN_GET_TEAM_NUM OMP_GET_TEAM_NUM_
Jim Cownie5e8470a2013-09-27 10:38:44 +0000438#endif
Jonathan Peyton30419822017-05-12 18:01:32 +0000439#define FTN_INIT_LOCK OMP_INIT_LOCK_
Andrey Churbanov5c56fb52015-02-20 18:05:17 +0000440#if KMP_USE_DYNAMIC_LOCK
Jonathan Peyton30419822017-05-12 18:01:32 +0000441#define FTN_INIT_LOCK_WITH_HINT OMP_INIT_LOCK_WITH_HINT_
442#define FTN_INIT_NEST_LOCK_WITH_HINT OMP_INIT_NEST_LOCK_WITH_HINT_
Andrey Churbanov5c56fb52015-02-20 18:05:17 +0000443#endif
Jonathan Peyton30419822017-05-12 18:01:32 +0000444#define FTN_DESTROY_LOCK OMP_DESTROY_LOCK_
445#define FTN_SET_LOCK OMP_SET_LOCK_
446#define FTN_UNSET_LOCK OMP_UNSET_LOCK_
447#define FTN_TEST_LOCK OMP_TEST_LOCK_
448#define FTN_INIT_NEST_LOCK OMP_INIT_NEST_LOCK_
449#define FTN_DESTROY_NEST_LOCK OMP_DESTROY_NEST_LOCK_
450#define FTN_SET_NEST_LOCK OMP_SET_NEST_LOCK_
451#define FTN_UNSET_NEST_LOCK OMP_UNSET_NEST_LOCK_
452#define FTN_TEST_NEST_LOCK OMP_TEST_NEST_LOCK_
Jim Cownie5e8470a2013-09-27 10:38:44 +0000453
Jonathan Peyton30419822017-05-12 18:01:32 +0000454#define FTN_SET_WARNINGS_ON KMP_SET_WARNINGS_ON_
455#define FTN_SET_WARNINGS_OFF KMP_SET_WARNINGS_OFF_
Jim Cownie5e8470a2013-09-27 10:38:44 +0000456
Jonathan Peyton30419822017-05-12 18:01:32 +0000457#define FTN_GET_WTIME OMP_GET_WTIME_
458#define FTN_GET_WTICK OMP_GET_WTICK_
Jim Cownie5e8470a2013-09-27 10:38:44 +0000459
460#if OMP_40_ENABLED
Jonathan Peyton50eae7f2016-05-27 15:51:14 +0000461#if KMP_MIC || KMP_OS_DARWIN || defined(KMP_STUB)
Jonathan Peyton30419822017-05-12 18:01:32 +0000462#define FTN_GET_NUM_DEVICES OMP_GET_NUM_DEVICES_
Jim Cownie5e8470a2013-09-27 10:38:44 +0000463#endif
Jonathan Peyton30419822017-05-12 18:01:32 +0000464#define FTN_GET_DEFAULT_DEVICE OMP_GET_DEFAULT_DEVICE_
465#define FTN_SET_DEFAULT_DEVICE OMP_SET_DEFAULT_DEVICE_
466#define FTN_IS_INITIAL_DEVICE OMP_IS_INITIAL_DEVICE_
Jim Cownie5e8470a2013-09-27 10:38:44 +0000467#endif
468
469
Jim Cownie181b4bb2013-12-23 17:28:57 +0000470#if OMP_40_ENABLED
Jonathan Peyton30419822017-05-12 18:01:32 +0000471#define FTN_GET_CANCELLATION OMP_GET_CANCELLATION_
472#define FTN_GET_CANCELLATION_STATUS KMP_GET_CANCELLATION_STATUS_
Jim Cownie181b4bb2013-12-23 17:28:57 +0000473#endif
474
Jonathan Peytondf6818b2016-06-14 17:57:47 +0000475#if OMP_45_ENABLED
Jonathan Peyton30419822017-05-12 18:01:32 +0000476#define FTN_GET_MAX_TASK_PRIORITY OMP_GET_MAX_TASK_PRIORITY_
477#define FTN_GET_NUM_PLACES OMP_GET_NUM_PLACES_
478#define FTN_GET_PLACE_NUM_PROCS OMP_GET_PLACE_NUM_PROCS_
479#define FTN_GET_PLACE_PROC_IDS OMP_GET_PLACE_PROC_IDS_
480#define FTN_GET_PLACE_NUM OMP_GET_PLACE_NUM_
481#define FTN_GET_PARTITION_NUM_PLACES OMP_GET_PARTITION_NUM_PLACES_
482#define FTN_GET_PARTITION_PLACE_NUMS OMP_GET_PARTITION_PLACE_NUMS_
483#ifdef KMP_STUB
484#define FTN_GET_INITIAL_DEVICE OMP_GET_INITIAL_DEVICE_
485#define FTN_TARGET_ALLOC OMP_TARGET_ALLOC_
486#define FTN_TARGET_FREE OMP_TARGET_FREE_
487#define FTN_TARGET_IS_PRESENT OMP_TARGET_IS_PRESENT_
488#define FTN_TARGET_MEMCPY OMP_TARGET_MEMCPY_
489#define FTN_TARGET_MEMCPY_RECT OMP_TARGET_MEMCPY_RECT_
490#define FTN_TARGET_ASSOCIATE_PTR OMP_TARGET_ASSOCIATE_PTR_
491#define FTN_TARGET_DISASSOCIATE_PTR OMP_TARGET_DISASSOCIATE_PTR_
492#endif
Jonathan Peyton28510722016-02-25 18:04:09 +0000493#endif
494
Jim Cownie5e8470a2013-09-27 10:38:44 +0000495#endif /* KMP_FTN_UAPPEND */
496
Jim Cownie181b4bb2013-12-23 17:28:57 +0000497/* -------------------------- GOMP API NAMES ------------------------ */
498// All GOMP_1.0 symbols
Jonathan Peyton30419822017-05-12 18:01:32 +0000499#define KMP_API_NAME_GOMP_ATOMIC_END GOMP_atomic_end
500#define KMP_API_NAME_GOMP_ATOMIC_START GOMP_atomic_start
501#define KMP_API_NAME_GOMP_BARRIER GOMP_barrier
502#define KMP_API_NAME_GOMP_CRITICAL_END GOMP_critical_end
503#define KMP_API_NAME_GOMP_CRITICAL_NAME_END GOMP_critical_name_end
504#define KMP_API_NAME_GOMP_CRITICAL_NAME_START GOMP_critical_name_start
505#define KMP_API_NAME_GOMP_CRITICAL_START GOMP_critical_start
506#define KMP_API_NAME_GOMP_LOOP_DYNAMIC_NEXT GOMP_loop_dynamic_next
507#define KMP_API_NAME_GOMP_LOOP_DYNAMIC_START GOMP_loop_dynamic_start
508#define KMP_API_NAME_GOMP_LOOP_END GOMP_loop_end
509#define KMP_API_NAME_GOMP_LOOP_END_NOWAIT GOMP_loop_end_nowait
510#define KMP_API_NAME_GOMP_LOOP_GUIDED_NEXT GOMP_loop_guided_next
511#define KMP_API_NAME_GOMP_LOOP_GUIDED_START GOMP_loop_guided_start
512#define KMP_API_NAME_GOMP_LOOP_ORDERED_DYNAMIC_NEXT \
513 GOMP_loop_ordered_dynamic_next
514#define KMP_API_NAME_GOMP_LOOP_ORDERED_DYNAMIC_START \
515 GOMP_loop_ordered_dynamic_start
516#define KMP_API_NAME_GOMP_LOOP_ORDERED_GUIDED_NEXT GOMP_loop_ordered_guided_next
517#define KMP_API_NAME_GOMP_LOOP_ORDERED_GUIDED_START \
518 GOMP_loop_ordered_guided_start
519#define KMP_API_NAME_GOMP_LOOP_ORDERED_RUNTIME_NEXT \
520 GOMP_loop_ordered_runtime_next
521#define KMP_API_NAME_GOMP_LOOP_ORDERED_RUNTIME_START \
522 GOMP_loop_ordered_runtime_start
523#define KMP_API_NAME_GOMP_LOOP_ORDERED_STATIC_NEXT GOMP_loop_ordered_static_next
524#define KMP_API_NAME_GOMP_LOOP_ORDERED_STATIC_START \
525 GOMP_loop_ordered_static_start
526#define KMP_API_NAME_GOMP_LOOP_RUNTIME_NEXT GOMP_loop_runtime_next
527#define KMP_API_NAME_GOMP_LOOP_RUNTIME_START GOMP_loop_runtime_start
528#define KMP_API_NAME_GOMP_LOOP_STATIC_NEXT GOMP_loop_static_next
529#define KMP_API_NAME_GOMP_LOOP_STATIC_START GOMP_loop_static_start
530#define KMP_API_NAME_GOMP_ORDERED_END GOMP_ordered_end
531#define KMP_API_NAME_GOMP_ORDERED_START GOMP_ordered_start
532#define KMP_API_NAME_GOMP_PARALLEL_END GOMP_parallel_end
533#define KMP_API_NAME_GOMP_PARALLEL_LOOP_DYNAMIC_START \
534 GOMP_parallel_loop_dynamic_start
535#define KMP_API_NAME_GOMP_PARALLEL_LOOP_GUIDED_START \
536 GOMP_parallel_loop_guided_start
537#define KMP_API_NAME_GOMP_PARALLEL_LOOP_RUNTIME_START \
538 GOMP_parallel_loop_runtime_start
539#define KMP_API_NAME_GOMP_PARALLEL_LOOP_STATIC_START \
540 GOMP_parallel_loop_static_start
541#define KMP_API_NAME_GOMP_PARALLEL_SECTIONS_START GOMP_parallel_sections_start
542#define KMP_API_NAME_GOMP_PARALLEL_START GOMP_parallel_start
543#define KMP_API_NAME_GOMP_SECTIONS_END GOMP_sections_end
544#define KMP_API_NAME_GOMP_SECTIONS_END_NOWAIT GOMP_sections_end_nowait
545#define KMP_API_NAME_GOMP_SECTIONS_NEXT GOMP_sections_next
546#define KMP_API_NAME_GOMP_SECTIONS_START GOMP_sections_start
547#define KMP_API_NAME_GOMP_SINGLE_COPY_END GOMP_single_copy_end
548#define KMP_API_NAME_GOMP_SINGLE_COPY_START GOMP_single_copy_start
549#define KMP_API_NAME_GOMP_SINGLE_START GOMP_single_start
Jim Cownie181b4bb2013-12-23 17:28:57 +0000550
551// All GOMP_2.0 symbols
Jonathan Peyton30419822017-05-12 18:01:32 +0000552#define KMP_API_NAME_GOMP_TASK GOMP_task
553#define KMP_API_NAME_GOMP_TASKWAIT GOMP_taskwait
554#define KMP_API_NAME_GOMP_LOOP_ULL_DYNAMIC_NEXT GOMP_loop_ull_dynamic_next
555#define KMP_API_NAME_GOMP_LOOP_ULL_DYNAMIC_START GOMP_loop_ull_dynamic_start
556#define KMP_API_NAME_GOMP_LOOP_ULL_GUIDED_NEXT GOMP_loop_ull_guided_next
557#define KMP_API_NAME_GOMP_LOOP_ULL_GUIDED_START GOMP_loop_ull_guided_start
558#define KMP_API_NAME_GOMP_LOOP_ULL_ORDERED_DYNAMIC_NEXT \
559 GOMP_loop_ull_ordered_dynamic_next
560#define KMP_API_NAME_GOMP_LOOP_ULL_ORDERED_DYNAMIC_START \
561 GOMP_loop_ull_ordered_dynamic_start
562#define KMP_API_NAME_GOMP_LOOP_ULL_ORDERED_GUIDED_NEXT \
563 GOMP_loop_ull_ordered_guided_next
564#define KMP_API_NAME_GOMP_LOOP_ULL_ORDERED_GUIDED_START \
565 GOMP_loop_ull_ordered_guided_start
566#define KMP_API_NAME_GOMP_LOOP_ULL_ORDERED_RUNTIME_NEXT \
567 GOMP_loop_ull_ordered_runtime_next
568#define KMP_API_NAME_GOMP_LOOP_ULL_ORDERED_RUNTIME_START \
569 GOMP_loop_ull_ordered_runtime_start
570#define KMP_API_NAME_GOMP_LOOP_ULL_ORDERED_STATIC_NEXT \
571 GOMP_loop_ull_ordered_static_next
572#define KMP_API_NAME_GOMP_LOOP_ULL_ORDERED_STATIC_START \
573 GOMP_loop_ull_ordered_static_start
574#define KMP_API_NAME_GOMP_LOOP_ULL_RUNTIME_NEXT GOMP_loop_ull_runtime_next
575#define KMP_API_NAME_GOMP_LOOP_ULL_RUNTIME_START GOMP_loop_ull_runtime_start
576#define KMP_API_NAME_GOMP_LOOP_ULL_STATIC_NEXT GOMP_loop_ull_static_next
577#define KMP_API_NAME_GOMP_LOOP_ULL_STATIC_START GOMP_loop_ull_static_start
Jim Cownie181b4bb2013-12-23 17:28:57 +0000578
579// All GOMP_3.0 symbols
Jonathan Peyton30419822017-05-12 18:01:32 +0000580#define KMP_API_NAME_GOMP_TASKYIELD GOMP_taskyield
Jim Cownie181b4bb2013-12-23 17:28:57 +0000581
Jonathan Peyton61118492016-05-20 19:03:38 +0000582// All GOMP_4.0 symbols
Jonathan Peyton30419822017-05-12 18:01:32 +0000583// TODO: As of 2013-10-14, none of the GOMP_4.0 functions are implemented in
584// libomp
585#define KMP_API_NAME_GOMP_BARRIER_CANCEL GOMP_barrier_cancel
586#define KMP_API_NAME_GOMP_CANCEL GOMP_cancel
587#define KMP_API_NAME_GOMP_CANCELLATION_POINT GOMP_cancellation_point
588#define KMP_API_NAME_GOMP_LOOP_END_CANCEL GOMP_loop_end_cancel
589#define KMP_API_NAME_GOMP_PARALLEL_LOOP_DYNAMIC GOMP_parallel_loop_dynamic
590#define KMP_API_NAME_GOMP_PARALLEL_LOOP_GUIDED GOMP_parallel_loop_guided
591#define KMP_API_NAME_GOMP_PARALLEL_LOOP_RUNTIME GOMP_parallel_loop_runtime
592#define KMP_API_NAME_GOMP_PARALLEL_LOOP_STATIC GOMP_parallel_loop_static
593#define KMP_API_NAME_GOMP_PARALLEL_SECTIONS GOMP_parallel_sections
594#define KMP_API_NAME_GOMP_PARALLEL GOMP_parallel
595#define KMP_API_NAME_GOMP_SECTIONS_END_CANCEL GOMP_sections_end_cancel
596#define KMP_API_NAME_GOMP_TASKGROUP_START GOMP_taskgroup_start
597#define KMP_API_NAME_GOMP_TASKGROUP_END GOMP_taskgroup_end
Jim Cownie181b4bb2013-12-23 17:28:57 +0000598/* Target functions should be taken care of by liboffload */
Jonathan Peyton30419822017-05-12 18:01:32 +0000599#define KMP_API_NAME_GOMP_TARGET GOMP_target
600#define KMP_API_NAME_GOMP_TARGET_DATA GOMP_target_data
601#define KMP_API_NAME_GOMP_TARGET_END_DATA GOMP_target_end_data
602#define KMP_API_NAME_GOMP_TARGET_UPDATE GOMP_target_update
603#define KMP_API_NAME_GOMP_TEAMS GOMP_teams
Jim Cownie181b4bb2013-12-23 17:28:57 +0000604
Jim Cownie4cc4bb42014-10-07 16:25:50 +0000605#ifdef KMP_USE_VERSION_SYMBOLS
Jonathan Peyton30419822017-05-12 18:01:32 +0000606#define xstr(x) str(x)
607#define str(x) #x
Jim Cownie181b4bb2013-12-23 17:28:57 +0000608
Jonathan Peyton30419822017-05-12 18:01:32 +0000609// If Linux, xexpand prepends __kmp_api_ to the real API name
610#define xexpand(api_name) expand(api_name)
611#define expand(api_name) __kmp_api_##api_name
Jim Cownie181b4bb2013-12-23 17:28:57 +0000612
Jonathan Peyton30419822017-05-12 18:01:32 +0000613#define xaliasify(api_name, ver) aliasify(api_name, ver)
614#define aliasify(api_name, ver) \
615 __typeof__(__kmp_api_##api_name) __kmp_api_##api_name##_##ver##_alias \
616 __attribute__((alias(xstr(__kmp_api_##api_name))))
Jim Cownie181b4bb2013-12-23 17:28:57 +0000617
Jonathan Peyton30419822017-05-12 18:01:32 +0000618#define xversionify(api_name, version_num, version_str) \
619 versionify(api_name, version_num, version_str, "VERSION")
620#define versionify(api_name, version_num, version_str, default_ver) \
621 __asm__( \
622 ".symver " xstr(__kmp_api_##api_name##_##version_num##_alias) "," xstr( \
623 api_name) "@" version_str "\n\t"); \
624 __asm__(".symver " xstr(__kmp_api_##api_name) "," xstr( \
625 api_name) "@@" default_ver "\n\t")
Jim Cownie181b4bb2013-12-23 17:28:57 +0000626
Jim Cownie4cc4bb42014-10-07 16:25:50 +0000627#else // KMP_USE_VERSION_SYMBOLS
Jonathan Peyton30419822017-05-12 18:01:32 +0000628#define xstr(x) /* Nothing */
629#define str(x) /* Nothing */
Jim Cownie181b4bb2013-12-23 17:28:57 +0000630
Jonathan Peyton30419822017-05-12 18:01:32 +0000631// if Windows or Mac, xexpand does no name transformation
632#define xexpand(api_name) expand(api_name)
633#define expand(api_name) api_name
Jim Cownie181b4bb2013-12-23 17:28:57 +0000634
Jonathan Peyton30419822017-05-12 18:01:32 +0000635#define xaliasify(api_name, ver) /* Nothing */
636#define aliasify(api_name, ver) /* Nothing */
Jim Cownie181b4bb2013-12-23 17:28:57 +0000637
Jonathan Peyton30419822017-05-12 18:01:32 +0000638#define xversionify(api_name, version_num, version_str) /* Nothing */
639#define versionify(api_name, version_num, version_str, \
640 default_ver) /* Nothing */
Jim Cownie181b4bb2013-12-23 17:28:57 +0000641
Jim Cownie4cc4bb42014-10-07 16:25:50 +0000642#endif // KMP_USE_VERSION_SYMBOLS
Jim Cownie181b4bb2013-12-23 17:28:57 +0000643
Jim Cownie5e8470a2013-09-27 10:38:44 +0000644#endif /* KMP_FTN_OS_H */