Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 1 | /* |
| 2 | * kmp_ftn_os.h -- KPTS Fortran defines header file. |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 3 | */ |
| 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 | |
| 19 | // KMP_FNT_ENTRIES may be one of: KMP_FTN_PLAIN, KMP_FTN_UPPER, KMP_FTN_APPEND, KMP_FTN_UAPPEND. |
| 20 | |
| 21 | |
| 22 | /* -------------------------- External definitions ------------------------ */ |
| 23 | |
| 24 | #if KMP_FTN_ENTRIES == KMP_FTN_PLAIN |
| 25 | |
| 26 | #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_AFFINITY kmp_set_affinity |
| 39 | #define FTN_GET_AFFINITY kmp_get_affinity |
| 40 | #define FTN_GET_AFFINITY_MAX_PROC kmp_get_affinity_max_proc |
| 41 | #define FTN_CREATE_AFFINITY_MASK kmp_create_affinity_mask |
| 42 | #define FTN_DESTROY_AFFINITY_MASK kmp_destroy_affinity_mask |
| 43 | #define FTN_SET_AFFINITY_MASK_PROC kmp_set_affinity_mask_proc |
| 44 | #define FTN_UNSET_AFFINITY_MASK_PROC kmp_unset_affinity_mask_proc |
| 45 | #define FTN_GET_AFFINITY_MASK_PROC kmp_get_affinity_mask_proc |
| 46 | |
| 47 | #define FTN_MALLOC kmp_malloc |
| 48 | #define FTN_CALLOC kmp_calloc |
| 49 | #define FTN_REALLOC kmp_realloc |
| 50 | #define FTN_FREE kmp_free |
| 51 | |
| 52 | #define FTN_GET_NUM_KNOWN_THREADS kmp_get_num_known_threads |
| 53 | |
| 54 | #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 |
| 74 | // #define FTN_SET_PROC_BIND omp_set_proc_bind |
| 75 | #define FTN_GET_PROC_BIND omp_get_proc_bind |
| 76 | // #define FTN_CURR_PROC_BIND omp_curr_proc_bind |
| 77 | #if OMP_40_ENABLED |
| 78 | #define FTN_GET_NUM_TEAMS omp_get_num_teams |
| 79 | #define FTN_GET_TEAM_NUM omp_get_team_num |
| 80 | #endif |
| 81 | #define FTN_INIT_LOCK omp_init_lock |
Andrey Churbanov | 5c56fb5 | 2015-02-20 18:05:17 +0000 | [diff] [blame^] | 82 | #if KMP_USE_DYNAMIC_LOCK |
| 83 | #define FTN_INIT_LOCK_HINTED kmp_init_lock_hinted |
| 84 | #define FTN_INIT_NEST_LOCK_HINTED kmp_init_nest_lock_hinted |
| 85 | #endif |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 86 | #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 |
| 95 | |
| 96 | #define FTN_SET_WARNINGS_ON kmp_set_warnings_on |
| 97 | #define FTN_SET_WARNINGS_OFF kmp_set_warnings_off |
| 98 | |
| 99 | #define FTN_GET_WTIME omp_get_wtime |
| 100 | #define FTN_GET_WTICK omp_get_wtick |
| 101 | |
| 102 | #if OMP_40_ENABLED |
| 103 | #if KMP_MIC || KMP_OS_DARWIN |
| 104 | #define FTN_GET_DEFAULT_DEVICE omp_get_default_device |
| 105 | #define FTN_SET_DEFAULT_DEVICE omp_set_default_device |
| 106 | #define FTN_GET_NUM_DEVICES omp_get_num_devices |
| 107 | #endif |
Andrey Churbanov | 851563f | 2015-02-10 19:47:09 +0000 | [diff] [blame] | 108 | #define FTN_IS_INITIAL_DEVICE omp_is_initial_device |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 109 | #endif |
| 110 | |
Jim Cownie | 181b4bb | 2013-12-23 17:28:57 +0000 | [diff] [blame] | 111 | #if OMP_40_ENABLED |
| 112 | #define FTN_GET_CANCELLATION omp_get_cancellation |
| 113 | #define FTN_GET_CANCELLATION_STATUS kmp_get_cancellation_status |
| 114 | #endif |
| 115 | |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 116 | #endif /* KMP_FTN_PLAIN */ |
| 117 | |
| 118 | /* ------------------------------------------------------------------------ */ |
| 119 | |
| 120 | #if KMP_FTN_ENTRIES == KMP_FTN_APPEND |
| 121 | |
| 122 | #define FTN_SET_STACKSIZE kmp_set_stacksize_ |
| 123 | #define FTN_SET_STACKSIZE_S kmp_set_stacksize_s_ |
| 124 | #define FTN_GET_STACKSIZE kmp_get_stacksize_ |
| 125 | #define FTN_GET_STACKSIZE_S kmp_get_stacksize_s_ |
| 126 | #define FTN_SET_BLOCKTIME kmp_set_blocktime_ |
| 127 | #define FTN_GET_BLOCKTIME kmp_get_blocktime_ |
| 128 | #define FTN_SET_LIBRARY_SERIAL kmp_set_library_serial_ |
| 129 | #define FTN_SET_LIBRARY_TURNAROUND kmp_set_library_turnaround_ |
| 130 | #define FTN_SET_LIBRARY_THROUGHPUT kmp_set_library_throughput_ |
| 131 | #define FTN_SET_LIBRARY kmp_set_library_ |
| 132 | #define FTN_GET_LIBRARY kmp_get_library_ |
| 133 | #define FTN_SET_DEFAULTS kmp_set_defaults_ |
| 134 | #define FTN_SET_AFFINITY kmp_set_affinity_ |
| 135 | #define FTN_GET_AFFINITY kmp_get_affinity_ |
| 136 | #define FTN_GET_AFFINITY_MAX_PROC kmp_get_affinity_max_proc_ |
| 137 | #define FTN_CREATE_AFFINITY_MASK kmp_create_affinity_mask_ |
| 138 | #define FTN_DESTROY_AFFINITY_MASK kmp_destroy_affinity_mask_ |
| 139 | #define FTN_SET_AFFINITY_MASK_PROC kmp_set_affinity_mask_proc_ |
| 140 | #define FTN_UNSET_AFFINITY_MASK_PROC kmp_unset_affinity_mask_proc_ |
| 141 | #define FTN_GET_AFFINITY_MASK_PROC kmp_get_affinity_mask_proc_ |
| 142 | |
| 143 | #define FTN_MALLOC kmp_malloc_ |
| 144 | #define FTN_CALLOC kmp_calloc_ |
| 145 | #define FTN_REALLOC kmp_realloc_ |
| 146 | #define FTN_FREE kmp_free_ |
| 147 | |
| 148 | #define FTN_GET_NUM_KNOWN_THREADS kmp_get_num_known_threads_ |
| 149 | |
| 150 | #define FTN_SET_NUM_THREADS omp_set_num_threads_ |
| 151 | #define FTN_GET_NUM_THREADS omp_get_num_threads_ |
| 152 | #define FTN_GET_MAX_THREADS omp_get_max_threads_ |
| 153 | #define FTN_GET_THREAD_NUM omp_get_thread_num_ |
| 154 | #define FTN_GET_NUM_PROCS omp_get_num_procs_ |
| 155 | #define FTN_SET_DYNAMIC omp_set_dynamic_ |
| 156 | #define FTN_GET_DYNAMIC omp_get_dynamic_ |
| 157 | #define FTN_SET_NESTED omp_set_nested_ |
| 158 | #define FTN_GET_NESTED omp_get_nested_ |
| 159 | #define FTN_IN_PARALLEL omp_in_parallel_ |
| 160 | #define FTN_GET_THREAD_LIMIT omp_get_thread_limit_ |
| 161 | #define FTN_SET_SCHEDULE omp_set_schedule_ |
| 162 | #define FTN_GET_SCHEDULE omp_get_schedule_ |
| 163 | #define FTN_SET_MAX_ACTIVE_LEVELS omp_set_max_active_levels_ |
| 164 | #define FTN_GET_MAX_ACTIVE_LEVELS omp_get_max_active_levels_ |
| 165 | #define FTN_GET_ACTIVE_LEVEL omp_get_active_level_ |
| 166 | #define FTN_GET_LEVEL omp_get_level_ |
| 167 | #define FTN_GET_ANCESTOR_THREAD_NUM omp_get_ancestor_thread_num_ |
| 168 | #define FTN_GET_TEAM_SIZE omp_get_team_size_ |
| 169 | #define FTN_IN_FINAL omp_in_final_ |
| 170 | // #define FTN_SET_PROC_BIND omp_set_proc_bind_ |
| 171 | #define FTN_GET_PROC_BIND omp_get_proc_bind_ |
| 172 | // #define FTN_CURR_PROC_BIND omp_curr_proc_bind_ |
| 173 | #if OMP_40_ENABLED |
| 174 | #define FTN_GET_NUM_TEAMS omp_get_num_teams_ |
| 175 | #define FTN_GET_TEAM_NUM omp_get_team_num_ |
| 176 | #endif |
| 177 | #define FTN_INIT_LOCK omp_init_lock_ |
Andrey Churbanov | 5c56fb5 | 2015-02-20 18:05:17 +0000 | [diff] [blame^] | 178 | #if KMP_USE_DYNAMIC_LOCK |
| 179 | #define FTN_INIT_LOCK_HINTED kmp_init_lock_hinted_ |
| 180 | #define FTN_INIT_NEST_LOCK_HINTED kmp_init_nest_lock_hinted_ |
| 181 | #endif |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 182 | #define FTN_DESTROY_LOCK omp_destroy_lock_ |
| 183 | #define FTN_SET_LOCK omp_set_lock_ |
| 184 | #define FTN_UNSET_LOCK omp_unset_lock_ |
| 185 | #define FTN_TEST_LOCK omp_test_lock_ |
| 186 | #define FTN_INIT_NEST_LOCK omp_init_nest_lock_ |
| 187 | #define FTN_DESTROY_NEST_LOCK omp_destroy_nest_lock_ |
| 188 | #define FTN_SET_NEST_LOCK omp_set_nest_lock_ |
| 189 | #define FTN_UNSET_NEST_LOCK omp_unset_nest_lock_ |
| 190 | #define FTN_TEST_NEST_LOCK omp_test_nest_lock_ |
| 191 | |
| 192 | #define FTN_SET_WARNINGS_ON kmp_set_warnings_on_ |
| 193 | #define FTN_SET_WARNINGS_OFF kmp_set_warnings_off_ |
| 194 | |
| 195 | #define FTN_GET_WTIME omp_get_wtime_ |
| 196 | #define FTN_GET_WTICK omp_get_wtick_ |
| 197 | |
| 198 | #if OMP_40_ENABLED |
| 199 | #if KMP_MIC || KMP_OS_DARWIN |
| 200 | #define FTN_GET_DEFAULT_DEVICE omp_get_default_device_ |
| 201 | #define FTN_SET_DEFAULT_DEVICE omp_set_default_device_ |
| 202 | #define FTN_GET_NUM_DEVICES omp_get_num_devices_ |
| 203 | #endif |
Andrey Churbanov | 851563f | 2015-02-10 19:47:09 +0000 | [diff] [blame] | 204 | #define FTN_IS_INITIAL_DEVICE omp_is_initial_device_ |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 205 | #endif |
| 206 | |
| 207 | |
Jim Cownie | 181b4bb | 2013-12-23 17:28:57 +0000 | [diff] [blame] | 208 | #if OMP_40_ENABLED |
| 209 | #define FTN_GET_CANCELLATION omp_get_cancellation_ |
| 210 | #define FTN_GET_CANCELLATION_STATUS kmp_get_cancellation_status_ |
| 211 | #endif |
| 212 | |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 213 | #endif /* KMP_FTN_APPEND */ |
| 214 | |
| 215 | /* ------------------------------------------------------------------------ */ |
| 216 | |
| 217 | #if KMP_FTN_ENTRIES == KMP_FTN_UPPER |
| 218 | |
| 219 | #define FTN_SET_STACKSIZE KMP_SET_STACKSIZE |
| 220 | #define FTN_SET_STACKSIZE_S KMP_SET_STACKSIZE_S |
| 221 | #define FTN_GET_STACKSIZE KMP_GET_STACKSIZE |
| 222 | #define FTN_GET_STACKSIZE_S KMP_GET_STACKSIZE_S |
| 223 | #define FTN_SET_BLOCKTIME KMP_SET_BLOCKTIME |
| 224 | #define FTN_GET_BLOCKTIME KMP_GET_BLOCKTIME |
| 225 | #define FTN_SET_LIBRARY_SERIAL KMP_SET_LIBRARY_SERIAL |
| 226 | #define FTN_SET_LIBRARY_TURNAROUND KMP_SET_LIBRARY_TURNAROUND |
| 227 | #define FTN_SET_LIBRARY_THROUGHPUT KMP_SET_LIBRARY_THROUGHPUT |
| 228 | #define FTN_SET_LIBRARY KMP_SET_LIBRARY |
| 229 | #define FTN_GET_LIBRARY KMP_GET_LIBRARY |
| 230 | #define FTN_SET_DEFAULTS KMP_SET_DEFAULTS |
| 231 | #define FTN_SET_AFFINITY KMP_SET_AFFINITY |
| 232 | #define FTN_GET_AFFINITY KMP_GET_AFFINITY |
| 233 | #define FTN_GET_AFFINITY_MAX_PROC KMP_GET_AFFINITY_MAX_PROC |
| 234 | #define FTN_CREATE_AFFINITY_MASK KMP_CREATE_AFFINITY_MASK |
| 235 | #define FTN_DESTROY_AFFINITY_MASK KMP_DESTROY_AFFINITY_MASK |
| 236 | #define FTN_SET_AFFINITY_MASK_PROC KMP_SET_AFFINITY_MASK_PROC |
| 237 | #define FTN_UNSET_AFFINITY_MASK_PROC KMP_UNSET_AFFINITY_MASK_PROC |
| 238 | #define FTN_GET_AFFINITY_MASK_PROC KMP_GET_AFFINITY_MASK_PROC |
| 239 | |
| 240 | #define FTN_MALLOC KMP_MALLOC |
| 241 | #define FTN_CALLOC KMP_CALLOC |
| 242 | #define FTN_REALLOC KMP_REALLOC |
| 243 | #define FTN_FREE KMP_FREE |
| 244 | |
| 245 | #define FTN_GET_NUM_KNOWN_THREADS KMP_GET_NUM_KNOWN_THREADS |
| 246 | |
| 247 | #define FTN_SET_NUM_THREADS OMP_SET_NUM_THREADS |
| 248 | #define FTN_GET_NUM_THREADS OMP_GET_NUM_THREADS |
| 249 | #define FTN_GET_MAX_THREADS OMP_GET_MAX_THREADS |
| 250 | #define FTN_GET_THREAD_NUM OMP_GET_THREAD_NUM |
| 251 | #define FTN_GET_NUM_PROCS OMP_GET_NUM_PROCS |
| 252 | #define FTN_SET_DYNAMIC OMP_SET_DYNAMIC |
| 253 | #define FTN_GET_DYNAMIC OMP_GET_DYNAMIC |
| 254 | #define FTN_SET_NESTED OMP_SET_NESTED |
| 255 | #define FTN_GET_NESTED OMP_GET_NESTED |
| 256 | #define FTN_IN_PARALLEL OMP_IN_PARALLEL |
| 257 | #define FTN_GET_THREAD_LIMIT OMP_GET_THREAD_LIMIT |
| 258 | #define FTN_SET_SCHEDULE OMP_SET_SCHEDULE |
| 259 | #define FTN_GET_SCHEDULE OMP_GET_SCHEDULE |
| 260 | #define FTN_SET_MAX_ACTIVE_LEVELS OMP_SET_MAX_ACTIVE_LEVELS |
| 261 | #define FTN_GET_MAX_ACTIVE_LEVELS OMP_GET_MAX_ACTIVE_LEVELS |
| 262 | #define FTN_GET_ACTIVE_LEVEL OMP_GET_ACTIVE_LEVEL |
| 263 | #define FTN_GET_LEVEL OMP_GET_LEVEL |
| 264 | #define FTN_GET_ANCESTOR_THREAD_NUM OMP_GET_ANCESTOR_THREAD_NUM |
| 265 | #define FTN_GET_TEAM_SIZE OMP_GET_TEAM_SIZE |
| 266 | #define FTN_IN_FINAL OMP_IN_FINAL |
| 267 | // #define FTN_SET_PROC_BIND OMP_SET_PROC_BIND |
| 268 | #define FTN_GET_PROC_BIND OMP_GET_PROC_BIND |
| 269 | // #define FTN_CURR_PROC_BIND OMP_CURR_PROC_BIND |
| 270 | #if OMP_40_ENABLED |
| 271 | #define FTN_GET_NUM_TEAMS OMP_GET_NUM_TEAMS |
| 272 | #define FTN_GET_TEAM_NUM OMP_GET_TEAM_NUM |
| 273 | #endif |
| 274 | #define FTN_INIT_LOCK OMP_INIT_LOCK |
Andrey Churbanov | 5c56fb5 | 2015-02-20 18:05:17 +0000 | [diff] [blame^] | 275 | #if KMP_USE_DYNAMIC_LOCK |
| 276 | #define FTN_INIT_LOCK_HINTED KMP_INIT_LOCK_HINTED |
| 277 | #define FTN_INIT_NEST_LOCK_HINTED KMP_INIT_NEST_LOCK_HINTED |
| 278 | #endif |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 279 | #define FTN_DESTROY_LOCK OMP_DESTROY_LOCK |
| 280 | #define FTN_SET_LOCK OMP_SET_LOCK |
| 281 | #define FTN_UNSET_LOCK OMP_UNSET_LOCK |
| 282 | #define FTN_TEST_LOCK OMP_TEST_LOCK |
| 283 | #define FTN_INIT_NEST_LOCK OMP_INIT_NEST_LOCK |
| 284 | #define FTN_DESTROY_NEST_LOCK OMP_DESTROY_NEST_LOCK |
| 285 | #define FTN_SET_NEST_LOCK OMP_SET_NEST_LOCK |
| 286 | #define FTN_UNSET_NEST_LOCK OMP_UNSET_NEST_LOCK |
| 287 | #define FTN_TEST_NEST_LOCK OMP_TEST_NEST_LOCK |
| 288 | |
| 289 | #define FTN_SET_WARNINGS_ON KMP_SET_WARNINGS_ON |
| 290 | #define FTN_SET_WARNINGS_OFF KMP_SET_WARNINGS_OFF |
| 291 | |
| 292 | #define FTN_GET_WTIME OMP_GET_WTIME |
| 293 | #define FTN_GET_WTICK OMP_GET_WTICK |
| 294 | |
| 295 | #if OMP_40_ENABLED |
| 296 | #if KMP_MIC || KMP_OS_DARWIN |
| 297 | #define FTN_GET_DEFAULT_DEVICE OMP_GET_DEFAULT_DEVICE |
| 298 | #define FTN_SET_DEFAULT_DEVICE OMP_SET_DEFAULT_DEVICE |
| 299 | #define FTN_GET_NUM_DEVICES OMP_GET_NUM_DEVICES |
| 300 | #endif |
Andrey Churbanov | 851563f | 2015-02-10 19:47:09 +0000 | [diff] [blame] | 301 | #define FTN_IS_INITIAL_DEVICE OMP_IS_INITIAL_DEVICE |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 302 | #endif |
| 303 | |
| 304 | |
Jim Cownie | 181b4bb | 2013-12-23 17:28:57 +0000 | [diff] [blame] | 305 | #if OMP_40_ENABLED |
| 306 | #define FTN_GET_CANCELLATION OMP_GET_CANCELLATION |
| 307 | #define FTN_GET_CANCELLATION_STATUS KMP_GET_CANCELLATION_STATUS |
| 308 | #endif |
| 309 | |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 310 | #endif /* KMP_FTN_UPPER */ |
| 311 | |
| 312 | /* ------------------------------------------------------------------------ */ |
| 313 | |
| 314 | #if KMP_FTN_ENTRIES == KMP_FTN_UAPPEND |
| 315 | |
| 316 | #define FTN_SET_STACKSIZE KMP_SET_STACKSIZE_ |
| 317 | #define FTN_SET_STACKSIZE_S KMP_SET_STACKSIZE_S_ |
| 318 | #define FTN_GET_STACKSIZE KMP_GET_STACKSIZE_ |
| 319 | #define FTN_GET_STACKSIZE_S KMP_GET_STACKSIZE_S_ |
| 320 | #define FTN_SET_BLOCKTIME KMP_SET_BLOCKTIME_ |
| 321 | #define FTN_GET_BLOCKTIME KMP_GET_BLOCKTIME_ |
| 322 | #define FTN_SET_LIBRARY_SERIAL KMP_SET_LIBRARY_SERIAL_ |
| 323 | #define FTN_SET_LIBRARY_TURNAROUND KMP_SET_LIBRARY_TURNAROUND_ |
| 324 | #define FTN_SET_LIBRARY_THROUGHPUT KMP_SET_LIBRARY_THROUGHPUT_ |
| 325 | #define FTN_SET_LIBRARY KMP_SET_LIBRARY_ |
| 326 | #define FTN_GET_LIBRARY KMP_GET_LIBRARY_ |
| 327 | #define FTN_SET_DEFAULTS KMP_SET_DEFAULTS_ |
| 328 | #define FTN_SET_AFFINITY KMP_SET_AFFINITY_ |
| 329 | #define FTN_GET_AFFINITY KMP_GET_AFFINITY_ |
| 330 | #define FTN_GET_AFFINITY_MAX_PROC KMP_GET_AFFINITY_MAX_PROC_ |
| 331 | #define FTN_CREATE_AFFINITY_MASK KMP_CREATE_AFFINITY_MASK_ |
| 332 | #define FTN_DESTROY_AFFINITY_MASK KMP_DESTROY_AFFINITY_MASK_ |
| 333 | #define FTN_SET_AFFINITY_MASK_PROC KMP_SET_AFFINITY_MASK_PROC_ |
| 334 | #define FTN_UNSET_AFFINITY_MASK_PROC KMP_UNSET_AFFINITY_MASK_PROC_ |
| 335 | #define FTN_GET_AFFINITY_MASK_PROC KMP_GET_AFFINITY_MASK_PROC_ |
| 336 | |
| 337 | #define FTN_MALLOC KMP_MALLOC_ |
| 338 | #define FTN_CALLOC KMP_CALLOC_ |
| 339 | #define FTN_REALLOC KMP_REALLOC_ |
| 340 | #define FTN_FREE KMP_FREE_ |
| 341 | |
| 342 | #define FTN_GET_NUM_KNOWN_THREADS KMP_GET_NUM_KNOWN_THREADS_ |
| 343 | |
| 344 | #define FTN_SET_NUM_THREADS OMP_SET_NUM_THREADS_ |
| 345 | #define FTN_GET_NUM_THREADS OMP_GET_NUM_THREADS_ |
| 346 | #define FTN_GET_MAX_THREADS OMP_GET_MAX_THREADS_ |
| 347 | #define FTN_GET_THREAD_NUM OMP_GET_THREAD_NUM_ |
| 348 | #define FTN_GET_NUM_PROCS OMP_GET_NUM_PROCS_ |
| 349 | #define FTN_SET_DYNAMIC OMP_SET_DYNAMIC_ |
| 350 | #define FTN_GET_DYNAMIC OMP_GET_DYNAMIC_ |
| 351 | #define FTN_SET_NESTED OMP_SET_NESTED_ |
| 352 | #define FTN_GET_NESTED OMP_GET_NESTED_ |
| 353 | #define FTN_IN_PARALLEL OMP_IN_PARALLEL_ |
| 354 | #define FTN_GET_THREAD_LIMIT OMP_GET_THREAD_LIMIT_ |
| 355 | #define FTN_SET_SCHEDULE OMP_SET_SCHEDULE_ |
| 356 | #define FTN_GET_SCHEDULE OMP_GET_SCHEDULE_ |
| 357 | #define FTN_SET_MAX_ACTIVE_LEVELS OMP_SET_MAX_ACTIVE_LEVELS_ |
| 358 | #define FTN_GET_MAX_ACTIVE_LEVELS OMP_GET_MAX_ACTIVE_LEVELS_ |
| 359 | #define FTN_GET_ACTIVE_LEVEL OMP_GET_ACTIVE_LEVEL_ |
| 360 | #define FTN_GET_LEVEL OMP_GET_LEVEL_ |
| 361 | #define FTN_GET_ANCESTOR_THREAD_NUM OMP_GET_ANCESTOR_THREAD_NUM_ |
| 362 | #define FTN_GET_TEAM_SIZE OMP_GET_TEAM_SIZE_ |
| 363 | #define FTN_IN_FINAL OMP_IN_FINAL_ |
| 364 | // #define FTN_SET_PROC_BIND OMP_SET_PROC_BIND_ |
| 365 | #define FTN_GET_PROC_BIND OMP_GET_PROC_BIND_ |
| 366 | // #define FTN_CURR_PROC_BIND OMP_CURR_PROC_BIND_ |
| 367 | #if OMP_40_ENABLED |
| 368 | #define FTN_GET_NUM_TEAMS OMP_GET_NUM_TEAMS_ |
| 369 | #define FTN_GET_TEAM_NUM OMP_GET_TEAM_NUM_ |
| 370 | #endif |
| 371 | #define FTN_INIT_LOCK OMP_INIT_LOCK_ |
Andrey Churbanov | 5c56fb5 | 2015-02-20 18:05:17 +0000 | [diff] [blame^] | 372 | #if KMP_USE_DYNAMIC_LOCK |
| 373 | #define FTN_INIT_LOCK_HINTED KMP_INIT_LOCK_HINTED_ |
| 374 | #define FTN_INIT_NEST_LOCK_HINTED KMP_INIT_NEST_LOCK_HINTED_ |
| 375 | #endif |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 376 | #define FTN_DESTROY_LOCK OMP_DESTROY_LOCK_ |
| 377 | #define FTN_SET_LOCK OMP_SET_LOCK_ |
| 378 | #define FTN_UNSET_LOCK OMP_UNSET_LOCK_ |
| 379 | #define FTN_TEST_LOCK OMP_TEST_LOCK_ |
| 380 | #define FTN_INIT_NEST_LOCK OMP_INIT_NEST_LOCK_ |
| 381 | #define FTN_DESTROY_NEST_LOCK OMP_DESTROY_NEST_LOCK_ |
| 382 | #define FTN_SET_NEST_LOCK OMP_SET_NEST_LOCK_ |
| 383 | #define FTN_UNSET_NEST_LOCK OMP_UNSET_NEST_LOCK_ |
| 384 | #define FTN_TEST_NEST_LOCK OMP_TEST_NEST_LOCK_ |
| 385 | |
| 386 | #define FTN_SET_WARNINGS_ON KMP_SET_WARNINGS_ON_ |
| 387 | #define FTN_SET_WARNINGS_OFF KMP_SET_WARNINGS_OFF_ |
| 388 | |
| 389 | #define FTN_GET_WTIME OMP_GET_WTIME_ |
| 390 | #define FTN_GET_WTICK OMP_GET_WTICK_ |
| 391 | |
| 392 | #if OMP_40_ENABLED |
| 393 | #if KMP_MIC || KMP_OS_DARWIN |
| 394 | #define FTN_GET_DEFAULT_DEVICE OMP_GET_DEFAULT_DEVICE_ |
| 395 | #define FTN_SET_DEFAULT_DEVICE OMP_SET_DEFAULT_DEVICE_ |
| 396 | #define FTN_GET_NUM_DEVICES OMP_GET_NUM_DEVICES_ |
| 397 | #endif |
Andrey Churbanov | 851563f | 2015-02-10 19:47:09 +0000 | [diff] [blame] | 398 | #define FTN_IS_INITIAL_DEVICE OMP_IS_INITIAL_DEVICE_ |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 399 | #endif |
| 400 | |
| 401 | |
Jim Cownie | 181b4bb | 2013-12-23 17:28:57 +0000 | [diff] [blame] | 402 | #if OMP_40_ENABLED |
| 403 | #define FTN_GET_CANCELLATION OMP_GET_CANCELLATION_ |
| 404 | #define FTN_GET_CANCELLATION_STATUS KMP_GET_CANCELLATION_STATUS_ |
| 405 | #endif |
| 406 | |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 407 | #endif /* KMP_FTN_UAPPEND */ |
| 408 | |
Jim Cownie | 181b4bb | 2013-12-23 17:28:57 +0000 | [diff] [blame] | 409 | /* ------------------------------------------------------------------ */ |
| 410 | /* -------------------------- GOMP API NAMES ------------------------ */ |
| 411 | // All GOMP_1.0 symbols |
| 412 | #define KMP_API_NAME_GOMP_ATOMIC_END GOMP_atomic_end |
| 413 | #define KMP_API_NAME_GOMP_ATOMIC_START GOMP_atomic_start |
| 414 | #define KMP_API_NAME_GOMP_BARRIER GOMP_barrier |
| 415 | #define KMP_API_NAME_GOMP_CRITICAL_END GOMP_critical_end |
| 416 | #define KMP_API_NAME_GOMP_CRITICAL_NAME_END GOMP_critical_name_end |
| 417 | #define KMP_API_NAME_GOMP_CRITICAL_NAME_START GOMP_critical_name_start |
| 418 | #define KMP_API_NAME_GOMP_CRITICAL_START GOMP_critical_start |
| 419 | #define KMP_API_NAME_GOMP_LOOP_DYNAMIC_NEXT GOMP_loop_dynamic_next |
| 420 | #define KMP_API_NAME_GOMP_LOOP_DYNAMIC_START GOMP_loop_dynamic_start |
| 421 | #define KMP_API_NAME_GOMP_LOOP_END GOMP_loop_end |
| 422 | #define KMP_API_NAME_GOMP_LOOP_END_NOWAIT GOMP_loop_end_nowait |
| 423 | #define KMP_API_NAME_GOMP_LOOP_GUIDED_NEXT GOMP_loop_guided_next |
| 424 | #define KMP_API_NAME_GOMP_LOOP_GUIDED_START GOMP_loop_guided_start |
| 425 | #define KMP_API_NAME_GOMP_LOOP_ORDERED_DYNAMIC_NEXT GOMP_loop_ordered_dynamic_next |
| 426 | #define KMP_API_NAME_GOMP_LOOP_ORDERED_DYNAMIC_START GOMP_loop_ordered_dynamic_start |
| 427 | #define KMP_API_NAME_GOMP_LOOP_ORDERED_GUIDED_NEXT GOMP_loop_ordered_guided_next |
| 428 | #define KMP_API_NAME_GOMP_LOOP_ORDERED_GUIDED_START GOMP_loop_ordered_guided_start |
| 429 | #define KMP_API_NAME_GOMP_LOOP_ORDERED_RUNTIME_NEXT GOMP_loop_ordered_runtime_next |
| 430 | #define KMP_API_NAME_GOMP_LOOP_ORDERED_RUNTIME_START GOMP_loop_ordered_runtime_start |
| 431 | #define KMP_API_NAME_GOMP_LOOP_ORDERED_STATIC_NEXT GOMP_loop_ordered_static_next |
| 432 | #define KMP_API_NAME_GOMP_LOOP_ORDERED_STATIC_START GOMP_loop_ordered_static_start |
| 433 | #define KMP_API_NAME_GOMP_LOOP_RUNTIME_NEXT GOMP_loop_runtime_next |
| 434 | #define KMP_API_NAME_GOMP_LOOP_RUNTIME_START GOMP_loop_runtime_start |
| 435 | #define KMP_API_NAME_GOMP_LOOP_STATIC_NEXT GOMP_loop_static_next |
| 436 | #define KMP_API_NAME_GOMP_LOOP_STATIC_START GOMP_loop_static_start |
| 437 | #define KMP_API_NAME_GOMP_ORDERED_END GOMP_ordered_end |
| 438 | #define KMP_API_NAME_GOMP_ORDERED_START GOMP_ordered_start |
| 439 | #define KMP_API_NAME_GOMP_PARALLEL_END GOMP_parallel_end |
| 440 | #define KMP_API_NAME_GOMP_PARALLEL_LOOP_DYNAMIC_START GOMP_parallel_loop_dynamic_start |
| 441 | #define KMP_API_NAME_GOMP_PARALLEL_LOOP_GUIDED_START GOMP_parallel_loop_guided_start |
| 442 | #define KMP_API_NAME_GOMP_PARALLEL_LOOP_RUNTIME_START GOMP_parallel_loop_runtime_start |
| 443 | #define KMP_API_NAME_GOMP_PARALLEL_LOOP_STATIC_START GOMP_parallel_loop_static_start |
| 444 | #define KMP_API_NAME_GOMP_PARALLEL_SECTIONS_START GOMP_parallel_sections_start |
| 445 | #define KMP_API_NAME_GOMP_PARALLEL_START GOMP_parallel_start |
| 446 | #define KMP_API_NAME_GOMP_SECTIONS_END GOMP_sections_end |
| 447 | #define KMP_API_NAME_GOMP_SECTIONS_END_NOWAIT GOMP_sections_end_nowait |
| 448 | #define KMP_API_NAME_GOMP_SECTIONS_NEXT GOMP_sections_next |
| 449 | #define KMP_API_NAME_GOMP_SECTIONS_START GOMP_sections_start |
| 450 | #define KMP_API_NAME_GOMP_SINGLE_COPY_END GOMP_single_copy_end |
| 451 | #define KMP_API_NAME_GOMP_SINGLE_COPY_START GOMP_single_copy_start |
| 452 | #define KMP_API_NAME_GOMP_SINGLE_START GOMP_single_start |
| 453 | |
| 454 | // All GOMP_2.0 symbols |
| 455 | #define KMP_API_NAME_GOMP_TASK GOMP_task |
| 456 | #define KMP_API_NAME_GOMP_TASKWAIT GOMP_taskwait |
| 457 | #define KMP_API_NAME_GOMP_LOOP_ULL_DYNAMIC_NEXT GOMP_loop_ull_dynamic_next |
| 458 | #define KMP_API_NAME_GOMP_LOOP_ULL_DYNAMIC_START GOMP_loop_ull_dynamic_start |
| 459 | #define KMP_API_NAME_GOMP_LOOP_ULL_GUIDED_NEXT GOMP_loop_ull_guided_next |
| 460 | #define KMP_API_NAME_GOMP_LOOP_ULL_GUIDED_START GOMP_loop_ull_guided_start |
| 461 | #define KMP_API_NAME_GOMP_LOOP_ULL_ORDERED_DYNAMIC_NEXT GOMP_loop_ull_ordered_dynamic_next |
| 462 | #define KMP_API_NAME_GOMP_LOOP_ULL_ORDERED_DYNAMIC_START GOMP_loop_ull_ordered_dynamic_start |
| 463 | #define KMP_API_NAME_GOMP_LOOP_ULL_ORDERED_GUIDED_NEXT GOMP_loop_ull_ordered_guided_next |
| 464 | #define KMP_API_NAME_GOMP_LOOP_ULL_ORDERED_GUIDED_START GOMP_loop_ull_ordered_guided_start |
| 465 | #define KMP_API_NAME_GOMP_LOOP_ULL_ORDERED_RUNTIME_NEXT GOMP_loop_ull_ordered_runtime_next |
| 466 | #define KMP_API_NAME_GOMP_LOOP_ULL_ORDERED_RUNTIME_START GOMP_loop_ull_ordered_runtime_start |
| 467 | #define KMP_API_NAME_GOMP_LOOP_ULL_ORDERED_STATIC_NEXT GOMP_loop_ull_ordered_static_next |
| 468 | #define KMP_API_NAME_GOMP_LOOP_ULL_ORDERED_STATIC_START GOMP_loop_ull_ordered_static_start |
| 469 | #define KMP_API_NAME_GOMP_LOOP_ULL_RUNTIME_NEXT GOMP_loop_ull_runtime_next |
| 470 | #define KMP_API_NAME_GOMP_LOOP_ULL_RUNTIME_START GOMP_loop_ull_runtime_start |
| 471 | #define KMP_API_NAME_GOMP_LOOP_ULL_STATIC_NEXT GOMP_loop_ull_static_next |
| 472 | #define KMP_API_NAME_GOMP_LOOP_ULL_STATIC_START GOMP_loop_ull_static_start |
| 473 | |
| 474 | // All GOMP_3.0 symbols |
| 475 | #define KMP_API_NAME_GOMP_TASKYIELD GOMP_taskyield |
| 476 | |
| 477 | // All GOMP_4.0 symbols |
| 478 | // TODO: As of 2013-10-14, none of the GOMP_4.0 functions are implemented in libiomp5 |
| 479 | #define KMP_API_NAME_GOMP_BARRIER_CANCEL GOMP_barrier_cancel |
| 480 | #define KMP_API_NAME_GOMP_CANCEL GOMP_cancel |
| 481 | #define KMP_API_NAME_GOMP_CANCELLATION_POINT GOMP_cancellation_point |
| 482 | #define KMP_API_NAME_GOMP_LOOP_END_CANCEL GOMP_loop_end_cancel |
| 483 | #define KMP_API_NAME_GOMP_PARALLEL_LOOP_DYNAMIC GOMP_parallel_loop_dynamic |
| 484 | #define KMP_API_NAME_GOMP_PARALLEL_LOOP_GUIDED GOMP_parallel_loop_guided |
| 485 | #define KMP_API_NAME_GOMP_PARALLEL_LOOP_RUNTIME GOMP_parallel_loop_runtime |
| 486 | #define KMP_API_NAME_GOMP_PARALLEL_LOOP_STATIC GOMP_parallel_loop_static |
| 487 | #define KMP_API_NAME_GOMP_PARALLEL_SECTIONS GOMP_parallel_sections |
| 488 | #define KMP_API_NAME_GOMP_PARALLEL GOMP_parallel |
| 489 | #define KMP_API_NAME_GOMP_SECTIONS_END_CANCEL GOMP_sections_end_cancel |
| 490 | #define KMP_API_NAME_GOMP_TASKGROUP_START GOMP_taskgroup_start |
| 491 | #define KMP_API_NAME_GOMP_TASKGROUP_END GOMP_taskgroup_end |
| 492 | /* Target functions should be taken care of by liboffload */ |
Jim Cownie | 4cc4bb4 | 2014-10-07 16:25:50 +0000 | [diff] [blame] | 493 | #define KMP_API_NAME_GOMP_TARGET GOMP_target |
| 494 | #define KMP_API_NAME_GOMP_TARGET_DATA GOMP_target_data |
| 495 | #define KMP_API_NAME_GOMP_TARGET_END_DATA GOMP_target_end_data |
| 496 | #define KMP_API_NAME_GOMP_TARGET_UPDATE GOMP_target_update |
Jim Cownie | 181b4bb | 2013-12-23 17:28:57 +0000 | [diff] [blame] | 497 | #define KMP_API_NAME_GOMP_TEAMS GOMP_teams |
| 498 | |
Jim Cownie | 4cc4bb4 | 2014-10-07 16:25:50 +0000 | [diff] [blame] | 499 | #ifdef KMP_USE_VERSION_SYMBOLS |
| 500 | #define xstr(x) str(x) |
Jim Cownie | 181b4bb | 2013-12-23 17:28:57 +0000 | [diff] [blame] | 501 | #define str(x) #x |
| 502 | |
| 503 | // If Linux, xexpand prepends __kmp_api_ to the real API name |
| 504 | #define xexpand(api_name) expand(api_name) |
| 505 | #define expand(api_name) __kmp_api_##api_name |
| 506 | |
| 507 | #define xaliasify(api_name,ver) aliasify(api_name,ver) |
| 508 | #define aliasify(api_name,ver) __typeof__(__kmp_api_##api_name) __kmp_api_##api_name##_##ver##_alias __attribute__((alias(xstr(__kmp_api_##api_name)))) |
| 509 | |
| 510 | #define xversionify(api_name, version_num, version_str) versionify(api_name, version_num, version_str, "VERSION") |
| 511 | #define versionify(api_name, version_num, version_str, default_ver) \ |
| 512 | __asm__(".symver " xstr(__kmp_api_##api_name##_##version_num##_alias) "," xstr(api_name) "@" version_str "\n\t"); \ |
| 513 | __asm__(".symver " xstr(__kmp_api_##api_name) "," xstr(api_name) "@@" default_ver "\n\t") |
| 514 | |
Jim Cownie | 4cc4bb4 | 2014-10-07 16:25:50 +0000 | [diff] [blame] | 515 | #else // KMP_USE_VERSION_SYMBOLS |
Jim Cownie | 181b4bb | 2013-12-23 17:28:57 +0000 | [diff] [blame] | 516 | #define xstr(x) /* Nothing */ |
| 517 | #define str(x) /* Nothing */ |
| 518 | |
| 519 | // if Windows or Mac, xexpand does no name transformation |
| 520 | #define xexpand(api_name) expand(api_name) |
| 521 | #define expand(api_name) api_name |
| 522 | |
| 523 | #define xaliasify(api_name,ver) /* Nothing */ |
| 524 | #define aliasify(api_name,ver) /* Nothing */ |
| 525 | |
| 526 | #define xversionify(api_name, version_num, version_str) /* Nothing */ |
| 527 | #define versionify(api_name, version_num, version_str, default_ver) /* Nothing */ |
| 528 | |
Jim Cownie | 4cc4bb4 | 2014-10-07 16:25:50 +0000 | [diff] [blame] | 529 | #endif // KMP_USE_VERSION_SYMBOLS |
Jim Cownie | 181b4bb | 2013-12-23 17:28:57 +0000 | [diff] [blame] | 530 | |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 531 | #endif /* KMP_FTN_OS_H */ |
| 532 | |