Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 1 | ! include/30/omp_lib.f90.var |
| 2 | ! $Revision: 42061 $ |
| 3 | ! $Date: 2013-02-28 16:36:24 -0600 (Thu, 28 Feb 2013) $ |
| 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 | module omp_lib_kinds |
| 17 | |
| 18 | use, intrinsic :: iso_c_binding |
| 19 | |
| 20 | integer, parameter :: omp_integer_kind = c_int |
| 21 | integer, parameter :: omp_logical_kind = 4 |
| 22 | integer, parameter :: omp_real_kind = c_float |
| 23 | integer, parameter :: kmp_double_kind = c_double |
| 24 | integer, parameter :: omp_lock_kind = c_intptr_t |
| 25 | integer, parameter :: omp_nest_lock_kind = c_intptr_t |
| 26 | integer, parameter :: omp_sched_kind = omp_integer_kind |
| 27 | integer, parameter :: kmp_pointer_kind = c_intptr_t |
| 28 | integer, parameter :: kmp_size_t_kind = c_size_t |
| 29 | integer, parameter :: kmp_affinity_mask_kind = c_intptr_t |
| 30 | |
| 31 | end module omp_lib_kinds |
| 32 | |
| 33 | module omp_lib |
| 34 | |
| 35 | use omp_lib_kinds |
| 36 | |
| 37 | integer (kind=omp_integer_kind), parameter :: openmp_version = $OMP_VERSION |
| 38 | integer (kind=omp_integer_kind), parameter :: kmp_version_major = $KMP_VERSION_MAJOR |
| 39 | integer (kind=omp_integer_kind), parameter :: kmp_version_minor = $KMP_VERSION_MINOR |
| 40 | integer (kind=omp_integer_kind), parameter :: kmp_version_build = $KMP_VERSION_BUILD |
| 41 | character(*) kmp_build_date |
| 42 | parameter( kmp_build_date = '$KMP_BUILD_DATE' ) |
| 43 | |
| 44 | integer(kind=omp_sched_kind), parameter :: omp_sched_static = 1 |
| 45 | integer(kind=omp_sched_kind), parameter :: omp_sched_dynamic = 2 |
| 46 | integer(kind=omp_sched_kind), parameter :: omp_sched_guided = 3 |
| 47 | integer(kind=omp_sched_kind), parameter :: omp_sched_auto = 4 |
| 48 | |
| 49 | interface |
| 50 | |
| 51 | ! *** |
| 52 | ! *** omp_* entry points |
| 53 | ! *** |
| 54 | |
| 55 | subroutine omp_set_num_threads(nthreads) bind(c) |
| 56 | use omp_lib_kinds |
| 57 | integer (kind=omp_integer_kind), value :: nthreads |
| 58 | end subroutine omp_set_num_threads |
| 59 | |
| 60 | subroutine omp_set_dynamic(enable) bind(c) |
| 61 | use omp_lib_kinds |
| 62 | logical (kind=omp_logical_kind), value :: enable |
| 63 | end subroutine omp_set_dynamic |
| 64 | |
| 65 | subroutine omp_set_nested(enable) bind(c) |
| 66 | use omp_lib_kinds |
| 67 | logical (kind=omp_logical_kind), value :: enable |
| 68 | end subroutine omp_set_nested |
| 69 | |
| 70 | function omp_get_num_threads() bind(c) |
| 71 | use omp_lib_kinds |
| 72 | integer (kind=omp_integer_kind) omp_get_num_threads |
| 73 | end function omp_get_num_threads |
| 74 | |
| 75 | function omp_get_max_threads() bind(c) |
| 76 | use omp_lib_kinds |
| 77 | integer (kind=omp_integer_kind) omp_get_max_threads |
| 78 | end function omp_get_max_threads |
| 79 | |
| 80 | function omp_get_thread_num() bind(c) |
| 81 | use omp_lib_kinds |
| 82 | integer (kind=omp_integer_kind) omp_get_thread_num |
| 83 | end function omp_get_thread_num |
| 84 | |
| 85 | function omp_get_num_procs() bind(c) |
| 86 | use omp_lib_kinds |
| 87 | integer (kind=omp_integer_kind) omp_get_num_procs |
| 88 | end function omp_get_num_procs |
| 89 | |
| 90 | function omp_in_parallel() bind(c) |
| 91 | use omp_lib_kinds |
| 92 | logical (kind=omp_logical_kind) omp_in_parallel |
| 93 | end function omp_in_parallel |
| 94 | |
| 95 | function omp_get_dynamic() bind(c) |
| 96 | use omp_lib_kinds |
| 97 | logical (kind=omp_logical_kind) omp_get_dynamic |
| 98 | end function omp_get_dynamic |
| 99 | |
| 100 | function omp_get_nested() bind(c) |
| 101 | use omp_lib_kinds |
| 102 | logical (kind=omp_logical_kind) omp_get_nested |
| 103 | end function omp_get_nested |
| 104 | |
| 105 | function omp_get_thread_limit() bind(c) |
| 106 | use omp_lib_kinds |
| 107 | integer (kind=omp_integer_kind) omp_get_thread_limit |
| 108 | end function omp_get_thread_limit |
| 109 | |
| 110 | subroutine omp_set_max_active_levels(max_levels) bind(c) |
| 111 | use omp_lib_kinds |
| 112 | integer (kind=omp_integer_kind), value :: max_levels |
| 113 | end subroutine omp_set_max_active_levels |
| 114 | |
| 115 | function omp_get_max_active_levels() bind(c) |
| 116 | use omp_lib_kinds |
| 117 | integer (kind=omp_integer_kind) omp_get_max_active_levels |
| 118 | end function omp_get_max_active_levels |
| 119 | |
| 120 | function omp_get_level() bind(c) |
| 121 | use omp_lib_kinds |
| 122 | integer (kind=omp_integer_kind) :: omp_get_level |
| 123 | end function omp_get_level |
| 124 | |
| 125 | function omp_get_active_level() bind(c) |
| 126 | use omp_lib_kinds |
| 127 | integer (kind=omp_integer_kind) :: omp_get_active_level |
| 128 | end function omp_get_active_level |
| 129 | |
| 130 | function omp_get_ancestor_thread_num(level) bind(c) |
| 131 | use omp_lib_kinds |
| 132 | integer (kind=omp_integer_kind) omp_get_ancestor_thread_num |
| 133 | integer (kind=omp_integer_kind), value :: level |
| 134 | end function omp_get_ancestor_thread_num |
| 135 | |
| 136 | function omp_get_team_size(level) bind(c) |
| 137 | use omp_lib_kinds |
| 138 | integer (kind=omp_integer_kind) omp_get_team_size |
| 139 | integer (kind=omp_integer_kind), value :: level |
| 140 | end function omp_get_team_size |
| 141 | |
| 142 | subroutine omp_set_schedule(kind, modifier) bind(c) |
| 143 | use omp_lib_kinds |
| 144 | integer (kind=omp_sched_kind), value :: kind |
| 145 | integer (kind=omp_integer_kind), value :: modifier |
| 146 | end subroutine omp_set_schedule |
| 147 | |
| 148 | subroutine omp_get_schedule(kind, modifier) bind(c) |
| 149 | use omp_lib_kinds |
| 150 | integer (kind=omp_sched_kind) :: kind |
| 151 | integer (kind=omp_integer_kind) :: modifier |
| 152 | end subroutine omp_get_schedule |
| 153 | |
| 154 | function omp_get_wtime() bind(c) |
| 155 | use omp_lib_kinds |
| 156 | real (kind=kmp_double_kind) omp_get_wtime |
| 157 | end function omp_get_wtime |
| 158 | |
| 159 | function omp_get_wtick() bind(c) |
| 160 | use omp_lib_kinds |
| 161 | real (kind=kmp_double_kind) omp_get_wtick |
| 162 | end function omp_get_wtick |
| 163 | |
| 164 | subroutine omp_init_lock(lockvar) bind(c) |
| 165 | use omp_lib_kinds |
| 166 | integer (kind=omp_lock_kind) lockvar |
| 167 | end subroutine omp_init_lock |
| 168 | |
| 169 | subroutine omp_destroy_lock(lockvar) bind(c) |
| 170 | use omp_lib_kinds |
| 171 | integer (kind=omp_lock_kind) lockvar |
| 172 | end subroutine omp_destroy_lock |
| 173 | |
| 174 | subroutine omp_set_lock(lockvar) bind(c) |
| 175 | use omp_lib_kinds |
| 176 | integer (kind=omp_lock_kind) lockvar |
| 177 | end subroutine omp_set_lock |
| 178 | |
| 179 | subroutine omp_unset_lock(lockvar) bind(c) |
| 180 | use omp_lib_kinds |
| 181 | integer (kind=omp_lock_kind) lockvar |
| 182 | end subroutine omp_unset_lock |
| 183 | |
| 184 | function omp_test_lock(lockvar) bind(c) |
| 185 | use omp_lib_kinds |
| 186 | logical (kind=omp_logical_kind) omp_test_lock |
| 187 | integer (kind=omp_lock_kind) lockvar |
| 188 | end function omp_test_lock |
| 189 | |
| 190 | subroutine omp_init_nest_lock(lockvar) bind(c) |
| 191 | use omp_lib_kinds |
| 192 | integer (kind=omp_nest_lock_kind) lockvar |
| 193 | end subroutine omp_init_nest_lock |
| 194 | |
| 195 | subroutine omp_destroy_nest_lock(lockvar) bind(c) |
| 196 | use omp_lib_kinds |
| 197 | integer (kind=omp_nest_lock_kind) lockvar |
| 198 | end subroutine omp_destroy_nest_lock |
| 199 | |
| 200 | subroutine omp_set_nest_lock(lockvar) bind(c) |
| 201 | use omp_lib_kinds |
| 202 | integer (kind=omp_nest_lock_kind) lockvar |
| 203 | end subroutine omp_set_nest_lock |
| 204 | |
| 205 | subroutine omp_unset_nest_lock(lockvar) bind(c) |
| 206 | use omp_lib_kinds |
| 207 | integer (kind=omp_nest_lock_kind) lockvar |
| 208 | end subroutine omp_unset_nest_lock |
| 209 | |
| 210 | function omp_test_nest_lock(lockvar) bind(c) |
| 211 | use omp_lib_kinds |
| 212 | integer (kind=omp_integer_kind) omp_test_nest_lock |
| 213 | integer (kind=omp_nest_lock_kind) lockvar |
| 214 | end function omp_test_nest_lock |
| 215 | |
| 216 | ! *** |
| 217 | ! *** kmp_* entry points |
| 218 | ! *** |
| 219 | |
| 220 | subroutine kmp_set_stacksize(size) bind(c) |
| 221 | use omp_lib_kinds |
| 222 | integer (kind=omp_integer_kind), value :: size |
| 223 | end subroutine kmp_set_stacksize |
| 224 | |
| 225 | subroutine kmp_set_stacksize_s(size) bind(c) |
| 226 | use omp_lib_kinds |
| 227 | integer (kind=kmp_size_t_kind), value :: size |
| 228 | end subroutine kmp_set_stacksize_s |
| 229 | |
| 230 | subroutine kmp_set_blocktime(msec) bind(c) |
| 231 | use omp_lib_kinds |
| 232 | integer (kind=omp_integer_kind), value :: msec |
| 233 | end subroutine kmp_set_blocktime |
| 234 | |
| 235 | subroutine kmp_set_library_serial() bind(c) |
| 236 | end subroutine kmp_set_library_serial |
| 237 | |
| 238 | subroutine kmp_set_library_turnaround() bind(c) |
| 239 | end subroutine kmp_set_library_turnaround |
| 240 | |
| 241 | subroutine kmp_set_library_throughput() bind(c) |
| 242 | end subroutine kmp_set_library_throughput |
| 243 | |
| 244 | subroutine kmp_set_library(libnum) bind(c) |
| 245 | use omp_lib_kinds |
| 246 | integer (kind=omp_integer_kind), value :: libnum |
| 247 | end subroutine kmp_set_library |
| 248 | |
| 249 | subroutine kmp_set_defaults(string) bind(c) |
| 250 | use, intrinsic :: iso_c_binding |
| 251 | character (kind=c_char) :: string(*) |
| 252 | end subroutine kmp_set_defaults |
| 253 | |
| 254 | function kmp_get_stacksize() bind(c) |
| 255 | use omp_lib_kinds |
| 256 | integer (kind=omp_integer_kind) kmp_get_stacksize |
| 257 | end function kmp_get_stacksize |
| 258 | |
| 259 | function kmp_get_stacksize_s() bind(c) |
| 260 | use omp_lib_kinds |
| 261 | integer (kind=kmp_size_t_kind) kmp_get_stacksize_s |
| 262 | end function kmp_get_stacksize_s |
| 263 | |
| 264 | function kmp_get_blocktime() bind(c) |
| 265 | use omp_lib_kinds |
| 266 | integer (kind=omp_integer_kind) kmp_get_blocktime |
| 267 | end function kmp_get_blocktime |
| 268 | |
| 269 | function kmp_get_library() bind(c) |
| 270 | use omp_lib_kinds |
| 271 | integer (kind=omp_integer_kind) kmp_get_library |
| 272 | end function kmp_get_library |
| 273 | |
| 274 | function kmp_set_affinity(mask) bind(c) |
| 275 | use omp_lib_kinds |
| 276 | integer (kind=omp_integer_kind) kmp_set_affinity |
| 277 | integer (kind=kmp_affinity_mask_kind) mask |
| 278 | end function kmp_set_affinity |
| 279 | |
| 280 | function kmp_get_affinity(mask) bind(c) |
| 281 | use omp_lib_kinds |
| 282 | integer (kind=omp_integer_kind) kmp_get_affinity |
| 283 | integer (kind=kmp_affinity_mask_kind) mask |
| 284 | end function kmp_get_affinity |
| 285 | |
| 286 | function kmp_get_affinity_max_proc() bind(c) |
| 287 | use omp_lib_kinds |
| 288 | integer (kind=omp_integer_kind) kmp_get_affinity_max_proc |
| 289 | end function kmp_get_affinity_max_proc |
| 290 | |
| 291 | subroutine kmp_create_affinity_mask(mask) bind(c) |
| 292 | use omp_lib_kinds |
| 293 | integer (kind=kmp_affinity_mask_kind) mask |
| 294 | end subroutine kmp_create_affinity_mask |
| 295 | |
| 296 | subroutine kmp_destroy_affinity_mask(mask) bind(c) |
| 297 | use omp_lib_kinds |
| 298 | integer (kind=kmp_affinity_mask_kind) mask |
| 299 | end subroutine kmp_destroy_affinity_mask |
| 300 | |
| 301 | function kmp_set_affinity_mask_proc(proc, mask) bind(c) |
| 302 | use omp_lib_kinds |
| 303 | integer (kind=omp_integer_kind) kmp_set_affinity_mask_proc |
| 304 | integer (kind=omp_integer_kind), value :: proc |
| 305 | integer (kind=kmp_affinity_mask_kind) mask |
| 306 | end function kmp_set_affinity_mask_proc |
| 307 | |
| 308 | function kmp_unset_affinity_mask_proc(proc, mask) bind(c) |
| 309 | use omp_lib_kinds |
| 310 | integer (kind=omp_integer_kind) kmp_unset_affinity_mask_proc |
| 311 | integer (kind=omp_integer_kind), value :: proc |
| 312 | integer (kind=kmp_affinity_mask_kind) mask |
| 313 | end function kmp_unset_affinity_mask_proc |
| 314 | |
| 315 | function kmp_get_affinity_mask_proc(proc, mask) bind(c) |
| 316 | use omp_lib_kinds |
| 317 | integer (kind=omp_integer_kind) kmp_get_affinity_mask_proc |
| 318 | integer (kind=omp_integer_kind), value :: proc |
| 319 | integer (kind=kmp_affinity_mask_kind) mask |
| 320 | end function kmp_get_affinity_mask_proc |
| 321 | |
| 322 | function kmp_malloc(size) bind(c) |
| 323 | use omp_lib_kinds |
| 324 | integer (kind=kmp_pointer_kind) kmp_malloc |
| 325 | integer (kind=kmp_size_t_kind), value :: size |
| 326 | end function kmp_malloc |
| 327 | |
| 328 | function kmp_calloc(nelem, elsize) bind(c) |
| 329 | use omp_lib_kinds |
| 330 | integer (kind=kmp_pointer_kind) kmp_calloc |
| 331 | integer (kind=kmp_size_t_kind), value :: nelem |
| 332 | integer (kind=kmp_size_t_kind), value :: elsize |
| 333 | end function kmp_calloc |
| 334 | |
| 335 | function kmp_realloc(ptr, size) bind(c) |
| 336 | use omp_lib_kinds |
| 337 | integer (kind=kmp_pointer_kind) kmp_realloc |
| 338 | integer (kind=kmp_pointer_kind), value :: ptr |
| 339 | integer (kind=kmp_size_t_kind), value :: size |
| 340 | end function kmp_realloc |
| 341 | |
| 342 | subroutine kmp_free(ptr) bind(c) |
| 343 | use omp_lib_kinds |
| 344 | integer (kind=kmp_pointer_kind), value :: ptr |
| 345 | end subroutine kmp_free |
| 346 | |
| 347 | subroutine kmp_set_warnings_on() bind(c) |
| 348 | end subroutine kmp_set_warnings_on |
| 349 | |
| 350 | subroutine kmp_set_warnings_off() bind(c) |
| 351 | end subroutine kmp_set_warnings_off |
| 352 | |
| 353 | end interface |
| 354 | |
| 355 | end module omp_lib |