1 1.18 mrg This is libgomp.info, produced by makeinfo version 6.5 from 2 1.11 mrg libgomp.texi. 3 1.1 mrg 4 1.19 mrg Copyright (C) 2006-2024 Free Software Foundation, Inc. 5 1.1 mrg 6 1.1 mrg Permission is granted to copy, distribute and/or modify this document 7 1.3 skrll under the terms of the GNU Free Documentation License, Version 1.3 or 8 1.1 mrg any later version published by the Free Software Foundation; with the 9 1.1 mrg Invariant Sections being "Funding Free Software", the Front-Cover texts 10 1.1 mrg being (a) (see below), and with the Back-Cover Texts being (b) (see 11 1.1 mrg below). A copy of the license is included in the section entitled "GNU 12 1.1 mrg Free Documentation License". 13 1.1 mrg 14 1.1 mrg (a) The FSF's Front-Cover Text is: 15 1.1 mrg 16 1.1 mrg A GNU Manual 17 1.1 mrg 18 1.1 mrg (b) The FSF's Back-Cover Text is: 19 1.1 mrg 20 1.1 mrg You have freedom to copy and modify this GNU Manual, like GNU 21 1.11 mrg software. Copies published by the Free Software Foundation raise funds 22 1.11 mrg for GNU development. 23 1.1 mrg INFO-DIR-SECTION GNU Libraries 24 1.1 mrg START-INFO-DIR-ENTRY 25 1.5 mrg * libgomp: (libgomp). GNU Offloading and Multi Processing Runtime Library. 26 1.1 mrg END-INFO-DIR-ENTRY 27 1.1 mrg 28 1.5 mrg This manual documents libgomp, the GNU Offloading and Multi 29 1.5 mrg Processing Runtime library. This is the GNU implementation of the 30 1.5 mrg OpenMP and OpenACC APIs for parallel and accelerator programming in 31 1.5 mrg C/C++ and Fortran. 32 1.1 mrg 33 1.1 mrg Published by the Free Software Foundation 51 Franklin Street, Fifth 34 1.1 mrg Floor Boston, MA 02110-1301 USA 35 1.1 mrg 36 1.19 mrg Copyright (C) 2006-2024 Free Software Foundation, Inc. 37 1.1 mrg 38 1.1 mrg Permission is granted to copy, distribute and/or modify this document 39 1.3 skrll under the terms of the GNU Free Documentation License, Version 1.3 or 40 1.1 mrg any later version published by the Free Software Foundation; with the 41 1.1 mrg Invariant Sections being "Funding Free Software", the Front-Cover texts 42 1.1 mrg being (a) (see below), and with the Back-Cover Texts being (b) (see 43 1.1 mrg below). A copy of the license is included in the section entitled "GNU 44 1.1 mrg Free Documentation License". 45 1.1 mrg 46 1.1 mrg (a) The FSF's Front-Cover Text is: 47 1.1 mrg 48 1.1 mrg A GNU Manual 49 1.1 mrg 50 1.1 mrg (b) The FSF's Back-Cover Text is: 51 1.1 mrg 52 1.1 mrg You have freedom to copy and modify this GNU Manual, like GNU 53 1.11 mrg software. Copies published by the Free Software Foundation raise funds 54 1.11 mrg for GNU development. 55 1.1 mrg 56 1.1 mrg 57 1.18 mrg File: libgomp.info, Node: Top, Next: Enabling OpenMP 58 1.1 mrg 59 1.1 mrg Introduction 60 1.1 mrg ************ 61 1.1 mrg 62 1.11 mrg This manual documents the usage of libgomp, the GNU Offloading and Multi 63 1.11 mrg Processing Runtime Library. This includes the GNU implementation of the 64 1.12 mrg OpenMP (https://www.openmp.org) Application Programming Interface (API) 65 1.11 mrg for multi-platform shared-memory parallel programming in C/C++ and 66 1.11 mrg Fortran, and the GNU implementation of the OpenACC 67 1.11 mrg (https://www.openacc.org) Application Programming Interface (API) for 68 1.5 mrg offloading of code to accelerator devices in C/C++ and Fortran. 69 1.5 mrg 70 1.5 mrg Originally, libgomp implemented the GNU OpenMP Runtime Library. 71 1.5 mrg Based on this, support for OpenACC and offloading (both OpenACC and 72 1.5 mrg OpenMP 4's target construct) has been added later on, and the library's 73 1.5 mrg name changed to GNU Offloading and Multi Processing Runtime Library. 74 1.1 mrg 75 1.1 mrg * Menu: 76 1.1 mrg 77 1.1 mrg * Enabling OpenMP:: How to enable OpenMP for your applications. 78 1.16 mrg * OpenMP Implementation Status:: List of implemented features by OpenMP version 79 1.12 mrg * OpenMP Runtime Library Routines: Runtime Library Routines. 80 1.12 mrg The OpenMP runtime application programming 81 1.1 mrg interface. 82 1.12 mrg * OpenMP Environment Variables: Environment Variables. 83 1.12 mrg Influencing OpenMP runtime behavior with 84 1.12 mrg environment variables. 85 1.8 mrg * Enabling OpenACC:: How to enable OpenACC for your 86 1.8 mrg applications. 87 1.8 mrg * OpenACC Runtime Library Routines:: The OpenACC runtime application 88 1.8 mrg programming interface. 89 1.8 mrg * OpenACC Environment Variables:: Influencing OpenACC runtime behavior with 90 1.8 mrg environment variables. 91 1.8 mrg * CUDA Streams Usage:: Notes on the implementation of 92 1.8 mrg asynchronous operations. 93 1.8 mrg * OpenACC Library Interoperability:: OpenACC library interoperability with the 94 1.8 mrg NVIDIA CUBLAS library. 95 1.13 mrg * OpenACC Profiling Interface:: 96 1.19 mrg * OpenMP-Implementation Specifics:: Notes specifics of this OpenMP 97 1.19 mrg implementation 98 1.19 mrg * Offload-Target Specifics:: Notes on offload-target specific internals 99 1.1 mrg * The libgomp ABI:: Notes on the external ABI presented by libgomp. 100 1.5 mrg * Reporting Bugs:: How to report bugs in the GNU Offloading and 101 1.5 mrg Multi Processing Runtime Library. 102 1.1 mrg * Copying:: GNU general public license says 103 1.1 mrg how you can copy and share libgomp. 104 1.1 mrg * GNU Free Documentation License:: 105 1.1 mrg How you can copy and share this manual. 106 1.1 mrg * Funding:: How to help assure continued work for free 107 1.1 mrg software. 108 1.3 skrll * Library Index:: Index of this documentation. 109 1.1 mrg 110 1.1 mrg 111 1.16 mrg File: libgomp.info, Node: Enabling OpenMP, Next: OpenMP Implementation Status, Up: Top 112 1.1 mrg 113 1.1 mrg 1 Enabling OpenMP 114 1.1 mrg ***************** 115 1.1 mrg 116 1.1 mrg To activate the OpenMP extensions for C/C++ and Fortran, the 117 1.19 mrg compile-time flag '-fopenmp' must be specified. For C and C++, this 118 1.19 mrg enables the handling of the OpenMP directives using '#pragma omp' and 119 1.19 mrg the '[[omp::directive(...)]]', '[[omp::sequence(...)]]' and 120 1.19 mrg '[[omp::decl(...)]]' attributes. For Fortran, it enables for free 121 1.19 mrg source form the '!$omp' sentinel for directives and the '!$' conditional 122 1.19 mrg compilation sentinel and for fixed source form the 'c$omp', '*$omp' and 123 1.19 mrg '!$omp' sentinels for directives and the 'c$', '*$' and '!$' conditional 124 1.19 mrg compilation sentinels. The flag also arranges for automatic linking of 125 1.19 mrg the OpenMP runtime library (*note Runtime Library Routines::). 126 1.19 mrg 127 1.19 mrg The '-fopenmp-simd' flag can be used to enable a subset of OpenMP 128 1.19 mrg directives that do not require the linking of either the OpenMP runtime 129 1.19 mrg library or the POSIX threads library. 130 1.11 mrg 131 1.16 mrg A complete description of all OpenMP directives may be found in the 132 1.16 mrg OpenMP Application Program Interface (https://www.openmp.org) manuals. 133 1.16 mrg See also *note OpenMP Implementation Status::. 134 1.1 mrg 135 1.1 mrg 136 1.16 mrg File: libgomp.info, Node: OpenMP Implementation Status, Next: Runtime Library Routines, Prev: Enabling OpenMP, Up: Top 137 1.1 mrg 138 1.16 mrg 2 OpenMP Implementation Status 139 1.16 mrg ****************************** 140 1.16 mrg 141 1.16 mrg * Menu: 142 1.16 mrg 143 1.16 mrg * OpenMP 4.5:: Feature completion status to 4.5 specification 144 1.16 mrg * OpenMP 5.0:: Feature completion status to 5.0 specification 145 1.16 mrg * OpenMP 5.1:: Feature completion status to 5.1 specification 146 1.19 mrg * OpenMP 5.2:: Feature completion status to 5.2 specification 147 1.19 mrg * OpenMP Technical Report 12:: Feature completion status to second 6.0 preview 148 1.16 mrg 149 1.16 mrg The '_OPENMP' preprocessor macro and Fortran's 'openmp_version' 150 1.16 mrg parameter, provided by 'omp_lib.h' and the 'omp_lib' module, have the 151 1.16 mrg value '201511' (i.e. OpenMP 4.5). 152 1.16 mrg 153 1.16 mrg 154 1.16 mrg File: libgomp.info, Node: OpenMP 4.5, Next: OpenMP 5.0, Up: OpenMP Implementation Status 155 1.16 mrg 156 1.16 mrg 2.1 OpenMP 4.5 157 1.16 mrg ============== 158 1.16 mrg 159 1.16 mrg The OpenMP 4.5 specification is fully supported. 160 1.16 mrg 161 1.16 mrg 162 1.16 mrg File: libgomp.info, Node: OpenMP 5.0, Next: OpenMP 5.1, Prev: OpenMP 4.5, Up: OpenMP Implementation Status 163 1.16 mrg 164 1.16 mrg 2.2 OpenMP 5.0 165 1.16 mrg ============== 166 1.16 mrg 167 1.16 mrg New features listed in Appendix B of the OpenMP specification 168 1.16 mrg ------------------------------------------------------------- 169 1.16 mrg 170 1.16 mrg Description Status Comments 171 1.16 mrg ----------------------------------------------------------------------- 172 1.16 mrg Array shaping N 173 1.16 mrg Array sections with non-unit strides in C N 174 1.16 mrg and C++ 175 1.16 mrg Iterators Y 176 1.16 mrg 'metadirective' directive N 177 1.19 mrg 'declare variant' directive P _simd_ traits 178 1.19 mrg not handled 179 1.16 mrg correctly 180 1.19 mrg TARGET-OFFLOAD-VAR ICV and Y 181 1.16 mrg 'OMP_TARGET_OFFLOAD' env variable 182 1.16 mrg Nested-parallel changes to Y 183 1.19 mrg MAX-ACTIVE-LEVELS-VAR ICV 184 1.19 mrg 'requires' directive P complete but no 185 1.19 mrg non-host device 186 1.19 mrg provides 187 1.19 mrg 'unified_shared_memory' 188 1.16 mrg 'teams' construct outside an enclosing Y 189 1.16 mrg target region 190 1.19 mrg Non-rectangular loop nests P Full support for 191 1.19 mrg C/C++, partial 192 1.19 mrg for Fortran 193 1.19 mrg (PR110735 194 1.19 mrg (https://gcc.gnu.org/PR110735)) 195 1.16 mrg '!=' as relational-op in canonical loop Y 196 1.16 mrg form for C/C++ 197 1.16 mrg 'nonmonotonic' as default loop schedule Y 198 1.16 mrg modifier for worksharing-loop constructs 199 1.19 mrg Collapse of associated loops that are Y 200 1.16 mrg imperfectly nested loops 201 1.16 mrg Clauses 'if', 'nontemporal' and Y 202 1.16 mrg 'order(concurrent)' in 'simd' construct 203 1.16 mrg 'atomic' constructs in 'simd' Y 204 1.16 mrg 'loop' construct Y 205 1.16 mrg 'order(concurrent)' clause Y 206 1.16 mrg 'scan' directive and 'in_scan' modifier Y 207 1.16 mrg for the 'reduction' clause 208 1.16 mrg 'in_reduction' clause on 'task' Y 209 1.16 mrg constructs 210 1.16 mrg 'in_reduction' clause on 'target' P 'nowait' only 211 1.16 mrg constructs stub 212 1.16 mrg 'task_reduction' clause with 'taskgroup' Y 213 1.16 mrg 'task' modifier to 'reduction' clause Y 214 1.16 mrg 'affinity' clause to 'task' construct Y Stub only 215 1.16 mrg 'detach' clause to 'task' construct Y 216 1.16 mrg 'omp_fulfill_event' runtime routine Y 217 1.16 mrg 'reduction' and 'in_reduction' clauses on Y 218 1.16 mrg 'taskloop' and 'taskloop simd' constructs 219 1.16 mrg 'taskloop' construct cancelable by Y 220 1.16 mrg 'cancel' construct 221 1.16 mrg 'mutexinoutset' _dependence-type_ for Y 222 1.16 mrg 'depend' clause 223 1.19 mrg Predefined memory spaces, memory Y See also 224 1.19 mrg allocators, allocator traits *note Memory allocation:: 225 1.16 mrg Memory management routines Y 226 1.19 mrg 'allocate' directive P Only C for 227 1.19 mrg stack/automatic 228 1.19 mrg and Fortran for 229 1.19 mrg stack/automatic 230 1.19 mrg and 231 1.19 mrg allocatable/pointer 232 1.19 mrg variables 233 1.19 mrg 'allocate' clause P Initial support 234 1.16 mrg 'use_device_addr' clause on 'target data' Y 235 1.19 mrg 'ancestor' modifier on 'device' clause Y 236 1.16 mrg Implicit declare target directive Y 237 1.16 mrg Discontiguous array section with 'target N 238 1.16 mrg update' construct 239 1.19 mrg C/C++'s lvalue expressions in 'to', Y 240 1.16 mrg 'from' and 'map' clauses 241 1.16 mrg C/C++'s lvalue expressions in 'depend' Y 242 1.16 mrg clauses 243 1.16 mrg Nested 'declare target' directive Y 244 1.16 mrg Combined 'master' constructs Y 245 1.16 mrg 'depend' clause on 'taskwait' Y 246 1.16 mrg Weak memory ordering clauses on 'atomic' Y 247 1.16 mrg and 'flush' construct 248 1.16 mrg 'hint' clause on the 'atomic' construct Y Stub only 249 1.16 mrg 'depobj' construct and depend objects Y 250 1.16 mrg Lock hints were renamed to Y 251 1.16 mrg synchronization hints 252 1.16 mrg 'conditional' modifier to 'lastprivate' Y 253 1.16 mrg clause 254 1.16 mrg Map-order clarifications P 255 1.16 mrg 'close' _map-type-modifier_ Y 256 1.16 mrg Mapping C/C++ pointer variables and to P 257 1.16 mrg assign the address of device memory 258 1.16 mrg mapped by an array section 259 1.16 mrg Mapping of Fortran pointer and P Mapping of vars 260 1.16 mrg allocatable variables, including pointer with allocatable 261 1.16 mrg and allocatable components of variables components 262 1.16 mrg unsupported 263 1.16 mrg 'defaultmap' extensions Y 264 1.16 mrg 'declare mapper' directive N 265 1.16 mrg 'omp_get_supported_active_levels' routine Y 266 1.16 mrg Runtime routines and environment Y 267 1.16 mrg variables to display runtime thread 268 1.16 mrg affinity information 269 1.16 mrg 'omp_pause_resource' and Y 270 1.16 mrg 'omp_pause_resource_all' runtime routines 271 1.16 mrg 'omp_get_device_num' runtime routine Y 272 1.16 mrg OMPT interface N 273 1.16 mrg OMPD interface N 274 1.16 mrg 275 1.16 mrg Other new OpenMP 5.0 features 276 1.16 mrg ----------------------------- 277 1.16 mrg 278 1.16 mrg Description Status Comments 279 1.16 mrg ----------------------------------------------------------------------- 280 1.16 mrg Supporting C++'s range-based for loop Y 281 1.16 mrg 282 1.16 mrg 283 1.19 mrg File: libgomp.info, Node: OpenMP 5.1, Next: OpenMP 5.2, Prev: OpenMP 5.0, Up: OpenMP Implementation Status 284 1.16 mrg 285 1.16 mrg 2.3 OpenMP 5.1 286 1.16 mrg ============== 287 1.16 mrg 288 1.16 mrg New features listed in Appendix B of the OpenMP specification 289 1.16 mrg ------------------------------------------------------------- 290 1.16 mrg 291 1.16 mrg Description Status Comments 292 1.16 mrg ----------------------------------------------------------------------- 293 1.16 mrg OpenMP directive as C++ attribute Y 294 1.16 mrg specifiers 295 1.19 mrg 'omp_all_memory' reserved locator Y 296 1.16 mrg _target_device trait_ in OpenMP Context N 297 1.16 mrg 'target_device' selector set in context N 298 1.16 mrg selectors 299 1.16 mrg C/C++'s 'declare variant' directive: N 300 1.16 mrg elision support of preprocessed code 301 1.16 mrg 'declare variant': new clauses N 302 1.16 mrg 'adjust_args' and 'append_args' 303 1.16 mrg 'dispatch' construct N 304 1.19 mrg device-specific ICV settings with Y 305 1.16 mrg environment variables 306 1.19 mrg 'assume' and 'assumes' directives Y 307 1.16 mrg 'nothing' directive Y 308 1.16 mrg 'error' directive Y 309 1.16 mrg 'masked' construct Y 310 1.16 mrg 'scope' directive Y 311 1.16 mrg Loop transformation constructs N 312 1.16 mrg 'strict' modifier in the 'grainsize' and Y 313 1.19 mrg 'num_tasks' clauses of the 'taskloop' 314 1.16 mrg construct 315 1.19 mrg 'align' clause in 'allocate' directive P Only C and 316 1.19 mrg Fortran (and not 317 1.19 mrg for static 318 1.19 mrg variables) 319 1.19 mrg 'align' modifier in 'allocate' clause Y 320 1.16 mrg 'thread_limit' clause to 'target' Y 321 1.16 mrg construct 322 1.16 mrg 'has_device_addr' clause to 'target' Y 323 1.16 mrg construct 324 1.19 mrg Iterators in 'target update' motion N 325 1.16 mrg clauses and 'map' clauses 326 1.19 mrg Indirect calls to the device version of a Y 327 1.16 mrg procedure or function in 'target' regions 328 1.16 mrg 'interop' directive N 329 1.16 mrg 'omp_interop_t' object support in runtime N 330 1.16 mrg routines 331 1.19 mrg 'nowait' clause in 'taskwait' directive Y 332 1.16 mrg Extensions to the 'atomic' directive Y 333 1.16 mrg 'seq_cst' clause on a 'flush' construct Y 334 1.19 mrg 'inoutset' argument to the 'depend' Y 335 1.16 mrg clause 336 1.16 mrg 'private' and 'firstprivate' argument to Y 337 1.16 mrg 'default' clause in C and C++ 338 1.19 mrg 'present' argument to 'defaultmap' clause Y 339 1.16 mrg 'omp_set_num_teams', Y 340 1.16 mrg 'omp_set_teams_thread_limit', 341 1.16 mrg 'omp_get_max_teams', 342 1.16 mrg 'omp_get_teams_thread_limit' runtime 343 1.16 mrg routines 344 1.19 mrg 'omp_target_is_accessible' runtime Y 345 1.16 mrg routine 346 1.19 mrg 'omp_target_memcpy_async' and Y 347 1.16 mrg 'omp_target_memcpy_rect_async' runtime 348 1.16 mrg routines 349 1.19 mrg 'omp_get_mapped_ptr' runtime routine Y 350 1.16 mrg 'omp_calloc', 'omp_realloc', Y 351 1.16 mrg 'omp_aligned_alloc' and 352 1.16 mrg 'omp_aligned_calloc' runtime routines 353 1.16 mrg 'omp_alloctrait_key_t' enum: Y 354 1.16 mrg 'omp_atv_serialized' added, 355 1.16 mrg 'omp_atv_default' changed 356 1.16 mrg 'omp_display_env' runtime routine Y 357 1.16 mrg 'ompt_scope_endpoint_t' enum: N 358 1.16 mrg 'ompt_scope_beginend' 359 1.16 mrg 'ompt_sync_region_t' enum additions N 360 1.16 mrg 'ompt_state_t' enum: N 361 1.16 mrg 'ompt_state_wait_barrier_implementation' 362 1.16 mrg and 'ompt_state_wait_barrier_teams' 363 1.16 mrg 'ompt_callback_target_data_op_emi_t', N 364 1.16 mrg 'ompt_callback_target_emi_t', 365 1.16 mrg 'ompt_callback_target_map_emi_t' and 366 1.16 mrg 'ompt_callback_target_submit_emi_t' 367 1.16 mrg 'ompt_callback_error_t' type N 368 1.16 mrg 'OMP_PLACES' syntax extensions Y 369 1.16 mrg 'OMP_NUM_TEAMS' and Y 370 1.16 mrg 'OMP_TEAMS_THREAD_LIMIT' environment 371 1.16 mrg variables 372 1.16 mrg 373 1.16 mrg Other new OpenMP 5.1 features 374 1.16 mrg ----------------------------- 375 1.16 mrg 376 1.16 mrg Description Status Comments 377 1.16 mrg ----------------------------------------------------------------------- 378 1.16 mrg Support of strictly structured blocks in Y 379 1.16 mrg Fortran 380 1.16 mrg Support of structured block sequences in Y 381 1.16 mrg C/C++ 382 1.16 mrg 'unconstrained' and 'reproducible' Y 383 1.16 mrg modifiers on 'order' clause 384 1.19 mrg Support 'begin/end declare target' syntax Y 385 1.19 mrg in C/C++ 386 1.19 mrg Pointer predetermined firstprivate N 387 1.19 mrg getting initialized to address of 388 1.19 mrg matching mapped list item per 5.1, Sect. 389 1.19 mrg 2.21.7.2 390 1.19 mrg For Fortran, diagnose placing declarative N 391 1.19 mrg before/between 'USE', 'IMPORT', and 392 1.19 mrg 'IMPLICIT' as invalid 393 1.19 mrg Optional comma between directive and Y 394 1.19 mrg clause in the '#pragma' form 395 1.19 mrg 'indirect' clause in 'declare target' Y 396 1.19 mrg 'device_type(nohost)'/'device_type(host)' N 397 1.19 mrg for variables 398 1.19 mrg 'present' modifier to the 'map', 'to' and Y 399 1.19 mrg 'from' clauses 400 1.19 mrg 401 1.19 mrg 402 1.19 mrg File: libgomp.info, Node: OpenMP 5.2, Next: OpenMP Technical Report 12, Prev: OpenMP 5.1, Up: OpenMP Implementation Status 403 1.19 mrg 404 1.19 mrg 2.4 OpenMP 5.2 405 1.19 mrg ============== 406 1.19 mrg 407 1.19 mrg New features listed in Appendix B of the OpenMP specification 408 1.19 mrg ------------------------------------------------------------- 409 1.19 mrg 410 1.19 mrg Description Status Comments 411 1.19 mrg ----------------------------------------------------------------------- 412 1.19 mrg 'omp_in_explicit_task' routine and Y 413 1.19 mrg EXPLICIT-TASK-VAR ICV 414 1.19 mrg 'omp'/'ompx'/'omx' sentinels and N/A warning for 415 1.19 mrg 'omp_'/'ompx_' namespaces 'ompx/omx' 416 1.19 mrg sentinels(1) 417 1.19 mrg Clauses on 'end' directive can be on Y 418 1.19 mrg directive 419 1.19 mrg 'destroy' clause with destroy-var Y 420 1.19 mrg argument on 'depobj' 421 1.19 mrg Deprecation of no-argument 'destroy' N 422 1.19 mrg clause on 'depobj' 423 1.19 mrg 'linear' clause syntax changes and 'step' Y 424 1.19 mrg modifier 425 1.19 mrg Deprecation of minus operator for N 426 1.19 mrg reductions 427 1.19 mrg Deprecation of separating 'map' modifiers N 428 1.19 mrg without comma 429 1.19 mrg 'declare mapper' with iterator and N 430 1.19 mrg 'present' modifiers 431 1.19 mrg If a matching mapped list item is not Y 432 1.19 mrg found in the data environment, the 433 1.19 mrg pointer retains its original value 434 1.19 mrg New 'enter' clause as alias for 'to' on Y 435 1.19 mrg declare target directive 436 1.19 mrg Deprecation of 'to' clause on declare N 437 1.19 mrg target directive 438 1.19 mrg Extended list of directives permitted in Y 439 1.19 mrg Fortran pure procedures 440 1.19 mrg New 'allocators' directive for Fortran Y 441 1.19 mrg Deprecation of 'allocate' directive for N 442 1.19 mrg Fortran allocatables/pointers 443 1.19 mrg Optional paired 'end' directive with N 444 1.19 mrg 'dispatch' 445 1.19 mrg New 'memspace' and 'traits' modifiers for N 446 1.19 mrg 'uses_allocators' 447 1.19 mrg Deprecation of traits array following the N 448 1.19 mrg allocator_handle expression in 449 1.19 mrg 'uses_allocators' 450 1.19 mrg New 'otherwise' clause as alias for N 451 1.19 mrg 'default' on metadirectives 452 1.19 mrg Deprecation of 'default' clause on N 453 1.19 mrg metadirectives 454 1.19 mrg Deprecation of delimited form of 'declare N 455 1.19 mrg target' 456 1.19 mrg Reproducible semantics changed for N 457 1.19 mrg 'order(concurrent)' 458 1.19 mrg 'allocate' and 'firstprivate' clauses on Y 459 1.19 mrg 'scope' 460 1.19 mrg 'ompt_callback_work' N 461 1.19 mrg Default map-type for the 'map' clause in Y 462 1.19 mrg 'target enter/exit data' 463 1.19 mrg New 'doacross' clause as alias for Y 464 1.19 mrg 'depend' with 'source'/'sink' modifier 465 1.19 mrg Deprecation of 'depend' with N 466 1.19 mrg 'source'/'sink' modifier 467 1.19 mrg 'omp_cur_iteration' keyword Y 468 1.19 mrg 469 1.19 mrg Other new OpenMP 5.2 features 470 1.19 mrg ----------------------------- 471 1.19 mrg 472 1.19 mrg Description Status Comments 473 1.19 mrg ----------------------------------------------------------------------- 474 1.19 mrg For Fortran, optional comma between N 475 1.19 mrg directive and clause 476 1.19 mrg Conforming device numbers and Y 477 1.19 mrg 'omp_initial_device' and 478 1.19 mrg 'omp_invalid_device' enum/PARAMETER 479 1.19 mrg Initial value of DEFAULT-DEVICE-VAR ICV Y 480 1.19 mrg with 'OMP_TARGET_OFFLOAD=mandatory' 481 1.19 mrg 'all' as _implicit-behavior_ for Y 482 1.19 mrg 'defaultmap' 483 1.19 mrg _interop_types_ in any position of the N 484 1.19 mrg modifier list for the 'init' clause of 485 1.19 mrg the 'interop' construct 486 1.19 mrg Invoke virtual member functions of C++ N 487 1.19 mrg objects created on the host device on 488 1.19 mrg other devices 489 1.19 mrg 490 1.19 mrg ---------- Footnotes ---------- 491 1.19 mrg 492 1.19 mrg (1) The 'ompx' sentinel as C/C++ pragma and C++ attributes are warned 493 1.19 mrg for with '-Wunknown-pragmas' (implied by '-Wall') and '-Wattributes' 494 1.19 mrg (enabled by default), respectively; for Fortran free-source code, there 495 1.19 mrg is a warning enabled by default and, for fixed-source code, the 'omx' 496 1.19 mrg sentinel is warned for with '-Wsurprising' (enabled by '-Wall'). 497 1.19 mrg Unknown clauses are always rejected with an error. 498 1.19 mrg 499 1.19 mrg 500 1.19 mrg File: libgomp.info, Node: OpenMP Technical Report 12, Prev: OpenMP 5.2, Up: OpenMP Implementation Status 501 1.19 mrg 502 1.19 mrg 2.5 OpenMP Technical Report 12 503 1.19 mrg ============================== 504 1.19 mrg 505 1.19 mrg Technical Report (TR) 12 is the second preview for OpenMP 6.0. 506 1.19 mrg 507 1.19 mrg New features listed in Appendix B of the OpenMP specification 508 1.19 mrg ------------------------------------------------------------- 509 1.19 mrg 510 1.19 mrg Features deprecated in versions 5.2, 5.1 N/A Backward 511 1.19 mrg and 5.0 were removed compatibility 512 1.19 mrg Full support for C23 was added P 513 1.19 mrg Full support for C++23 was added P 514 1.19 mrg '_ALL' suffix to the device-scope P Host device 515 1.19 mrg environment variables number wrongly 516 1.19 mrg accepted 517 1.19 mrg 'num_threads' now accepts a list N 518 1.19 mrg Supporting increments with abstract names N 519 1.19 mrg in 'OMP_PLACES' 520 1.19 mrg Extension of 'OMP_DEFAULT_DEVICE' and new N 521 1.19 mrg 'OMP_AVAILABLE_DEVICES' environment vars 522 1.19 mrg New 'OMP_THREADS_RESERVE' environment N 523 1.19 mrg variable 524 1.19 mrg The 'decl' attribute was added to the C++ Y 525 1.19 mrg attribute syntax 526 1.19 mrg The OpenMP directive syntax was extended Y 527 1.19 mrg to include C 23 attribute specifiers 528 1.19 mrg All inarguable clauses take now an N 529 1.19 mrg optional Boolean argument 530 1.19 mrg For Fortran, _locator list_ can be also N 531 1.19 mrg function reference with data pointer 532 1.19 mrg result 533 1.19 mrg Concept of _assumed-size arrays_ in C and N 534 1.19 mrg C++ 535 1.19 mrg _directive-name-modifier_ accepted in all N 536 1.19 mrg clauses 537 1.19 mrg For Fortran, atomic with BLOCK construct N 538 1.19 mrg and, for C/C++, with unlimited curly 539 1.19 mrg braces supported 540 1.19 mrg For Fortran, atomic compare with storing N 541 1.19 mrg the comparison result 542 1.19 mrg New 'looprange' clause N 543 1.19 mrg Ref-count change for N 544 1.19 mrg 'use_device_ptr'/'use_device_addr' 545 1.19 mrg Support for inductions N 546 1.19 mrg Implicit reduction identifiers of C++ N 547 1.19 mrg classes 548 1.19 mrg Change of the _map-type_ property from N 549 1.19 mrg _ultimate_ to _default_ 550 1.19 mrg 'self' modifier to 'map' and 'self' as N 551 1.19 mrg 'defaultmap' argument 552 1.19 mrg Mapping of _assumed-size arrays_ in C, N 553 1.19 mrg C++ and Fortran 554 1.19 mrg 'groupprivate' directive N 555 1.19 mrg 'local' clause to 'declare target' N 556 1.19 mrg directive 557 1.19 mrg 'part_size' allocator trait N 558 1.19 mrg 'pin_device', 'preferred_device' and N 559 1.19 mrg 'target_access' allocator traits 560 1.19 mrg 'access' allocator trait changes N 561 1.19 mrg Extension of 'interop' operation of N 562 1.19 mrg 'append_args', allowing all modifiers of 563 1.19 mrg the 'init' clause 564 1.19 mrg 'interop' clause to 'dispatch' N 565 1.19 mrg 'message' and 'severity' clauses to N 566 1.19 mrg 'parallel' directive 567 1.19 mrg 'self' clause to 'requires' directive N 568 1.19 mrg 'no_openmp_constructs' assumptions clause N 569 1.19 mrg 'reverse' loop-transformation construct N 570 1.19 mrg 'interchange' loop-transformation N 571 1.19 mrg construct 572 1.19 mrg 'fuse' loop-transformation construct N 573 1.19 mrg 'apply' code to loop-transforming N 574 1.19 mrg constructs 575 1.19 mrg 'omp_curr_progress_width' identifier N 576 1.19 mrg 'safesync' clause to the 'parallel' N 577 1.19 mrg construct 578 1.19 mrg 'omp_get_max_progress_width' runtime N 579 1.19 mrg routine 580 1.19 mrg 'strict' modifier keyword to N 581 1.19 mrg 'num_threads' 582 1.19 mrg 'atomic' permitted in a construct with N 583 1.19 mrg 'order(concurrent)' 584 1.19 mrg 'workdistribute' directive for Fortran N Renamed just 585 1.19 mrg after TR12; 586 1.19 mrg added in TR12 as 587 1.19 mrg 'coexecute' 588 1.19 mrg Fortran DO CONCURRENT as associated loop N 589 1.19 mrg in a 'loop' construct 590 1.19 mrg 'threadset' clause in task-generating N 591 1.19 mrg constructs 592 1.19 mrg 'nowait' clause with reverse-offload N 593 1.19 mrg 'target' directives 594 1.19 mrg Boolean argument to 'nowait' and N 595 1.19 mrg 'nogroup' may be non constant 596 1.19 mrg 'memscope' clause to 'atomic' and 'flush' N 597 1.19 mrg 'omp_is_free_agent' and N 598 1.19 mrg 'omp_ancestor_is_free_agent' routines 599 1.19 mrg 'omp_target_memset' and N 600 1.19 mrg 'omp_target_memset_rect_async' routines 601 1.19 mrg Routines for obtaining memory N 602 1.19 mrg spaces/allocators for shared/device 603 1.19 mrg memory 604 1.19 mrg 'omp_get_memspace_num_resources' routine N 605 1.19 mrg 'omp_get_submemspace' routine N 606 1.19 mrg 'ompt_target_data_transfer' and N 607 1.19 mrg 'ompt_target_data_transfer_async' values 608 1.19 mrg in 'ompt_target_data_op_t' enum 609 1.19 mrg 'ompt_get_buffer_limits' OMPT routine N 610 1.19 mrg 611 1.19 mrg Other new TR 12 features 612 1.19 mrg ------------------------ 613 1.19 mrg 614 1.19 mrg Canonical loop nest enclosed in N 615 1.19 mrg (multiple) curly braces (C/C++) or BLOCK 616 1.19 mrg constructs (Fortran) 617 1.19 mrg Relaxed Fortran restrictions to the N 618 1.19 mrg 'aligned' clause 619 1.19 mrg Mapping lambda captures N 620 1.19 mrg New 'omp_pause_stop_tool' constant for N 621 1.19 mrg omp_pause_resource 622 1.16 mrg 623 1.16 mrg 624 1.16 mrg File: libgomp.info, Node: Runtime Library Routines, Next: Environment Variables, Prev: OpenMP Implementation Status, Up: Top 625 1.16 mrg 626 1.16 mrg 3 OpenMP Runtime Library Routines 627 1.12 mrg ********************************* 628 1.1 mrg 629 1.19 mrg The runtime routines described here are defined by Section 18 of the 630 1.19 mrg OpenMP specification in version 5.2. 631 1.1 mrg 632 1.5 mrg * Menu: 633 1.1 mrg 634 1.19 mrg * Thread Team Routines:: 635 1.19 mrg * Thread Affinity Routines:: 636 1.19 mrg * Teams Region Routines:: 637 1.19 mrg * Tasking Routines:: 638 1.19 mrg * Resource Relinquishing Routines:: 639 1.19 mrg * Device Information Routines:: 640 1.19 mrg * Device Memory Routines:: 641 1.19 mrg * Lock Routines:: 642 1.19 mrg * Timing Routines:: 643 1.19 mrg * Event Routine:: 644 1.19 mrg * Memory Management Routines:: 645 1.19 mrg * Environment Display Routine:: 646 1.19 mrg 647 1.19 mrg 648 1.19 mrg File: libgomp.info, Node: Thread Team Routines, Next: Thread Affinity Routines, Up: Runtime Library Routines 649 1.19 mrg 650 1.19 mrg 3.1 Thread Team Routines 651 1.19 mrg ======================== 652 1.19 mrg 653 1.19 mrg Routines controlling threads in the current contention group. They have 654 1.19 mrg C linkage and do not throw exceptions. 655 1.19 mrg 656 1.19 mrg * Menu: 657 1.1 mrg 658 1.19 mrg * omp_set_num_threads:: Set upper team size limit 659 1.19 mrg * omp_get_num_threads:: Size of the active team 660 1.3 skrll * omp_get_max_threads:: Maximum number of threads of parallel region 661 1.1 mrg * omp_get_thread_num:: Current thread ID 662 1.1 mrg * omp_in_parallel:: Whether a parallel region is active 663 1.1 mrg * omp_set_dynamic:: Enable/disable dynamic teams 664 1.19 mrg * omp_get_dynamic:: Dynamic teams setting 665 1.19 mrg * omp_get_cancellation:: Whether cancellation support is enabled 666 1.1 mrg * omp_set_nested:: Enable/disable nested parallel regions 667 1.19 mrg * omp_get_nested:: Nested parallel regions 668 1.1 mrg * omp_set_schedule:: Set the runtime scheduling method 669 1.19 mrg * omp_get_schedule:: Obtain the runtime scheduling method 670 1.19 mrg * omp_get_teams_thread_limit:: Maximum number of threads imposed by teams 671 1.19 mrg * omp_get_supported_active_levels:: Maximum number of active regions supported 672 1.19 mrg * omp_set_max_active_levels:: Limits the number of active parallel regions 673 1.19 mrg * omp_get_max_active_levels:: Current maximum number of active regions 674 1.19 mrg * omp_get_level:: Number of parallel regions 675 1.19 mrg * omp_get_ancestor_thread_num:: Ancestor thread ID 676 1.19 mrg * omp_get_team_size:: Number of threads in a team 677 1.19 mrg * omp_get_active_level:: Number of active parallel regions 678 1.19 mrg 679 1.19 mrg 680 1.19 mrg File: libgomp.info, Node: omp_set_num_threads, Next: omp_get_num_threads, Up: Thread Team Routines 681 1.1 mrg 682 1.19 mrg 3.1.1 'omp_set_num_threads' - Set upper team size limit 683 1.19 mrg ------------------------------------------------------- 684 1.1 mrg 685 1.19 mrg _Description_: 686 1.19 mrg Specifies the number of threads used by default in subsequent 687 1.19 mrg parallel sections, if those do not specify a 'num_threads' clause. 688 1.19 mrg The argument of 'omp_set_num_threads' shall be a positive integer. 689 1.1 mrg 690 1.19 mrg _C/C++_: 691 1.19 mrg _Prototype_: 'void omp_set_num_threads(int num_threads);' 692 1.1 mrg 693 1.19 mrg _Fortran_: 694 1.19 mrg _Interface_: 'subroutine omp_set_num_threads(num_threads)' 695 1.19 mrg 'integer, intent(in) :: num_threads' 696 1.1 mrg 697 1.19 mrg _See also_: 698 1.19 mrg *note OMP_NUM_THREADS::, *note omp_get_num_threads::, *note 699 1.19 mrg omp_get_max_threads:: 700 1.16 mrg 701 1.19 mrg _Reference_: 702 1.19 mrg OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.1. 703 1.16 mrg 704 1.1 mrg 705 1.19 mrg File: libgomp.info, Node: omp_get_num_threads, Next: omp_get_max_threads, Prev: omp_set_num_threads, Up: Thread Team Routines 706 1.1 mrg 707 1.19 mrg 3.1.2 'omp_get_num_threads' - Size of the active team 708 1.19 mrg ----------------------------------------------------- 709 1.1 mrg 710 1.1 mrg _Description_: 711 1.19 mrg Returns the number of threads in the current team. In a sequential 712 1.19 mrg section of the program 'omp_get_num_threads' returns 1. 713 1.19 mrg 714 1.19 mrg The default team size may be initialized at startup by the 715 1.19 mrg 'OMP_NUM_THREADS' environment variable. At runtime, the size of 716 1.19 mrg the current team may be set either by the 'NUM_THREADS' clause or 717 1.19 mrg by 'omp_set_num_threads'. If none of the above were used to define 718 1.19 mrg a specific value and 'OMP_DYNAMIC' is disabled, one thread per CPU 719 1.19 mrg online is used. 720 1.1 mrg 721 1.19 mrg _C/C++_: 722 1.19 mrg _Prototype_: 'int omp_get_num_threads(void);' 723 1.1 mrg 724 1.1 mrg _Fortran_: 725 1.19 mrg _Interface_: 'integer function omp_get_num_threads()' 726 1.1 mrg 727 1.1 mrg _See also_: 728 1.19 mrg *note omp_get_max_threads::, *note omp_set_num_threads::, *note 729 1.19 mrg OMP_NUM_THREADS:: 730 1.1 mrg 731 1.1 mrg _Reference_: 732 1.19 mrg OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.2. 733 1.1 mrg 734 1.1 mrg 735 1.19 mrg File: libgomp.info, Node: omp_get_max_threads, Next: omp_get_thread_num, Prev: omp_get_num_threads, Up: Thread Team Routines 736 1.1 mrg 737 1.19 mrg 3.1.3 'omp_get_max_threads' - Maximum number of threads of parallel region 738 1.19 mrg -------------------------------------------------------------------------- 739 1.1 mrg 740 1.1 mrg _Description_: 741 1.19 mrg Return the maximum number of threads used for the current parallel 742 1.19 mrg region that does not use the clause 'num_threads'. 743 1.1 mrg 744 1.19 mrg _C/C++_: 745 1.19 mrg _Prototype_: 'int omp_get_max_threads(void);' 746 1.1 mrg 747 1.1 mrg _Fortran_: 748 1.19 mrg _Interface_: 'integer function omp_get_max_threads()' 749 1.1 mrg 750 1.1 mrg _See also_: 751 1.19 mrg *note omp_set_num_threads::, *note omp_set_dynamic::, *note 752 1.19 mrg omp_get_thread_limit:: 753 1.1 mrg 754 1.1 mrg _Reference_: 755 1.19 mrg OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.3. 756 1.1 mrg 757 1.1 mrg 758 1.19 mrg File: libgomp.info, Node: omp_get_thread_num, Next: omp_in_parallel, Prev: omp_get_max_threads, Up: Thread Team Routines 759 1.5 mrg 760 1.19 mrg 3.1.4 'omp_get_thread_num' - Current thread ID 761 1.19 mrg ---------------------------------------------- 762 1.5 mrg 763 1.5 mrg _Description_: 764 1.19 mrg Returns a unique thread identification number within the current 765 1.19 mrg team. In a sequential parts of the program, 'omp_get_thread_num' 766 1.19 mrg always returns 0. In parallel regions the return value varies from 767 1.19 mrg 0 to 'omp_get_num_threads'-1 inclusive. The return value of the 768 1.19 mrg primary thread of a team is always 0. 769 1.5 mrg 770 1.5 mrg _C/C++_: 771 1.19 mrg _Prototype_: 'int omp_get_thread_num(void);' 772 1.5 mrg 773 1.5 mrg _Fortran_: 774 1.19 mrg _Interface_: 'integer function omp_get_thread_num()' 775 1.5 mrg 776 1.5 mrg _See also_: 777 1.19 mrg *note omp_get_num_threads::, *note omp_get_ancestor_thread_num:: 778 1.5 mrg 779 1.5 mrg _Reference_: 780 1.19 mrg OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.4. 781 1.5 mrg 782 1.5 mrg 783 1.19 mrg File: libgomp.info, Node: omp_in_parallel, Next: omp_set_dynamic, Prev: omp_get_thread_num, Up: Thread Team Routines 784 1.5 mrg 785 1.19 mrg 3.1.5 'omp_in_parallel' - Whether a parallel region is active 786 1.19 mrg ------------------------------------------------------------- 787 1.5 mrg 788 1.5 mrg _Description_: 789 1.19 mrg This function returns 'true' if currently running in parallel, 790 1.19 mrg 'false' otherwise. Here, 'true' and 'false' represent their 791 1.19 mrg language-specific counterparts. 792 1.5 mrg 793 1.5 mrg _C/C++_: 794 1.19 mrg _Prototype_: 'int omp_in_parallel(void);' 795 1.1 mrg 796 1.5 mrg _Fortran_: 797 1.19 mrg _Interface_: 'logical function omp_in_parallel()' 798 1.5 mrg 799 1.5 mrg _Reference_: 800 1.19 mrg OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.6. 801 1.5 mrg 802 1.5 mrg 803 1.19 mrg File: libgomp.info, Node: omp_set_dynamic, Next: omp_get_dynamic, Prev: omp_in_parallel, Up: Thread Team Routines 804 1.16 mrg 805 1.19 mrg 3.1.6 'omp_set_dynamic' - Enable/disable dynamic teams 806 1.19 mrg ------------------------------------------------------ 807 1.16 mrg 808 1.16 mrg _Description_: 809 1.19 mrg Enable or disable the dynamic adjustment of the number of threads 810 1.19 mrg within a team. The function takes the language-specific equivalent 811 1.19 mrg of 'true' and 'false', where 'true' enables dynamic adjustment of 812 1.19 mrg team sizes and 'false' disables it. 813 1.16 mrg 814 1.19 mrg _C/C++_: 815 1.19 mrg _Prototype_: 'void omp_set_dynamic(int dynamic_threads);' 816 1.16 mrg 817 1.16 mrg _Fortran_: 818 1.19 mrg _Interface_: 'subroutine omp_set_dynamic(dynamic_threads)' 819 1.19 mrg 'logical, intent(in) :: dynamic_threads' 820 1.16 mrg 821 1.16 mrg _See also_: 822 1.19 mrg *note OMP_DYNAMIC::, *note omp_get_dynamic:: 823 1.16 mrg 824 1.16 mrg _Reference_: 825 1.19 mrg OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.7. 826 1.5 mrg 827 1.16 mrg 828 1.19 mrg File: libgomp.info, Node: omp_get_dynamic, Next: omp_get_cancellation, Prev: omp_set_dynamic, Up: Thread Team Routines 829 1.16 mrg 830 1.19 mrg 3.1.7 'omp_get_dynamic' - Dynamic teams setting 831 1.19 mrg ----------------------------------------------- 832 1.1 mrg 833 1.1 mrg _Description_: 834 1.11 mrg This function returns 'true' if enabled, 'false' otherwise. Here, 835 1.11 mrg 'true' and 'false' represent their language-specific counterparts. 836 1.1 mrg 837 1.1 mrg The dynamic team setting may be initialized at startup by the 838 1.11 mrg 'OMP_DYNAMIC' environment variable or at runtime using 839 1.11 mrg 'omp_set_dynamic'. If undefined, dynamic adjustment is disabled by 840 1.11 mrg default. 841 1.1 mrg 842 1.1 mrg _C/C++_: 843 1.11 mrg _Prototype_: 'int omp_get_dynamic(void);' 844 1.1 mrg 845 1.1 mrg _Fortran_: 846 1.11 mrg _Interface_: 'logical function omp_get_dynamic()' 847 1.1 mrg 848 1.1 mrg _See also_: 849 1.1 mrg *note omp_set_dynamic::, *note OMP_DYNAMIC:: 850 1.1 mrg 851 1.1 mrg _Reference_: 852 1.12 mrg OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.8. 853 1.1 mrg 854 1.1 mrg 855 1.19 mrg File: libgomp.info, Node: omp_get_cancellation, Next: omp_set_nested, Prev: omp_get_dynamic, Up: Thread Team Routines 856 1.16 mrg 857 1.19 mrg 3.1.8 'omp_get_cancellation' - Whether cancellation support is enabled 858 1.19 mrg ---------------------------------------------------------------------- 859 1.16 mrg 860 1.16 mrg _Description_: 861 1.19 mrg This function returns 'true' if cancellation is activated, 'false' 862 1.19 mrg otherwise. Here, 'true' and 'false' represent their 863 1.19 mrg language-specific counterparts. Unless 'OMP_CANCELLATION' is set 864 1.19 mrg true, cancellations are deactivated. 865 1.16 mrg 866 1.19 mrg _C/C++_: 867 1.19 mrg _Prototype_: 'int omp_get_cancellation(void);' 868 1.16 mrg 869 1.16 mrg _Fortran_: 870 1.19 mrg _Interface_: 'logical function omp_get_cancellation()' 871 1.16 mrg 872 1.16 mrg _See also_: 873 1.19 mrg *note OMP_CANCELLATION:: 874 1.16 mrg 875 1.16 mrg _Reference_: 876 1.19 mrg OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.9. 877 1.16 mrg 878 1.16 mrg 879 1.19 mrg File: libgomp.info, Node: omp_set_nested, Next: omp_get_nested, Prev: omp_get_cancellation, Up: Thread Team Routines 880 1.1 mrg 881 1.19 mrg 3.1.9 'omp_set_nested' - Enable/disable nested parallel regions 882 1.19 mrg --------------------------------------------------------------- 883 1.1 mrg 884 1.1 mrg _Description_: 885 1.19 mrg Enable or disable nested parallel regions, i.e., whether team 886 1.19 mrg members are allowed to create new teams. The function takes the 887 1.19 mrg language-specific equivalent of 'true' and 'false', where 'true' 888 1.19 mrg enables dynamic adjustment of team sizes and 'false' disables it. 889 1.19 mrg 890 1.19 mrg Enabling nested parallel regions also sets the maximum number of 891 1.19 mrg active nested regions to the maximum supported. Disabling nested 892 1.19 mrg parallel regions sets the maximum number of active nested regions 893 1.19 mrg to one. 894 1.19 mrg 895 1.19 mrg Note that the 'omp_set_nested' API routine was deprecated in the 896 1.19 mrg OpenMP specification 5.2 in favor of 'omp_set_max_active_levels'. 897 1.1 mrg 898 1.19 mrg _C/C++_: 899 1.19 mrg _Prototype_: 'void omp_set_nested(int nested);' 900 1.1 mrg 901 1.1 mrg _Fortran_: 902 1.19 mrg _Interface_: 'subroutine omp_set_nested(nested)' 903 1.19 mrg 'logical, intent(in) :: nested' 904 1.1 mrg 905 1.1 mrg _See also_: 906 1.19 mrg *note omp_get_nested::, *note omp_set_max_active_levels::, *note 907 1.19 mrg OMP_MAX_ACTIVE_LEVELS::, *note OMP_NESTED:: 908 1.1 mrg 909 1.1 mrg _Reference_: 910 1.19 mrg OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.10. 911 1.1 mrg 912 1.1 mrg 913 1.19 mrg File: libgomp.info, Node: omp_get_nested, Next: omp_set_schedule, Prev: omp_set_nested, Up: Thread Team Routines 914 1.1 mrg 915 1.19 mrg 3.1.10 'omp_get_nested' - Nested parallel regions 916 1.19 mrg ------------------------------------------------- 917 1.1 mrg 918 1.1 mrg _Description_: 919 1.19 mrg This function returns 'true' if nested parallel regions are 920 1.19 mrg enabled, 'false' otherwise. Here, 'true' and 'false' represent 921 1.1 mrg their language-specific counterparts. 922 1.1 mrg 923 1.16 mrg The state of nested parallel regions at startup depends on several 924 1.16 mrg environment variables. If 'OMP_MAX_ACTIVE_LEVELS' is defined and 925 1.16 mrg is set to greater than one, then nested parallel regions will be 926 1.16 mrg enabled. If not defined, then the value of the 'OMP_NESTED' 927 1.16 mrg environment variable will be followed if defined. If neither are 928 1.16 mrg defined, then if either 'OMP_NUM_THREADS' or 'OMP_PROC_BIND' are 929 1.16 mrg defined with a list of more than one value, then nested parallel 930 1.16 mrg regions are enabled. If none of these are defined, then nested 931 1.16 mrg parallel regions are disabled by default. 932 1.16 mrg 933 1.16 mrg Nested parallel regions can be enabled or disabled at runtime using 934 1.16 mrg 'omp_set_nested', or by setting the maximum number of nested 935 1.16 mrg regions with 'omp_set_max_active_levels' to one to disable, or 936 1.16 mrg above one to enable. 937 1.1 mrg 938 1.19 mrg Note that the 'omp_get_nested' API routine was deprecated in the 939 1.19 mrg OpenMP specification 5.2 in favor of 'omp_get_max_active_levels'. 940 1.19 mrg 941 1.1 mrg _C/C++_: 942 1.11 mrg _Prototype_: 'int omp_get_nested(void);' 943 1.1 mrg 944 1.1 mrg _Fortran_: 945 1.11 mrg _Interface_: 'logical function omp_get_nested()' 946 1.1 mrg 947 1.1 mrg _See also_: 948 1.19 mrg *note omp_get_max_active_levels::, *note omp_set_nested::, *note 949 1.16 mrg OMP_MAX_ACTIVE_LEVELS::, *note OMP_NESTED:: 950 1.1 mrg 951 1.1 mrg _Reference_: 952 1.12 mrg OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.11. 953 1.1 mrg 954 1.1 mrg 955 1.19 mrg File: libgomp.info, Node: omp_set_schedule, Next: omp_get_schedule, Prev: omp_get_nested, Up: Thread Team Routines 956 1.1 mrg 957 1.19 mrg 3.1.11 'omp_set_schedule' - Set the runtime scheduling method 958 1.19 mrg ------------------------------------------------------------- 959 1.1 mrg 960 1.1 mrg _Description_: 961 1.19 mrg Sets the runtime scheduling method. The KIND argument can have the 962 1.19 mrg value 'omp_sched_static', 'omp_sched_dynamic', 'omp_sched_guided' 963 1.19 mrg or 'omp_sched_auto'. Except for 'omp_sched_auto', the chunk size 964 1.19 mrg is set to the value of CHUNK_SIZE if positive, or to the default 965 1.19 mrg value if zero or negative. For 'omp_sched_auto' the CHUNK_SIZE 966 1.19 mrg argument is ignored. 967 1.5 mrg 968 1.19 mrg _C/C++_ 969 1.19 mrg _Prototype_: 'void omp_set_schedule(omp_sched_t kind, int 970 1.19 mrg chunk_size);' 971 1.5 mrg 972 1.5 mrg _Fortran_: 973 1.19 mrg _Interface_: 'subroutine omp_set_schedule(kind, chunk_size)' 974 1.19 mrg 'integer(kind=omp_sched_kind) kind' 975 1.19 mrg 'integer chunk_size' 976 1.19 mrg 977 1.19 mrg _See also_: 978 1.19 mrg *note omp_get_schedule:: *note OMP_SCHEDULE:: 979 1.5 mrg 980 1.5 mrg _Reference_: 981 1.19 mrg OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.12. 982 1.5 mrg 983 1.5 mrg 984 1.19 mrg File: libgomp.info, Node: omp_get_schedule, Next: omp_get_teams_thread_limit, Prev: omp_set_schedule, Up: Thread Team Routines 985 1.5 mrg 986 1.19 mrg 3.1.12 'omp_get_schedule' - Obtain the runtime scheduling method 987 1.19 mrg ---------------------------------------------------------------- 988 1.5 mrg 989 1.5 mrg _Description_: 990 1.19 mrg Obtain the runtime scheduling method. The KIND argument is set to 991 1.19 mrg 'omp_sched_static', 'omp_sched_dynamic', 'omp_sched_guided' or 992 1.19 mrg 'omp_sched_auto'. The second argument, CHUNK_SIZE, is set to the 993 1.19 mrg chunk size. 994 1.1 mrg 995 1.19 mrg _C/C++_ 996 1.19 mrg _Prototype_: 'void omp_get_schedule(omp_sched_t *kind, int 997 1.19 mrg *chunk_size);' 998 1.1 mrg 999 1.1 mrg _Fortran_: 1000 1.19 mrg _Interface_: 'subroutine omp_get_schedule(kind, chunk_size)' 1001 1.19 mrg 'integer(kind=omp_sched_kind) kind' 1002 1.19 mrg 'integer chunk_size' 1003 1.19 mrg 1004 1.19 mrg _See also_: 1005 1.19 mrg *note omp_set_schedule::, *note OMP_SCHEDULE:: 1006 1.1 mrg 1007 1.1 mrg _Reference_: 1008 1.19 mrg OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.13. 1009 1.1 mrg 1010 1.1 mrg 1011 1.19 mrg File: libgomp.info, Node: omp_get_teams_thread_limit, Next: omp_get_supported_active_levels, Prev: omp_get_schedule, Up: Thread Team Routines 1012 1.1 mrg 1013 1.19 mrg 3.1.13 'omp_get_teams_thread_limit' - Maximum number of threads imposed by teams 1014 1.19 mrg -------------------------------------------------------------------------------- 1015 1.1 mrg 1016 1.1 mrg _Description_: 1017 1.19 mrg Return the maximum number of threads that are able to participate 1018 1.19 mrg in each team created by a teams construct. 1019 1.5 mrg 1020 1.5 mrg _C/C++_: 1021 1.19 mrg _Prototype_: 'int omp_get_teams_thread_limit(void);' 1022 1.5 mrg 1023 1.5 mrg _Fortran_: 1024 1.19 mrg _Interface_: 'integer function omp_get_teams_thread_limit()' 1025 1.19 mrg 1026 1.19 mrg _See also_: 1027 1.19 mrg *note omp_set_teams_thread_limit::, *note OMP_TEAMS_THREAD_LIMIT:: 1028 1.5 mrg 1029 1.5 mrg _Reference_: 1030 1.19 mrg OpenMP specification v5.1 (https://www.openmp.org), Section 3.4.6. 1031 1.5 mrg 1032 1.5 mrg 1033 1.19 mrg File: libgomp.info, Node: omp_get_supported_active_levels, Next: omp_set_max_active_levels, Prev: omp_get_teams_thread_limit, Up: Thread Team Routines 1034 1.5 mrg 1035 1.19 mrg 3.1.14 'omp_get_supported_active_levels' - Maximum number of active regions supported 1036 1.19 mrg ------------------------------------------------------------------------------------- 1037 1.5 mrg 1038 1.5 mrg _Description_: 1039 1.19 mrg This function returns the maximum number of nested, active parallel 1040 1.19 mrg regions supported by this implementation. 1041 1.1 mrg 1042 1.19 mrg _C/C++_ 1043 1.19 mrg _Prototype_: 'int omp_get_supported_active_levels(void);' 1044 1.1 mrg 1045 1.1 mrg _Fortran_: 1046 1.19 mrg _Interface_: 'integer function omp_get_supported_active_levels()' 1047 1.1 mrg 1048 1.1 mrg _See also_: 1049 1.19 mrg *note omp_get_max_active_levels::, *note 1050 1.19 mrg omp_set_max_active_levels:: 1051 1.1 mrg 1052 1.1 mrg _Reference_: 1053 1.19 mrg OpenMP specification v5.0 (https://www.openmp.org), Section 3.2.15. 1054 1.5 mrg 1055 1.5 mrg 1056 1.19 mrg File: libgomp.info, Node: omp_set_max_active_levels, Next: omp_get_max_active_levels, Prev: omp_get_supported_active_levels, Up: Thread Team Routines 1057 1.5 mrg 1058 1.19 mrg 3.1.15 'omp_set_max_active_levels' - Limits the number of active parallel regions 1059 1.19 mrg --------------------------------------------------------------------------------- 1060 1.5 mrg 1061 1.5 mrg _Description_: 1062 1.19 mrg This function limits the maximum allowed number of nested, active 1063 1.19 mrg parallel regions. MAX_LEVELS must be less or equal to the value 1064 1.19 mrg returned by 'omp_get_supported_active_levels'. 1065 1.5 mrg 1066 1.19 mrg _C/C++_ 1067 1.19 mrg _Prototype_: 'void omp_set_max_active_levels(int max_levels);' 1068 1.5 mrg 1069 1.5 mrg _Fortran_: 1070 1.19 mrg _Interface_: 'subroutine omp_set_max_active_levels(max_levels)' 1071 1.19 mrg 'integer max_levels' 1072 1.5 mrg 1073 1.5 mrg _See also_: 1074 1.19 mrg *note omp_get_max_active_levels::, *note omp_get_active_level::, 1075 1.19 mrg *note omp_get_supported_active_levels:: 1076 1.5 mrg 1077 1.5 mrg _Reference_: 1078 1.19 mrg OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.15. 1079 1.1 mrg 1080 1.1 mrg 1081 1.19 mrg File: libgomp.info, Node: omp_get_max_active_levels, Next: omp_get_level, Prev: omp_set_max_active_levels, Up: Thread Team Routines 1082 1.1 mrg 1083 1.19 mrg 3.1.16 'omp_get_max_active_levels' - Current maximum number of active regions 1084 1.19 mrg ----------------------------------------------------------------------------- 1085 1.1 mrg 1086 1.1 mrg _Description_: 1087 1.19 mrg This function obtains the maximum allowed number of nested, active 1088 1.19 mrg parallel regions. 1089 1.1 mrg 1090 1.1 mrg _C/C++_ 1091 1.19 mrg _Prototype_: 'int omp_get_max_active_levels(void);' 1092 1.1 mrg 1093 1.1 mrg _Fortran_: 1094 1.19 mrg _Interface_: 'integer function omp_get_max_active_levels()' 1095 1.1 mrg 1096 1.1 mrg _See also_: 1097 1.19 mrg *note omp_set_max_active_levels::, *note omp_get_active_level:: 1098 1.1 mrg 1099 1.1 mrg _Reference_: 1100 1.19 mrg OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.16. 1101 1.5 mrg 1102 1.5 mrg 1103 1.19 mrg File: libgomp.info, Node: omp_get_level, Next: omp_get_ancestor_thread_num, Prev: omp_get_max_active_levels, Up: Thread Team Routines 1104 1.16 mrg 1105 1.19 mrg 3.1.17 'omp_get_level' - Obtain the current nesting level 1106 1.19 mrg --------------------------------------------------------- 1107 1.16 mrg 1108 1.16 mrg _Description_: 1109 1.19 mrg This function returns the nesting level for the parallel blocks, 1110 1.19 mrg which enclose the calling call. 1111 1.16 mrg 1112 1.16 mrg _C/C++_ 1113 1.19 mrg _Prototype_: 'int omp_get_level(void);' 1114 1.5 mrg 1115 1.16 mrg _Fortran_: 1116 1.19 mrg _Interface_: 'integer function omp_level()' 1117 1.16 mrg 1118 1.16 mrg _See also_: 1119 1.19 mrg *note omp_get_active_level:: 1120 1.16 mrg 1121 1.16 mrg _Reference_: 1122 1.19 mrg OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.17. 1123 1.16 mrg 1124 1.16 mrg 1125 1.19 mrg File: libgomp.info, Node: omp_get_ancestor_thread_num, Next: omp_get_team_size, Prev: omp_get_level, Up: Thread Team Routines 1126 1.16 mrg 1127 1.19 mrg 3.1.18 'omp_get_ancestor_thread_num' - Ancestor thread ID 1128 1.19 mrg --------------------------------------------------------- 1129 1.5 mrg 1130 1.5 mrg _Description_: 1131 1.19 mrg This function returns the thread identification number for the 1132 1.19 mrg given nesting level of the current thread. For values of LEVEL 1133 1.19 mrg outside zero to 'omp_get_level' -1 is returned; if LEVEL is 1134 1.19 mrg 'omp_get_level' the result is identical to 'omp_get_thread_num'. 1135 1.5 mrg 1136 1.19 mrg _C/C++_ 1137 1.19 mrg _Prototype_: 'int omp_get_ancestor_thread_num(int level);' 1138 1.5 mrg 1139 1.5 mrg _Fortran_: 1140 1.19 mrg _Interface_: 'integer function omp_get_ancestor_thread_num(level)' 1141 1.19 mrg 'integer level' 1142 1.19 mrg 1143 1.19 mrg _See also_: 1144 1.19 mrg *note omp_get_level::, *note omp_get_thread_num::, *note 1145 1.19 mrg omp_get_team_size:: 1146 1.5 mrg 1147 1.5 mrg _Reference_: 1148 1.19 mrg OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.18. 1149 1.1 mrg 1150 1.1 mrg 1151 1.19 mrg File: libgomp.info, Node: omp_get_team_size, Next: omp_get_active_level, Prev: omp_get_ancestor_thread_num, Up: Thread Team Routines 1152 1.1 mrg 1153 1.19 mrg 3.1.19 'omp_get_team_size' - Number of threads in a team 1154 1.19 mrg -------------------------------------------------------- 1155 1.1 mrg 1156 1.1 mrg _Description_: 1157 1.1 mrg This function returns the number of threads in a thread team to 1158 1.5 mrg which either the current thread or its ancestor belongs. For 1159 1.11 mrg values of LEVEL outside zero to 'omp_get_level', -1 is returned; if 1160 1.11 mrg LEVEL is zero, 1 is returned, and for 'omp_get_level', the result 1161 1.11 mrg is identical to 'omp_get_num_threads'. 1162 1.1 mrg 1163 1.1 mrg _C/C++_: 1164 1.11 mrg _Prototype_: 'int omp_get_team_size(int level);' 1165 1.1 mrg 1166 1.1 mrg _Fortran_: 1167 1.11 mrg _Interface_: 'integer function omp_get_team_size(level)' 1168 1.11 mrg 'integer level' 1169 1.1 mrg 1170 1.1 mrg _See also_: 1171 1.1 mrg *note omp_get_num_threads::, *note omp_get_level::, *note 1172 1.1 mrg omp_get_ancestor_thread_num:: 1173 1.1 mrg 1174 1.1 mrg _Reference_: 1175 1.12 mrg OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.19. 1176 1.1 mrg 1177 1.1 mrg 1178 1.19 mrg File: libgomp.info, Node: omp_get_active_level, Prev: omp_get_team_size, Up: Thread Team Routines 1179 1.16 mrg 1180 1.19 mrg 3.1.20 'omp_get_active_level' - Number of parallel regions 1181 1.19 mrg ---------------------------------------------------------- 1182 1.16 mrg 1183 1.16 mrg _Description_: 1184 1.19 mrg This function returns the nesting level for the active parallel 1185 1.19 mrg blocks, which enclose the calling call. 1186 1.16 mrg 1187 1.19 mrg _C/C++_ 1188 1.19 mrg _Prototype_: 'int omp_get_active_level(void);' 1189 1.1 mrg 1190 1.16 mrg _Fortran_: 1191 1.19 mrg _Interface_: 'integer function omp_get_active_level()' 1192 1.16 mrg 1193 1.16 mrg _See also_: 1194 1.19 mrg *note omp_get_level::, *note omp_get_max_active_levels::, *note 1195 1.19 mrg omp_set_max_active_levels:: 1196 1.16 mrg 1197 1.16 mrg _Reference_: 1198 1.19 mrg OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.20. 1199 1.16 mrg 1200 1.16 mrg 1201 1.19 mrg File: libgomp.info, Node: Thread Affinity Routines, Next: Teams Region Routines, Prev: Thread Team Routines, Up: Runtime Library Routines 1202 1.16 mrg 1203 1.19 mrg 3.2 Thread Affinity Routines 1204 1.19 mrg ============================ 1205 1.1 mrg 1206 1.19 mrg Routines controlling and accessing thread-affinity policies. They have 1207 1.19 mrg C linkage and do not throw exceptions. 1208 1.1 mrg 1209 1.19 mrg * Menu: 1210 1.1 mrg 1211 1.19 mrg * omp_get_proc_bind:: Whether threads may be moved between CPUs 1212 1.1 mrg 1213 1.1 mrg 1214 1.19 mrg File: libgomp.info, Node: omp_get_proc_bind, Up: Thread Affinity Routines 1215 1.1 mrg 1216 1.19 mrg 3.2.1 'omp_get_proc_bind' - Whether threads may be moved between CPUs 1217 1.19 mrg --------------------------------------------------------------------- 1218 1.1 mrg 1219 1.1 mrg _Description_: 1220 1.19 mrg This functions returns the currently active thread affinity policy, 1221 1.19 mrg which is set via 'OMP_PROC_BIND'. Possible values are 1222 1.19 mrg 'omp_proc_bind_false', 'omp_proc_bind_true', 1223 1.19 mrg 'omp_proc_bind_primary', 'omp_proc_bind_master', 1224 1.19 mrg 'omp_proc_bind_close' and 'omp_proc_bind_spread', where 1225 1.19 mrg 'omp_proc_bind_master' is an alias for 'omp_proc_bind_primary'. 1226 1.1 mrg 1227 1.1 mrg _C/C++_: 1228 1.19 mrg _Prototype_: 'omp_proc_bind_t omp_get_proc_bind(void);' 1229 1.1 mrg 1230 1.1 mrg _Fortran_: 1231 1.19 mrg _Interface_: 'integer(kind=omp_proc_bind_kind) function 1232 1.19 mrg omp_get_proc_bind()' 1233 1.1 mrg 1234 1.1 mrg _See also_: 1235 1.19 mrg *note OMP_PROC_BIND::, *note OMP_PLACES::, *note 1236 1.19 mrg GOMP_CPU_AFFINITY::, 1237 1.1 mrg 1238 1.1 mrg _Reference_: 1239 1.19 mrg OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.22. 1240 1.1 mrg 1241 1.1 mrg 1242 1.19 mrg File: libgomp.info, Node: Teams Region Routines, Next: Tasking Routines, Prev: Thread Affinity Routines, Up: Runtime Library Routines 1243 1.1 mrg 1244 1.19 mrg 3.3 Teams Region Routines 1245 1.19 mrg ========================= 1246 1.1 mrg 1247 1.19 mrg Routines controlling the league of teams that are executed in a 'teams' 1248 1.19 mrg region. They have C linkage and do not throw exceptions. 1249 1.1 mrg 1250 1.19 mrg * Menu: 1251 1.1 mrg 1252 1.19 mrg * omp_get_num_teams:: Number of teams 1253 1.19 mrg * omp_get_team_num:: Get team number 1254 1.19 mrg * omp_set_num_teams:: Set upper teams limit for teams region 1255 1.19 mrg * omp_get_max_teams:: Maximum number of teams for teams region 1256 1.19 mrg * omp_set_teams_thread_limit:: Set upper thread limit for teams construct 1257 1.19 mrg * omp_get_thread_limit:: Maximum number of threads 1258 1.1 mrg 1259 1.1 mrg 1260 1.19 mrg File: libgomp.info, Node: omp_get_num_teams, Next: omp_get_team_num, Up: Teams Region Routines 1261 1.3 skrll 1262 1.19 mrg 3.3.1 'omp_get_num_teams' - Number of teams 1263 1.19 mrg ------------------------------------------- 1264 1.3 skrll 1265 1.3 skrll _Description_: 1266 1.19 mrg Returns the number of teams in the current team region. 1267 1.3 skrll 1268 1.3 skrll _C/C++_: 1269 1.19 mrg _Prototype_: 'int omp_get_num_teams(void);' 1270 1.1 mrg 1271 1.3 skrll _Fortran_: 1272 1.19 mrg _Interface_: 'integer function omp_get_num_teams()' 1273 1.3 skrll 1274 1.3 skrll _Reference_: 1275 1.19 mrg OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.32. 1276 1.5 mrg 1277 1.5 mrg 1278 1.19 mrg File: libgomp.info, Node: omp_get_team_num, Next: omp_set_num_teams, Prev: omp_get_num_teams, Up: Teams Region Routines 1279 1.5 mrg 1280 1.19 mrg 3.3.2 'omp_get_team_num' - Get team number 1281 1.19 mrg ------------------------------------------ 1282 1.5 mrg 1283 1.5 mrg _Description_: 1284 1.19 mrg Returns the team number of the calling thread. 1285 1.5 mrg 1286 1.5 mrg _C/C++_: 1287 1.19 mrg _Prototype_: 'int omp_get_team_num(void);' 1288 1.5 mrg 1289 1.5 mrg _Fortran_: 1290 1.19 mrg _Interface_: 'integer function omp_get_team_num()' 1291 1.5 mrg 1292 1.5 mrg _Reference_: 1293 1.19 mrg OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.33. 1294 1.5 mrg 1295 1.5 mrg 1296 1.19 mrg File: libgomp.info, Node: omp_set_num_teams, Next: omp_get_max_teams, Prev: omp_get_team_num, Up: Teams Region Routines 1297 1.5 mrg 1298 1.19 mrg 3.3.3 'omp_set_num_teams' - Set upper teams limit for teams construct 1299 1.19 mrg --------------------------------------------------------------------- 1300 1.5 mrg 1301 1.5 mrg _Description_: 1302 1.19 mrg Specifies the upper bound for number of teams created by the teams 1303 1.19 mrg construct which does not specify a 'num_teams' clause. The 1304 1.19 mrg argument of 'omp_set_num_teams' shall be a positive integer. 1305 1.5 mrg 1306 1.5 mrg _C/C++_: 1307 1.19 mrg _Prototype_: 'void omp_set_num_teams(int num_teams);' 1308 1.5 mrg 1309 1.5 mrg _Fortran_: 1310 1.19 mrg _Interface_: 'subroutine omp_set_num_teams(num_teams)' 1311 1.19 mrg 'integer, intent(in) :: num_teams' 1312 1.5 mrg 1313 1.5 mrg _See also_: 1314 1.19 mrg *note OMP_NUM_TEAMS::, *note omp_get_num_teams::, *note 1315 1.19 mrg omp_get_max_teams:: 1316 1.5 mrg 1317 1.5 mrg _Reference_: 1318 1.19 mrg OpenMP specification v5.1 (https://www.openmp.org), Section 3.4.3. 1319 1.3 skrll 1320 1.3 skrll 1321 1.19 mrg File: libgomp.info, Node: omp_get_max_teams, Next: omp_set_teams_thread_limit, Prev: omp_set_num_teams, Up: Teams Region Routines 1322 1.3 skrll 1323 1.19 mrg 3.3.4 'omp_get_max_teams' - Maximum number of teams of teams region 1324 1.19 mrg ------------------------------------------------------------------- 1325 1.1 mrg 1326 1.1 mrg _Description_: 1327 1.19 mrg Return the maximum number of teams used for the teams region that 1328 1.19 mrg does not use the clause 'num_teams'. 1329 1.1 mrg 1330 1.1 mrg _C/C++_: 1331 1.19 mrg _Prototype_: 'int omp_get_max_teams(void);' 1332 1.1 mrg 1333 1.1 mrg _Fortran_: 1334 1.19 mrg _Interface_: 'integer function omp_get_max_teams()' 1335 1.1 mrg 1336 1.1 mrg _See also_: 1337 1.19 mrg *note omp_set_num_teams::, *note omp_get_num_teams:: 1338 1.1 mrg 1339 1.1 mrg _Reference_: 1340 1.19 mrg OpenMP specification v5.1 (https://www.openmp.org), Section 3.4.4. 1341 1.1 mrg 1342 1.1 mrg 1343 1.19 mrg File: libgomp.info, Node: omp_set_teams_thread_limit, Next: omp_get_thread_limit, Prev: omp_get_max_teams, Up: Teams Region Routines 1344 1.1 mrg 1345 1.19 mrg 3.3.5 'omp_set_teams_thread_limit' - Set upper thread limit for teams construct 1346 1.19 mrg ------------------------------------------------------------------------------- 1347 1.1 mrg 1348 1.1 mrg _Description_: 1349 1.19 mrg Specifies the upper bound for number of threads that are available 1350 1.19 mrg for each team created by the teams construct which does not specify 1351 1.19 mrg a 'thread_limit' clause. The argument of 1352 1.19 mrg 'omp_set_teams_thread_limit' shall be a positive integer. 1353 1.1 mrg 1354 1.19 mrg _C/C++_: 1355 1.19 mrg _Prototype_: 'void omp_set_teams_thread_limit(int thread_limit);' 1356 1.1 mrg 1357 1.1 mrg _Fortran_: 1358 1.19 mrg _Interface_: 'subroutine omp_set_teams_thread_limit(thread_limit)' 1359 1.19 mrg 'integer, intent(in) :: thread_limit' 1360 1.1 mrg 1361 1.1 mrg _See also_: 1362 1.19 mrg *note OMP_TEAMS_THREAD_LIMIT::, *note omp_get_teams_thread_limit::, 1363 1.19 mrg *note omp_get_thread_limit:: 1364 1.1 mrg 1365 1.1 mrg _Reference_: 1366 1.19 mrg OpenMP specification v5.1 (https://www.openmp.org), Section 3.4.5. 1367 1.1 mrg 1368 1.1 mrg 1369 1.19 mrg File: libgomp.info, Node: omp_get_thread_limit, Prev: omp_set_teams_thread_limit, Up: Teams Region Routines 1370 1.1 mrg 1371 1.19 mrg 3.3.6 'omp_get_thread_limit' - Maximum number of threads 1372 1.19 mrg -------------------------------------------------------- 1373 1.1 mrg 1374 1.1 mrg _Description_: 1375 1.19 mrg Return the maximum number of threads of the program. 1376 1.16 mrg 1377 1.1 mrg _C/C++_: 1378 1.19 mrg _Prototype_: 'int omp_get_thread_limit(void);' 1379 1.1 mrg 1380 1.1 mrg _Fortran_: 1381 1.19 mrg _Interface_: 'integer function omp_get_thread_limit()' 1382 1.1 mrg 1383 1.1 mrg _See also_: 1384 1.19 mrg *note omp_get_max_threads::, *note OMP_THREAD_LIMIT:: 1385 1.1 mrg 1386 1.1 mrg _Reference_: 1387 1.19 mrg OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.14. 1388 1.19 mrg 1389 1.19 mrg 1390 1.19 mrg File: libgomp.info, Node: Tasking Routines, Next: Resource Relinquishing Routines, Prev: Teams Region Routines, Up: Runtime Library Routines 1391 1.19 mrg 1392 1.19 mrg 3.4 Tasking Routines 1393 1.19 mrg ==================== 1394 1.19 mrg 1395 1.19 mrg Routines relating to explicit tasks. They have C linkage and do not 1396 1.19 mrg throw exceptions. 1397 1.19 mrg 1398 1.19 mrg * Menu: 1399 1.19 mrg 1400 1.19 mrg * omp_get_max_task_priority:: Maximum task priority value that can be set 1401 1.19 mrg * omp_in_explicit_task:: Whether a given task is an explicit task 1402 1.19 mrg * omp_in_final:: Whether in final or included task region 1403 1.1 mrg 1404 1.1 mrg 1405 1.19 mrg File: libgomp.info, Node: omp_get_max_task_priority, Next: omp_in_explicit_task, Up: Tasking Routines 1406 1.16 mrg 1407 1.19 mrg 3.4.1 'omp_get_max_task_priority' - Maximum priority value 1408 1.19 mrg ---------------------------------------------------------- 1409 1.16 mrg 1410 1.19 mrg that can be set for tasks. 1411 1.16 mrg _Description_: 1412 1.19 mrg This function obtains the maximum allowed priority number for 1413 1.19 mrg tasks. 1414 1.16 mrg 1415 1.19 mrg _C/C++_ 1416 1.19 mrg _Prototype_: 'int omp_get_max_task_priority(void);' 1417 1.1 mrg 1418 1.16 mrg _Fortran_: 1419 1.19 mrg _Interface_: 'integer function omp_get_max_task_priority()' 1420 1.16 mrg 1421 1.16 mrg _Reference_: 1422 1.19 mrg OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.29. 1423 1.16 mrg 1424 1.16 mrg 1425 1.19 mrg File: libgomp.info, Node: omp_in_explicit_task, Next: omp_in_final, Prev: omp_get_max_task_priority, Up: Tasking Routines 1426 1.16 mrg 1427 1.19 mrg 3.4.2 'omp_in_explicit_task' - Whether a given task is an explicit task 1428 1.19 mrg ----------------------------------------------------------------------- 1429 1.1 mrg 1430 1.1 mrg _Description_: 1431 1.19 mrg The function returns the EXPLICIT-TASK-VAR ICV; it returns true 1432 1.19 mrg when the encountering task was generated by a task-generating 1433 1.19 mrg construct such as 'target', 'task' or 'taskloop'. Otherwise, the 1434 1.19 mrg encountering task is in an implicit task region such as generated 1435 1.19 mrg by the implicit or explicit 'parallel' region and 1436 1.19 mrg 'omp_in_explicit_task' returns false. 1437 1.1 mrg 1438 1.19 mrg _C/C++_ 1439 1.19 mrg _Prototype_: 'int omp_in_explicit_task(void);' 1440 1.1 mrg 1441 1.1 mrg _Fortran_: 1442 1.19 mrg _Interface_: 'logical function omp_in_explicit_task()' 1443 1.1 mrg 1444 1.1 mrg _Reference_: 1445 1.19 mrg OpenMP specification v5.2 (https://www.openmp.org), Section 18.5.2. 1446 1.1 mrg 1447 1.1 mrg 1448 1.19 mrg File: libgomp.info, Node: omp_in_final, Prev: omp_in_explicit_task, Up: Tasking Routines 1449 1.1 mrg 1450 1.19 mrg 3.4.3 'omp_in_final' - Whether in final or included task region 1451 1.19 mrg --------------------------------------------------------------- 1452 1.1 mrg 1453 1.1 mrg _Description_: 1454 1.19 mrg This function returns 'true' if currently running in a final or 1455 1.19 mrg included task region, 'false' otherwise. Here, 'true' and 'false' 1456 1.19 mrg represent their language-specific counterparts. 1457 1.1 mrg 1458 1.19 mrg _C/C++_: 1459 1.19 mrg _Prototype_: 'int omp_in_final(void);' 1460 1.1 mrg 1461 1.1 mrg _Fortran_: 1462 1.19 mrg _Interface_: 'logical function omp_in_final()' 1463 1.19 mrg 1464 1.19 mrg _Reference_: 1465 1.19 mrg OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.21. 1466 1.19 mrg 1467 1.19 mrg 1468 1.19 mrg File: libgomp.info, Node: Resource Relinquishing Routines, Next: Device Information Routines, Prev: Tasking Routines, Up: Runtime Library Routines 1469 1.19 mrg 1470 1.19 mrg 3.5 Resource Relinquishing Routines 1471 1.19 mrg =================================== 1472 1.19 mrg 1473 1.19 mrg Routines releasing resources used by the OpenMP runtime. They have C 1474 1.19 mrg linkage and do not throw exceptions. 1475 1.1 mrg 1476 1.19 mrg * Menu: 1477 1.1 mrg 1478 1.19 mrg * omp_pause_resource:: Release OpenMP resources on a device 1479 1.19 mrg * omp_pause_resource_all:: Release OpenMP resources on all devices 1480 1.1 mrg 1481 1.1 mrg 1482 1.19 mrg File: libgomp.info, Node: omp_pause_resource, Next: omp_pause_resource_all, Up: Resource Relinquishing Routines 1483 1.16 mrg 1484 1.19 mrg 3.5.1 'omp_pause_resource' - Release OpenMP resources on a device 1485 1.19 mrg ----------------------------------------------------------------- 1486 1.1 mrg 1487 1.16 mrg _Description_: 1488 1.19 mrg Free resources used by the OpenMP program and the runtime library 1489 1.19 mrg on and for the device specified by DEVICE_NUM; on success, zero is 1490 1.19 mrg returned and non-zero otherwise. 1491 1.19 mrg 1492 1.19 mrg The value of DEVICE_NUM must be a conforming device number. The 1493 1.19 mrg routine may not be called from within any explicit region and all 1494 1.19 mrg explicit threads that do not bind to the implicit parallel region 1495 1.19 mrg have finalized execution. 1496 1.16 mrg 1497 1.16 mrg _C/C++_: 1498 1.19 mrg _Prototype_: 'int omp_pause_resource(omp_pause_resource_t kind, int 1499 1.19 mrg device_num);' 1500 1.16 mrg 1501 1.16 mrg _Fortran_: 1502 1.19 mrg _Interface_: 'integer function omp_pause_resource(kind, device_num)' 1503 1.19 mrg 'integer (kind=omp_pause_resource_kind) kind' 1504 1.19 mrg 'integer device_num' 1505 1.16 mrg 1506 1.16 mrg _Reference_: 1507 1.19 mrg OpenMP specification v5.0 (https://www.openmp.org), Section 3.2.43. 1508 1.16 mrg 1509 1.16 mrg 1510 1.19 mrg File: libgomp.info, Node: omp_pause_resource_all, Prev: omp_pause_resource, Up: Resource Relinquishing Routines 1511 1.16 mrg 1512 1.19 mrg 3.5.2 'omp_pause_resource_all' - Release OpenMP resources on all devices 1513 1.19 mrg ------------------------------------------------------------------------ 1514 1.1 mrg 1515 1.1 mrg _Description_: 1516 1.19 mrg Free resources used by the OpenMP program and the runtime library 1517 1.19 mrg on all devices, including the host. On success, zero is returned 1518 1.19 mrg and non-zero otherwise. 1519 1.19 mrg 1520 1.19 mrg The routine may not be called from within any explicit region and 1521 1.19 mrg all explicit threads that do not bind to the implicit parallel 1522 1.19 mrg region have finalized execution. 1523 1.1 mrg 1524 1.1 mrg _C/C++_: 1525 1.19 mrg _Prototype_: 'int omp_pause_resource(omp_pause_resource_t kind);' 1526 1.1 mrg 1527 1.1 mrg _Fortran_: 1528 1.19 mrg _Interface_: 'integer function omp_pause_resource(kind)' 1529 1.19 mrg 'integer (kind=omp_pause_resource_kind) kind' 1530 1.1 mrg 1531 1.1 mrg _See also_: 1532 1.19 mrg *note omp_pause_resource:: 1533 1.1 mrg 1534 1.1 mrg _Reference_: 1535 1.19 mrg OpenMP specification v5.0 (https://www.openmp.org), Section 3.2.44. 1536 1.19 mrg 1537 1.19 mrg 1538 1.19 mrg File: libgomp.info, Node: Device Information Routines, Next: Device Memory Routines, Prev: Resource Relinquishing Routines, Up: Runtime Library Routines 1539 1.19 mrg 1540 1.19 mrg 3.6 Device Information Routines 1541 1.19 mrg =============================== 1542 1.19 mrg 1543 1.19 mrg Routines related to devices available to an OpenMP program. They have C 1544 1.19 mrg linkage and do not throw exceptions. 1545 1.19 mrg 1546 1.19 mrg * Menu: 1547 1.19 mrg 1548 1.19 mrg * omp_get_num_procs:: Number of processors online 1549 1.19 mrg * omp_set_default_device:: Set the default device for target regions 1550 1.19 mrg * omp_get_default_device:: Get the default device for target regions 1551 1.19 mrg * omp_get_num_devices:: Number of target devices 1552 1.19 mrg * omp_get_device_num:: Get device that current thread is running on 1553 1.19 mrg * omp_is_initial_device:: Whether executing on the host device 1554 1.19 mrg * omp_get_initial_device:: Device number of host device 1555 1.1 mrg 1556 1.1 mrg 1557 1.19 mrg File: libgomp.info, Node: omp_get_num_procs, Next: omp_set_default_device, Up: Device Information Routines 1558 1.1 mrg 1559 1.19 mrg 3.6.1 'omp_get_num_procs' - Number of processors online 1560 1.19 mrg ------------------------------------------------------- 1561 1.1 mrg 1562 1.1 mrg _Description_: 1563 1.19 mrg Returns the number of processors online on that device. 1564 1.1 mrg 1565 1.1 mrg _C/C++_: 1566 1.19 mrg _Prototype_: 'int omp_get_num_procs(void);' 1567 1.1 mrg 1568 1.1 mrg _Fortran_: 1569 1.19 mrg _Interface_: 'integer function omp_get_num_procs()' 1570 1.19 mrg 1571 1.19 mrg _Reference_: 1572 1.19 mrg OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.5. 1573 1.19 mrg 1574 1.19 mrg 1575 1.19 mrg File: libgomp.info, Node: omp_set_default_device, Next: omp_get_default_device, Prev: omp_get_num_procs, Up: Device Information Routines 1576 1.19 mrg 1577 1.19 mrg 3.6.2 'omp_set_default_device' - Set the default device for target regions 1578 1.19 mrg -------------------------------------------------------------------------- 1579 1.19 mrg 1580 1.19 mrg _Description_: 1581 1.19 mrg Set the default device for target regions without device clause. 1582 1.19 mrg The argument shall be a nonnegative device number. 1583 1.19 mrg 1584 1.19 mrg _C/C++_: 1585 1.19 mrg _Prototype_: 'void omp_set_default_device(int device_num);' 1586 1.19 mrg 1587 1.19 mrg _Fortran_: 1588 1.19 mrg _Interface_: 'subroutine omp_set_default_device(device_num)' 1589 1.19 mrg 'integer device_num' 1590 1.19 mrg 1591 1.19 mrg _See also_: 1592 1.19 mrg *note OMP_DEFAULT_DEVICE::, *note omp_get_default_device:: 1593 1.19 mrg 1594 1.19 mrg _Reference_: 1595 1.19 mrg OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.29. 1596 1.19 mrg 1597 1.19 mrg 1598 1.19 mrg File: libgomp.info, Node: omp_get_default_device, Next: omp_get_num_devices, Prev: omp_set_default_device, Up: Device Information Routines 1599 1.19 mrg 1600 1.19 mrg 3.6.3 'omp_get_default_device' - Get the default device for target regions 1601 1.19 mrg -------------------------------------------------------------------------- 1602 1.19 mrg 1603 1.19 mrg _Description_: 1604 1.19 mrg Get the default device for target regions without device clause. 1605 1.19 mrg 1606 1.19 mrg _C/C++_: 1607 1.19 mrg _Prototype_: 'int omp_get_default_device(void);' 1608 1.19 mrg 1609 1.19 mrg _Fortran_: 1610 1.19 mrg _Interface_: 'integer function omp_get_default_device()' 1611 1.19 mrg 1612 1.19 mrg _See also_: 1613 1.19 mrg *note OMP_DEFAULT_DEVICE::, *note omp_set_default_device:: 1614 1.19 mrg 1615 1.19 mrg _Reference_: 1616 1.19 mrg OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.30. 1617 1.19 mrg 1618 1.19 mrg 1619 1.19 mrg File: libgomp.info, Node: omp_get_num_devices, Next: omp_get_device_num, Prev: omp_get_default_device, Up: Device Information Routines 1620 1.19 mrg 1621 1.19 mrg 3.6.4 'omp_get_num_devices' - Number of target devices 1622 1.19 mrg ------------------------------------------------------ 1623 1.19 mrg 1624 1.19 mrg _Description_: 1625 1.19 mrg Returns the number of target devices. 1626 1.19 mrg 1627 1.19 mrg _C/C++_: 1628 1.19 mrg _Prototype_: 'int omp_get_num_devices(void);' 1629 1.19 mrg 1630 1.19 mrg _Fortran_: 1631 1.19 mrg _Interface_: 'integer function omp_get_num_devices()' 1632 1.19 mrg 1633 1.19 mrg _Reference_: 1634 1.19 mrg OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.31. 1635 1.19 mrg 1636 1.19 mrg 1637 1.19 mrg File: libgomp.info, Node: omp_get_device_num, Next: omp_is_initial_device, Prev: omp_get_num_devices, Up: Device Information Routines 1638 1.19 mrg 1639 1.19 mrg 3.6.5 'omp_get_device_num' - Return device number of current device 1640 1.19 mrg ------------------------------------------------------------------- 1641 1.19 mrg 1642 1.19 mrg _Description_: 1643 1.19 mrg This function returns a device number that represents the device 1644 1.19 mrg that the current thread is executing on. For OpenMP 5.0, this must 1645 1.19 mrg be equal to the value returned by the 'omp_get_initial_device' 1646 1.19 mrg function when called from the host. 1647 1.19 mrg 1648 1.19 mrg _C/C++_ 1649 1.19 mrg _Prototype_: 'int omp_get_device_num(void);' 1650 1.19 mrg 1651 1.19 mrg _Fortran_: 1652 1.19 mrg _Interface_: 'integer function omp_get_device_num()' 1653 1.19 mrg 1654 1.19 mrg _See also_: 1655 1.19 mrg *note omp_get_initial_device:: 1656 1.19 mrg 1657 1.19 mrg _Reference_: 1658 1.19 mrg OpenMP specification v5.0 (https://www.openmp.org), Section 3.2.37. 1659 1.19 mrg 1660 1.19 mrg 1661 1.19 mrg File: libgomp.info, Node: omp_is_initial_device, Next: omp_get_initial_device, Prev: omp_get_device_num, Up: Device Information Routines 1662 1.19 mrg 1663 1.19 mrg 3.6.6 'omp_is_initial_device' - Whether executing on the host device 1664 1.19 mrg -------------------------------------------------------------------- 1665 1.19 mrg 1666 1.19 mrg _Description_: 1667 1.19 mrg This function returns 'true' if currently running on the host 1668 1.19 mrg device, 'false' otherwise. Here, 'true' and 'false' represent 1669 1.19 mrg their language-specific counterparts. 1670 1.19 mrg 1671 1.19 mrg _C/C++_: 1672 1.19 mrg _Prototype_: 'int omp_is_initial_device(void);' 1673 1.19 mrg 1674 1.19 mrg _Fortran_: 1675 1.19 mrg _Interface_: 'logical function omp_is_initial_device()' 1676 1.19 mrg 1677 1.19 mrg _Reference_: 1678 1.19 mrg OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.34. 1679 1.19 mrg 1680 1.19 mrg 1681 1.19 mrg File: libgomp.info, Node: omp_get_initial_device, Prev: omp_is_initial_device, Up: Device Information Routines 1682 1.19 mrg 1683 1.19 mrg 3.6.7 'omp_get_initial_device' - Return device number of initial device 1684 1.19 mrg ----------------------------------------------------------------------- 1685 1.19 mrg 1686 1.19 mrg _Description_: 1687 1.19 mrg This function returns a device number that represents the host 1688 1.19 mrg device. For OpenMP 5.1, this must be equal to the value returned 1689 1.19 mrg by the 'omp_get_num_devices' function. 1690 1.19 mrg 1691 1.19 mrg _C/C++_ 1692 1.19 mrg _Prototype_: 'int omp_get_initial_device(void);' 1693 1.19 mrg 1694 1.19 mrg _Fortran_: 1695 1.19 mrg _Interface_: 'integer function omp_get_initial_device()' 1696 1.19 mrg 1697 1.19 mrg _See also_: 1698 1.19 mrg *note omp_get_num_devices:: 1699 1.19 mrg 1700 1.19 mrg _Reference_: 1701 1.19 mrg OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.35. 1702 1.19 mrg 1703 1.19 mrg 1704 1.19 mrg File: libgomp.info, Node: Device Memory Routines, Next: Lock Routines, Prev: Device Information Routines, Up: Runtime Library Routines 1705 1.19 mrg 1706 1.19 mrg 3.7 Device Memory Routines 1707 1.19 mrg ========================== 1708 1.19 mrg 1709 1.19 mrg Routines related to memory allocation and managing corresponding 1710 1.19 mrg pointers on devices. They have C linkage and do not throw exceptions. 1711 1.19 mrg 1712 1.19 mrg * Menu: 1713 1.19 mrg 1714 1.19 mrg * omp_target_alloc:: Allocate device memory 1715 1.19 mrg * omp_target_free:: Free device memory 1716 1.19 mrg * omp_target_is_present:: Check whether storage is mapped 1717 1.19 mrg * omp_target_is_accessible:: Check whether memory is device accessible 1718 1.19 mrg * omp_target_memcpy:: Copy data between devices 1719 1.19 mrg * omp_target_memcpy_async:: Copy data between devices asynchronously 1720 1.19 mrg * omp_target_memcpy_rect:: Copy a subvolume of data between devices 1721 1.19 mrg * omp_target_memcpy_rect_async:: Copy a subvolume of data between devices asynchronously 1722 1.19 mrg * omp_target_associate_ptr:: Associate a device pointer with a host pointer 1723 1.19 mrg * omp_target_disassociate_ptr:: Remove device-host pointer association 1724 1.19 mrg * omp_get_mapped_ptr:: Return device pointer to a host pointer 1725 1.19 mrg 1726 1.19 mrg 1727 1.19 mrg File: libgomp.info, Node: omp_target_alloc, Next: omp_target_free, Up: Device Memory Routines 1728 1.19 mrg 1729 1.19 mrg 3.7.1 'omp_target_alloc' - Allocate device memory 1730 1.19 mrg ------------------------------------------------- 1731 1.19 mrg 1732 1.19 mrg _Description_: 1733 1.19 mrg This routine allocates SIZE bytes of memory in the device 1734 1.19 mrg environment associated with the device number DEVICE_NUM. If 1735 1.19 mrg successful, a device pointer is returned, otherwise a null pointer. 1736 1.19 mrg 1737 1.19 mrg In GCC, when the device is the host or the device shares memory 1738 1.19 mrg with the host, the memory is allocated on the host; in that case, 1739 1.19 mrg when SIZE is zero, either NULL or a unique pointer value that can 1740 1.19 mrg later be successfully passed to 'omp_target_free' is returned. 1741 1.19 mrg When the allocation is not performed on the host, a null pointer is 1742 1.19 mrg returned when SIZE is zero; in that case, additionally a diagnostic 1743 1.19 mrg might be printed to standard error (stderr). 1744 1.19 mrg 1745 1.19 mrg Running this routine in a 'target' region except on the initial 1746 1.19 mrg device is not supported. 1747 1.19 mrg 1748 1.19 mrg _C/C++_ 1749 1.19 mrg _Prototype_: 'void *omp_target_alloc(size_t size, int device_num)' 1750 1.19 mrg 1751 1.19 mrg _Fortran_: 1752 1.19 mrg _Interface_: 'type(c_ptr) function omp_target_alloc(size, device_num) 1753 1.19 mrg bind(C)' 1754 1.19 mrg 'use, intrinsic :: iso_c_binding, only: c_ptr, c_int, 1755 1.19 mrg c_size_t' 1756 1.19 mrg 'integer(c_size_t), value :: size' 1757 1.19 mrg 'integer(c_int), value :: device_num' 1758 1.19 mrg 1759 1.19 mrg _See also_: 1760 1.19 mrg *note omp_target_free::, *note omp_target_associate_ptr:: 1761 1.19 mrg 1762 1.19 mrg _Reference_: 1763 1.19 mrg OpenMP specification v5.1 (https://www.openmp.org), Section 3.8.1 1764 1.19 mrg 1765 1.19 mrg 1766 1.19 mrg File: libgomp.info, Node: omp_target_free, Next: omp_target_is_present, Prev: omp_target_alloc, Up: Device Memory Routines 1767 1.19 mrg 1768 1.19 mrg 3.7.2 'omp_target_free' - Free device memory 1769 1.19 mrg -------------------------------------------- 1770 1.19 mrg 1771 1.19 mrg _Description_: 1772 1.19 mrg This routine frees memory allocated by the 'omp_target_alloc' 1773 1.19 mrg routine. The DEVICE_PTR argument must be either a null pointer or 1774 1.19 mrg a device pointer returned by 'omp_target_alloc' for the specified 1775 1.19 mrg 'device_num'. The device number DEVICE_NUM must be a conforming 1776 1.19 mrg device number. 1777 1.19 mrg 1778 1.19 mrg Running this routine in a 'target' region except on the initial 1779 1.19 mrg device is not supported. 1780 1.19 mrg 1781 1.19 mrg _C/C++_ 1782 1.19 mrg _Prototype_: 'void omp_target_free(void *device_ptr, int device_num)' 1783 1.19 mrg 1784 1.19 mrg _Fortran_: 1785 1.19 mrg _Interface_: 'subroutine omp_target_free(device_ptr, device_num) 1786 1.19 mrg bind(C)' 1787 1.19 mrg 'use, intrinsic :: iso_c_binding, only: c_ptr, c_int' 1788 1.19 mrg 'type(c_ptr), value :: device_ptr' 1789 1.19 mrg 'integer(c_int), value :: device_num' 1790 1.19 mrg 1791 1.19 mrg _See also_: 1792 1.19 mrg *note omp_target_alloc::, *note omp_target_disassociate_ptr:: 1793 1.19 mrg 1794 1.19 mrg _Reference_: 1795 1.19 mrg OpenMP specification v5.1 (https://www.openmp.org), Section 3.8.2 1796 1.19 mrg 1797 1.19 mrg 1798 1.19 mrg File: libgomp.info, Node: omp_target_is_present, Next: omp_target_is_accessible, Prev: omp_target_free, Up: Device Memory Routines 1799 1.19 mrg 1800 1.19 mrg 3.7.3 'omp_target_is_present' - Check whether storage is mapped 1801 1.19 mrg --------------------------------------------------------------- 1802 1.19 mrg 1803 1.19 mrg _Description_: 1804 1.19 mrg This routine tests whether storage, identified by the host pointer 1805 1.19 mrg PTR is mapped to the device specified by DEVICE_NUM. If so, it 1806 1.19 mrg returns a nonzero value and otherwise zero. 1807 1.19 mrg 1808 1.19 mrg In GCC, this includes self mapping such that 1809 1.19 mrg 'omp_target_is_present' returns _true_ when DEVICE_NUM specifies 1810 1.19 mrg the host or when the host and the device share memory. If PTR is a 1811 1.19 mrg null pointer, TRUE is returned and if DEVICE_NUM is an invalid 1812 1.19 mrg device number, FALSE is returned. 1813 1.19 mrg 1814 1.19 mrg If those conditions do not apply, _true_ is returned if the 1815 1.19 mrg association has been established by an explicit or implicit 'map' 1816 1.19 mrg clause, the 'declare target' directive or a call to the 1817 1.19 mrg 'omp_target_associate_ptr' routine. 1818 1.19 mrg 1819 1.19 mrg Running this routine in a 'target' region except on the initial 1820 1.19 mrg device is not supported. 1821 1.19 mrg 1822 1.19 mrg _C/C++_ 1823 1.19 mrg _Prototype_: 'int omp_target_is_present(const void *ptr,' 1824 1.19 mrg ' int device_num)' 1825 1.19 mrg 1826 1.19 mrg _Fortran_: 1827 1.19 mrg _Interface_: 'integer(c_int) function omp_target_is_present(ptr, &' 1828 1.19 mrg ' device_num) bind(C)' 1829 1.19 mrg 'use, intrinsic :: iso_c_binding, only: c_ptr, c_int' 1830 1.19 mrg 'type(c_ptr), value :: ptr' 1831 1.19 mrg 'integer(c_int), value :: device_num' 1832 1.19 mrg 1833 1.19 mrg _See also_: 1834 1.19 mrg *note omp_target_associate_ptr:: 1835 1.19 mrg 1836 1.19 mrg _Reference_: 1837 1.19 mrg OpenMP specification v5.1 (https://www.openmp.org), Section 3.8.3 1838 1.19 mrg 1839 1.19 mrg 1840 1.19 mrg File: libgomp.info, Node: omp_target_is_accessible, Next: omp_target_memcpy, Prev: omp_target_is_present, Up: Device Memory Routines 1841 1.19 mrg 1842 1.19 mrg 3.7.4 'omp_target_is_accessible' - Check whether memory is device accessible 1843 1.19 mrg ---------------------------------------------------------------------------- 1844 1.19 mrg 1845 1.19 mrg _Description_: 1846 1.19 mrg This routine tests whether memory, starting at the address given by 1847 1.19 mrg PTR and extending SIZE bytes, is accessibly on the device specified 1848 1.19 mrg by DEVICE_NUM. If so, it returns a nonzero value and otherwise 1849 1.19 mrg zero. 1850 1.19 mrg 1851 1.19 mrg The address given by PTR is interpreted to be in the address space 1852 1.19 mrg of the device and SIZE must be positive. 1853 1.19 mrg 1854 1.19 mrg Note that GCC's current implementation assumes that PTR is a valid 1855 1.19 mrg host pointer. Therefore, all addresses given by PTR are assumed to 1856 1.19 mrg be accessible on the initial device. And, to err on the safe side, 1857 1.19 mrg this memory is only available on a non-host device that can access 1858 1.19 mrg all host memory ([uniform] shared memory access). 1859 1.19 mrg 1860 1.19 mrg Running this routine in a 'target' region except on the initial 1861 1.19 mrg device is not supported. 1862 1.19 mrg 1863 1.19 mrg _C/C++_ 1864 1.19 mrg _Prototype_: 'int omp_target_is_accessible(const void *ptr,' 1865 1.19 mrg ' size_t size,' 1866 1.19 mrg ' int device_num)' 1867 1.19 mrg 1868 1.19 mrg _Fortran_: 1869 1.19 mrg _Interface_: 'integer(c_int) function omp_target_is_accessible(ptr, 1870 1.19 mrg &' 1871 1.19 mrg ' size, device_num) bind(C)' 1872 1.19 mrg 'use, intrinsic :: iso_c_binding, only: c_ptr, c_size_t, 1873 1.19 mrg c_int' 1874 1.19 mrg 'type(c_ptr), value :: ptr' 1875 1.19 mrg 'integer(c_size_t), value :: size' 1876 1.19 mrg 'integer(c_int), value :: device_num' 1877 1.19 mrg 1878 1.19 mrg _See also_: 1879 1.19 mrg *note omp_target_associate_ptr:: 1880 1.19 mrg 1881 1.19 mrg _Reference_: 1882 1.19 mrg OpenMP specification v5.1 (https://www.openmp.org), Section 3.8.4 1883 1.19 mrg 1884 1.19 mrg 1885 1.19 mrg File: libgomp.info, Node: omp_target_memcpy, Next: omp_target_memcpy_async, Prev: omp_target_is_accessible, Up: Device Memory Routines 1886 1.19 mrg 1887 1.19 mrg 3.7.5 'omp_target_memcpy' - Copy data between devices 1888 1.19 mrg ----------------------------------------------------- 1889 1.19 mrg 1890 1.19 mrg _Description_: 1891 1.19 mrg This routine copies LENGTH of bytes of data from the device 1892 1.19 mrg identified by device number SRC_DEVICE_NUM to device 1893 1.19 mrg DST_DEVICE_NUM. The data is copied from the source device from the 1894 1.19 mrg address provided by SRC, shifted by the offset of SRC_OFFSET bytes, 1895 1.19 mrg to the destination device's DST address shifted by DST_OFFSET. The 1896 1.19 mrg routine returns zero on success and non-zero otherwise. 1897 1.19 mrg 1898 1.19 mrg Running this routine in a 'target' region except on the initial 1899 1.19 mrg device is not supported. 1900 1.19 mrg 1901 1.19 mrg _C/C++_ 1902 1.19 mrg _Prototype_: 'int omp_target_memcpy(void *dst,' 1903 1.19 mrg ' const void *src,' 1904 1.19 mrg ' size_t length,' 1905 1.19 mrg ' size_t dst_offset,' 1906 1.19 mrg ' size_t src_offset,' 1907 1.19 mrg ' int dst_device_num,' 1908 1.19 mrg ' int src_device_num)' 1909 1.19 mrg 1910 1.19 mrg _Fortran_: 1911 1.19 mrg _Interface_: 'integer(c_int) function omp_target_memcpy( &' 1912 1.19 mrg ' dst, src, length, dst_offset, src_offset, &' 1913 1.19 mrg ' dst_device_num, src_device_num) bind(C)' 1914 1.19 mrg 'use, intrinsic :: iso_c_binding, only: c_ptr, c_size_t, 1915 1.19 mrg c_int' 1916 1.19 mrg 'type(c_ptr), value :: dst, src' 1917 1.19 mrg 'integer(c_size_t), value :: length, dst_offset, 1918 1.19 mrg src_offset' 1919 1.19 mrg 'integer(c_int), value :: dst_device_num, 1920 1.19 mrg src_device_num' 1921 1.19 mrg 1922 1.19 mrg _See also_: 1923 1.19 mrg *note omp_target_memcpy_async::, *note omp_target_memcpy_rect:: 1924 1.19 mrg 1925 1.19 mrg _Reference_: 1926 1.19 mrg OpenMP specification v5.1 (https://www.openmp.org), Section 3.8.5 1927 1.19 mrg 1928 1.19 mrg 1929 1.19 mrg File: libgomp.info, Node: omp_target_memcpy_async, Next: omp_target_memcpy_rect, Prev: omp_target_memcpy, Up: Device Memory Routines 1930 1.19 mrg 1931 1.19 mrg 3.7.6 'omp_target_memcpy_async' - Copy data between devices asynchronously 1932 1.19 mrg -------------------------------------------------------------------------- 1933 1.19 mrg 1934 1.19 mrg _Description_: 1935 1.19 mrg This routine copies asynchronously LENGTH of bytes of data from the 1936 1.19 mrg device identified by device number SRC_DEVICE_NUM to device 1937 1.19 mrg DST_DEVICE_NUM. The data is copied from the source device from the 1938 1.19 mrg address provided by SRC, shifted by the offset of SRC_OFFSET bytes, 1939 1.19 mrg to the destination device's DST address shifted by DST_OFFSET. 1940 1.19 mrg Task dependence is expressed by passing an array of depend objects 1941 1.19 mrg to DEPOBJ_LIST, where the number of array elements is passed as 1942 1.19 mrg DEPOBJ_COUNT; if the count is zero, the DEPOBJ_LIST argument is 1943 1.19 mrg ignored. The routine returns zero if the copying process has 1944 1.19 mrg successfully been started and non-zero otherwise. 1945 1.19 mrg 1946 1.19 mrg Running this routine in a 'target' region except on the initial 1947 1.19 mrg device is not supported. 1948 1.19 mrg 1949 1.19 mrg _C/C++_ 1950 1.19 mrg _Prototype_: 'int omp_target_memcpy_async(void *dst,' 1951 1.19 mrg ' const void *src,' 1952 1.19 mrg ' size_t length,' 1953 1.19 mrg ' size_t dst_offset,' 1954 1.19 mrg ' size_t src_offset,' 1955 1.19 mrg ' int dst_device_num,' 1956 1.19 mrg ' int src_device_num,' 1957 1.19 mrg ' int depobj_count,' 1958 1.19 mrg ' omp_depend_t *depobj_list)' 1959 1.19 mrg 1960 1.19 mrg _Fortran_: 1961 1.19 mrg _Interface_: 'integer(c_int) function omp_target_memcpy_async( &' 1962 1.19 mrg ' dst, src, length, dst_offset, src_offset, &' 1963 1.19 mrg ' dst_device_num, src_device_num, &' 1964 1.19 mrg ' depobj_count, depobj_list) bind(C)' 1965 1.19 mrg 'use, intrinsic :: iso_c_binding, only: c_ptr, c_size_t, 1966 1.19 mrg c_int' 1967 1.19 mrg 'type(c_ptr), value :: dst, src' 1968 1.19 mrg 'integer(c_size_t), value :: length, dst_offset, 1969 1.19 mrg src_offset' 1970 1.19 mrg 'integer(c_int), value :: dst_device_num, 1971 1.19 mrg src_device_num, depobj_count' 1972 1.19 mrg 'integer(omp_depend_kind), optional :: depobj_list(*)' 1973 1.19 mrg 1974 1.19 mrg _See also_: 1975 1.19 mrg *note omp_target_memcpy::, *note omp_target_memcpy_rect_async:: 1976 1.19 mrg 1977 1.19 mrg _Reference_: 1978 1.19 mrg OpenMP specification v5.1 (https://www.openmp.org), Section 3.8.7 1979 1.19 mrg 1980 1.19 mrg 1981 1.19 mrg File: libgomp.info, Node: omp_target_memcpy_rect, Next: omp_target_memcpy_rect_async, Prev: omp_target_memcpy_async, Up: Device Memory Routines 1982 1.19 mrg 1983 1.19 mrg 3.7.7 'omp_target_memcpy_rect' - Copy a subvolume of data between devices 1984 1.19 mrg ------------------------------------------------------------------------- 1985 1.19 mrg 1986 1.19 mrg _Description_: 1987 1.19 mrg This routine copies a subvolume of data from the device identified 1988 1.19 mrg by device number SRC_DEVICE_NUM to device DST_DEVICE_NUM. The 1989 1.19 mrg array has NUM_DIMS dimensions and each array element has a size of 1990 1.19 mrg ELEMENT_SIZE bytes. The VOLUME array specifies how many elements 1991 1.19 mrg per dimension are copied. The full sizes of the destination and 1992 1.19 mrg source arrays are given by the DST_DIMENSIONS and SRC_DIMENSIONS 1993 1.19 mrg arguments, respectively. The offset per dimension to the first 1994 1.19 mrg element to be copied is given by the DST_OFFSET and SRC_OFFSET 1995 1.19 mrg arguments. The routine returns zero on success and non-zero 1996 1.19 mrg otherwise. 1997 1.19 mrg 1998 1.19 mrg The OpenMP specification only requires that NUM_DIMS up to three is 1999 1.19 mrg supported. In order to find implementation-specific maximally 2000 1.19 mrg supported number of dimensions, the routine returns this value when 2001 1.19 mrg invoked with a null pointer to both the DST and SRC arguments. As 2002 1.19 mrg GCC supports arbitrary dimensions, it returns 'INT_MAX'. 2003 1.19 mrg 2004 1.19 mrg The device-number arguments must be conforming device numbers, the 2005 1.19 mrg SRC and DST must be either both null pointers or all of the 2006 1.19 mrg following must be fulfilled: ELEMENT_SIZE and NUM_DIMS must be 2007 1.19 mrg positive and the VOLUME, offset and dimension arrays must have at 2008 1.19 mrg least NUM_DIMS dimensions. 2009 1.19 mrg 2010 1.19 mrg Running this routine in a 'target' region is not supported except 2011 1.19 mrg on the initial device. 2012 1.19 mrg 2013 1.19 mrg _C/C++_ 2014 1.19 mrg _Prototype_: 'int omp_target_memcpy_rect(void *dst,' 2015 1.19 mrg ' const void *src,' 2016 1.19 mrg ' size_t element_size,' 2017 1.19 mrg ' int num_dims,' 2018 1.19 mrg ' const size_t *volume,' 2019 1.19 mrg ' const size_t *dst_offset,' 2020 1.19 mrg ' const size_t *src_offset,' 2021 1.19 mrg ' const size_t *dst_dimensions,' 2022 1.19 mrg ' const size_t *src_dimensions,' 2023 1.19 mrg ' int dst_device_num,' 2024 1.19 mrg ' int src_device_num)' 2025 1.19 mrg 2026 1.19 mrg _Fortran_: 2027 1.19 mrg _Interface_: 'integer(c_int) function omp_target_memcpy_rect( &' 2028 1.19 mrg ' dst, src, element_size, num_dims, volume, &' 2029 1.19 mrg ' dst_offset, src_offset, dst_dimensions, &' 2030 1.19 mrg ' src_dimensions, dst_device_num, src_device_num) 2031 1.19 mrg bind(C)' 2032 1.19 mrg 'use, intrinsic :: iso_c_binding, only: c_ptr, c_size_t, 2033 1.19 mrg c_int' 2034 1.19 mrg 'type(c_ptr), value :: dst, src' 2035 1.19 mrg 'integer(c_size_t), value :: element_size, dst_offset, 2036 1.19 mrg src_offset' 2037 1.19 mrg 'integer(c_size_t), value :: volume, dst_dimensions, 2038 1.19 mrg src_dimensions' 2039 1.19 mrg 'integer(c_int), value :: num_dims, dst_device_num, 2040 1.19 mrg src_device_num' 2041 1.19 mrg 2042 1.19 mrg _See also_: 2043 1.19 mrg *note omp_target_memcpy_rect_async::, *note omp_target_memcpy:: 2044 1.19 mrg 2045 1.19 mrg _Reference_: 2046 1.19 mrg OpenMP specification v5.1 (https://www.openmp.org), Section 3.8.6 2047 1.19 mrg 2048 1.19 mrg 2049 1.19 mrg File: libgomp.info, Node: omp_target_memcpy_rect_async, Next: omp_target_associate_ptr, Prev: omp_target_memcpy_rect, Up: Device Memory Routines 2050 1.19 mrg 2051 1.19 mrg 3.7.8 'omp_target_memcpy_rect_async' - Copy a subvolume of data between devices asynchronously 2052 1.19 mrg ---------------------------------------------------------------------------------------------- 2053 1.19 mrg 2054 1.19 mrg _Description_: 2055 1.19 mrg This routine copies asynchronously a subvolume of data from the 2056 1.19 mrg device identified by device number SRC_DEVICE_NUM to device 2057 1.19 mrg DST_DEVICE_NUM. The array has NUM_DIMS dimensions and each array 2058 1.19 mrg element has a size of ELEMENT_SIZE bytes. The VOLUME array 2059 1.19 mrg specifies how many elements per dimension are copied. The full 2060 1.19 mrg sizes of the destination and source arrays are given by the 2061 1.19 mrg DST_DIMENSIONS and SRC_DIMENSIONS arguments, respectively. The 2062 1.19 mrg offset per dimension to the first element to be copied is given by 2063 1.19 mrg the DST_OFFSET and SRC_OFFSET arguments. Task dependence is 2064 1.19 mrg expressed by passing an array of depend objects to DEPOBJ_LIST, 2065 1.19 mrg where the number of array elements is passed as DEPOBJ_COUNT; if 2066 1.19 mrg the count is zero, the DEPOBJ_LIST argument is ignored. The 2067 1.19 mrg routine returns zero on success and non-zero otherwise. 2068 1.19 mrg 2069 1.19 mrg The OpenMP specification only requires that NUM_DIMS up to three is 2070 1.19 mrg supported. In order to find implementation-specific maximally 2071 1.19 mrg supported number of dimensions, the routine returns this value when 2072 1.19 mrg invoked with a null pointer to both the DST and SRC arguments. As 2073 1.19 mrg GCC supports arbitrary dimensions, it returns 'INT_MAX'. 2074 1.19 mrg 2075 1.19 mrg The device-number arguments must be conforming device numbers, the 2076 1.19 mrg SRC and DST must be either both null pointers or all of the 2077 1.19 mrg following must be fulfilled: ELEMENT_SIZE and NUM_DIMS must be 2078 1.19 mrg positive and the VOLUME, offset and dimension arrays must have at 2079 1.19 mrg least NUM_DIMS dimensions. 2080 1.19 mrg 2081 1.19 mrg Running this routine in a 'target' region is not supported except 2082 1.19 mrg on the initial device. 2083 1.19 mrg 2084 1.19 mrg _C/C++_ 2085 1.19 mrg _Prototype_: 'int omp_target_memcpy_rect_async(void *dst,' 2086 1.19 mrg ' const void *src,' 2087 1.19 mrg ' size_t element_size,' 2088 1.19 mrg ' int num_dims,' 2089 1.19 mrg ' const size_t *volume,' 2090 1.19 mrg ' const size_t *dst_offset,' 2091 1.19 mrg ' const size_t *src_offset,' 2092 1.19 mrg ' const size_t *dst_dimensions,' 2093 1.19 mrg ' const size_t *src_dimensions,' 2094 1.19 mrg ' int dst_device_num,' 2095 1.19 mrg ' int src_device_num,' 2096 1.19 mrg ' int depobj_count,' 2097 1.19 mrg ' omp_depend_t *depobj_list)' 2098 1.19 mrg 2099 1.19 mrg _Fortran_: 2100 1.19 mrg _Interface_: 'integer(c_int) function omp_target_memcpy_rect_async( 2101 1.19 mrg &' 2102 1.19 mrg ' dst, src, element_size, num_dims, volume, &' 2103 1.19 mrg ' dst_offset, src_offset, dst_dimensions, &' 2104 1.19 mrg ' src_dimensions, dst_device_num, src_device_num, &' 2105 1.19 mrg ' depobj_count, depobj_list) bind(C)' 2106 1.19 mrg 'use, intrinsic :: iso_c_binding, only: c_ptr, c_size_t, 2107 1.19 mrg c_int' 2108 1.19 mrg 'type(c_ptr), value :: dst, src' 2109 1.19 mrg 'integer(c_size_t), value :: element_size, dst_offset, 2110 1.19 mrg src_offset' 2111 1.19 mrg 'integer(c_size_t), value :: volume, dst_dimensions, 2112 1.19 mrg src_dimensions' 2113 1.19 mrg 'integer(c_int), value :: num_dims, dst_device_num, 2114 1.19 mrg src_device_num' 2115 1.19 mrg 'integer(c_int), value :: depobj_count' 2116 1.19 mrg 'integer(omp_depend_kind), optional :: depobj_list(*)' 2117 1.19 mrg 2118 1.19 mrg _See also_: 2119 1.19 mrg *note omp_target_memcpy_rect::, *note omp_target_memcpy_async:: 2120 1.19 mrg 2121 1.19 mrg _Reference_: 2122 1.19 mrg OpenMP specification v5.1 (https://www.openmp.org), Section 3.8.8 2123 1.19 mrg 2124 1.19 mrg 2125 1.19 mrg File: libgomp.info, Node: omp_target_associate_ptr, Next: omp_target_disassociate_ptr, Prev: omp_target_memcpy_rect_async, Up: Device Memory Routines 2126 1.19 mrg 2127 1.19 mrg 3.7.9 'omp_target_associate_ptr' - Associate a device pointer with a host pointer 2128 1.19 mrg --------------------------------------------------------------------------------- 2129 1.19 mrg 2130 1.19 mrg _Description_: 2131 1.19 mrg This routine associates storage on the host with storage on a 2132 1.19 mrg device identified by DEVICE_NUM. The device pointer is usually 2133 1.19 mrg obtained by calling 'omp_target_alloc' or by other means (but not 2134 1.19 mrg by using the 'map' clauses or the 'declare target' directive). The 2135 1.19 mrg host pointer should point to memory that has a storage size of at 2136 1.19 mrg least SIZE. 2137 1.19 mrg 2138 1.19 mrg The DEVICE_OFFSET parameter specifies the offset into DEVICE_PTR 2139 1.19 mrg that is used as the base address for the device side of the 2140 1.19 mrg mapping; the storage size should be at least DEVICE_OFFSET plus 2141 1.19 mrg SIZE. 2142 1.19 mrg 2143 1.19 mrg After the association, the host pointer can be used in a 'map' 2144 1.19 mrg clause and in the 'to' and 'from' clauses of the 'target update' 2145 1.19 mrg directive to transfer data between the associated pointers. The 2146 1.19 mrg reference count of such associated storage is infinite. The 2147 1.19 mrg association can be removed by calling 'omp_target_disassociate_ptr' 2148 1.19 mrg which should be done before the lifetime of either storage ends. 2149 1.19 mrg 2150 1.19 mrg The routine returns nonzero ('EINVAL') when the DEVICE_NUM invalid, 2151 1.19 mrg for when the initial device or the associated device shares memory 2152 1.19 mrg with the host. 'omp_target_associate_ptr' returns zero if HOST_PTR 2153 1.19 mrg points into already associated storage that is fully inside of a 2154 1.19 mrg previously associated memory. Otherwise, if the association was 2155 1.19 mrg successful zero is returned; if none of the cases above apply, 2156 1.19 mrg nonzero ('EINVAL') is returned. 2157 1.19 mrg 2158 1.19 mrg The 'omp_target_is_present' routine can be used to test whether 2159 1.19 mrg associated storage for a device pointer exists. 2160 1.19 mrg 2161 1.19 mrg Running this routine in a 'target' region except on the initial 2162 1.19 mrg device is not supported. 2163 1.19 mrg 2164 1.19 mrg _C/C++_ 2165 1.19 mrg _Prototype_: 'int omp_target_associate_ptr(const void *host_ptr,' 2166 1.19 mrg ' const void *device_ptr,' 2167 1.19 mrg ' size_t size,' 2168 1.19 mrg ' size_t device_offset,' 2169 1.19 mrg ' int device_num)' 2170 1.19 mrg 2171 1.19 mrg _Fortran_: 2172 1.19 mrg _Interface_: 'integer(c_int) function 2173 1.19 mrg omp_target_associate_ptr(host_ptr, &' 2174 1.19 mrg ' device_ptr, size, device_offset, device_num) bind(C)' 2175 1.19 mrg 'use, intrinsic :: iso_c_binding, only: c_ptr, c_int, 2176 1.19 mrg c_size_t' 2177 1.19 mrg 'type(c_ptr), value :: host_ptr, device_ptr' 2178 1.19 mrg 'integer(c_size_t), value :: size, device_offset' 2179 1.19 mrg 'integer(c_int), value :: device_num' 2180 1.19 mrg 2181 1.19 mrg _See also_: 2182 1.19 mrg *note omp_target_disassociate_ptr::, *note omp_target_is_present::, 2183 1.19 mrg *note omp_target_alloc:: 2184 1.19 mrg 2185 1.19 mrg _Reference_: 2186 1.19 mrg OpenMP specification v5.1 (https://www.openmp.org), Section 3.8.9 2187 1.19 mrg 2188 1.19 mrg 2189 1.19 mrg File: libgomp.info, Node: omp_target_disassociate_ptr, Next: omp_get_mapped_ptr, Prev: omp_target_associate_ptr, Up: Device Memory Routines 2190 1.19 mrg 2191 1.19 mrg 3.7.10 'omp_target_disassociate_ptr' - Remove device-host pointer association 2192 1.19 mrg ----------------------------------------------------------------------------- 2193 1.19 mrg 2194 1.19 mrg _Description_: 2195 1.19 mrg This routine removes the storage association established by calling 2196 1.19 mrg 'omp_target_associate_ptr' and sets the reference count to zero, 2197 1.19 mrg even if 'omp_target_associate_ptr' was invoked multiple times for 2198 1.19 mrg for host pointer 'ptr'. If applicable, the device memory needs to 2199 1.19 mrg be freed by the user. 2200 1.19 mrg 2201 1.19 mrg If an associated device storage location for the DEVICE_NUM was 2202 1.19 mrg found and has infinite reference count, the association is removed 2203 1.19 mrg and zero is returned. In all other cases, nonzero ('EINVAL') is 2204 1.19 mrg returned and no other action is taken. 2205 1.19 mrg 2206 1.19 mrg Note that passing a host pointer where the association to the 2207 1.19 mrg device pointer was established with the 'declare target' directive 2208 1.19 mrg yields undefined behavior. 2209 1.19 mrg 2210 1.19 mrg Running this routine in a 'target' region except on the initial 2211 1.19 mrg device is not supported. 2212 1.19 mrg 2213 1.19 mrg _C/C++_ 2214 1.19 mrg _Prototype_: 'int omp_target_disassociate_ptr(const void *ptr,' 2215 1.19 mrg ' int device_num)' 2216 1.19 mrg 2217 1.19 mrg _Fortran_: 2218 1.19 mrg _Interface_: 'integer(c_int) function 2219 1.19 mrg omp_target_disassociate_ptr(ptr, &' 2220 1.19 mrg ' device_num) bind(C)' 2221 1.19 mrg 'use, intrinsic :: iso_c_binding, only: c_ptr, c_int' 2222 1.19 mrg 'type(c_ptr), value :: ptr' 2223 1.19 mrg 'integer(c_int), value :: device_num' 2224 1.19 mrg 2225 1.19 mrg _See also_: 2226 1.19 mrg *note omp_target_associate_ptr:: 2227 1.19 mrg 2228 1.19 mrg _Reference_: 2229 1.19 mrg OpenMP specification v5.1 (https://www.openmp.org), Section 3.8.10 2230 1.19 mrg 2231 1.19 mrg 2232 1.19 mrg File: libgomp.info, Node: omp_get_mapped_ptr, Prev: omp_target_disassociate_ptr, Up: Device Memory Routines 2233 1.19 mrg 2234 1.19 mrg 3.7.11 'omp_get_mapped_ptr' - Return device pointer to a host pointer 2235 1.19 mrg --------------------------------------------------------------------- 2236 1.19 mrg 2237 1.19 mrg _Description_: 2238 1.19 mrg If the device number is refers to the initial device or to a device 2239 1.19 mrg with memory accessible from the host (shared memory), the 2240 1.19 mrg 'omp_get_mapped_ptr' routines returns the value of the passed PTR. 2241 1.19 mrg Otherwise, if associated storage to the passed host pointer PTR 2242 1.19 mrg exists on device associated with DEVICE_NUM, it returns that 2243 1.19 mrg pointer. In all other cases and in cases of an error, a null 2244 1.19 mrg pointer is returned. 2245 1.19 mrg 2246 1.19 mrg The association of storage location is established either via an 2247 1.19 mrg explicit or implicit 'map' clause, the 'declare target' directive 2248 1.19 mrg or the 'omp_target_associate_ptr' routine. 2249 1.19 mrg 2250 1.19 mrg Running this routine in a 'target' region except on the initial 2251 1.19 mrg device is not supported. 2252 1.19 mrg 2253 1.19 mrg _C/C++_ 2254 1.19 mrg _Prototype_: 'void *omp_get_mapped_ptr(const void *ptr, int 2255 1.19 mrg device_num);' 2256 1.19 mrg 2257 1.19 mrg _Fortran_: 2258 1.19 mrg _Interface_: 'type(c_ptr) function omp_get_mapped_ptr(ptr, 2259 1.19 mrg device_num) bind(C)' 2260 1.19 mrg 'use, intrinsic :: iso_c_binding, only: c_ptr, c_int' 2261 1.19 mrg 'type(c_ptr), value :: ptr' 2262 1.19 mrg 'integer(c_int), value :: device_num' 2263 1.19 mrg 2264 1.19 mrg _See also_: 2265 1.19 mrg *note omp_target_associate_ptr:: 2266 1.19 mrg 2267 1.19 mrg _Reference_: 2268 1.19 mrg OpenMP specification v5.1 (https://www.openmp.org), Section 3.8.11 2269 1.19 mrg 2270 1.19 mrg 2271 1.19 mrg File: libgomp.info, Node: Lock Routines, Next: Timing Routines, Prev: Device Memory Routines, Up: Runtime Library Routines 2272 1.19 mrg 2273 1.19 mrg 3.8 Lock Routines 2274 1.19 mrg ================= 2275 1.19 mrg 2276 1.19 mrg Initialize, set, test, unset and destroy simple and nested locks. The 2277 1.19 mrg routines have C linkage and do not throw exceptions. 2278 1.19 mrg 2279 1.19 mrg * Menu: 2280 1.19 mrg 2281 1.19 mrg * omp_init_lock:: Initialize simple lock 2282 1.19 mrg * omp_init_nest_lock:: Initialize nested lock 2283 1.19 mrg * omp_destroy_lock:: Destroy simple lock 2284 1.19 mrg * omp_destroy_nest_lock:: Destroy nested lock 2285 1.19 mrg * omp_set_lock:: Wait for and set simple lock 2286 1.19 mrg * omp_set_nest_lock:: Wait for and set simple lock 2287 1.19 mrg * omp_unset_lock:: Unset simple lock 2288 1.19 mrg * omp_unset_nest_lock:: Unset nested lock 2289 1.19 mrg * omp_test_lock:: Test and set simple lock if available 2290 1.19 mrg * omp_test_nest_lock:: Test and set nested lock if available 2291 1.19 mrg 2292 1.19 mrg 2293 1.19 mrg File: libgomp.info, Node: omp_init_lock, Next: omp_init_nest_lock, Up: Lock Routines 2294 1.19 mrg 2295 1.19 mrg 3.8.1 'omp_init_lock' - Initialize simple lock 2296 1.19 mrg ---------------------------------------------- 2297 1.19 mrg 2298 1.19 mrg _Description_: 2299 1.19 mrg Initialize a simple lock. After initialization, the lock is in an 2300 1.19 mrg unlocked state. 2301 1.19 mrg 2302 1.19 mrg _C/C++_: 2303 1.19 mrg _Prototype_: 'void omp_init_lock(omp_lock_t *lock);' 2304 1.19 mrg 2305 1.19 mrg _Fortran_: 2306 1.19 mrg _Interface_: 'subroutine omp_init_lock(svar)' 2307 1.19 mrg 'integer(omp_lock_kind), intent(out) :: svar' 2308 1.19 mrg 2309 1.19 mrg _See also_: 2310 1.19 mrg *note omp_destroy_lock:: 2311 1.19 mrg 2312 1.19 mrg _Reference_: 2313 1.19 mrg OpenMP specification v4.5 (https://www.openmp.org), Section 3.3.1. 2314 1.19 mrg 2315 1.19 mrg 2316 1.19 mrg File: libgomp.info, Node: omp_init_nest_lock, Next: omp_destroy_lock, Prev: omp_init_lock, Up: Lock Routines 2317 1.19 mrg 2318 1.19 mrg 3.8.2 'omp_init_nest_lock' - Initialize nested lock 2319 1.19 mrg --------------------------------------------------- 2320 1.19 mrg 2321 1.19 mrg _Description_: 2322 1.19 mrg Initialize a nested lock. After initialization, the lock is in an 2323 1.19 mrg unlocked state and the nesting count is set to zero. 2324 1.19 mrg 2325 1.19 mrg _C/C++_: 2326 1.19 mrg _Prototype_: 'void omp_init_nest_lock(omp_nest_lock_t *lock);' 2327 1.19 mrg 2328 1.19 mrg _Fortran_: 2329 1.19 mrg _Interface_: 'subroutine omp_init_nest_lock(nvar)' 2330 1.19 mrg 'integer(omp_nest_lock_kind), intent(out) :: nvar' 2331 1.19 mrg 2332 1.19 mrg _See also_: 2333 1.19 mrg *note omp_destroy_nest_lock:: 2334 1.19 mrg 2335 1.19 mrg _Reference_: 2336 1.19 mrg OpenMP specification v4.5 (https://www.openmp.org), Section 3.3.1. 2337 1.19 mrg 2338 1.19 mrg 2339 1.19 mrg File: libgomp.info, Node: omp_destroy_lock, Next: omp_destroy_nest_lock, Prev: omp_init_nest_lock, Up: Lock Routines 2340 1.19 mrg 2341 1.19 mrg 3.8.3 'omp_destroy_lock' - Destroy simple lock 2342 1.19 mrg ---------------------------------------------- 2343 1.19 mrg 2344 1.19 mrg _Description_: 2345 1.19 mrg Destroy a simple lock. In order to be destroyed, a simple lock 2346 1.19 mrg must be in the unlocked state. 2347 1.19 mrg 2348 1.19 mrg _C/C++_: 2349 1.19 mrg _Prototype_: 'void omp_destroy_lock(omp_lock_t *lock);' 2350 1.19 mrg 2351 1.19 mrg _Fortran_: 2352 1.19 mrg _Interface_: 'subroutine omp_destroy_lock(svar)' 2353 1.19 mrg 'integer(omp_lock_kind), intent(inout) :: svar' 2354 1.19 mrg 2355 1.19 mrg _See also_: 2356 1.19 mrg *note omp_init_lock:: 2357 1.19 mrg 2358 1.19 mrg _Reference_: 2359 1.19 mrg OpenMP specification v4.5 (https://www.openmp.org), Section 3.3.3. 2360 1.19 mrg 2361 1.19 mrg 2362 1.19 mrg File: libgomp.info, Node: omp_destroy_nest_lock, Next: omp_set_lock, Prev: omp_destroy_lock, Up: Lock Routines 2363 1.19 mrg 2364 1.19 mrg 3.8.4 'omp_destroy_nest_lock' - Destroy nested lock 2365 1.19 mrg --------------------------------------------------- 2366 1.19 mrg 2367 1.19 mrg _Description_: 2368 1.19 mrg Destroy a nested lock. In order to be destroyed, a nested lock 2369 1.19 mrg must be in the unlocked state and its nesting count must equal 2370 1.19 mrg zero. 2371 1.19 mrg 2372 1.19 mrg _C/C++_: 2373 1.19 mrg _Prototype_: 'void omp_destroy_nest_lock(omp_nest_lock_t *);' 2374 1.19 mrg 2375 1.19 mrg _Fortran_: 2376 1.19 mrg _Interface_: 'subroutine omp_destroy_nest_lock(nvar)' 2377 1.19 mrg 'integer(omp_nest_lock_kind), intent(inout) :: nvar' 2378 1.19 mrg 2379 1.19 mrg _See also_: 2380 1.19 mrg *note omp_init_lock:: 2381 1.19 mrg 2382 1.19 mrg _Reference_: 2383 1.19 mrg OpenMP specification v4.5 (https://www.openmp.org), Section 3.3.3. 2384 1.19 mrg 2385 1.19 mrg 2386 1.19 mrg File: libgomp.info, Node: omp_set_lock, Next: omp_set_nest_lock, Prev: omp_destroy_nest_lock, Up: Lock Routines 2387 1.19 mrg 2388 1.19 mrg 3.8.5 'omp_set_lock' - Wait for and set simple lock 2389 1.19 mrg --------------------------------------------------- 2390 1.19 mrg 2391 1.19 mrg _Description_: 2392 1.19 mrg Before setting a simple lock, the lock variable must be initialized 2393 1.19 mrg by 'omp_init_lock'. The calling thread is blocked until the lock 2394 1.19 mrg is available. If the lock is already held by the current thread, a 2395 1.19 mrg deadlock occurs. 2396 1.19 mrg 2397 1.19 mrg _C/C++_: 2398 1.19 mrg _Prototype_: 'void omp_set_lock(omp_lock_t *lock);' 2399 1.19 mrg 2400 1.19 mrg _Fortran_: 2401 1.19 mrg _Interface_: 'subroutine omp_set_lock(svar)' 2402 1.19 mrg 'integer(omp_lock_kind), intent(inout) :: svar' 2403 1.1 mrg 2404 1.1 mrg _See also_: 2405 1.1 mrg *note omp_init_lock::, *note omp_test_lock::, *note 2406 1.1 mrg omp_unset_lock:: 2407 1.1 mrg 2408 1.19 mrg _Reference_: 2409 1.19 mrg OpenMP specification v4.5 (https://www.openmp.org), Section 3.3.4. 2410 1.19 mrg 2411 1.19 mrg 2412 1.19 mrg File: libgomp.info, Node: omp_set_nest_lock, Next: omp_unset_lock, Prev: omp_set_lock, Up: Lock Routines 2413 1.19 mrg 2414 1.19 mrg 3.8.6 'omp_set_nest_lock' - Wait for and set nested lock 2415 1.19 mrg -------------------------------------------------------- 2416 1.19 mrg 2417 1.19 mrg _Description_: 2418 1.19 mrg Before setting a nested lock, the lock variable must be initialized 2419 1.19 mrg by 'omp_init_nest_lock'. The calling thread is blocked until the 2420 1.19 mrg lock is available. If the lock is already held by the current 2421 1.19 mrg thread, the nesting count for the lock is incremented. 2422 1.19 mrg 2423 1.19 mrg _C/C++_: 2424 1.19 mrg _Prototype_: 'void omp_set_nest_lock(omp_nest_lock_t *lock);' 2425 1.19 mrg 2426 1.19 mrg _Fortran_: 2427 1.19 mrg _Interface_: 'subroutine omp_set_nest_lock(nvar)' 2428 1.19 mrg 'integer(omp_nest_lock_kind), intent(inout) :: nvar' 2429 1.19 mrg 2430 1.19 mrg _See also_: 2431 1.19 mrg *note omp_init_nest_lock::, *note omp_unset_nest_lock:: 2432 1.19 mrg 2433 1.19 mrg _Reference_: 2434 1.19 mrg OpenMP specification v4.5 (https://www.openmp.org), Section 3.3.4. 2435 1.19 mrg 2436 1.19 mrg 2437 1.19 mrg File: libgomp.info, Node: omp_unset_lock, Next: omp_unset_nest_lock, Prev: omp_set_nest_lock, Up: Lock Routines 2438 1.19 mrg 2439 1.19 mrg 3.8.7 'omp_unset_lock' - Unset simple lock 2440 1.19 mrg ------------------------------------------ 2441 1.19 mrg 2442 1.19 mrg _Description_: 2443 1.19 mrg A simple lock about to be unset must have been locked by 2444 1.19 mrg 'omp_set_lock' or 'omp_test_lock' before. In addition, the lock 2445 1.19 mrg must be held by the thread calling 'omp_unset_lock'. Then, the 2446 1.19 mrg lock becomes unlocked. If one or more threads attempted to set the 2447 1.19 mrg lock before, one of them is chosen to, again, set the lock to 2448 1.19 mrg itself. 2449 1.19 mrg 2450 1.19 mrg _C/C++_: 2451 1.19 mrg _Prototype_: 'void omp_unset_lock(omp_lock_t *lock);' 2452 1.19 mrg 2453 1.19 mrg _Fortran_: 2454 1.19 mrg _Interface_: 'subroutine omp_unset_lock(svar)' 2455 1.19 mrg 'integer(omp_lock_kind), intent(inout) :: svar' 2456 1.19 mrg 2457 1.19 mrg _See also_: 2458 1.19 mrg *note omp_set_lock::, *note omp_test_lock:: 2459 1.19 mrg 2460 1.19 mrg _Reference_: 2461 1.19 mrg OpenMP specification v4.5 (https://www.openmp.org), Section 3.3.5. 2462 1.19 mrg 2463 1.19 mrg 2464 1.19 mrg File: libgomp.info, Node: omp_unset_nest_lock, Next: omp_test_lock, Prev: omp_unset_lock, Up: Lock Routines 2465 1.19 mrg 2466 1.19 mrg 3.8.8 'omp_unset_nest_lock' - Unset nested lock 2467 1.19 mrg ----------------------------------------------- 2468 1.19 mrg 2469 1.19 mrg _Description_: 2470 1.19 mrg A nested lock about to be unset must have been locked by 2471 1.19 mrg 'omp_set_nested_lock' or 'omp_test_nested_lock' before. In 2472 1.19 mrg addition, the lock must be held by the thread calling 2473 1.19 mrg 'omp_unset_nested_lock'. If the nesting count drops to zero, the 2474 1.19 mrg lock becomes unlocked. If one ore more threads attempted to set 2475 1.19 mrg the lock before, one of them is chosen to, again, set the lock to 2476 1.19 mrg itself. 2477 1.19 mrg 2478 1.19 mrg _C/C++_: 2479 1.19 mrg _Prototype_: 'void omp_unset_nest_lock(omp_nest_lock_t *lock);' 2480 1.19 mrg 2481 1.19 mrg _Fortran_: 2482 1.19 mrg _Interface_: 'subroutine omp_unset_nest_lock(nvar)' 2483 1.19 mrg 'integer(omp_nest_lock_kind), intent(inout) :: nvar' 2484 1.19 mrg 2485 1.19 mrg _See also_: 2486 1.19 mrg *note omp_set_nest_lock:: 2487 1.19 mrg 2488 1.19 mrg _Reference_: 2489 1.19 mrg OpenMP specification v4.5 (https://www.openmp.org), Section 3.3.5. 2490 1.19 mrg 2491 1.19 mrg 2492 1.19 mrg File: libgomp.info, Node: omp_test_lock, Next: omp_test_nest_lock, Prev: omp_unset_nest_lock, Up: Lock Routines 2493 1.19 mrg 2494 1.19 mrg 3.8.9 'omp_test_lock' - Test and set simple lock if available 2495 1.19 mrg ------------------------------------------------------------- 2496 1.19 mrg 2497 1.19 mrg _Description_: 2498 1.19 mrg Before setting a simple lock, the lock variable must be initialized 2499 1.19 mrg by 'omp_init_lock'. Contrary to 'omp_set_lock', 'omp_test_lock' 2500 1.19 mrg does not block if the lock is not available. This function returns 2501 1.19 mrg 'true' upon success, 'false' otherwise. Here, 'true' and 'false' 2502 1.19 mrg represent their language-specific counterparts. 2503 1.19 mrg 2504 1.19 mrg _C/C++_: 2505 1.19 mrg _Prototype_: 'int omp_test_lock(omp_lock_t *lock);' 2506 1.19 mrg 2507 1.19 mrg _Fortran_: 2508 1.19 mrg _Interface_: 'logical function omp_test_lock(svar)' 2509 1.19 mrg 'integer(omp_lock_kind), intent(inout) :: svar' 2510 1.19 mrg 2511 1.19 mrg _See also_: 2512 1.19 mrg *note omp_init_lock::, *note omp_set_lock::, *note omp_set_lock:: 2513 1.19 mrg 2514 1.19 mrg _Reference_: 2515 1.19 mrg OpenMP specification v4.5 (https://www.openmp.org), Section 3.3.6. 2516 1.19 mrg 2517 1.19 mrg 2518 1.19 mrg File: libgomp.info, Node: omp_test_nest_lock, Prev: omp_test_lock, Up: Lock Routines 2519 1.19 mrg 2520 1.19 mrg 3.8.10 'omp_test_nest_lock' - Test and set nested lock if available 2521 1.19 mrg ------------------------------------------------------------------- 2522 1.19 mrg 2523 1.19 mrg _Description_: 2524 1.19 mrg Before setting a nested lock, the lock variable must be initialized 2525 1.19 mrg by 'omp_init_nest_lock'. Contrary to 'omp_set_nest_lock', 2526 1.19 mrg 'omp_test_nest_lock' does not block if the lock is not available. 2527 1.19 mrg If the lock is already held by the current thread, the new nesting 2528 1.19 mrg count is returned. Otherwise, the return value equals zero. 2529 1.19 mrg 2530 1.19 mrg _C/C++_: 2531 1.19 mrg _Prototype_: 'int omp_test_nest_lock(omp_nest_lock_t *lock);' 2532 1.19 mrg 2533 1.19 mrg _Fortran_: 2534 1.19 mrg _Interface_: 'logical function omp_test_nest_lock(nvar)' 2535 1.19 mrg 'integer(omp_nest_lock_kind), intent(inout) :: nvar' 2536 1.19 mrg 2537 1.19 mrg _See also_: 2538 1.19 mrg *note omp_init_lock::, *note omp_set_lock::, *note omp_set_lock:: 2539 1.19 mrg 2540 1.19 mrg _Reference_: 2541 1.19 mrg OpenMP specification v4.5 (https://www.openmp.org), Section 3.3.6. 2542 1.19 mrg 2543 1.19 mrg 2544 1.19 mrg File: libgomp.info, Node: Timing Routines, Next: Event Routine, Prev: Lock Routines, Up: Runtime Library Routines 2545 1.19 mrg 2546 1.19 mrg 3.9 Timing Routines 2547 1.19 mrg =================== 2548 1.19 mrg 2549 1.19 mrg Portable, thread-based, wall clock timer. The routines have C linkage 2550 1.19 mrg and do not throw exceptions. 2551 1.19 mrg 2552 1.19 mrg * Menu: 2553 1.19 mrg 2554 1.19 mrg * omp_get_wtick:: Get timer precision. 2555 1.19 mrg * omp_get_wtime:: Elapsed wall clock time. 2556 1.19 mrg 2557 1.19 mrg 2558 1.19 mrg File: libgomp.info, Node: omp_get_wtick, Next: omp_get_wtime, Up: Timing Routines 2559 1.19 mrg 2560 1.19 mrg 3.9.1 'omp_get_wtick' - Get timer precision 2561 1.19 mrg ------------------------------------------- 2562 1.19 mrg 2563 1.19 mrg _Description_: 2564 1.19 mrg Gets the timer precision, i.e., the number of seconds between two 2565 1.19 mrg successive clock ticks. 2566 1.19 mrg 2567 1.19 mrg _C/C++_: 2568 1.19 mrg _Prototype_: 'double omp_get_wtick(void);' 2569 1.19 mrg 2570 1.19 mrg _Fortran_: 2571 1.19 mrg _Interface_: 'double precision function omp_get_wtick()' 2572 1.19 mrg 2573 1.19 mrg _See also_: 2574 1.19 mrg *note omp_get_wtime:: 2575 1.19 mrg 2576 1.19 mrg _Reference_: 2577 1.19 mrg OpenMP specification v4.5 (https://www.openmp.org), Section 3.4.2. 2578 1.19 mrg 2579 1.19 mrg 2580 1.19 mrg File: libgomp.info, Node: omp_get_wtime, Prev: omp_get_wtick, Up: Timing Routines 2581 1.19 mrg 2582 1.19 mrg 3.9.2 'omp_get_wtime' - Elapsed wall clock time 2583 1.19 mrg ----------------------------------------------- 2584 1.19 mrg 2585 1.19 mrg _Description_: 2586 1.19 mrg Elapsed wall clock time in seconds. The time is measured per 2587 1.19 mrg thread, no guarantee can be made that two distinct threads measure 2588 1.19 mrg the same time. Time is measured from some "time in the past", 2589 1.19 mrg which is an arbitrary time guaranteed not to change during the 2590 1.19 mrg execution of the program. 2591 1.19 mrg 2592 1.19 mrg _C/C++_: 2593 1.19 mrg _Prototype_: 'double omp_get_wtime(void);' 2594 1.19 mrg 2595 1.19 mrg _Fortran_: 2596 1.19 mrg _Interface_: 'double precision function omp_get_wtime()' 2597 1.19 mrg 2598 1.19 mrg _See also_: 2599 1.19 mrg *note omp_get_wtick:: 2600 1.19 mrg 2601 1.19 mrg _Reference_: 2602 1.19 mrg OpenMP specification v4.5 (https://www.openmp.org), Section 3.4.1. 2603 1.19 mrg 2604 1.19 mrg 2605 1.19 mrg File: libgomp.info, Node: Event Routine, Next: Memory Management Routines, Prev: Timing Routines, Up: Runtime Library Routines 2606 1.19 mrg 2607 1.19 mrg 3.10 Event Routine 2608 1.19 mrg ================== 2609 1.19 mrg 2610 1.19 mrg Support for event objects. The routine has C linkage and do not throw 2611 1.19 mrg exceptions. 2612 1.19 mrg 2613 1.19 mrg * Menu: 2614 1.19 mrg 2615 1.19 mrg * omp_fulfill_event:: Fulfill and destroy an OpenMP event. 2616 1.19 mrg 2617 1.19 mrg 2618 1.19 mrg File: libgomp.info, Node: omp_fulfill_event, Up: Event Routine 2619 1.19 mrg 2620 1.19 mrg 3.10.1 'omp_fulfill_event' - Fulfill and destroy an OpenMP event 2621 1.19 mrg ---------------------------------------------------------------- 2622 1.19 mrg 2623 1.19 mrg _Description_: 2624 1.19 mrg Fulfill the event associated with the event handle argument. 2625 1.19 mrg Currently, it is only used to fulfill events generated by detach 2626 1.19 mrg clauses on task constructs - the effect of fulfilling the event is 2627 1.19 mrg to allow the task to complete. 2628 1.19 mrg 2629 1.19 mrg The result of calling 'omp_fulfill_event' with an event handle 2630 1.19 mrg other than that generated by a detach clause is undefined. Calling 2631 1.19 mrg it with an event handle that has already been fulfilled is also 2632 1.19 mrg undefined. 2633 1.19 mrg 2634 1.19 mrg _C/C++_: 2635 1.19 mrg _Prototype_: 'void omp_fulfill_event(omp_event_handle_t event);' 2636 1.19 mrg 2637 1.19 mrg _Fortran_: 2638 1.19 mrg _Interface_: 'subroutine omp_fulfill_event(event)' 2639 1.19 mrg 'integer (kind=omp_event_handle_kind) :: event' 2640 1.19 mrg 2641 1.19 mrg _Reference_: 2642 1.19 mrg OpenMP specification v5.0 (https://www.openmp.org), Section 3.5.1. 2643 1.19 mrg 2644 1.19 mrg 2645 1.19 mrg File: libgomp.info, Node: Memory Management Routines, Next: Environment Display Routine, Prev: Event Routine, Up: Runtime Library Routines 2646 1.19 mrg 2647 1.19 mrg 3.11 Memory Management Routines 2648 1.19 mrg =============================== 2649 1.19 mrg 2650 1.19 mrg Routines to manage and allocate memory on the current device. They have 2651 1.19 mrg C linkage and do not throw exceptions. 2652 1.19 mrg 2653 1.19 mrg * Menu: 2654 1.19 mrg 2655 1.19 mrg * omp_init_allocator:: Create an allocator 2656 1.19 mrg * omp_destroy_allocator:: Destroy an allocator 2657 1.19 mrg * omp_set_default_allocator:: Set the default allocator 2658 1.19 mrg * omp_get_default_allocator:: Get the default allocator 2659 1.19 mrg * omp_alloc:: Memory allocation with an allocator 2660 1.19 mrg * omp_aligned_alloc:: Memory allocation with an allocator and alignment 2661 1.19 mrg * omp_free:: Freeing memory allocated with OpenMP routines 2662 1.19 mrg * omp_calloc:: Allocate nullified memory with an allocator 2663 1.19 mrg * omp_aligned_calloc:: Allocate nullified aligned memory with an allocator 2664 1.19 mrg * omp_realloc:: Reallocate memory allocated with OpenMP routines 2665 1.1 mrg 2666 1.1 mrg 2667 1.19 mrg File: libgomp.info, Node: omp_init_allocator, Next: omp_destroy_allocator, Up: Memory Management Routines 2668 1.1 mrg 2669 1.19 mrg 3.11.1 'omp_init_allocator' - Create an allocator 2670 1.19 mrg ------------------------------------------------- 2671 1.1 mrg 2672 1.1 mrg _Description_: 2673 1.19 mrg Create an allocator that uses the specified memory space and has 2674 1.19 mrg the specified traits; if an allocator that fulfills the 2675 1.19 mrg requirements cannot be created, 'omp_null_allocator' is returned. 2676 1.19 mrg 2677 1.19 mrg The predefined memory spaces and available traits can be found at 2678 1.19 mrg *note OMP_ALLOCATOR::, where the trait names have to be prefixed by 2679 1.19 mrg 'omp_atk_' (e.g. 'omp_atk_pinned') and the named trait values by 2680 1.19 mrg 'omp_atv_' (e.g. 'omp_atv_true'); additionally, 'omp_atv_default' 2681 1.19 mrg may be used as trait value to specify that the default value should 2682 1.19 mrg be used. 2683 1.1 mrg 2684 1.1 mrg _C/C++_: 2685 1.19 mrg _Prototype_: 'omp_allocator_handle_t omp_init_allocator(' 2686 1.19 mrg ' omp_memspace_handle_t memspace,' 2687 1.19 mrg ' int ntraits,' 2688 1.19 mrg ' const omp_alloctrait_t traits[]);' 2689 1.1 mrg 2690 1.1 mrg _Fortran_: 2691 1.19 mrg _Interface_: 'function omp_init_allocator(memspace, ntraits, traits)' 2692 1.19 mrg 'integer (omp_allocator_handle_kind) :: 2693 1.19 mrg omp_init_allocator' 2694 1.19 mrg 'integer (omp_memspace_handle_kind), intent(in) :: 2695 1.19 mrg memspace' 2696 1.19 mrg 'integer, intent(in) :: ntraits' 2697 1.19 mrg 'type (omp_alloctrait), intent(in) :: traits(*)' 2698 1.1 mrg 2699 1.1 mrg _See also_: 2700 1.19 mrg *note OMP_ALLOCATOR::, *note Memory allocation::, *note 2701 1.19 mrg omp_destroy_allocator:: 2702 1.1 mrg 2703 1.1 mrg _Reference_: 2704 1.19 mrg OpenMP specification v5.0 (https://www.openmp.org), Section 3.7.2 2705 1.1 mrg 2706 1.1 mrg 2707 1.19 mrg File: libgomp.info, Node: omp_destroy_allocator, Next: omp_set_default_allocator, Prev: omp_init_allocator, Up: Memory Management Routines 2708 1.1 mrg 2709 1.19 mrg 3.11.2 'omp_destroy_allocator' - Destroy an allocator 2710 1.19 mrg ----------------------------------------------------- 2711 1.1 mrg 2712 1.1 mrg _Description_: 2713 1.19 mrg Releases all resources used by a memory allocator, which must not 2714 1.19 mrg represent a predefined memory allocator. Accessing memory after 2715 1.19 mrg its allocator has been destroyed has unspecified behavior. Passing 2716 1.19 mrg 'omp_null_allocator' to the routine is permitted but has no effect. 2717 1.1 mrg 2718 1.1 mrg _C/C++_: 2719 1.19 mrg _Prototype_: 'void omp_destroy_allocator (omp_allocator_handle_t 2720 1.19 mrg allocator);' 2721 1.1 mrg 2722 1.1 mrg _Fortran_: 2723 1.19 mrg _Interface_: 'subroutine omp_destroy_allocator(allocator)' 2724 1.19 mrg 'integer (omp_allocator_handle_kind), intent(in) :: 2725 1.19 mrg allocator' 2726 1.1 mrg 2727 1.1 mrg _See also_: 2728 1.19 mrg *note omp_init_allocator:: 2729 1.1 mrg 2730 1.1 mrg _Reference_: 2731 1.19 mrg OpenMP specification v5.0 (https://www.openmp.org), Section 3.7.3 2732 1.1 mrg 2733 1.1 mrg 2734 1.19 mrg File: libgomp.info, Node: omp_set_default_allocator, Next: omp_get_default_allocator, Prev: omp_destroy_allocator, Up: Memory Management Routines 2735 1.1 mrg 2736 1.19 mrg 3.11.3 'omp_set_default_allocator' - Set the default allocator 2737 1.19 mrg -------------------------------------------------------------- 2738 1.1 mrg 2739 1.1 mrg _Description_: 2740 1.19 mrg Sets the default allocator that is used when no allocator has been 2741 1.19 mrg specified in the 'allocate' or 'allocator' clause or if an OpenMP 2742 1.19 mrg memory routine is invoked with the 'omp_null_allocator' allocator. 2743 1.1 mrg 2744 1.1 mrg _C/C++_: 2745 1.19 mrg _Prototype_: 'void omp_set_default_allocator(omp_allocator_handle_t 2746 1.19 mrg allocator);' 2747 1.1 mrg 2748 1.1 mrg _Fortran_: 2749 1.19 mrg _Interface_: 'subroutine omp_set_default_allocator(allocator)' 2750 1.19 mrg 'integer (omp_allocator_handle_kind), intent(in) :: 2751 1.19 mrg allocator' 2752 1.1 mrg 2753 1.1 mrg _See also_: 2754 1.19 mrg *note omp_get_default_allocator::, *note omp_init_allocator::, 2755 1.19 mrg *note OMP_ALLOCATOR::, *note Memory allocation:: 2756 1.1 mrg 2757 1.1 mrg _Reference_: 2758 1.19 mrg OpenMP specification v5.0 (https://www.openmp.org), Section 3.7.4 2759 1.1 mrg 2760 1.1 mrg 2761 1.19 mrg File: libgomp.info, Node: omp_get_default_allocator, Next: omp_alloc, Prev: omp_set_default_allocator, Up: Memory Management Routines 2762 1.1 mrg 2763 1.19 mrg 3.11.4 'omp_get_default_allocator' - Get the default allocator 2764 1.19 mrg -------------------------------------------------------------- 2765 1.1 mrg 2766 1.1 mrg _Description_: 2767 1.19 mrg The routine returns the default allocator that is used when no 2768 1.19 mrg allocator has been specified in the 'allocate' or 'allocator' 2769 1.19 mrg clause or if an OpenMP memory routine is invoked with the 2770 1.19 mrg 'omp_null_allocator' allocator. 2771 1.1 mrg 2772 1.1 mrg _C/C++_: 2773 1.19 mrg _Prototype_: 'omp_allocator_handle_t omp_get_default_allocator();' 2774 1.1 mrg 2775 1.1 mrg _Fortran_: 2776 1.19 mrg _Interface_: 'function omp_get_default_allocator()' 2777 1.19 mrg 'integer (omp_allocator_handle_kind) :: 2778 1.19 mrg omp_get_default_allocator' 2779 1.1 mrg 2780 1.1 mrg _See also_: 2781 1.19 mrg *note omp_set_default_allocator::, *note OMP_ALLOCATOR:: 2782 1.1 mrg 2783 1.1 mrg _Reference_: 2784 1.19 mrg OpenMP specification v5.0 (https://www.openmp.org), Section 3.7.5 2785 1.1 mrg 2786 1.1 mrg 2787 1.19 mrg File: libgomp.info, Node: omp_alloc, Next: omp_aligned_alloc, Prev: omp_get_default_allocator, Up: Memory Management Routines 2788 1.1 mrg 2789 1.19 mrg 3.11.5 'omp_alloc' - Memory allocation with an allocator 2790 1.19 mrg -------------------------------------------------------- 2791 1.1 mrg 2792 1.1 mrg _Description_: 2793 1.19 mrg Allocate memory with the specified allocator, which can either be a 2794 1.19 mrg predefined allocator, an allocator handle or 'omp_null_allocator'. 2795 1.19 mrg If the allocators is 'omp_null_allocator', the allocator specified 2796 1.19 mrg by the DEF-ALLOCATOR-VAR ICV is used. SIZE must be a nonnegative 2797 1.19 mrg number denoting the number of bytes to be allocated; if SIZE is 2798 1.19 mrg zero, 'omp_alloc' will return a null pointer. If successful, a 2799 1.19 mrg pointer to the allocated memory is returned, otherwise the 2800 1.19 mrg 'fallback' trait of the allocator determines the behavior. The 2801 1.19 mrg content of the allocated memory is unspecified. 2802 1.19 mrg 2803 1.19 mrg In 'target' regions, either the 'dynamic_allocators' clause must 2804 1.19 mrg appear on a 'requires' directive in the same compilation unit - or 2805 1.19 mrg the ALLOCATOR argument may only be a constant expression with the 2806 1.19 mrg value of one of the predefined allocators and may not be 2807 1.19 mrg 'omp_null_allocator'. 2808 1.19 mrg 2809 1.19 mrg Memory allocated by 'omp_alloc' must be freed using 'omp_free'. 2810 1.19 mrg 2811 1.19 mrg _C_: 2812 1.19 mrg _Prototype_: 'void* omp_alloc(size_t size,' 2813 1.19 mrg ' omp_allocator_handle_t allocator)' 2814 1.1 mrg 2815 1.19 mrg _C++_: 2816 1.19 mrg _Prototype_: 'void* omp_alloc(size_t size,' 2817 1.19 mrg ' omp_allocator_handle_t allocator=omp_null_allocator)' 2818 1.1 mrg 2819 1.1 mrg _Fortran_: 2820 1.19 mrg _Interface_: 'type(c_ptr) function omp_alloc(size, allocator) 2821 1.19 mrg bind(C)' 2822 1.19 mrg 'use, intrinsic :: iso_c_binding, only : c_ptr, 2823 1.19 mrg c_size_t' 2824 1.19 mrg 'integer (c_size_t), value :: size' 2825 1.19 mrg 'integer (omp_allocator_handle_kind), value :: 2826 1.19 mrg allocator' 2827 1.1 mrg 2828 1.1 mrg _See also_: 2829 1.19 mrg *note OMP_ALLOCATOR::, *note Memory allocation::, *note 2830 1.19 mrg omp_set_default_allocator::, *note omp_free::, *note 2831 1.19 mrg omp_init_allocator:: 2832 1.1 mrg 2833 1.1 mrg _Reference_: 2834 1.19 mrg OpenMP specification v5.0 (https://www.openmp.org), Section 3.7.6 2835 1.1 mrg 2836 1.1 mrg 2837 1.19 mrg File: libgomp.info, Node: omp_aligned_alloc, Next: omp_free, Prev: omp_alloc, Up: Memory Management Routines 2838 1.1 mrg 2839 1.19 mrg 3.11.6 'omp_aligned_alloc' - Memory allocation with an allocator and alignment 2840 1.19 mrg ------------------------------------------------------------------------------ 2841 1.1 mrg 2842 1.1 mrg _Description_: 2843 1.19 mrg Allocate memory with the specified allocator, which can either be a 2844 1.19 mrg predefined allocator, an allocator handle or 'omp_null_allocator'. 2845 1.19 mrg If the allocators is 'omp_null_allocator', the allocator specified 2846 1.19 mrg by the DEF-ALLOCATOR-VAR ICV is used. ALIGNMENT must be a positive 2847 1.19 mrg power of two and SIZE must be a nonnegative number that is a 2848 1.19 mrg multiple of the alignment and denotes the number of bytes to be 2849 1.19 mrg allocated; if SIZE is zero, 'omp_aligned_alloc' will return a null 2850 1.19 mrg pointer. The alignment will be at least the maximal value required 2851 1.19 mrg by 'alignment' trait of the allocator and the value of the passed 2852 1.19 mrg ALIGNMENT argument. If successful, a pointer to the allocated 2853 1.19 mrg memory is returned, otherwise the 'fallback' trait of the allocator 2854 1.19 mrg determines the behavior. The content of the allocated memory is 2855 1.19 mrg unspecified. 2856 1.19 mrg 2857 1.19 mrg In 'target' regions, either the 'dynamic_allocators' clause must 2858 1.19 mrg appear on a 'requires' directive in the same compilation unit - or 2859 1.19 mrg the ALLOCATOR argument may only be a constant expression with the 2860 1.19 mrg value of one of the predefined allocators and may not be 2861 1.19 mrg 'omp_null_allocator'. 2862 1.19 mrg 2863 1.19 mrg Memory allocated by 'omp_aligned_alloc' must be freed using 2864 1.19 mrg 'omp_free'. 2865 1.19 mrg 2866 1.19 mrg _C_: 2867 1.19 mrg _Prototype_: 'void* omp_aligned_alloc(size_t alignment,' 2868 1.19 mrg ' size_t size,' 2869 1.19 mrg ' omp_allocator_handle_t allocator)' 2870 1.1 mrg 2871 1.19 mrg _C++_: 2872 1.19 mrg _Prototype_: 'void* omp_aligned_alloc(size_t alignment,' 2873 1.19 mrg ' size_t size,' 2874 1.19 mrg ' omp_allocator_handle_t allocator=omp_null_allocator)' 2875 1.1 mrg 2876 1.1 mrg _Fortran_: 2877 1.19 mrg _Interface_: 'type(c_ptr) function omp_aligned_alloc(alignment, size, 2878 1.19 mrg allocator) bind(C)' 2879 1.19 mrg 'use, intrinsic :: iso_c_binding, only : c_ptr, 2880 1.19 mrg c_size_t' 2881 1.19 mrg 'integer (c_size_t), value :: alignment, size' 2882 1.19 mrg 'integer (omp_allocator_handle_kind), value :: 2883 1.19 mrg allocator' 2884 1.1 mrg 2885 1.1 mrg _See also_: 2886 1.19 mrg *note OMP_ALLOCATOR::, *note Memory allocation::, *note 2887 1.19 mrg omp_set_default_allocator::, *note omp_free::, *note 2888 1.19 mrg omp_init_allocator:: 2889 1.1 mrg 2890 1.1 mrg _Reference_: 2891 1.19 mrg OpenMP specification v5.1 (https://www.openmp.org), Section 3.13.6 2892 1.1 mrg 2893 1.1 mrg 2894 1.19 mrg File: libgomp.info, Node: omp_free, Next: omp_calloc, Prev: omp_aligned_alloc, Up: Memory Management Routines 2895 1.1 mrg 2896 1.19 mrg 3.11.7 'omp_free' - Freeing memory allocated with OpenMP routines 2897 1.19 mrg ----------------------------------------------------------------- 2898 1.1 mrg 2899 1.1 mrg _Description_: 2900 1.19 mrg The 'omp_free' routine deallocates memory previously allocated by 2901 1.19 mrg an OpenMP memory-management routine. The PTR argument must point 2902 1.19 mrg to such memory or be a null pointer; if it is a null pointer, no 2903 1.19 mrg operation is performed. If specified, the ALLOCATOR argument must 2904 1.19 mrg be either the memory allocator that was used for the allocation or 2905 1.19 mrg 'omp_null_allocator'; if it is 'omp_null_allocator', the 2906 1.19 mrg implementation will determine the value automatically. 2907 1.19 mrg 2908 1.19 mrg Calling 'omp_free' invokes undefined behavior if the memory was 2909 1.19 mrg already deallocated or when the used allocator has already been 2910 1.19 mrg destroyed. 2911 1.19 mrg 2912 1.19 mrg _C_: 2913 1.19 mrg _Prototype_: 'void omp_free(void *ptr,' 2914 1.19 mrg ' omp_allocator_handle_t allocator)' 2915 1.1 mrg 2916 1.19 mrg _C++_: 2917 1.19 mrg _Prototype_: 'void omp_free(void *ptr,' 2918 1.19 mrg ' omp_allocator_handle_t allocator=omp_null_allocator)' 2919 1.1 mrg 2920 1.1 mrg _Fortran_: 2921 1.19 mrg _Interface_: 'subroutine omp_free(ptr, allocator) bind(C)' 2922 1.19 mrg 'use, intrinsic :: iso_c_binding, only : c_ptr' 2923 1.19 mrg 'type (c_ptr), value :: ptr' 2924 1.19 mrg 'integer (omp_allocator_handle_kind), value :: 2925 1.19 mrg allocator' 2926 1.1 mrg 2927 1.1 mrg _See also_: 2928 1.19 mrg *note omp_alloc::, *note omp_aligned_alloc::, *note omp_calloc::, 2929 1.19 mrg *note omp_aligned_calloc::, *note omp_realloc:: 2930 1.1 mrg 2931 1.1 mrg _Reference_: 2932 1.19 mrg OpenMP specification v5.0 (https://www.openmp.org), Section 3.7.7 2933 1.1 mrg 2934 1.1 mrg 2935 1.19 mrg File: libgomp.info, Node: omp_calloc, Next: omp_aligned_calloc, Prev: omp_free, Up: Memory Management Routines 2936 1.1 mrg 2937 1.19 mrg 3.11.8 'omp_calloc' - Allocate nullified memory with an allocator 2938 1.19 mrg ----------------------------------------------------------------- 2939 1.1 mrg 2940 1.1 mrg _Description_: 2941 1.19 mrg Allocate zero-initialized memory with the specified allocator, 2942 1.19 mrg which can either be a predefined allocator, an allocator handle or 2943 1.19 mrg 'omp_null_allocator'. If the allocators is 'omp_null_allocator', 2944 1.19 mrg the allocator specified by the DEF-ALLOCATOR-VAR ICV is used. The 2945 1.19 mrg to-be allocated memory is for an array with NMEMB elements, each 2946 1.19 mrg having a size of SIZE bytes. Both NMEMB and SIZE must be 2947 1.19 mrg nonnegative numbers; if either of them is zero, 'omp_calloc' will 2948 1.19 mrg return a null pointer. If successful, a pointer to the 2949 1.19 mrg zero-initialized allocated memory is returned, otherwise the 2950 1.19 mrg 'fallback' trait of the allocator determines the behavior. 2951 1.19 mrg 2952 1.19 mrg In 'target' regions, either the 'dynamic_allocators' clause must 2953 1.19 mrg appear on a 'requires' directive in the same compilation unit - or 2954 1.19 mrg the ALLOCATOR argument may only be a constant expression with the 2955 1.19 mrg value of one of the predefined allocators and may not be 2956 1.19 mrg 'omp_null_allocator'. 2957 1.19 mrg 2958 1.19 mrg Memory allocated by 'omp_calloc' must be freed using 'omp_free'. 2959 1.19 mrg 2960 1.19 mrg _C_: 2961 1.19 mrg _Prototype_: 'void* omp_calloc(size_t nmemb, size_t size,' 2962 1.19 mrg ' omp_allocator_handle_t allocator)' 2963 1.1 mrg 2964 1.19 mrg _C++_: 2965 1.19 mrg _Prototype_: 'void* omp_calloc(size_t nmemb, size_t size,' 2966 1.19 mrg ' omp_allocator_handle_t allocator=omp_null_allocator)' 2967 1.1 mrg 2968 1.1 mrg _Fortran_: 2969 1.19 mrg _Interface_: 'type(c_ptr) function omp_calloc(nmemb, size, allocator) 2970 1.19 mrg bind(C)' 2971 1.19 mrg 'use, intrinsic :: iso_c_binding, only : c_ptr, 2972 1.19 mrg c_size_t' 2973 1.19 mrg 'integer (c_size_t), value :: nmemb, size' 2974 1.19 mrg 'integer (omp_allocator_handle_kind), value :: 2975 1.19 mrg allocator' 2976 1.1 mrg 2977 1.1 mrg _See also_: 2978 1.19 mrg *note OMP_ALLOCATOR::, *note Memory allocation::, *note 2979 1.19 mrg omp_set_default_allocator::, *note omp_free::, *note 2980 1.19 mrg omp_init_allocator:: 2981 1.1 mrg 2982 1.1 mrg _Reference_: 2983 1.19 mrg OpenMP specification v5.1 (https://www.openmp.org), Section 3.13.8 2984 1.1 mrg 2985 1.1 mrg 2986 1.19 mrg File: libgomp.info, Node: omp_aligned_calloc, Next: omp_realloc, Prev: omp_calloc, Up: Memory Management Routines 2987 1.1 mrg 2988 1.19 mrg 3.11.9 'omp_aligned_calloc' - Allocate aligned nullified memory with an allocator 2989 1.19 mrg --------------------------------------------------------------------------------- 2990 1.1 mrg 2991 1.1 mrg _Description_: 2992 1.19 mrg Allocate zero-initialized memory with the specified allocator, 2993 1.19 mrg which can either be a predefined allocator, an allocator handle or 2994 1.19 mrg 'omp_null_allocator'. If the allocators is 'omp_null_allocator', 2995 1.19 mrg the allocator specified by the DEF-ALLOCATOR-VAR ICV is used. The 2996 1.19 mrg to-be allocated memory is for an array with NMEMB elements, each 2997 1.19 mrg having a size of SIZE bytes. Both NMEMB and SIZE must be 2998 1.19 mrg nonnegative numbers; if either of them is zero, 2999 1.19 mrg 'omp_aligned_calloc' will return a null pointer. ALIGNMENT must be 3000 1.19 mrg a positive power of two and SIZE must be a multiple of the 3001 1.19 mrg alignment; the alignment will be at least the maximal value 3002 1.19 mrg required by 'alignment' trait of the allocator and the value of the 3003 1.19 mrg passed ALIGNMENT argument. If successful, a pointer to the 3004 1.19 mrg zero-initialized allocated memory is returned, otherwise the 3005 1.19 mrg 'fallback' trait of the allocator determines the behavior. 3006 1.19 mrg 3007 1.19 mrg In 'target' regions, either the 'dynamic_allocators' clause must 3008 1.19 mrg appear on a 'requires' directive in the same compilation unit - or 3009 1.19 mrg the ALLOCATOR argument may only be a constant expression with the 3010 1.19 mrg value of one of the predefined allocators and may not be 3011 1.19 mrg 'omp_null_allocator'. 3012 1.19 mrg 3013 1.19 mrg Memory allocated by 'omp_aligned_calloc' must be freed using 3014 1.19 mrg 'omp_free'. 3015 1.19 mrg 3016 1.19 mrg _C_: 3017 1.19 mrg _Prototype_: 'void* omp_aligned_calloc(size_t nmemb, size_t size,' 3018 1.19 mrg ' omp_allocator_handle_t allocator)' 3019 1.1 mrg 3020 1.19 mrg _C++_: 3021 1.19 mrg _Prototype_: 'void* omp_aligned_calloc(size_t nmemb, size_t size,' 3022 1.19 mrg ' omp_allocator_handle_t allocator=omp_null_allocator)' 3023 1.1 mrg 3024 1.1 mrg _Fortran_: 3025 1.19 mrg _Interface_: 'type(c_ptr) function omp_aligned_calloc(nmemb, size, 3026 1.19 mrg allocator) bind(C)' 3027 1.19 mrg 'use, intrinsic :: iso_c_binding, only : c_ptr, 3028 1.19 mrg c_size_t' 3029 1.19 mrg 'integer (c_size_t), value :: nmemb, size' 3030 1.19 mrg 'integer (omp_allocator_handle_kind), value :: 3031 1.19 mrg allocator' 3032 1.1 mrg 3033 1.1 mrg _See also_: 3034 1.19 mrg *note OMP_ALLOCATOR::, *note Memory allocation::, *note 3035 1.19 mrg omp_set_default_allocator::, *note omp_free::, *note 3036 1.19 mrg omp_init_allocator:: 3037 1.1 mrg 3038 1.1 mrg _Reference_: 3039 1.19 mrg OpenMP specification v5.1 (https://www.openmp.org), Section 3.13.8 3040 1.1 mrg 3041 1.1 mrg 3042 1.19 mrg File: libgomp.info, Node: omp_realloc, Prev: omp_aligned_calloc, Up: Memory Management Routines 3043 1.1 mrg 3044 1.19 mrg 3.11.10 'omp_realloc' - Reallocate memory allocated with OpenMP routines 3045 1.19 mrg ------------------------------------------------------------------------ 3046 1.1 mrg 3047 1.1 mrg _Description_: 3048 1.19 mrg The 'omp_realloc' routine deallocates memory to which PTR points to 3049 1.19 mrg and allocates new memory with the specified ALLOCATOR argument; the 3050 1.19 mrg new memory will have the content of the old memory up to the 3051 1.19 mrg minimum of the old size and the new SIZE, otherwise the content of 3052 1.19 mrg the returned memory is unspecified. If the new allocator is the 3053 1.19 mrg same as the old one, the routine tries to resize the existing 3054 1.19 mrg memory allocation, returning the same address as PTR if successful. 3055 1.19 mrg PTR must point to memory allocated by an OpenMP memory-management 3056 1.19 mrg routine. 3057 1.19 mrg 3058 1.19 mrg The ALLOCATOR and FREE_ALLOCATOR arguments must be a predefined 3059 1.19 mrg allocator, an allocator handle or 'omp_null_allocator'. If 3060 1.19 mrg FREE_ALLOCATOR is 'omp_null_allocator', the implementation 3061 1.19 mrg automatically determines the allocator used for the allocation of 3062 1.19 mrg PTR. If ALLOCATOR is 'omp_null_allocator' and PTR is not a null 3063 1.19 mrg pointer, the same allocator as 'free_allocator' is used and when 3064 1.19 mrg PTR is a null pointer the allocator specified by the 3065 1.19 mrg DEF-ALLOCATOR-VAR ICV is used. 3066 1.19 mrg 3067 1.19 mrg The SIZE must be a nonnegative number denoting the number of bytes 3068 1.19 mrg to be allocated; if SIZE is zero, 'omp_realloc' will return free 3069 1.19 mrg the memory and return a null pointer. When SIZE is nonzero: if 3070 1.19 mrg successful, a pointer to the allocated memory is returned, 3071 1.19 mrg otherwise the 'fallback' trait of the allocator determines the 3072 1.19 mrg behavior. 3073 1.19 mrg 3074 1.19 mrg In 'target' regions, either the 'dynamic_allocators' clause must 3075 1.19 mrg appear on a 'requires' directive in the same compilation unit - or 3076 1.19 mrg the FREE_ALLOCATOR and ALLOCATOR arguments may only be a constant 3077 1.19 mrg expression with the value of one of the predefined allocators and 3078 1.19 mrg may not be 'omp_null_allocator'. 3079 1.19 mrg 3080 1.19 mrg Memory allocated by 'omp_realloc' must be freed using 'omp_free'. 3081 1.19 mrg Calling 'omp_free' invokes undefined behavior if the memory was 3082 1.19 mrg already deallocated or when the used allocator has already been 3083 1.19 mrg destroyed. 3084 1.19 mrg 3085 1.19 mrg _C_: 3086 1.19 mrg _Prototype_: 'void* omp_realloc(void *ptr, size_t size,' 3087 1.19 mrg ' omp_allocator_handle_t allocator,' 3088 1.19 mrg ' omp_allocator_handle_t free_allocator)' 3089 1.1 mrg 3090 1.19 mrg _C++_: 3091 1.19 mrg _Prototype_: 'void* omp_realloc(void *ptr, size_t size,' 3092 1.19 mrg ' omp_allocator_handle_t allocator=omp_null_allocator,' 3093 1.19 mrg ' omp_allocator_handle_t 3094 1.19 mrg free_allocator=omp_null_allocator)' 3095 1.1 mrg 3096 1.1 mrg _Fortran_: 3097 1.19 mrg _Interface_: 'type(c_ptr) function omp_realloc(ptr, size, allocator, 3098 1.19 mrg free_allocator) bind(C)' 3099 1.19 mrg 'use, intrinsic :: iso_c_binding, only : c_ptr, 3100 1.19 mrg c_size_t' 3101 1.19 mrg 'type(C_ptr), value :: ptr' 3102 1.19 mrg 'integer (c_size_t), value :: size' 3103 1.19 mrg 'integer (omp_allocator_handle_kind), value :: 3104 1.19 mrg allocator, free_allocator' 3105 1.1 mrg 3106 1.1 mrg _See also_: 3107 1.19 mrg *note OMP_ALLOCATOR::, *note Memory allocation::, *note 3108 1.19 mrg omp_set_default_allocator::, *note omp_free::, *note 3109 1.19 mrg omp_init_allocator:: 3110 1.1 mrg 3111 1.1 mrg _Reference_: 3112 1.19 mrg OpenMP specification v5.0 (https://www.openmp.org), Section 3.7.9 3113 1.19 mrg 3114 1.19 mrg 3115 1.19 mrg File: libgomp.info, Node: Environment Display Routine, Prev: Memory Management Routines, Up: Runtime Library Routines 3116 1.19 mrg 3117 1.19 mrg 3.12 Environment Display Routine 3118 1.19 mrg ================================ 3119 1.19 mrg 3120 1.19 mrg Routine to display the OpenMP version number and the initial value of 3121 1.19 mrg ICVs. It has C linkage and does not throw exceptions. 3122 1.19 mrg 3123 1.19 mrg * Menu: 3124 1.19 mrg 3125 1.19 mrg * omp_display_env:: print the initial ICV values 3126 1.1 mrg 3127 1.1 mrg 3128 1.19 mrg File: libgomp.info, Node: omp_display_env, Up: Environment Display Routine 3129 1.16 mrg 3130 1.19 mrg 3.12.1 'omp_display_env' - print the initial ICV values 3131 1.19 mrg ------------------------------------------------------- 3132 1.16 mrg 3133 1.16 mrg _Description_: 3134 1.19 mrg Each time this routine is invoked, the OpenMP version number and 3135 1.19 mrg initial value of internal control variables (ICVs) is printed on 3136 1.19 mrg 'stderr'. The displayed values are those at startup after 3137 1.19 mrg evaluating the environment variables; later calls to API routines 3138 1.19 mrg or clauses used in enclosing constructs do not affect the output. 3139 1.19 mrg 3140 1.19 mrg If the VERBOSE argument is 'false', only the OpenMP version and 3141 1.19 mrg standard OpenMP ICVs are shown; if it is 'true', additionally, the 3142 1.19 mrg GCC-specific ICVs are shown. 3143 1.19 mrg 3144 1.19 mrg The output consists of multiple lines and starts with 'OPENMP 3145 1.19 mrg DISPLAY ENVIRONMENT BEGIN' followed by the name-value lines and 3146 1.19 mrg ends with 'OPENMP DISPLAY ENVIRONMENT END'. The NAME is followed 3147 1.19 mrg by an equal sign and the VALUE is enclosed in single quotes. 3148 1.19 mrg 3149 1.19 mrg The first line has as NAME either '_OPENMP' or 'openmp_version' and 3150 1.19 mrg shows as value the supported OpenMP version number (4-digit year, 3151 1.19 mrg 2-digit month) of the implementation, matching the value of the 3152 1.19 mrg '_OPENMP' macro and, in Fortran, the named constant 3153 1.19 mrg 'openmp_version'. 3154 1.19 mrg 3155 1.19 mrg In each of the succeeding lines, the NAME matches the 3156 1.19 mrg environment-variable name of an ICV and shows its value. Those 3157 1.19 mrg line are might be prefixed by pair of brackets and a space, where 3158 1.19 mrg the brackets enclose a comma-separated list of devices to which the 3159 1.19 mrg ICV-value combination applies to; the value can either be a numeric 3160 1.19 mrg device number or an abstract name denoting all devices ('all'), the 3161 1.19 mrg initial host device ('host') or all devices but the host 3162 1.19 mrg ('device'). Note that the same ICV might be printed multiple times 3163 1.19 mrg for multiple devices, even if all have the same value. 3164 1.16 mrg 3165 1.19 mrg The effect when invoked from within a 'target' region is 3166 1.19 mrg unspecified. 3167 1.16 mrg 3168 1.16 mrg _C/C++_: 3169 1.19 mrg _Prototype_: 'void omp_display_env(int verbose)' 3170 1.16 mrg 3171 1.16 mrg _Fortran_: 3172 1.19 mrg _Interface_: 'subroutine omp_display_env(vebose)' 3173 1.19 mrg 'logical, intent(in) :: verbose' 3174 1.19 mrg 3175 1.19 mrg _Example_: 3176 1.19 mrg Note that the GCC-specific ICVs, such as the shown 3177 1.19 mrg 'GOMP_SPINCOUNT', are only printed when VARBOSE set to 'true'. 3178 1.19 mrg 3179 1.19 mrg OPENMP DISPLAY ENVIRONMENT BEGIN 3180 1.19 mrg _OPENMP = '201511' 3181 1.19 mrg [host] OMP_DYNAMIC = 'FALSE' 3182 1.19 mrg [host] OMP_NESTED = 'FALSE' 3183 1.19 mrg [all] OMP_CANCELLATION = 'FALSE' 3184 1.19 mrg ... 3185 1.19 mrg [host] GOMP_SPINCOUNT = '300000' 3186 1.19 mrg OPENMP DISPLAY ENVIRONMENT END 3187 1.19 mrg 3188 1.19 mrg _See also_: 3189 1.19 mrg *note OMP_DISPLAY_ENV::, *note Environment Variables::, *note 3190 1.19 mrg Implementation-defined ICV Initialization:: 3191 1.16 mrg 3192 1.16 mrg _Reference_: 3193 1.19 mrg OpenMP specification v5.1 (https://www.openmp.org), Section 3.15 3194 1.16 mrg 3195 1.16 mrg 3196 1.8 mrg File: libgomp.info, Node: Environment Variables, Next: Enabling OpenACC, Prev: Runtime Library Routines, Up: Top 3197 1.1 mrg 3198 1.16 mrg 4 OpenMP Environment Variables 3199 1.12 mrg ****************************** 3200 1.1 mrg 3201 1.11 mrg The environment variables which beginning with 'OMP_' are defined by 3202 1.19 mrg section 4 of the OpenMP specification in version 4.5 or in a later 3203 1.19 mrg version of the specification, while those beginning with 'GOMP_' are GNU 3204 1.19 mrg extensions. Most 'OMP_' environment variables have an associated 3205 1.19 mrg internal control variable (ICV). 3206 1.19 mrg 3207 1.19 mrg For any OpenMP environment variable that sets an ICV and is neither 3208 1.19 mrg 'OMP_DEFAULT_DEVICE' nor has global ICV scope, associated 3209 1.19 mrg device-specific environment variables exist. For them, the environment 3210 1.19 mrg variable without suffix affects the host. The suffix '_DEV_' followed 3211 1.19 mrg by a non-negative device number less that the number of available 3212 1.19 mrg devices sets the ICV for the corresponding device. The suffix '_DEV' 3213 1.19 mrg sets the ICV of all non-host devices for which a device-specific 3214 1.19 mrg corresponding environment variable has not been set while the '_ALL' 3215 1.19 mrg suffix sets the ICV of all host and non-host devices for which a more 3216 1.19 mrg specific corresponding environment variable is not set. 3217 1.1 mrg 3218 1.1 mrg * Menu: 3219 1.1 mrg 3220 1.19 mrg * OMP_ALLOCATOR:: Set the default allocator 3221 1.19 mrg * OMP_AFFINITY_FORMAT:: Set the format string used for affinity display 3222 1.8 mrg * OMP_CANCELLATION:: Set whether cancellation is activated 3223 1.19 mrg * OMP_DISPLAY_AFFINITY:: Display thread affinity information 3224 1.8 mrg * OMP_DISPLAY_ENV:: Show OpenMP version and environment variables 3225 1.8 mrg * OMP_DEFAULT_DEVICE:: Set the device used in target regions 3226 1.8 mrg * OMP_DYNAMIC:: Dynamic adjustment of threads 3227 1.8 mrg * OMP_MAX_ACTIVE_LEVELS:: Set the maximum number of nested parallel regions 3228 1.8 mrg * OMP_MAX_TASK_PRIORITY:: Set the maximum task priority value 3229 1.8 mrg * OMP_NESTED:: Nested parallel regions 3230 1.16 mrg * OMP_NUM_TEAMS:: Specifies the number of teams to use by teams region 3231 1.8 mrg * OMP_NUM_THREADS:: Specifies the number of threads to use 3232 1.15 mrg * OMP_PROC_BIND:: Whether threads may be moved between CPUs 3233 1.15 mrg * OMP_PLACES:: Specifies on which CPUs the threads should be placed 3234 1.8 mrg * OMP_STACKSIZE:: Set default thread stack size 3235 1.8 mrg * OMP_SCHEDULE:: How threads are scheduled 3236 1.19 mrg * OMP_TARGET_OFFLOAD:: Controls offloading behavior 3237 1.16 mrg * OMP_TEAMS_THREAD_LIMIT:: Set the maximum number of threads imposed by teams 3238 1.8 mrg * OMP_THREAD_LIMIT:: Set the maximum number of threads 3239 1.8 mrg * OMP_WAIT_POLICY:: How waiting threads are handled 3240 1.8 mrg * GOMP_CPU_AFFINITY:: Bind threads to specific CPUs 3241 1.8 mrg * GOMP_DEBUG:: Enable debugging output 3242 1.8 mrg * GOMP_STACKSIZE:: Set default thread stack size 3243 1.8 mrg * GOMP_SPINCOUNT:: Set the busy-wait spin count 3244 1.8 mrg * GOMP_RTEMS_THREAD_POOLS:: Set the RTEMS specific thread pools 3245 1.1 mrg 3246 1.1 mrg 3247 1.19 mrg File: libgomp.info, Node: OMP_ALLOCATOR, Next: OMP_AFFINITY_FORMAT, Up: Environment Variables 3248 1.19 mrg 3249 1.19 mrg 4.1 'OMP_ALLOCATOR' - Set the default allocator 3250 1.19 mrg =============================================== 3251 1.19 mrg 3252 1.19 mrg _ICV:_ DEF-ALLOCATOR-VAR 3253 1.19 mrg _Scope:_ data environment 3254 1.19 mrg _Description_: 3255 1.19 mrg Sets the default allocator that is used when no allocator has been 3256 1.19 mrg specified in the 'allocate' or 'allocator' clause or if an OpenMP 3257 1.19 mrg memory routine is invoked with the 'omp_null_allocator' allocator. 3258 1.19 mrg If unset, 'omp_default_mem_alloc' is used. 3259 1.19 mrg 3260 1.19 mrg The value can either be a predefined allocator or a predefined 3261 1.19 mrg memory space or a predefined memory space followed by a colon and a 3262 1.19 mrg comma-separated list of memory trait and value pairs, separated by 3263 1.19 mrg '='. 3264 1.19 mrg 3265 1.19 mrg Note: The corresponding device environment variables are currently 3266 1.19 mrg not supported. Therefore, the non-host DEF-ALLOCATOR-VAR ICVs are 3267 1.19 mrg always initialized to 'omp_default_mem_alloc'. However, on all 3268 1.19 mrg devices, the 'omp_set_default_allocator' API routine can be used to 3269 1.19 mrg change value. 3270 1.19 mrg 3271 1.19 mrg Predefined allocators Associated predefined memory 3272 1.19 mrg spaces 3273 1.19 mrg ------------------------------------------------------------------ 3274 1.19 mrg omp_default_mem_alloc omp_default_mem_space 3275 1.19 mrg omp_large_cap_mem_alloc omp_large_cap_mem_space 3276 1.19 mrg omp_const_mem_alloc omp_const_mem_space 3277 1.19 mrg omp_high_bw_mem_alloc omp_high_bw_mem_space 3278 1.19 mrg omp_low_lat_mem_alloc omp_low_lat_mem_space 3279 1.19 mrg omp_cgroup_mem_alloc omp_low_lat_mem_space 3280 1.19 mrg (implementation defined) 3281 1.19 mrg omp_pteam_mem_alloc omp_low_lat_mem_space 3282 1.19 mrg (implementation defined) 3283 1.19 mrg omp_thread_mem_alloc omp_low_lat_mem_space 3284 1.19 mrg (implementation defined) 3285 1.19 mrg 3286 1.19 mrg The predefined allocators use the default values for the traits, as 3287 1.19 mrg listed below. Except that the last three allocators have the 3288 1.19 mrg 'access' trait set to 'cgroup', 'pteam', and 'thread', 3289 1.19 mrg respectively. 3290 1.19 mrg 3291 1.19 mrg Trait Allowed values Default value 3292 1.19 mrg -------------------------------------------------------------------- 3293 1.19 mrg 'sync_hint' 'contended', 'uncontended', 'contended' 3294 1.19 mrg 'serialized', 'private' 3295 1.19 mrg 'alignment' Positive integer being a 1 byte 3296 1.19 mrg power of two 3297 1.19 mrg 'access' 'all', 'cgroup', 'pteam', 'all' 3298 1.19 mrg 'thread' 3299 1.19 mrg 'pool_size' Positive integer See 3300 1.19 mrg *note Memory allocation:: 3301 1.19 mrg 'fallback' 'default_mem_fb', See below 3302 1.19 mrg 'null_fb', 'abort_fb', 3303 1.19 mrg 'allocator_fb' 3304 1.19 mrg 'fb_data' _unsupported as it needs an (none) 3305 1.19 mrg allocator handle_ 3306 1.19 mrg 'pinned' 'true', 'false' 'false' 3307 1.19 mrg 'partition' 'environment', 'nearest', 'environment' 3308 1.19 mrg 'blocked', 'interleaved' 3309 1.19 mrg 3310 1.19 mrg For the 'fallback' trait, the default value is 'null_fb' for the 3311 1.19 mrg 'omp_default_mem_alloc' allocator and any allocator that is 3312 1.19 mrg associated with device memory; for all other allocators, it is 3313 1.19 mrg 'default_mem_fb' by default. 3314 1.19 mrg 3315 1.19 mrg Examples: 3316 1.19 mrg OMP_ALLOCATOR=omp_high_bw_mem_alloc 3317 1.19 mrg OMP_ALLOCATOR=omp_large_cap_mem_space 3318 1.19 mrg OMP_ALLOCATOR=omp_low_lat_mem_space:pinned=true,partition=nearest 3319 1.19 mrg 3320 1.19 mrg _See also_: 3321 1.19 mrg *note Memory allocation::, *note omp_get_default_allocator::, *note 3322 1.19 mrg omp_set_default_allocator::, *note Offload-Target Specifics:: 3323 1.19 mrg 3324 1.19 mrg _Reference_: 3325 1.19 mrg OpenMP specification v5.0 (https://www.openmp.org), Section 6.21 3326 1.19 mrg 3327 1.19 mrg 3328 1.19 mrg File: libgomp.info, Node: OMP_AFFINITY_FORMAT, Next: OMP_CANCELLATION, Prev: OMP_ALLOCATOR, Up: Environment Variables 3329 1.19 mrg 3330 1.19 mrg 4.2 'OMP_AFFINITY_FORMAT' - Set the format string used for affinity display 3331 1.19 mrg =========================================================================== 3332 1.19 mrg 3333 1.19 mrg _ICV:_ AFFINITY-FORMAT-VAR 3334 1.19 mrg _Scope:_ device 3335 1.19 mrg _Description_: 3336 1.19 mrg Sets the format string used when displaying OpenMP thread affinity 3337 1.19 mrg information. Special values are output using '%' followed by an 3338 1.19 mrg optional size specification and then either the single-character 3339 1.19 mrg field type or its long name enclosed in curly braces; using '%%' 3340 1.19 mrg displays a literal percent. The size specification consists of an 3341 1.19 mrg optional '0.' or '.' followed by a positive integer, specifying the 3342 1.19 mrg minimal width of the output. With '0.' and numerical values, the 3343 1.19 mrg output is padded with zeros on the left; with '.', the output is 3344 1.19 mrg padded by spaces on the left; otherwise, the output is padded by 3345 1.19 mrg spaces on the right. If unset, the value is "'level %L thread %i 3346 1.19 mrg affinity %A'". 3347 1.19 mrg 3348 1.19 mrg Supported field types are: 3349 1.19 mrg 3350 1.19 mrg t team_num value returned by 'omp_get_team_num' 3351 1.19 mrg T num_teams value returned by 'omp_get_num_teams' 3352 1.19 mrg L nesting_level value returned by 'omp_get_level' 3353 1.19 mrg n thread_num value returned by 'omp_get_thread_num' 3354 1.19 mrg N num_threads value returned by 'omp_get_num_threads' 3355 1.19 mrg a ancestor_tnum value returned by 3356 1.19 mrg 'omp_get_ancestor_thread_num(omp_get_level()-1)' 3357 1.19 mrg H host name of the host that executes the thread 3358 1.19 mrg P process_id process identifier 3359 1.19 mrg i native_thread_id native thread identifier 3360 1.19 mrg A thread_affinity comma separated list of integer values or 3361 1.19 mrg ranges, representing the processors on 3362 1.19 mrg which a process might execute, subject to 3363 1.19 mrg affinity mechanisms 3364 1.19 mrg 3365 1.19 mrg For instance, after setting 3366 1.19 mrg 3367 1.19 mrg OMP_AFFINITY_FORMAT="%0.2a!%n!%.4L!%N;%.2t;%0.2T;%{team_num};%{num_teams};%A" 3368 1.19 mrg 3369 1.19 mrg with either 'OMP_DISPLAY_AFFINITY' being set or when calling 3370 1.19 mrg 'omp_display_affinity' with 'NULL' or an empty string, the program 3371 1.19 mrg might display the following: 3372 1.19 mrg 3373 1.19 mrg 00!0! 1!4; 0;01;0;1;0-11 3374 1.19 mrg 00!3! 1!4; 0;01;0;1;0-11 3375 1.19 mrg 00!2! 1!4; 0;01;0;1;0-11 3376 1.19 mrg 00!1! 1!4; 0;01;0;1;0-11 3377 1.19 mrg 3378 1.19 mrg _See also_: 3379 1.19 mrg *note OMP_DISPLAY_AFFINITY:: 3380 1.19 mrg 3381 1.19 mrg _Reference_: 3382 1.19 mrg OpenMP specification v5.0 (https://www.openmp.org), Section 6.14 3383 1.19 mrg 3384 1.19 mrg 3385 1.19 mrg File: libgomp.info, Node: OMP_CANCELLATION, Next: OMP_DISPLAY_AFFINITY, Prev: OMP_AFFINITY_FORMAT, Up: Environment Variables 3386 1.5 mrg 3387 1.19 mrg 4.3 'OMP_CANCELLATION' - Set whether cancellation is activated 3388 1.5 mrg ============================================================== 3389 1.5 mrg 3390 1.19 mrg _ICV:_ CANCEL-VAR 3391 1.19 mrg _Scope:_ global 3392 1.5 mrg _Description_: 3393 1.11 mrg If set to 'TRUE', the cancellation is activated. If set to 'FALSE' 3394 1.11 mrg or if unset, cancellation is disabled and the 'cancel' construct is 3395 1.11 mrg ignored. 3396 1.5 mrg 3397 1.5 mrg _See also_: 3398 1.5 mrg *note omp_get_cancellation:: 3399 1.1 mrg 3400 1.5 mrg _Reference_: 3401 1.12 mrg OpenMP specification v4.5 (https://www.openmp.org), Section 4.11 3402 1.5 mrg 3403 1.5 mrg 3404 1.19 mrg File: libgomp.info, Node: OMP_DISPLAY_AFFINITY, Next: OMP_DISPLAY_ENV, Prev: OMP_CANCELLATION, Up: Environment Variables 3405 1.19 mrg 3406 1.19 mrg 4.4 'OMP_DISPLAY_AFFINITY' - Display thread affinity information 3407 1.19 mrg ================================================================ 3408 1.19 mrg 3409 1.19 mrg _ICV:_ DISPLAY-AFFINITY-VAR 3410 1.19 mrg _Scope:_ global 3411 1.19 mrg _Description_: 3412 1.19 mrg If set to 'FALSE' or if unset, affinity displaying is disabled. If 3413 1.19 mrg set to 'TRUE', the runtime displays affinity information about 3414 1.19 mrg OpenMP threads in a parallel region upon entering the region and 3415 1.19 mrg every time any change occurs. 3416 1.19 mrg 3417 1.19 mrg _See also_: 3418 1.19 mrg *note OMP_AFFINITY_FORMAT:: 3419 1.19 mrg 3420 1.19 mrg _Reference_: 3421 1.19 mrg OpenMP specification v5.0 (https://www.openmp.org), Section 6.13 3422 1.19 mrg 3423 1.19 mrg 3424 1.19 mrg File: libgomp.info, Node: OMP_DISPLAY_ENV, Next: OMP_DEFAULT_DEVICE, Prev: OMP_DISPLAY_AFFINITY, Up: Environment Variables 3425 1.5 mrg 3426 1.19 mrg 4.5 'OMP_DISPLAY_ENV' - Show OpenMP version and environment variables 3427 1.5 mrg ===================================================================== 3428 1.5 mrg 3429 1.19 mrg _ICV:_ none 3430 1.19 mrg _Scope:_ not applicable 3431 1.5 mrg _Description_: 3432 1.19 mrg If set to 'TRUE', the runtime displays the same information to 3433 1.19 mrg 'stderr' as shown by the 'omp_display_env' routine invoked with 3434 1.19 mrg VERBOSE argument set to 'false'. If set to 'VERBOSE', the same 3435 1.19 mrg information is shown as invoking the routine with VERBOSE set to 3436 1.19 mrg 'true'. If unset or set to 'FALSE', this information is not shown. 3437 1.19 mrg The result for any other value is unspecified. 3438 1.19 mrg 3439 1.19 mrg _See also_: 3440 1.19 mrg *note omp_display_env:: 3441 1.5 mrg 3442 1.5 mrg _Reference_: 3443 1.12 mrg OpenMP specification v4.5 (https://www.openmp.org), Section 4.12 3444 1.5 mrg 3445 1.5 mrg 3446 1.5 mrg File: libgomp.info, Node: OMP_DEFAULT_DEVICE, Next: OMP_DYNAMIC, Prev: OMP_DISPLAY_ENV, Up: Environment Variables 3447 1.5 mrg 3448 1.19 mrg 4.6 'OMP_DEFAULT_DEVICE' - Set the device used in target regions 3449 1.5 mrg ================================================================ 3450 1.5 mrg 3451 1.19 mrg _ICV:_ DEFAULT-DEVICE-VAR 3452 1.19 mrg _Scope:_ data environment 3453 1.5 mrg _Description_: 3454 1.11 mrg Set to choose the device which is used in a 'target' region, unless 3455 1.11 mrg the value is overridden by 'omp_set_default_device' or by a 3456 1.11 mrg 'device' clause. The value shall be the nonnegative device number. 3457 1.11 mrg If no device with the given device number exists, the code is 3458 1.19 mrg executed on the host. If unset, 'OMP_TARGET_OFFLOAD' is 3459 1.19 mrg 'mandatory' and no non-host devices are available, it is set to 3460 1.19 mrg 'omp_invalid_device'. Otherwise, if unset, device number 0 is 3461 1.19 mrg used. 3462 1.5 mrg 3463 1.5 mrg _See also_: 3464 1.5 mrg *note omp_get_default_device::, *note omp_set_default_device::, 3465 1.19 mrg *note OMP_TARGET_OFFLOAD:: 3466 1.5 mrg 3467 1.5 mrg _Reference_: 3468 1.19 mrg OpenMP specification v5.2 (https://www.openmp.org), Section 21.2.7 3469 1.5 mrg 3470 1.5 mrg 3471 1.5 mrg File: libgomp.info, Node: OMP_DYNAMIC, Next: OMP_MAX_ACTIVE_LEVELS, Prev: OMP_DEFAULT_DEVICE, Up: Environment Variables 3472 1.5 mrg 3473 1.19 mrg 4.7 'OMP_DYNAMIC' - Dynamic adjustment of threads 3474 1.1 mrg ================================================= 3475 1.1 mrg 3476 1.19 mrg _ICV:_ DYN-VAR 3477 1.19 mrg _Scope:_ global 3478 1.1 mrg _Description_: 3479 1.1 mrg Enable or disable the dynamic adjustment of the number of threads 3480 1.5 mrg within a team. The value of this environment variable shall be 3481 1.11 mrg 'TRUE' or 'FALSE'. If undefined, dynamic adjustment is disabled by 3482 1.11 mrg default. 3483 1.1 mrg 3484 1.1 mrg _See also_: 3485 1.1 mrg *note omp_set_dynamic:: 3486 1.1 mrg 3487 1.1 mrg _Reference_: 3488 1.12 mrg OpenMP specification v4.5 (https://www.openmp.org), Section 4.3 3489 1.1 mrg 3490 1.1 mrg 3491 1.8 mrg File: libgomp.info, Node: OMP_MAX_ACTIVE_LEVELS, Next: OMP_MAX_TASK_PRIORITY, Prev: OMP_DYNAMIC, Up: Environment Variables 3492 1.1 mrg 3493 1.19 mrg 4.8 'OMP_MAX_ACTIVE_LEVELS' - Set the maximum number of nested parallel regions 3494 1.1 mrg =============================================================================== 3495 1.1 mrg 3496 1.19 mrg _ICV:_ MAX-ACTIVE-LEVELS-VAR 3497 1.19 mrg _Scope:_ data environment 3498 1.1 mrg _Description_: 3499 1.3 skrll Specifies the initial value for the maximum number of nested 3500 1.5 mrg parallel regions. The value of this variable shall be a positive 3501 1.16 mrg integer. If undefined, then if 'OMP_NESTED' is defined and set to 3502 1.16 mrg true, or if 'OMP_NUM_THREADS' or 'OMP_PROC_BIND' are defined and 3503 1.16 mrg set to a list with more than one item, the maximum number of nested 3504 1.19 mrg parallel regions is initialized to the largest number supported, 3505 1.19 mrg otherwise it is set to one. 3506 1.1 mrg 3507 1.1 mrg _See also_: 3508 1.19 mrg *note omp_set_max_active_levels::, *note OMP_NESTED::, *note 3509 1.19 mrg OMP_PROC_BIND::, *note OMP_NUM_THREADS:: 3510 1.1 mrg 3511 1.1 mrg _Reference_: 3512 1.12 mrg OpenMP specification v4.5 (https://www.openmp.org), Section 4.9 3513 1.1 mrg 3514 1.1 mrg 3515 1.8 mrg File: libgomp.info, Node: OMP_MAX_TASK_PRIORITY, Next: OMP_NESTED, Prev: OMP_MAX_ACTIVE_LEVELS, Up: Environment Variables 3516 1.8 mrg 3517 1.19 mrg 4.9 'OMP_MAX_TASK_PRIORITY' - Set the maximum priority 3518 1.8 mrg ====================================================== 3519 1.8 mrg 3520 1.11 mrg number that can be set for a task. 3521 1.19 mrg _ICV:_ MAX-TASK-PRIORITY-VAR 3522 1.19 mrg _Scope:_ global 3523 1.8 mrg _Description_: 3524 1.11 mrg Specifies the initial value for the maximum priority value that can 3525 1.11 mrg be set for a task. The value of this variable shall be a 3526 1.8 mrg non-negative integer, and zero is allowed. If undefined, the 3527 1.8 mrg default priority is 0. 3528 1.8 mrg 3529 1.8 mrg _See also_: 3530 1.8 mrg *note omp_get_max_task_priority:: 3531 1.1 mrg 3532 1.8 mrg _Reference_: 3533 1.12 mrg OpenMP specification v4.5 (https://www.openmp.org), Section 4.14 3534 1.8 mrg 3535 1.8 mrg 3536 1.16 mrg File: libgomp.info, Node: OMP_NESTED, Next: OMP_NUM_TEAMS, Prev: OMP_MAX_TASK_PRIORITY, Up: Environment Variables 3537 1.8 mrg 3538 1.19 mrg 4.10 'OMP_NESTED' - Nested parallel regions 3539 1.19 mrg =========================================== 3540 1.1 mrg 3541 1.19 mrg _ICV:_ MAX-ACTIVE-LEVELS-VAR 3542 1.19 mrg _Scope:_ data environment 3543 1.1 mrg _Description_: 3544 1.1 mrg Enable or disable nested parallel regions, i.e., whether team 3545 1.5 mrg members are allowed to create new teams. The value of this 3546 1.16 mrg environment variable shall be 'TRUE' or 'FALSE'. If set to 'TRUE', 3547 1.19 mrg the number of maximum active nested regions supported is by default 3548 1.19 mrg set to the maximum supported, otherwise it is set to one. If 3549 1.19 mrg 'OMP_MAX_ACTIVE_LEVELS' is defined, its setting overrides this 3550 1.19 mrg setting. If both are undefined, nested parallel regions are 3551 1.19 mrg enabled if 'OMP_NUM_THREADS' or 'OMP_PROC_BINDS' are defined to a 3552 1.19 mrg list with more than one item, otherwise they are disabled by 3553 1.19 mrg default. 3554 1.19 mrg 3555 1.19 mrg Note that the 'OMP_NESTED' environment variable was deprecated in 3556 1.19 mrg the OpenMP specification 5.2 in favor of 'OMP_MAX_ACTIVE_LEVELS'. 3557 1.1 mrg 3558 1.1 mrg _See also_: 3559 1.19 mrg *note omp_set_max_active_levels::, *note omp_set_nested::, *note 3560 1.19 mrg OMP_MAX_ACTIVE_LEVELS:: 3561 1.1 mrg 3562 1.1 mrg _Reference_: 3563 1.12 mrg OpenMP specification v4.5 (https://www.openmp.org), Section 4.6 3564 1.1 mrg 3565 1.1 mrg 3566 1.16 mrg File: libgomp.info, Node: OMP_NUM_TEAMS, Next: OMP_NUM_THREADS, Prev: OMP_NESTED, Up: Environment Variables 3567 1.16 mrg 3568 1.19 mrg 4.11 'OMP_NUM_TEAMS' - Specifies the number of teams to use by teams region 3569 1.19 mrg =========================================================================== 3570 1.16 mrg 3571 1.19 mrg _ICV:_ NTEAMS-VAR 3572 1.19 mrg _Scope:_ device 3573 1.16 mrg _Description_: 3574 1.16 mrg Specifies the upper bound for number of teams to use in teams 3575 1.16 mrg regions without explicit 'num_teams' clause. The value of this 3576 1.16 mrg variable shall be a positive integer. If undefined it defaults to 3577 1.16 mrg 0 which means implementation defined upper bound. 3578 1.16 mrg 3579 1.16 mrg _See also_: 3580 1.16 mrg *note omp_set_num_teams:: 3581 1.16 mrg 3582 1.16 mrg _Reference_: 3583 1.16 mrg OpenMP specification v5.1 (https://www.openmp.org), Section 6.23 3584 1.16 mrg 3585 1.16 mrg 3586 1.16 mrg File: libgomp.info, Node: OMP_NUM_THREADS, Next: OMP_PROC_BIND, Prev: OMP_NUM_TEAMS, Up: Environment Variables 3587 1.1 mrg 3588 1.19 mrg 4.12 'OMP_NUM_THREADS' - Specifies the number of threads to use 3589 1.19 mrg =============================================================== 3590 1.1 mrg 3591 1.19 mrg _ICV:_ NTHREADS-VAR 3592 1.19 mrg _Scope:_ data environment 3593 1.1 mrg _Description_: 3594 1.11 mrg Specifies the default number of threads to use in parallel regions. 3595 1.11 mrg The value of this variable shall be a comma-separated list of 3596 1.16 mrg positive integers; the value specifies the number of threads to use 3597 1.16 mrg for the corresponding nested level. Specifying more than one item 3598 1.19 mrg in the list automatically enables nesting by default. If undefined 3599 1.19 mrg one thread per CPU is used. 3600 1.19 mrg 3601 1.19 mrg When a list with more than value is specified, it also affects the 3602 1.19 mrg MAX-ACTIVE-LEVELS-VAR ICV as described in *note 3603 1.19 mrg OMP_MAX_ACTIVE_LEVELS::. 3604 1.1 mrg 3605 1.1 mrg _See also_: 3606 1.19 mrg *note omp_set_num_threads::, *note OMP_MAX_ACTIVE_LEVELS:: 3607 1.1 mrg 3608 1.1 mrg _Reference_: 3609 1.12 mrg OpenMP specification v4.5 (https://www.openmp.org), Section 4.2 3610 1.1 mrg 3611 1.1 mrg 3612 1.5 mrg File: libgomp.info, Node: OMP_PROC_BIND, Next: OMP_PLACES, Prev: OMP_NUM_THREADS, Up: Environment Variables 3613 1.5 mrg 3614 1.19 mrg 4.13 'OMP_PROC_BIND' - Whether threads may be moved between CPUs 3615 1.16 mrg ================================================================ 3616 1.5 mrg 3617 1.19 mrg _ICV:_ BIND-VAR 3618 1.19 mrg _Scope:_ data environment 3619 1.5 mrg _Description_: 3620 1.5 mrg Specifies whether threads may be moved between processors. If set 3621 1.15 mrg to 'TRUE', OpenMP threads should not be moved; if set to 'FALSE' 3622 1.5 mrg they may be moved. Alternatively, a comma separated list with the 3623 1.16 mrg values 'PRIMARY', 'MASTER', 'CLOSE' and 'SPREAD' can be used to 3624 1.16 mrg specify the thread affinity policy for the corresponding nesting 3625 1.16 mrg level. With 'PRIMARY' and 'MASTER' the worker threads are in the 3626 1.16 mrg same place partition as the primary thread. With 'CLOSE' those are 3627 1.16 mrg kept close to the primary thread in contiguous place partitions. 3628 1.16 mrg And with 'SPREAD' a sparse distribution across the place partitions 3629 1.19 mrg is used. Specifying more than one item in the list automatically 3630 1.19 mrg enables nesting by default. 3631 1.19 mrg 3632 1.19 mrg When a list is specified, it also affects the MAX-ACTIVE-LEVELS-VAR 3633 1.19 mrg ICV as described in *note OMP_MAX_ACTIVE_LEVELS::. 3634 1.5 mrg 3635 1.11 mrg When undefined, 'OMP_PROC_BIND' defaults to 'TRUE' when 3636 1.11 mrg 'OMP_PLACES' or 'GOMP_CPU_AFFINITY' is set and 'FALSE' otherwise. 3637 1.5 mrg 3638 1.5 mrg _See also_: 3639 1.16 mrg *note omp_get_proc_bind::, *note GOMP_CPU_AFFINITY::, *note 3640 1.19 mrg OMP_PLACES::, *note OMP_MAX_ACTIVE_LEVELS:: 3641 1.5 mrg 3642 1.5 mrg _Reference_: 3643 1.12 mrg OpenMP specification v4.5 (https://www.openmp.org), Section 4.4 3644 1.5 mrg 3645 1.5 mrg 3646 1.5 mrg File: libgomp.info, Node: OMP_PLACES, Next: OMP_STACKSIZE, Prev: OMP_PROC_BIND, Up: Environment Variables 3647 1.1 mrg 3648 1.19 mrg 4.14 'OMP_PLACES' - Specifies on which CPUs the threads should be placed 3649 1.15 mrg ======================================================================== 3650 1.1 mrg 3651 1.19 mrg _ICV:_ PLACE-PARTITION-VAR 3652 1.19 mrg _Scope:_ implicit tasks 3653 1.1 mrg _Description_: 3654 1.11 mrg The thread placement can be either specified using an abstract name 3655 1.11 mrg or by an explicit list of the places. The abstract names 3656 1.16 mrg 'threads', 'cores', 'sockets', 'll_caches' and 'numa_domains' can 3657 1.16 mrg be optionally followed by a positive number in parentheses, which 3658 1.16 mrg denotes the how many places shall be created. With 'threads' each 3659 1.16 mrg place corresponds to a single hardware thread; 'cores' to a single 3660 1.16 mrg core with the corresponding number of hardware threads; with 3661 1.16 mrg 'sockets' the place corresponds to a single socket; with 3662 1.16 mrg 'll_caches' to a set of cores that shares the last level cache on 3663 1.16 mrg the device; and 'numa_domains' to a set of cores for which their 3664 1.16 mrg closest memory on the device is the same memory and at a similar 3665 1.16 mrg distance from the cores. The resulting placement can be shown by 3666 1.16 mrg setting the 'OMP_DISPLAY_ENV' environment variable. 3667 1.5 mrg 3668 1.5 mrg Alternatively, the placement can be specified explicitly as 3669 1.5 mrg comma-separated list of places. A place is specified by set of 3670 1.16 mrg nonnegative numbers in curly braces, denoting the hardware threads. 3671 1.16 mrg The curly braces can be omitted when only a single number has been 3672 1.16 mrg specified. The hardware threads belonging to a place can either be 3673 1.16 mrg specified as comma-separated list of nonnegative thread numbers or 3674 1.16 mrg using an interval. Multiple places can also be either specified by 3675 1.16 mrg a comma-separated list of places or by an interval. To specify an 3676 1.16 mrg interval, a colon followed by the count is placed after the 3677 1.16 mrg hardware thread number or the place. Optionally, the length can be 3678 1.16 mrg followed by a colon and the stride number - otherwise a unit stride 3679 1.16 mrg is assumed. Placing an exclamation mark ('!') directly before a 3680 1.16 mrg curly brace or numbers inside the curly braces (excluding 3681 1.19 mrg intervals) excludes those hardware threads. 3682 1.16 mrg 3683 1.16 mrg For instance, the following specifies the same places list: 3684 1.16 mrg '"{0,1,2}, {3,4,6}, {7,8,9}, {10,11,12}"'; '"{0:3}, {3:3}, {7:3}, 3685 1.16 mrg {10:3}"'; and '"{0:2}:4:3"'. 3686 1.5 mrg 3687 1.11 mrg If 'OMP_PLACES' and 'GOMP_CPU_AFFINITY' are unset and 3688 1.11 mrg 'OMP_PROC_BIND' is either unset or 'false', threads may be moved 3689 1.5 mrg between CPUs following no placement policy. 3690 1.1 mrg 3691 1.1 mrg _See also_: 3692 1.5 mrg *note OMP_PROC_BIND::, *note GOMP_CPU_AFFINITY::, *note 3693 1.5 mrg omp_get_proc_bind::, *note OMP_DISPLAY_ENV:: 3694 1.1 mrg 3695 1.1 mrg _Reference_: 3696 1.12 mrg OpenMP specification v4.5 (https://www.openmp.org), Section 4.5 3697 1.1 mrg 3698 1.1 mrg 3699 1.5 mrg File: libgomp.info, Node: OMP_STACKSIZE, Next: OMP_SCHEDULE, Prev: OMP_PLACES, Up: Environment Variables 3700 1.1 mrg 3701 1.19 mrg 4.15 'OMP_STACKSIZE' - Set default thread stack size 3702 1.5 mrg ==================================================== 3703 1.1 mrg 3704 1.19 mrg _ICV:_ STACKSIZE-VAR 3705 1.19 mrg _Scope:_ device 3706 1.1 mrg _Description_: 3707 1.1 mrg Set the default thread stack size in kilobytes, unless the number 3708 1.11 mrg is suffixed by 'B', 'K', 'M' or 'G', in which case the size is, 3709 1.11 mrg respectively, in bytes, kilobytes, megabytes or gigabytes. This is 3710 1.11 mrg different from 'pthread_attr_setstacksize' which gets the number of 3711 1.11 mrg bytes as an argument. If the stack size cannot be set due to 3712 1.11 mrg system constraints, an error is reported and the initial stack size 3713 1.11 mrg is left unchanged. If undefined, the stack size is system 3714 1.11 mrg dependent. 3715 1.1 mrg 3716 1.19 mrg _See also_: 3717 1.19 mrg *note GOMP_STACKSIZE:: 3718 1.19 mrg 3719 1.1 mrg _Reference_: 3720 1.12 mrg OpenMP specification v4.5 (https://www.openmp.org), Section 4.7 3721 1.1 mrg 3722 1.1 mrg 3723 1.16 mrg File: libgomp.info, Node: OMP_SCHEDULE, Next: OMP_TARGET_OFFLOAD, Prev: OMP_STACKSIZE, Up: Environment Variables 3724 1.1 mrg 3725 1.19 mrg 4.16 'OMP_SCHEDULE' - How threads are scheduled 3726 1.5 mrg =============================================== 3727 1.1 mrg 3728 1.19 mrg _ICV:_ RUN-SCHED-VAR 3729 1.19 mrg _Scope:_ data environment 3730 1.1 mrg _Description_: 3731 1.11 mrg Allows to specify 'schedule type' and 'chunk size'. The value of 3732 1.11 mrg the variable shall have the form: 'type[,chunk]' where 'type' is 3733 1.11 mrg one of 'static', 'dynamic', 'guided' or 'auto' The optional 'chunk' 3734 1.11 mrg size shall be a positive integer. If undefined, dynamic scheduling 3735 1.11 mrg and a chunk size of 1 is used. 3736 1.1 mrg 3737 1.1 mrg _See also_: 3738 1.5 mrg *note omp_set_schedule:: 3739 1.1 mrg 3740 1.1 mrg _Reference_: 3741 1.12 mrg OpenMP specification v4.5 (https://www.openmp.org), Sections 3742 1.8 mrg 2.7.1.1 and 4.1 3743 1.1 mrg 3744 1.1 mrg 3745 1.16 mrg File: libgomp.info, Node: OMP_TARGET_OFFLOAD, Next: OMP_TEAMS_THREAD_LIMIT, Prev: OMP_SCHEDULE, Up: Environment Variables 3746 1.16 mrg 3747 1.19 mrg 4.17 'OMP_TARGET_OFFLOAD' - Controls offloading behavior 3748 1.19 mrg ======================================================== 3749 1.16 mrg 3750 1.19 mrg _ICV:_ TARGET-OFFLOAD-VAR 3751 1.19 mrg _Scope:_ global 3752 1.16 mrg _Description_: 3753 1.19 mrg Specifies the behavior with regard to offloading code to a device. 3754 1.16 mrg This variable can be set to one of three values - 'MANDATORY', 3755 1.16 mrg 'DISABLED' or 'DEFAULT'. 3756 1.16 mrg 3757 1.19 mrg If set to 'MANDATORY', the program terminates with an error if any 3758 1.19 mrg device construct or device memory routine uses a device that is 3759 1.19 mrg unavailable or not supported by the implementation, or uses a 3760 1.19 mrg non-conforming device number. If set to 'DISABLED', then 3761 1.19 mrg offloading is disabled and all code runs on the host. If set to 3762 1.19 mrg 'DEFAULT', the program tries offloading to the device first, then 3763 1.19 mrg falls back to running code on the host if it cannot. 3764 1.19 mrg 3765 1.19 mrg If undefined, then the program behaves as if 'DEFAULT' was set. 3766 1.16 mrg 3767 1.19 mrg Note: Even with 'MANDATORY', no run-time termination is performed 3768 1.19 mrg when the device number in a 'device' clause or argument to a device 3769 1.19 mrg memory routine is for host, which includes using the device number 3770 1.19 mrg in the DEFAULT-DEVICE-VAR ICV. However, the initial value of the 3771 1.19 mrg DEFAULT-DEVICE-VAR ICV is affected by 'MANDATORY'. 3772 1.19 mrg 3773 1.19 mrg _See also_: 3774 1.19 mrg *note OMP_DEFAULT_DEVICE:: 3775 1.16 mrg 3776 1.16 mrg _Reference_: 3777 1.19 mrg OpenMP specification v5.2 (https://www.openmp.org), Section 21.2.8 3778 1.16 mrg 3779 1.16 mrg 3780 1.16 mrg File: libgomp.info, Node: OMP_TEAMS_THREAD_LIMIT, Next: OMP_THREAD_LIMIT, Prev: OMP_TARGET_OFFLOAD, Up: Environment Variables 3781 1.16 mrg 3782 1.19 mrg 4.18 'OMP_TEAMS_THREAD_LIMIT' - Set the maximum number of threads imposed by teams 3783 1.16 mrg ================================================================================== 3784 1.16 mrg 3785 1.19 mrg _ICV:_ TEAMS-THREAD-LIMIT-VAR 3786 1.19 mrg _Scope:_ device 3787 1.16 mrg _Description_: 3788 1.16 mrg Specifies an upper bound for the number of threads to use by each 3789 1.16 mrg contention group created by a teams construct without explicit 3790 1.16 mrg 'thread_limit' clause. The value of this variable shall be a 3791 1.16 mrg positive integer. If undefined, the value of 0 is used which 3792 1.16 mrg stands for an implementation defined upper limit. 3793 1.16 mrg 3794 1.16 mrg _See also_: 3795 1.16 mrg *note OMP_THREAD_LIMIT::, *note omp_set_teams_thread_limit:: 3796 1.16 mrg 3797 1.16 mrg _Reference_: 3798 1.16 mrg OpenMP specification v5.1 (https://www.openmp.org), Section 6.24 3799 1.16 mrg 3800 1.16 mrg 3801 1.16 mrg File: libgomp.info, Node: OMP_THREAD_LIMIT, Next: OMP_WAIT_POLICY, Prev: OMP_TEAMS_THREAD_LIMIT, Up: Environment Variables 3802 1.1 mrg 3803 1.19 mrg 4.19 'OMP_THREAD_LIMIT' - Set the maximum number of threads 3804 1.5 mrg =========================================================== 3805 1.1 mrg 3806 1.19 mrg _ICV:_ THREAD-LIMIT-VAR 3807 1.19 mrg _Scope:_ data environment 3808 1.1 mrg _Description_: 3809 1.5 mrg Specifies the number of threads to use for the whole program. The 3810 1.5 mrg value of this variable shall be a positive integer. If undefined, 3811 1.5 mrg the number of threads is not limited. 3812 1.5 mrg 3813 1.5 mrg _See also_: 3814 1.5 mrg *note OMP_NUM_THREADS::, *note omp_get_thread_limit:: 3815 1.1 mrg 3816 1.1 mrg _Reference_: 3817 1.12 mrg OpenMP specification v4.5 (https://www.openmp.org), Section 4.10 3818 1.3 skrll 3819 1.3 skrll 3820 1.5 mrg File: libgomp.info, Node: OMP_WAIT_POLICY, Next: GOMP_CPU_AFFINITY, Prev: OMP_THREAD_LIMIT, Up: Environment Variables 3821 1.3 skrll 3822 1.19 mrg 4.20 'OMP_WAIT_POLICY' - How waiting threads are handled 3823 1.5 mrg ======================================================== 3824 1.3 skrll 3825 1.3 skrll _Description_: 3826 1.5 mrg Specifies whether waiting threads should be active or passive. If 3827 1.11 mrg the value is 'PASSIVE', waiting threads should not consume CPU 3828 1.11 mrg power while waiting; while the value is 'ACTIVE' specifies that 3829 1.5 mrg they should. If undefined, threads wait actively for a short time 3830 1.5 mrg before waiting passively. 3831 1.3 skrll 3832 1.3 skrll _See also_: 3833 1.5 mrg *note GOMP_SPINCOUNT:: 3834 1.3 skrll 3835 1.3 skrll _Reference_: 3836 1.12 mrg OpenMP specification v4.5 (https://www.openmp.org), Section 4.8 3837 1.1 mrg 3838 1.1 mrg 3839 1.5 mrg File: libgomp.info, Node: GOMP_CPU_AFFINITY, Next: GOMP_DEBUG, Prev: OMP_WAIT_POLICY, Up: Environment Variables 3840 1.1 mrg 3841 1.19 mrg 4.21 'GOMP_CPU_AFFINITY' - Bind threads to specific CPUs 3842 1.3 skrll ======================================================== 3843 1.1 mrg 3844 1.1 mrg _Description_: 3845 1.5 mrg Binds threads to specific CPUs. The variable should contain a 3846 1.5 mrg space-separated or comma-separated list of CPUs. This list may 3847 1.3 skrll contain different kinds of entries: either single CPU numbers in 3848 1.3 skrll any order, a range of CPUs (M-N) or a range with some stride 3849 1.11 mrg (M-N:S). CPU numbers are zero based. For example, 3850 1.19 mrg 'GOMP_CPU_AFFINITY="0 3 1-2 4-15:2"' binds the initial thread to 3851 1.19 mrg CPU 0, the second to CPU 3, the third to CPU 1, the fourth to CPU 3852 1.19 mrg 2, the fifth to CPU 4, the sixth through tenth to CPUs 6, 8, 10, 3853 1.19 mrg 12, and 14 respectively and then starts assigning back from the 3854 1.11 mrg beginning of the list. 'GOMP_CPU_AFFINITY=0' binds all threads to 3855 1.3 skrll CPU 0. 3856 1.1 mrg 3857 1.5 mrg There is no libgomp library routine to determine whether a CPU 3858 1.5 mrg affinity specification is in effect. As a workaround, 3859 1.11 mrg language-specific library functions, e.g., 'getenv' in C or 3860 1.11 mrg 'GET_ENVIRONMENT_VARIABLE' in Fortran, may be used to query the 3861 1.11 mrg setting of the 'GOMP_CPU_AFFINITY' environment variable. A defined 3862 1.11 mrg CPU affinity on startup cannot be changed or disabled during the 3863 1.11 mrg runtime of the application. 3864 1.11 mrg 3865 1.11 mrg If both 'GOMP_CPU_AFFINITY' and 'OMP_PROC_BIND' are set, 3866 1.11 mrg 'OMP_PROC_BIND' has a higher precedence. If neither has been set 3867 1.11 mrg and 'OMP_PROC_BIND' is unset, or when 'OMP_PROC_BIND' is set to 3868 1.19 mrg 'FALSE', the host system handles the assignment of threads to CPUs. 3869 1.1 mrg 3870 1.3 skrll _See also_: 3871 1.5 mrg *note OMP_PLACES::, *note OMP_PROC_BIND:: 3872 1.5 mrg 3873 1.5 mrg 3874 1.5 mrg File: libgomp.info, Node: GOMP_DEBUG, Next: GOMP_STACKSIZE, Prev: GOMP_CPU_AFFINITY, Up: Environment Variables 3875 1.5 mrg 3876 1.19 mrg 4.22 'GOMP_DEBUG' - Enable debugging output 3877 1.5 mrg =========================================== 3878 1.5 mrg 3879 1.5 mrg _Description_: 3880 1.11 mrg Enable debugging output. The variable should be set to '0' 3881 1.11 mrg (disabled, also the default if not set), or '1' (enabled). 3882 1.5 mrg 3883 1.19 mrg If enabled, some debugging output is printed during execution. 3884 1.5 mrg This is currently not specified in more detail, and subject to 3885 1.5 mrg change. 3886 1.3 skrll 3887 1.1 mrg 3888 1.5 mrg File: libgomp.info, Node: GOMP_STACKSIZE, Next: GOMP_SPINCOUNT, Prev: GOMP_DEBUG, Up: Environment Variables 3889 1.1 mrg 3890 1.19 mrg 4.23 'GOMP_STACKSIZE' - Set default thread stack size 3891 1.1 mrg ===================================================== 3892 1.1 mrg 3893 1.1 mrg _Description_: 3894 1.5 mrg Set the default thread stack size in kilobytes. This is different 3895 1.11 mrg from 'pthread_attr_setstacksize' which gets the number of bytes as 3896 1.5 mrg an argument. If the stack size cannot be set due to system 3897 1.3 skrll constraints, an error is reported and the initial stack size is 3898 1.5 mrg left unchanged. If undefined, the stack size is system dependent. 3899 1.1 mrg 3900 1.1 mrg _See also_: 3901 1.3 skrll *note OMP_STACKSIZE:: 3902 1.1 mrg 3903 1.1 mrg _Reference_: 3904 1.1 mrg GCC Patches Mailinglist 3905 1.13 mrg (https://gcc.gnu.org/ml/gcc-patches/2006-06/msg00493.html), GCC 3906 1.1 mrg Patches Mailinglist 3907 1.13 mrg (https://gcc.gnu.org/ml/gcc-patches/2006-06/msg00496.html) 3908 1.1 mrg 3909 1.1 mrg 3910 1.8 mrg File: libgomp.info, Node: GOMP_SPINCOUNT, Next: GOMP_RTEMS_THREAD_POOLS, Prev: GOMP_STACKSIZE, Up: Environment Variables 3911 1.5 mrg 3912 1.19 mrg 4.24 'GOMP_SPINCOUNT' - Set the busy-wait spin count 3913 1.5 mrg ==================================================== 3914 1.5 mrg 3915 1.5 mrg _Description_: 3916 1.5 mrg Determines how long a threads waits actively with consuming CPU 3917 1.5 mrg power before waiting passively without consuming CPU power. The 3918 1.11 mrg value may be either 'INFINITE', 'INFINITY' to always wait actively 3919 1.5 mrg or an integer which gives the number of spins of the busy-wait 3920 1.5 mrg loop. The integer may optionally be followed by the following 3921 1.11 mrg suffixes acting as multiplication factors: 'k' (kilo, thousand), 3922 1.11 mrg 'M' (mega, million), 'G' (giga, billion), or 'T' (tera, trillion). 3923 1.11 mrg If undefined, 0 is used when 'OMP_WAIT_POLICY' is 'PASSIVE', 3924 1.11 mrg 300,000 is used when 'OMP_WAIT_POLICY' is undefined and 30 billion 3925 1.11 mrg is used when 'OMP_WAIT_POLICY' is 'ACTIVE'. If there are more 3926 1.11 mrg OpenMP threads than available CPUs, 1000 and 100 spins are used for 3927 1.11 mrg 'OMP_WAIT_POLICY' being 'ACTIVE' or undefined, respectively; unless 3928 1.11 mrg the 'GOMP_SPINCOUNT' is lower or 'OMP_WAIT_POLICY' is 'PASSIVE'. 3929 1.5 mrg 3930 1.5 mrg _See also_: 3931 1.5 mrg *note OMP_WAIT_POLICY:: 3932 1.5 mrg 3933 1.5 mrg 3934 1.8 mrg File: libgomp.info, Node: GOMP_RTEMS_THREAD_POOLS, Prev: GOMP_SPINCOUNT, Up: Environment Variables 3935 1.8 mrg 3936 1.19 mrg 4.25 'GOMP_RTEMS_THREAD_POOLS' - Set the RTEMS specific thread pools 3937 1.8 mrg ==================================================================== 3938 1.8 mrg 3939 1.8 mrg _Description_: 3940 1.8 mrg This environment variable is only used on the RTEMS real-time 3941 1.8 mrg operating system. It determines the scheduler instance specific 3942 1.11 mrg thread pools. The format for 'GOMP_RTEMS_THREAD_POOLS' is a list 3943 1.11 mrg of optional '<thread-pool-count>[$<priority>]@<scheduler-name>' 3944 1.11 mrg configurations separated by ':' where: 3945 1.11 mrg * '<thread-pool-count>' is the thread pool count for this 3946 1.8 mrg scheduler instance. 3947 1.11 mrg * '$<priority>' is an optional priority for the worker threads 3948 1.11 mrg of a thread pool according to 'pthread_setschedparam'. In 3949 1.19 mrg case a priority value is omitted, then a worker thread 3950 1.19 mrg inherits the priority of the OpenMP primary thread that 3951 1.19 mrg created it. The priority of the worker thread is not changed 3952 1.19 mrg after creation, even if a new OpenMP primary thread using the 3953 1.19 mrg worker has a different priority. 3954 1.11 mrg * '@<scheduler-name>' is the scheduler instance name according 3955 1.8 mrg to the RTEMS application configuration. 3956 1.8 mrg In case no thread pool configuration is specified for a scheduler 3957 1.16 mrg instance, then each OpenMP primary thread of this scheduler 3958 1.19 mrg instance uses its own dynamically allocated thread pool. To limit 3959 1.19 mrg the worker thread count of the thread pools, each OpenMP primary 3960 1.19 mrg thread must call 'omp_set_num_threads'. 3961 1.8 mrg _Example_: 3962 1.11 mrg Lets suppose we have three scheduler instances 'IO', 'WRK0', and 3963 1.11 mrg 'WRK1' with 'GOMP_RTEMS_THREAD_POOLS' set to '"1@WRK0:3$4@WRK1"'. 3964 1.8 mrg Then there are no thread pool restrictions for scheduler instance 3965 1.11 mrg 'IO'. In the scheduler instance 'WRK0' there is one thread pool 3966 1.8 mrg available. Since no priority is specified for this scheduler 3967 1.8 mrg instance, the worker thread inherits the priority of the OpenMP 3968 1.16 mrg primary thread that created it. In the scheduler instance 'WRK1' 3969 1.11 mrg there are three thread pools available and their worker threads run 3970 1.11 mrg at priority four. 3971 1.8 mrg 3972 1.8 mrg 3973 1.8 mrg File: libgomp.info, Node: Enabling OpenACC, Next: OpenACC Runtime Library Routines, Prev: Environment Variables, Up: Top 3974 1.8 mrg 3975 1.16 mrg 5 Enabling OpenACC 3976 1.8 mrg ****************** 3977 1.8 mrg 3978 1.8 mrg To activate the OpenACC extensions for C/C++ and Fortran, the 3979 1.11 mrg compile-time flag '-fopenacc' must be specified. This enables the 3980 1.19 mrg OpenACC directive '#pragma acc' in C/C++ and, in Fortran, the '!$acc' 3981 1.19 mrg sentinel in free source form and the 'c$acc', '*$acc' and '!$acc' 3982 1.19 mrg sentinels in fixed source form. The flag also arranges for automatic 3983 1.19 mrg linking of the OpenACC runtime library (*note OpenACC Runtime Library 3984 1.19 mrg Routines::). 3985 1.8 mrg 3986 1.13 mrg See <https://gcc.gnu.org/wiki/OpenACC> for more information. 3987 1.13 mrg 3988 1.8 mrg A complete description of all OpenACC directives accepted may be 3989 1.11 mrg found in the OpenACC (https://www.openacc.org) Application Programming 3990 1.13 mrg Interface manual, version 2.6. 3991 1.8 mrg 3992 1.8 mrg 3993 1.8 mrg File: libgomp.info, Node: OpenACC Runtime Library Routines, Next: OpenACC Environment Variables, Prev: Enabling OpenACC, Up: Top 3994 1.8 mrg 3995 1.16 mrg 6 OpenACC Runtime Library Routines 3996 1.8 mrg ********************************** 3997 1.8 mrg 3998 1.8 mrg The runtime routines described here are defined by section 3 of the 3999 1.13 mrg OpenACC specifications in version 2.6. They have C linkage, and do not 4000 1.11 mrg throw exceptions. Generally, they are available only for the host, with 4001 1.11 mrg the exception of 'acc_on_device', which is available for both the host 4002 1.11 mrg and the acceleration device. 4003 1.8 mrg 4004 1.8 mrg * Menu: 4005 1.8 mrg 4006 1.8 mrg * acc_get_num_devices:: Get number of devices for the given device 4007 1.8 mrg type. 4008 1.8 mrg * acc_set_device_type:: Set type of device accelerator to use. 4009 1.8 mrg * acc_get_device_type:: Get type of device accelerator to be used. 4010 1.8 mrg * acc_set_device_num:: Set device number to use. 4011 1.8 mrg * acc_get_device_num:: Get device number to be used. 4012 1.13 mrg * acc_get_property:: Get device property. 4013 1.8 mrg * acc_async_test:: Tests for completion of a specific asynchronous 4014 1.8 mrg operation. 4015 1.13 mrg * acc_async_test_all:: Tests for completion of all asynchronous 4016 1.8 mrg operations. 4017 1.8 mrg * acc_wait:: Wait for completion of a specific asynchronous 4018 1.8 mrg operation. 4019 1.13 mrg * acc_wait_all:: Waits for completion of all asynchronous 4020 1.8 mrg operations. 4021 1.8 mrg * acc_wait_all_async:: Wait for completion of all asynchronous 4022 1.8 mrg operations. 4023 1.8 mrg * acc_wait_async:: Wait for completion of asynchronous operations. 4024 1.8 mrg * acc_init:: Initialize runtime for a specific device type. 4025 1.8 mrg * acc_shutdown:: Shuts down the runtime for a specific device 4026 1.8 mrg type. 4027 1.8 mrg * acc_on_device:: Whether executing on a particular device 4028 1.8 mrg * acc_malloc:: Allocate device memory. 4029 1.8 mrg * acc_free:: Free device memory. 4030 1.8 mrg * acc_copyin:: Allocate device memory and copy host memory to 4031 1.8 mrg it. 4032 1.8 mrg * acc_present_or_copyin:: If the data is not present on the device, 4033 1.8 mrg allocate device memory and copy from host 4034 1.8 mrg memory. 4035 1.8 mrg * acc_create:: Allocate device memory and map it to host 4036 1.8 mrg memory. 4037 1.8 mrg * acc_present_or_create:: If the data is not present on the device, 4038 1.8 mrg allocate device memory and map it to host 4039 1.8 mrg memory. 4040 1.8 mrg * acc_copyout:: Copy device memory to host memory. 4041 1.8 mrg * acc_delete:: Free device memory. 4042 1.8 mrg * acc_update_device:: Update device memory from mapped host memory. 4043 1.8 mrg * acc_update_self:: Update host memory from mapped device memory. 4044 1.8 mrg * acc_map_data:: Map previously allocated device memory to host 4045 1.8 mrg memory. 4046 1.8 mrg * acc_unmap_data:: Unmap device memory from host memory. 4047 1.8 mrg * acc_deviceptr:: Get device pointer associated with specific 4048 1.8 mrg host address. 4049 1.8 mrg * acc_hostptr:: Get host pointer associated with specific 4050 1.8 mrg device address. 4051 1.13 mrg * acc_is_present:: Indicate whether host variable / array is 4052 1.8 mrg present on device. 4053 1.8 mrg * acc_memcpy_to_device:: Copy host memory to device memory. 4054 1.8 mrg * acc_memcpy_from_device:: Copy device memory to host memory. 4055 1.13 mrg * acc_attach:: Let device pointer point to device-pointer target. 4056 1.13 mrg * acc_detach:: Let device pointer point to host-pointer target. 4057 1.8 mrg 4058 1.8 mrg API routines for target platforms. 4059 1.8 mrg 4060 1.8 mrg * acc_get_current_cuda_device:: Get CUDA device handle. 4061 1.8 mrg * acc_get_current_cuda_context::Get CUDA context handle. 4062 1.8 mrg * acc_get_cuda_stream:: Get CUDA stream handle. 4063 1.8 mrg * acc_set_cuda_stream:: Set CUDA stream handle. 4064 1.8 mrg 4065 1.13 mrg API routines for the OpenACC Profiling Interface. 4066 1.13 mrg 4067 1.13 mrg * acc_prof_register:: Register callbacks. 4068 1.13 mrg * acc_prof_unregister:: Unregister callbacks. 4069 1.13 mrg * acc_prof_lookup:: Obtain inquiry functions. 4070 1.13 mrg * acc_register_library:: Library registration. 4071 1.13 mrg 4072 1.8 mrg 4073 1.8 mrg File: libgomp.info, Node: acc_get_num_devices, Next: acc_set_device_type, Up: OpenACC Runtime Library Routines 4074 1.8 mrg 4075 1.16 mrg 6.1 'acc_get_num_devices' - Get number of devices for given device type 4076 1.8 mrg ======================================================================= 4077 1.8 mrg 4078 1.8 mrg _Description_ 4079 1.8 mrg This function returns a value indicating the number of devices 4080 1.8 mrg available for the device type specified in DEVICETYPE. 4081 1.8 mrg 4082 1.8 mrg _C/C++_: 4083 1.11 mrg _Prototype_: 'int acc_get_num_devices(acc_device_t devicetype);' 4084 1.8 mrg 4085 1.8 mrg _Fortran_: 4086 1.11 mrg _Interface_: 'integer function acc_get_num_devices(devicetype)' 4087 1.11 mrg 'integer(kind=acc_device_kind) devicetype' 4088 1.8 mrg 4089 1.8 mrg _Reference_: 4090 1.13 mrg OpenACC specification v2.6 (https://www.openacc.org), section 4091 1.8 mrg 3.2.1. 4092 1.8 mrg 4093 1.8 mrg 4094 1.8 mrg File: libgomp.info, Node: acc_set_device_type, Next: acc_get_device_type, Prev: acc_get_num_devices, Up: OpenACC Runtime Library Routines 4095 1.8 mrg 4096 1.16 mrg 6.2 'acc_set_device_type' - Set type of device accelerator to use. 4097 1.8 mrg ================================================================== 4098 1.8 mrg 4099 1.8 mrg _Description_ 4100 1.13 mrg This function indicates to the runtime library which device type, 4101 1.8 mrg specified in DEVICETYPE, to use when executing a parallel or 4102 1.8 mrg kernels region. 4103 1.8 mrg 4104 1.8 mrg _C/C++_: 4105 1.11 mrg _Prototype_: 'acc_set_device_type(acc_device_t devicetype);' 4106 1.8 mrg 4107 1.8 mrg _Fortran_: 4108 1.11 mrg _Interface_: 'subroutine acc_set_device_type(devicetype)' 4109 1.11 mrg 'integer(kind=acc_device_kind) devicetype' 4110 1.8 mrg 4111 1.8 mrg _Reference_: 4112 1.13 mrg OpenACC specification v2.6 (https://www.openacc.org), section 4113 1.8 mrg 3.2.2. 4114 1.8 mrg 4115 1.8 mrg 4116 1.8 mrg File: libgomp.info, Node: acc_get_device_type, Next: acc_set_device_num, Prev: acc_set_device_type, Up: OpenACC Runtime Library Routines 4117 1.8 mrg 4118 1.16 mrg 6.3 'acc_get_device_type' - Get type of device accelerator to be used. 4119 1.8 mrg ====================================================================== 4120 1.8 mrg 4121 1.8 mrg _Description_ 4122 1.8 mrg This function returns what device type will be used when executing 4123 1.8 mrg a parallel or kernels region. 4124 1.8 mrg 4125 1.13 mrg This function returns 'acc_device_none' if 'acc_get_device_type' is 4126 1.13 mrg called from 'acc_ev_device_init_start', 'acc_ev_device_init_end' 4127 1.13 mrg callbacks of the OpenACC Profiling Interface (*note OpenACC 4128 1.13 mrg Profiling Interface::), that is, if the device is currently being 4129 1.13 mrg initialized. 4130 1.13 mrg 4131 1.8 mrg _C/C++_: 4132 1.11 mrg _Prototype_: 'acc_device_t acc_get_device_type(void);' 4133 1.8 mrg 4134 1.8 mrg _Fortran_: 4135 1.11 mrg _Interface_: 'function acc_get_device_type(void)' 4136 1.11 mrg 'integer(kind=acc_device_kind) acc_get_device_type' 4137 1.8 mrg 4138 1.8 mrg _Reference_: 4139 1.13 mrg OpenACC specification v2.6 (https://www.openacc.org), section 4140 1.8 mrg 3.2.3. 4141 1.8 mrg 4142 1.8 mrg 4143 1.8 mrg File: libgomp.info, Node: acc_set_device_num, Next: acc_get_device_num, Prev: acc_get_device_type, Up: OpenACC Runtime Library Routines 4144 1.8 mrg 4145 1.16 mrg 6.4 'acc_set_device_num' - Set device number to use. 4146 1.8 mrg ==================================================== 4147 1.8 mrg 4148 1.8 mrg _Description_ 4149 1.8 mrg This function will indicate to the runtime which device number, 4150 1.13 mrg specified by DEVICENUM, associated with the specified device type 4151 1.8 mrg DEVICETYPE. 4152 1.8 mrg 4153 1.8 mrg _C/C++_: 4154 1.13 mrg _Prototype_: 'acc_set_device_num(int devicenum, acc_device_t 4155 1.13 mrg devicetype);' 4156 1.8 mrg 4157 1.8 mrg _Fortran_: 4158 1.11 mrg _Interface_: 'subroutine acc_set_device_num(devicenum, devicetype)' 4159 1.11 mrg 'integer devicenum' 4160 1.11 mrg 'integer(kind=acc_device_kind) devicetype' 4161 1.8 mrg 4162 1.8 mrg _Reference_: 4163 1.13 mrg OpenACC specification v2.6 (https://www.openacc.org), section 4164 1.8 mrg 3.2.4. 4165 1.8 mrg 4166 1.8 mrg 4167 1.13 mrg File: libgomp.info, Node: acc_get_device_num, Next: acc_get_property, Prev: acc_set_device_num, Up: OpenACC Runtime Library Routines 4168 1.8 mrg 4169 1.16 mrg 6.5 'acc_get_device_num' - Get device number to be used. 4170 1.8 mrg ======================================================== 4171 1.8 mrg 4172 1.8 mrg _Description_ 4173 1.8 mrg This function returns which device number associated with the 4174 1.8 mrg specified device type DEVICETYPE, will be used when executing a 4175 1.8 mrg parallel or kernels region. 4176 1.8 mrg 4177 1.8 mrg _C/C++_: 4178 1.11 mrg _Prototype_: 'int acc_get_device_num(acc_device_t devicetype);' 4179 1.8 mrg 4180 1.8 mrg _Fortran_: 4181 1.11 mrg _Interface_: 'function acc_get_device_num(devicetype)' 4182 1.11 mrg 'integer(kind=acc_device_kind) devicetype' 4183 1.11 mrg 'integer acc_get_device_num' 4184 1.8 mrg 4185 1.8 mrg _Reference_: 4186 1.13 mrg OpenACC specification v2.6 (https://www.openacc.org), section 4187 1.8 mrg 3.2.5. 4188 1.8 mrg 4189 1.8 mrg 4190 1.13 mrg File: libgomp.info, Node: acc_get_property, Next: acc_async_test, Prev: acc_get_device_num, Up: OpenACC Runtime Library Routines 4191 1.13 mrg 4192 1.16 mrg 6.6 'acc_get_property' - Get device property. 4193 1.13 mrg ============================================= 4194 1.13 mrg 4195 1.13 mrg _Description_ 4196 1.13 mrg These routines return the value of the specified PROPERTY for the 4197 1.13 mrg device being queried according to DEVICENUM and DEVICETYPE. 4198 1.13 mrg Integer-valued and string-valued properties are returned by 4199 1.13 mrg 'acc_get_property' and 'acc_get_property_string' respectively. The 4200 1.13 mrg Fortran 'acc_get_property_string' subroutine returns the string 4201 1.13 mrg retrieved in its fourth argument while the remaining entry points 4202 1.13 mrg are functions, which pass the return value as their result. 4203 1.13 mrg 4204 1.13 mrg Note for Fortran, only: the OpenACC technical committee corrected 4205 1.13 mrg and, hence, modified the interface introduced in OpenACC 2.6. The 4206 1.13 mrg kind-value parameter 'acc_device_property' has been renamed to 4207 1.13 mrg 'acc_device_property_kind' for consistency and the return type of 4208 1.13 mrg the 'acc_get_property' function is now a 'c_size_t' integer instead 4209 1.13 mrg of a 'acc_device_property' integer. The parameter 4210 1.19 mrg 'acc_device_property' is still provided, but might be removed in a 4211 1.19 mrg future version of GCC. 4212 1.13 mrg 4213 1.13 mrg _C/C++_: 4214 1.13 mrg _Prototype_: 'size_t acc_get_property(int devicenum, acc_device_t 4215 1.13 mrg devicetype, acc_device_property_t property);' 4216 1.13 mrg _Prototype_: 'const char *acc_get_property_string(int devicenum, 4217 1.13 mrg acc_device_t devicetype, acc_device_property_t 4218 1.13 mrg property);' 4219 1.13 mrg 4220 1.13 mrg _Fortran_: 4221 1.13 mrg _Interface_: 'function acc_get_property(devicenum, devicetype, 4222 1.13 mrg property)' 4223 1.13 mrg _Interface_: 'subroutine acc_get_property_string(devicenum, 4224 1.13 mrg devicetype, property, string)' 4225 1.13 mrg 'use ISO_C_Binding, only: c_size_t' 4226 1.13 mrg 'integer devicenum' 4227 1.13 mrg 'integer(kind=acc_device_kind) devicetype' 4228 1.13 mrg 'integer(kind=acc_device_property_kind) property' 4229 1.13 mrg 'integer(kind=c_size_t) acc_get_property' 4230 1.13 mrg 'character(*) string' 4231 1.13 mrg 4232 1.13 mrg _Reference_: 4233 1.13 mrg OpenACC specification v2.6 (https://www.openacc.org), section 4234 1.13 mrg 3.2.6. 4235 1.13 mrg 4236 1.13 mrg 4237 1.13 mrg File: libgomp.info, Node: acc_async_test, Next: acc_async_test_all, Prev: acc_get_property, Up: OpenACC Runtime Library Routines 4238 1.8 mrg 4239 1.16 mrg 6.7 'acc_async_test' - Test for completion of a specific asynchronous operation. 4240 1.8 mrg ================================================================================ 4241 1.8 mrg 4242 1.8 mrg _Description_ 4243 1.13 mrg This function tests for completion of the asynchronous operation 4244 1.19 mrg specified in ARG. In C/C++, a non-zero value is returned to 4245 1.19 mrg indicate the specified asynchronous operation has completed while 4246 1.19 mrg Fortran returns 'true'. If the asynchronous operation has not 4247 1.19 mrg completed, C/C++ returns zero and Fortran returns 'false'. 4248 1.8 mrg 4249 1.8 mrg _C/C++_: 4250 1.11 mrg _Prototype_: 'int acc_async_test(int arg);' 4251 1.8 mrg 4252 1.8 mrg _Fortran_: 4253 1.11 mrg _Interface_: 'function acc_async_test(arg)' 4254 1.11 mrg 'integer(kind=acc_handle_kind) arg' 4255 1.11 mrg 'logical acc_async_test' 4256 1.8 mrg 4257 1.8 mrg _Reference_: 4258 1.13 mrg OpenACC specification v2.6 (https://www.openacc.org), section 4259 1.13 mrg 3.2.9. 4260 1.8 mrg 4261 1.8 mrg 4262 1.8 mrg File: libgomp.info, Node: acc_async_test_all, Next: acc_wait, Prev: acc_async_test, Up: OpenACC Runtime Library Routines 4263 1.8 mrg 4264 1.16 mrg 6.8 'acc_async_test_all' - Tests for completion of all asynchronous operations. 4265 1.8 mrg =============================================================================== 4266 1.8 mrg 4267 1.8 mrg _Description_ 4268 1.13 mrg This function tests for completion of all asynchronous operations. 4269 1.19 mrg In C/C++, a non-zero value is returned to indicate all asynchronous 4270 1.19 mrg operations have completed while Fortran returns 'true'. If any 4271 1.19 mrg asynchronous operation has not completed, C/C++ returns zero and 4272 1.19 mrg Fortran returns 'false'. 4273 1.8 mrg 4274 1.8 mrg _C/C++_: 4275 1.11 mrg _Prototype_: 'int acc_async_test_all(void);' 4276 1.8 mrg 4277 1.8 mrg _Fortran_: 4278 1.11 mrg _Interface_: 'function acc_async_test()' 4279 1.11 mrg 'logical acc_get_device_num' 4280 1.8 mrg 4281 1.8 mrg _Reference_: 4282 1.13 mrg OpenACC specification v2.6 (https://www.openacc.org), section 4283 1.13 mrg 3.2.10. 4284 1.8 mrg 4285 1.8 mrg 4286 1.8 mrg File: libgomp.info, Node: acc_wait, Next: acc_wait_all, Prev: acc_async_test_all, Up: OpenACC Runtime Library Routines 4287 1.8 mrg 4288 1.16 mrg 6.9 'acc_wait' - Wait for completion of a specific asynchronous operation. 4289 1.8 mrg ========================================================================== 4290 1.8 mrg 4291 1.8 mrg _Description_ 4292 1.8 mrg This function waits for completion of the asynchronous operation 4293 1.8 mrg specified in ARG. 4294 1.8 mrg 4295 1.8 mrg _C/C++_: 4296 1.11 mrg _Prototype_: 'acc_wait(arg);' 4297 1.11 mrg _Prototype 'acc_async_wait(arg);' 4298 1.11 mrg (OpenACC 1.0 4299 1.11 mrg compatibility)_: 4300 1.8 mrg 4301 1.8 mrg _Fortran_: 4302 1.11 mrg _Interface_: 'subroutine acc_wait(arg)' 4303 1.11 mrg 'integer(acc_handle_kind) arg' 4304 1.11 mrg _Interface 'subroutine acc_async_wait(arg)' 4305 1.11 mrg (OpenACC 1.0 4306 1.11 mrg compatibility)_: 4307 1.11 mrg 'integer(acc_handle_kind) arg' 4308 1.8 mrg 4309 1.8 mrg _Reference_: 4310 1.13 mrg OpenACC specification v2.6 (https://www.openacc.org), section 4311 1.13 mrg 3.2.11. 4312 1.8 mrg 4313 1.8 mrg 4314 1.8 mrg File: libgomp.info, Node: acc_wait_all, Next: acc_wait_all_async, Prev: acc_wait, Up: OpenACC Runtime Library Routines 4315 1.8 mrg 4316 1.16 mrg 6.10 'acc_wait_all' - Waits for completion of all asynchronous operations. 4317 1.13 mrg ========================================================================== 4318 1.8 mrg 4319 1.8 mrg _Description_ 4320 1.8 mrg This function waits for the completion of all asynchronous 4321 1.8 mrg operations. 4322 1.8 mrg 4323 1.8 mrg _C/C++_: 4324 1.11 mrg _Prototype_: 'acc_wait_all(void);' 4325 1.11 mrg _Prototype 'acc_async_wait_all(void);' 4326 1.11 mrg (OpenACC 1.0 4327 1.11 mrg compatibility)_: 4328 1.8 mrg 4329 1.8 mrg _Fortran_: 4330 1.11 mrg _Interface_: 'subroutine acc_wait_all()' 4331 1.11 mrg _Interface 'subroutine acc_async_wait_all()' 4332 1.11 mrg (OpenACC 1.0 4333 1.11 mrg compatibility)_: 4334 1.8 mrg 4335 1.8 mrg _Reference_: 4336 1.13 mrg OpenACC specification v2.6 (https://www.openacc.org), section 4337 1.13 mrg 3.2.13. 4338 1.8 mrg 4339 1.8 mrg 4340 1.8 mrg File: libgomp.info, Node: acc_wait_all_async, Next: acc_wait_async, Prev: acc_wait_all, Up: OpenACC Runtime Library Routines 4341 1.8 mrg 4342 1.16 mrg 6.11 'acc_wait_all_async' - Wait for completion of all asynchronous operations. 4343 1.8 mrg =============================================================================== 4344 1.8 mrg 4345 1.8 mrg _Description_ 4346 1.8 mrg This function enqueues a wait operation on the queue ASYNC for any 4347 1.8 mrg and all asynchronous operations that have been previously enqueued 4348 1.8 mrg on any queue. 4349 1.8 mrg 4350 1.8 mrg _C/C++_: 4351 1.11 mrg _Prototype_: 'acc_wait_all_async(int async);' 4352 1.8 mrg 4353 1.8 mrg _Fortran_: 4354 1.11 mrg _Interface_: 'subroutine acc_wait_all_async(async)' 4355 1.11 mrg 'integer(acc_handle_kind) async' 4356 1.8 mrg 4357 1.8 mrg _Reference_: 4358 1.13 mrg OpenACC specification v2.6 (https://www.openacc.org), section 4359 1.13 mrg 3.2.14. 4360 1.8 mrg 4361 1.8 mrg 4362 1.8 mrg File: libgomp.info, Node: acc_wait_async, Next: acc_init, Prev: acc_wait_all_async, Up: OpenACC Runtime Library Routines 4363 1.8 mrg 4364 1.16 mrg 6.12 'acc_wait_async' - Wait for completion of asynchronous operations. 4365 1.8 mrg ======================================================================= 4366 1.8 mrg 4367 1.8 mrg _Description_ 4368 1.8 mrg This function enqueues a wait operation on queue ASYNC for any and 4369 1.8 mrg all asynchronous operations enqueued on queue ARG. 4370 1.8 mrg 4371 1.8 mrg _C/C++_: 4372 1.11 mrg _Prototype_: 'acc_wait_async(int arg, int async);' 4373 1.8 mrg 4374 1.8 mrg _Fortran_: 4375 1.11 mrg _Interface_: 'subroutine acc_wait_async(arg, async)' 4376 1.11 mrg 'integer(acc_handle_kind) arg, async' 4377 1.8 mrg 4378 1.8 mrg _Reference_: 4379 1.13 mrg OpenACC specification v2.6 (https://www.openacc.org), section 4380 1.13 mrg 3.2.12. 4381 1.8 mrg 4382 1.8 mrg 4383 1.8 mrg File: libgomp.info, Node: acc_init, Next: acc_shutdown, Prev: acc_wait_async, Up: OpenACC Runtime Library Routines 4384 1.8 mrg 4385 1.16 mrg 6.13 'acc_init' - Initialize runtime for a specific device type. 4386 1.8 mrg ================================================================ 4387 1.8 mrg 4388 1.8 mrg _Description_ 4389 1.11 mrg This function initializes the runtime for the device type specified 4390 1.11 mrg in DEVICETYPE. 4391 1.8 mrg 4392 1.8 mrg _C/C++_: 4393 1.11 mrg _Prototype_: 'acc_init(acc_device_t devicetype);' 4394 1.8 mrg 4395 1.8 mrg _Fortran_: 4396 1.11 mrg _Interface_: 'subroutine acc_init(devicetype)' 4397 1.11 mrg 'integer(acc_device_kind) devicetype' 4398 1.8 mrg 4399 1.8 mrg _Reference_: 4400 1.13 mrg OpenACC specification v2.6 (https://www.openacc.org), section 4401 1.13 mrg 3.2.7. 4402 1.8 mrg 4403 1.8 mrg 4404 1.8 mrg File: libgomp.info, Node: acc_shutdown, Next: acc_on_device, Prev: acc_init, Up: OpenACC Runtime Library Routines 4405 1.8 mrg 4406 1.16 mrg 6.14 'acc_shutdown' - Shuts down the runtime for a specific device type. 4407 1.8 mrg ======================================================================== 4408 1.8 mrg 4409 1.8 mrg _Description_ 4410 1.8 mrg This function shuts down the runtime for the device type specified 4411 1.8 mrg in DEVICETYPE. 4412 1.8 mrg 4413 1.8 mrg _C/C++_: 4414 1.11 mrg _Prototype_: 'acc_shutdown(acc_device_t devicetype);' 4415 1.8 mrg 4416 1.8 mrg _Fortran_: 4417 1.11 mrg _Interface_: 'subroutine acc_shutdown(devicetype)' 4418 1.11 mrg 'integer(acc_device_kind) devicetype' 4419 1.8 mrg 4420 1.8 mrg _Reference_: 4421 1.13 mrg OpenACC specification v2.6 (https://www.openacc.org), section 4422 1.13 mrg 3.2.8. 4423 1.8 mrg 4424 1.8 mrg 4425 1.8 mrg File: libgomp.info, Node: acc_on_device, Next: acc_malloc, Prev: acc_shutdown, Up: OpenACC Runtime Library Routines 4426 1.8 mrg 4427 1.16 mrg 6.15 'acc_on_device' - Whether executing on a particular device 4428 1.8 mrg =============================================================== 4429 1.8 mrg 4430 1.8 mrg _Description_: 4431 1.8 mrg This function returns whether the program is executing on a 4432 1.11 mrg particular device specified in DEVICETYPE. In C/C++ a non-zero 4433 1.13 mrg value is returned to indicate the device is executing on the 4434 1.19 mrg specified device type. In Fortran, 'true' is returned. If the 4435 1.19 mrg program is not executing on the specified device type C/C++ returns 4436 1.19 mrg zero, while Fortran returns 'false'. 4437 1.8 mrg 4438 1.8 mrg _C/C++_: 4439 1.11 mrg _Prototype_: 'acc_on_device(acc_device_t devicetype);' 4440 1.8 mrg 4441 1.8 mrg _Fortran_: 4442 1.11 mrg _Interface_: 'function acc_on_device(devicetype)' 4443 1.11 mrg 'integer(acc_device_kind) devicetype' 4444 1.11 mrg 'logical acc_on_device' 4445 1.8 mrg 4446 1.8 mrg _Reference_: 4447 1.13 mrg OpenACC specification v2.6 (https://www.openacc.org), section 4448 1.13 mrg 3.2.17. 4449 1.8 mrg 4450 1.8 mrg 4451 1.8 mrg File: libgomp.info, Node: acc_malloc, Next: acc_free, Prev: acc_on_device, Up: OpenACC Runtime Library Routines 4452 1.8 mrg 4453 1.16 mrg 6.16 'acc_malloc' - Allocate device memory. 4454 1.8 mrg =========================================== 4455 1.8 mrg 4456 1.8 mrg _Description_ 4457 1.19 mrg This function allocates BYTES bytes of device memory. It returns 4458 1.19 mrg the device address of the allocated memory. 4459 1.8 mrg 4460 1.8 mrg _C/C++_: 4461 1.19 mrg _Prototype_: 'd_void* acc_malloc(size_t bytes);' 4462 1.19 mrg 4463 1.19 mrg _Fortran_: 4464 1.19 mrg _Interface_: 'type(c_ptr) function acc_malloc(bytes)' 4465 1.19 mrg 'integer(c_size_t), value :: bytes' 4466 1.8 mrg 4467 1.8 mrg _Reference_: 4468 1.13 mrg OpenACC specification v2.6 (https://www.openacc.org), section 4469 1.19 mrg 3.2.18. openacc specification v3.3 (https://www.openacc.org), 4470 1.19 mrg section 3.2.16. 4471 1.8 mrg 4472 1.8 mrg 4473 1.8 mrg File: libgomp.info, Node: acc_free, Next: acc_copyin, Prev: acc_malloc, Up: OpenACC Runtime Library Routines 4474 1.8 mrg 4475 1.16 mrg 6.17 'acc_free' - Free device memory. 4476 1.8 mrg ===================================== 4477 1.8 mrg 4478 1.8 mrg _Description_ 4479 1.19 mrg Free previously allocated device memory at the device address 4480 1.19 mrg 'data_dev'. 4481 1.8 mrg 4482 1.8 mrg _C/C++_: 4483 1.19 mrg _Prototype_: 'void acc_free(d_void *data_dev);' 4484 1.19 mrg 4485 1.19 mrg _Fortran_: 4486 1.19 mrg _Interface_: 'subroutine acc_free(data_dev)' 4487 1.19 mrg 'type(c_ptr), value :: data_dev' 4488 1.8 mrg 4489 1.8 mrg _Reference_: 4490 1.13 mrg OpenACC specification v2.6 (https://www.openacc.org), section 4491 1.19 mrg 3.2.19. openacc specification v3.3 (https://www.openacc.org), 4492 1.19 mrg section 3.2.17. 4493 1.8 mrg 4494 1.8 mrg 4495 1.8 mrg File: libgomp.info, Node: acc_copyin, Next: acc_present_or_copyin, Prev: acc_free, Up: OpenACC Runtime Library Routines 4496 1.8 mrg 4497 1.16 mrg 6.18 'acc_copyin' - Allocate device memory and copy host memory to it. 4498 1.8 mrg ====================================================================== 4499 1.8 mrg 4500 1.8 mrg _Description_ 4501 1.8 mrg In C/C++, this function allocates LEN bytes of device memory and 4502 1.11 mrg maps it to the specified host address in A. The device address of 4503 1.8 mrg the newly allocated device memory is returned. 4504 1.8 mrg 4505 1.11 mrg In Fortran, two (2) forms are supported. In the first form, A 4506 1.11 mrg specifies a contiguous array section. The second form A specifies 4507 1.11 mrg a variable or array element and LEN specifies the length in bytes. 4508 1.8 mrg 4509 1.8 mrg _C/C++_: 4510 1.11 mrg _Prototype_: 'void *acc_copyin(h_void *a, size_t len);' 4511 1.13 mrg _Prototype_: 'void *acc_copyin_async(h_void *a, size_t len, int 4512 1.13 mrg async);' 4513 1.8 mrg 4514 1.8 mrg _Fortran_: 4515 1.11 mrg _Interface_: 'subroutine acc_copyin(a)' 4516 1.11 mrg 'type, dimension(:[,:]...) :: a' 4517 1.11 mrg _Interface_: 'subroutine acc_copyin(a, len)' 4518 1.11 mrg 'type, dimension(:[,:]...) :: a' 4519 1.11 mrg 'integer len' 4520 1.13 mrg _Interface_: 'subroutine acc_copyin_async(a, async)' 4521 1.13 mrg 'type, dimension(:[,:]...) :: a' 4522 1.13 mrg 'integer(acc_handle_kind) :: async' 4523 1.13 mrg _Interface_: 'subroutine acc_copyin_async(a, len, async)' 4524 1.13 mrg 'type, dimension(:[,:]...) :: a' 4525 1.13 mrg 'integer len' 4526 1.13 mrg 'integer(acc_handle_kind) :: async' 4527 1.8 mrg 4528 1.8 mrg _Reference_: 4529 1.13 mrg OpenACC specification v2.6 (https://www.openacc.org), section 4530 1.13 mrg 3.2.20. 4531 1.8 mrg 4532 1.8 mrg 4533 1.8 mrg File: libgomp.info, Node: acc_present_or_copyin, Next: acc_create, Prev: acc_copyin, Up: OpenACC Runtime Library Routines 4534 1.8 mrg 4535 1.16 mrg 6.19 'acc_present_or_copyin' - If the data is not present on the device, allocate device memory and copy from host memory. 4536 1.8 mrg ========================================================================================================================== 4537 1.8 mrg 4538 1.8 mrg _Description_ 4539 1.13 mrg This function tests if the host data specified by A and of length 4540 1.19 mrg LEN is present or not. If it is not present, device memory is 4541 1.19 mrg allocated and the host memory copied. The device address of the 4542 1.19 mrg newly allocated device memory is returned. 4543 1.8 mrg 4544 1.11 mrg In Fortran, two (2) forms are supported. In the first form, A 4545 1.11 mrg specifies a contiguous array section. The second form A specifies 4546 1.8 mrg a variable or array element and LEN specifies the length in bytes. 4547 1.8 mrg 4548 1.13 mrg Note that 'acc_present_or_copyin' and 'acc_pcopyin' exist for 4549 1.13 mrg backward compatibility with OpenACC 2.0; use *note acc_copyin:: 4550 1.13 mrg instead. 4551 1.13 mrg 4552 1.8 mrg _C/C++_: 4553 1.11 mrg _Prototype_: 'void *acc_present_or_copyin(h_void *a, size_t len);' 4554 1.11 mrg _Prototype_: 'void *acc_pcopyin(h_void *a, size_t len);' 4555 1.8 mrg 4556 1.8 mrg _Fortran_: 4557 1.11 mrg _Interface_: 'subroutine acc_present_or_copyin(a)' 4558 1.11 mrg 'type, dimension(:[,:]...) :: a' 4559 1.11 mrg _Interface_: 'subroutine acc_present_or_copyin(a, len)' 4560 1.11 mrg 'type, dimension(:[,:]...) :: a' 4561 1.11 mrg 'integer len' 4562 1.11 mrg _Interface_: 'subroutine acc_pcopyin(a)' 4563 1.11 mrg 'type, dimension(:[,:]...) :: a' 4564 1.11 mrg _Interface_: 'subroutine acc_pcopyin(a, len)' 4565 1.11 mrg 'type, dimension(:[,:]...) :: a' 4566 1.11 mrg 'integer len' 4567 1.8 mrg 4568 1.8 mrg _Reference_: 4569 1.13 mrg OpenACC specification v2.6 (https://www.openacc.org), section 4570 1.13 mrg 3.2.20. 4571 1.8 mrg 4572 1.8 mrg 4573 1.8 mrg File: libgomp.info, Node: acc_create, Next: acc_present_or_create, Prev: acc_present_or_copyin, Up: OpenACC Runtime Library Routines 4574 1.8 mrg 4575 1.16 mrg 6.20 'acc_create' - Allocate device memory and map it to host memory. 4576 1.8 mrg ===================================================================== 4577 1.8 mrg 4578 1.8 mrg _Description_ 4579 1.8 mrg This function allocates device memory and maps it to host memory 4580 1.11 mrg specified by the host address A with a length of LEN bytes. In 4581 1.8 mrg C/C++, the function returns the device address of the allocated 4582 1.8 mrg device memory. 4583 1.8 mrg 4584 1.11 mrg In Fortran, two (2) forms are supported. In the first form, A 4585 1.11 mrg specifies a contiguous array section. The second form A specifies 4586 1.8 mrg a variable or array element and LEN specifies the length in bytes. 4587 1.8 mrg 4588 1.8 mrg _C/C++_: 4589 1.11 mrg _Prototype_: 'void *acc_create(h_void *a, size_t len);' 4590 1.13 mrg _Prototype_: 'void *acc_create_async(h_void *a, size_t len, int 4591 1.13 mrg async);' 4592 1.8 mrg 4593 1.8 mrg _Fortran_: 4594 1.11 mrg _Interface_: 'subroutine acc_create(a)' 4595 1.11 mrg 'type, dimension(:[,:]...) :: a' 4596 1.11 mrg _Interface_: 'subroutine acc_create(a, len)' 4597 1.11 mrg 'type, dimension(:[,:]...) :: a' 4598 1.11 mrg 'integer len' 4599 1.13 mrg _Interface_: 'subroutine acc_create_async(a, async)' 4600 1.13 mrg 'type, dimension(:[,:]...) :: a' 4601 1.13 mrg 'integer(acc_handle_kind) :: async' 4602 1.13 mrg _Interface_: 'subroutine acc_create_async(a, len, async)' 4603 1.13 mrg 'type, dimension(:[,:]...) :: a' 4604 1.13 mrg 'integer len' 4605 1.13 mrg 'integer(acc_handle_kind) :: async' 4606 1.8 mrg 4607 1.8 mrg _Reference_: 4608 1.13 mrg OpenACC specification v2.6 (https://www.openacc.org), section 4609 1.13 mrg 3.2.21. 4610 1.8 mrg 4611 1.8 mrg 4612 1.8 mrg File: libgomp.info, Node: acc_present_or_create, Next: acc_copyout, Prev: acc_create, Up: OpenACC Runtime Library Routines 4613 1.8 mrg 4614 1.16 mrg 6.21 'acc_present_or_create' - If the data is not present on the device, allocate device memory and map it to host memory. 4615 1.8 mrg ========================================================================================================================== 4616 1.1 mrg 4617 1.8 mrg _Description_ 4618 1.13 mrg This function tests if the host data specified by A and of length 4619 1.19 mrg LEN is present or not. If it is not present, device memory is 4620 1.19 mrg allocated and mapped to host memory. In C/C++, the device address 4621 1.19 mrg of the newly allocated device memory is returned. 4622 1.8 mrg 4623 1.11 mrg In Fortran, two (2) forms are supported. In the first form, A 4624 1.11 mrg specifies a contiguous array section. The second form A specifies 4625 1.8 mrg a variable or array element and LEN specifies the length in bytes. 4626 1.8 mrg 4627 1.13 mrg Note that 'acc_present_or_create' and 'acc_pcreate' exist for 4628 1.13 mrg backward compatibility with OpenACC 2.0; use *note acc_create:: 4629 1.13 mrg instead. 4630 1.13 mrg 4631 1.8 mrg _C/C++_: 4632 1.11 mrg _Prototype_: 'void *acc_present_or_create(h_void *a, size_t len)' 4633 1.11 mrg _Prototype_: 'void *acc_pcreate(h_void *a, size_t len)' 4634 1.8 mrg 4635 1.8 mrg _Fortran_: 4636 1.11 mrg _Interface_: 'subroutine acc_present_or_create(a)' 4637 1.11 mrg 'type, dimension(:[,:]...) :: a' 4638 1.11 mrg _Interface_: 'subroutine acc_present_or_create(a, len)' 4639 1.11 mrg 'type, dimension(:[,:]...) :: a' 4640 1.11 mrg 'integer len' 4641 1.11 mrg _Interface_: 'subroutine acc_pcreate(a)' 4642 1.11 mrg 'type, dimension(:[,:]...) :: a' 4643 1.11 mrg _Interface_: 'subroutine acc_pcreate(a, len)' 4644 1.11 mrg 'type, dimension(:[,:]...) :: a' 4645 1.11 mrg 'integer len' 4646 1.8 mrg 4647 1.8 mrg _Reference_: 4648 1.13 mrg OpenACC specification v2.6 (https://www.openacc.org), section 4649 1.13 mrg 3.2.21. 4650 1.8 mrg 4651 1.8 mrg 4652 1.8 mrg File: libgomp.info, Node: acc_copyout, Next: acc_delete, Prev: acc_present_or_create, Up: OpenACC Runtime Library Routines 4653 1.8 mrg 4654 1.16 mrg 6.22 'acc_copyout' - Copy device memory to host memory. 4655 1.8 mrg ======================================================= 4656 1.8 mrg 4657 1.8 mrg _Description_ 4658 1.8 mrg This function copies mapped device memory to host memory which is 4659 1.8 mrg specified by host address A for a length LEN bytes in C/C++. 4660 1.8 mrg 4661 1.11 mrg In Fortran, two (2) forms are supported. In the first form, A 4662 1.11 mrg specifies a contiguous array section. The second form A specifies 4663 1.8 mrg a variable or array element and LEN specifies the length in bytes. 4664 1.8 mrg 4665 1.8 mrg _C/C++_: 4666 1.11 mrg _Prototype_: 'acc_copyout(h_void *a, size_t len);' 4667 1.13 mrg _Prototype_: 'acc_copyout_async(h_void *a, size_t len, int async);' 4668 1.13 mrg _Prototype_: 'acc_copyout_finalize(h_void *a, size_t len);' 4669 1.13 mrg _Prototype_: 'acc_copyout_finalize_async(h_void *a, size_t len, int 4670 1.13 mrg async);' 4671 1.8 mrg 4672 1.8 mrg _Fortran_: 4673 1.11 mrg _Interface_: 'subroutine acc_copyout(a)' 4674 1.11 mrg 'type, dimension(:[,:]...) :: a' 4675 1.11 mrg _Interface_: 'subroutine acc_copyout(a, len)' 4676 1.11 mrg 'type, dimension(:[,:]...) :: a' 4677 1.11 mrg 'integer len' 4678 1.13 mrg _Interface_: 'subroutine acc_copyout_async(a, async)' 4679 1.13 mrg 'type, dimension(:[,:]...) :: a' 4680 1.13 mrg 'integer(acc_handle_kind) :: async' 4681 1.13 mrg _Interface_: 'subroutine acc_copyout_async(a, len, async)' 4682 1.13 mrg 'type, dimension(:[,:]...) :: a' 4683 1.13 mrg 'integer len' 4684 1.13 mrg 'integer(acc_handle_kind) :: async' 4685 1.13 mrg _Interface_: 'subroutine acc_copyout_finalize(a)' 4686 1.13 mrg 'type, dimension(:[,:]...) :: a' 4687 1.13 mrg _Interface_: 'subroutine acc_copyout_finalize(a, len)' 4688 1.13 mrg 'type, dimension(:[,:]...) :: a' 4689 1.13 mrg 'integer len' 4690 1.13 mrg _Interface_: 'subroutine acc_copyout_finalize_async(a, async)' 4691 1.13 mrg 'type, dimension(:[,:]...) :: a' 4692 1.13 mrg 'integer(acc_handle_kind) :: async' 4693 1.13 mrg _Interface_: 'subroutine acc_copyout_finalize_async(a, len, async)' 4694 1.13 mrg 'type, dimension(:[,:]...) :: a' 4695 1.13 mrg 'integer len' 4696 1.13 mrg 'integer(acc_handle_kind) :: async' 4697 1.8 mrg 4698 1.8 mrg _Reference_: 4699 1.13 mrg OpenACC specification v2.6 (https://www.openacc.org), section 4700 1.13 mrg 3.2.22. 4701 1.8 mrg 4702 1.8 mrg 4703 1.8 mrg File: libgomp.info, Node: acc_delete, Next: acc_update_device, Prev: acc_copyout, Up: OpenACC Runtime Library Routines 4704 1.8 mrg 4705 1.16 mrg 6.23 'acc_delete' - Free device memory. 4706 1.8 mrg ======================================= 4707 1.8 mrg 4708 1.8 mrg _Description_ 4709 1.8 mrg This function frees previously allocated device memory specified by 4710 1.8 mrg the device address A and the length of LEN bytes. 4711 1.8 mrg 4712 1.11 mrg In Fortran, two (2) forms are supported. In the first form, A 4713 1.11 mrg specifies a contiguous array section. The second form A specifies 4714 1.8 mrg a variable or array element and LEN specifies the length in bytes. 4715 1.8 mrg 4716 1.8 mrg _C/C++_: 4717 1.11 mrg _Prototype_: 'acc_delete(h_void *a, size_t len);' 4718 1.13 mrg _Prototype_: 'acc_delete_async(h_void *a, size_t len, int async);' 4719 1.13 mrg _Prototype_: 'acc_delete_finalize(h_void *a, size_t len);' 4720 1.13 mrg _Prototype_: 'acc_delete_finalize_async(h_void *a, size_t len, int 4721 1.13 mrg async);' 4722 1.8 mrg 4723 1.8 mrg _Fortran_: 4724 1.11 mrg _Interface_: 'subroutine acc_delete(a)' 4725 1.11 mrg 'type, dimension(:[,:]...) :: a' 4726 1.11 mrg _Interface_: 'subroutine acc_delete(a, len)' 4727 1.11 mrg 'type, dimension(:[,:]...) :: a' 4728 1.11 mrg 'integer len' 4729 1.13 mrg _Interface_: 'subroutine acc_delete_async(a, async)' 4730 1.13 mrg 'type, dimension(:[,:]...) :: a' 4731 1.13 mrg 'integer(acc_handle_kind) :: async' 4732 1.13 mrg _Interface_: 'subroutine acc_delete_async(a, len, async)' 4733 1.13 mrg 'type, dimension(:[,:]...) :: a' 4734 1.13 mrg 'integer len' 4735 1.13 mrg 'integer(acc_handle_kind) :: async' 4736 1.13 mrg _Interface_: 'subroutine acc_delete_finalize(a)' 4737 1.13 mrg 'type, dimension(:[,:]...) :: a' 4738 1.13 mrg _Interface_: 'subroutine acc_delete_finalize(a, len)' 4739 1.13 mrg 'type, dimension(:[,:]...) :: a' 4740 1.13 mrg 'integer len' 4741 1.13 mrg _Interface_: 'subroutine acc_delete_async_finalize(a, async)' 4742 1.13 mrg 'type, dimension(:[,:]...) :: a' 4743 1.13 mrg 'integer(acc_handle_kind) :: async' 4744 1.13 mrg _Interface_: 'subroutine acc_delete_async_finalize(a, len, async)' 4745 1.13 mrg 'type, dimension(:[,:]...) :: a' 4746 1.13 mrg 'integer len' 4747 1.13 mrg 'integer(acc_handle_kind) :: async' 4748 1.8 mrg 4749 1.8 mrg _Reference_: 4750 1.13 mrg OpenACC specification v2.6 (https://www.openacc.org), section 4751 1.13 mrg 3.2.23. 4752 1.8 mrg 4753 1.8 mrg 4754 1.8 mrg File: libgomp.info, Node: acc_update_device, Next: acc_update_self, Prev: acc_delete, Up: OpenACC Runtime Library Routines 4755 1.8 mrg 4756 1.16 mrg 6.24 'acc_update_device' - Update device memory from mapped host memory. 4757 1.8 mrg ======================================================================== 4758 1.8 mrg 4759 1.8 mrg _Description_ 4760 1.8 mrg This function updates the device copy from the previously mapped 4761 1.8 mrg host memory. The host memory is specified with the host address A 4762 1.8 mrg and a length of LEN bytes. 4763 1.8 mrg 4764 1.11 mrg In Fortran, two (2) forms are supported. In the first form, A 4765 1.11 mrg specifies a contiguous array section. The second form A specifies 4766 1.8 mrg a variable or array element and LEN specifies the length in bytes. 4767 1.8 mrg 4768 1.8 mrg _C/C++_: 4769 1.11 mrg _Prototype_: 'acc_update_device(h_void *a, size_t len);' 4770 1.13 mrg _Prototype_: 'acc_update_device(h_void *a, size_t len, async);' 4771 1.8 mrg 4772 1.8 mrg _Fortran_: 4773 1.11 mrg _Interface_: 'subroutine acc_update_device(a)' 4774 1.11 mrg 'type, dimension(:[,:]...) :: a' 4775 1.11 mrg _Interface_: 'subroutine acc_update_device(a, len)' 4776 1.11 mrg 'type, dimension(:[,:]...) :: a' 4777 1.11 mrg 'integer len' 4778 1.13 mrg _Interface_: 'subroutine acc_update_device_async(a, async)' 4779 1.13 mrg 'type, dimension(:[,:]...) :: a' 4780 1.13 mrg 'integer(acc_handle_kind) :: async' 4781 1.13 mrg _Interface_: 'subroutine acc_update_device_async(a, len, async)' 4782 1.13 mrg 'type, dimension(:[,:]...) :: a' 4783 1.13 mrg 'integer len' 4784 1.13 mrg 'integer(acc_handle_kind) :: async' 4785 1.8 mrg 4786 1.8 mrg _Reference_: 4787 1.13 mrg OpenACC specification v2.6 (https://www.openacc.org), section 4788 1.13 mrg 3.2.24. 4789 1.8 mrg 4790 1.8 mrg 4791 1.8 mrg File: libgomp.info, Node: acc_update_self, Next: acc_map_data, Prev: acc_update_device, Up: OpenACC Runtime Library Routines 4792 1.8 mrg 4793 1.16 mrg 6.25 'acc_update_self' - Update host memory from mapped device memory. 4794 1.8 mrg ====================================================================== 4795 1.8 mrg 4796 1.8 mrg _Description_ 4797 1.8 mrg This function updates the host copy from the previously mapped 4798 1.8 mrg device memory. The host memory is specified with the host address 4799 1.8 mrg A and a length of LEN bytes. 4800 1.8 mrg 4801 1.11 mrg In Fortran, two (2) forms are supported. In the first form, A 4802 1.11 mrg specifies a contiguous array section. The second form A specifies 4803 1.8 mrg a variable or array element and LEN specifies the length in bytes. 4804 1.8 mrg 4805 1.8 mrg _C/C++_: 4806 1.11 mrg _Prototype_: 'acc_update_self(h_void *a, size_t len);' 4807 1.13 mrg _Prototype_: 'acc_update_self_async(h_void *a, size_t len, int 4808 1.13 mrg async);' 4809 1.8 mrg 4810 1.8 mrg _Fortran_: 4811 1.11 mrg _Interface_: 'subroutine acc_update_self(a)' 4812 1.11 mrg 'type, dimension(:[,:]...) :: a' 4813 1.11 mrg _Interface_: 'subroutine acc_update_self(a, len)' 4814 1.11 mrg 'type, dimension(:[,:]...) :: a' 4815 1.11 mrg 'integer len' 4816 1.13 mrg _Interface_: 'subroutine acc_update_self_async(a, async)' 4817 1.13 mrg 'type, dimension(:[,:]...) :: a' 4818 1.13 mrg 'integer(acc_handle_kind) :: async' 4819 1.13 mrg _Interface_: 'subroutine acc_update_self_async(a, len, async)' 4820 1.13 mrg 'type, dimension(:[,:]...) :: a' 4821 1.13 mrg 'integer len' 4822 1.13 mrg 'integer(acc_handle_kind) :: async' 4823 1.8 mrg 4824 1.8 mrg _Reference_: 4825 1.13 mrg OpenACC specification v2.6 (https://www.openacc.org), section 4826 1.13 mrg 3.2.25. 4827 1.8 mrg 4828 1.8 mrg 4829 1.8 mrg File: libgomp.info, Node: acc_map_data, Next: acc_unmap_data, Prev: acc_update_self, Up: OpenACC Runtime Library Routines 4830 1.8 mrg 4831 1.16 mrg 6.26 'acc_map_data' - Map previously allocated device memory to host memory. 4832 1.8 mrg ============================================================================ 4833 1.8 mrg 4834 1.8 mrg _Description_ 4835 1.8 mrg This function maps previously allocated device and host memory. 4836 1.19 mrg The device memory is specified with the device address DATA_DEV. 4837 1.19 mrg The host memory is specified with the host address DATA_ARG and a 4838 1.19 mrg length of BYTES. 4839 1.8 mrg 4840 1.8 mrg _C/C++_: 4841 1.19 mrg _Prototype_: 'void acc_map_data(h_void *data_arg, d_void *data_dev, 4842 1.19 mrg size_t bytes);' 4843 1.19 mrg 4844 1.19 mrg _Fortran_: 4845 1.19 mrg _Interface_: 'subroutine acc_map_data(data_arg, data_dev, bytes)' 4846 1.19 mrg 'type(*), dimension(*) :: data_arg' 4847 1.19 mrg 'type(c_ptr), value :: data_dev' 4848 1.19 mrg 'integer(c_size_t), value :: bytes' 4849 1.8 mrg 4850 1.8 mrg _Reference_: 4851 1.13 mrg OpenACC specification v2.6 (https://www.openacc.org), section 4852 1.19 mrg 3.2.26. OpenACC specification v3.3 (https://www.openacc.org), 4853 1.19 mrg section 3.2.21. 4854 1.8 mrg 4855 1.8 mrg 4856 1.8 mrg File: libgomp.info, Node: acc_unmap_data, Next: acc_deviceptr, Prev: acc_map_data, Up: OpenACC Runtime Library Routines 4857 1.8 mrg 4858 1.16 mrg 6.27 'acc_unmap_data' - Unmap device memory from host memory. 4859 1.8 mrg ============================================================= 4860 1.8 mrg 4861 1.8 mrg _Description_ 4862 1.11 mrg This function unmaps previously mapped device and host memory. The 4863 1.19 mrg latter specified by DATA_ARG. 4864 1.8 mrg 4865 1.8 mrg _C/C++_: 4866 1.19 mrg _Prototype_: 'void acc_unmap_data(h_void *data_arg);' 4867 1.19 mrg 4868 1.19 mrg _Fortran_: 4869 1.19 mrg _Interface_: 'subroutine acc_unmap_data(data_arg)' 4870 1.19 mrg 'type(*), dimension(*) :: data_arg' 4871 1.8 mrg 4872 1.8 mrg _Reference_: 4873 1.13 mrg OpenACC specification v2.6 (https://www.openacc.org), section 4874 1.19 mrg 3.2.27. OpenACC specification v3.3 (https://www.openacc.org), 4875 1.19 mrg section 3.2.22. 4876 1.8 mrg 4877 1.8 mrg 4878 1.8 mrg File: libgomp.info, Node: acc_deviceptr, Next: acc_hostptr, Prev: acc_unmap_data, Up: OpenACC Runtime Library Routines 4879 1.8 mrg 4880 1.16 mrg 6.28 'acc_deviceptr' - Get device pointer associated with specific host address. 4881 1.8 mrg ================================================================================ 4882 1.8 mrg 4883 1.8 mrg _Description_ 4884 1.8 mrg This function returns the device address that has been mapped to 4885 1.19 mrg the host address specified by DATA_ARG. 4886 1.8 mrg 4887 1.8 mrg _C/C++_: 4888 1.19 mrg _Prototype_: 'void *acc_deviceptr(h_void *data_arg);' 4889 1.19 mrg 4890 1.19 mrg _Fortran_: 4891 1.19 mrg _Interface_: 'type(c_ptr) function acc_deviceptr(data_arg)' 4892 1.19 mrg 'type(*), dimension(*) :: data_arg' 4893 1.8 mrg 4894 1.8 mrg _Reference_: 4895 1.13 mrg OpenACC specification v2.6 (https://www.openacc.org), section 4896 1.19 mrg 3.2.28. OpenACC specification v3.3 (https://www.openacc.org), 4897 1.19 mrg section 3.2.23. 4898 1.8 mrg 4899 1.8 mrg 4900 1.8 mrg File: libgomp.info, Node: acc_hostptr, Next: acc_is_present, Prev: acc_deviceptr, Up: OpenACC Runtime Library Routines 4901 1.8 mrg 4902 1.16 mrg 6.29 'acc_hostptr' - Get host pointer associated with specific device address. 4903 1.8 mrg ============================================================================== 4904 1.8 mrg 4905 1.8 mrg _Description_ 4906 1.8 mrg This function returns the host address that has been mapped to the 4907 1.19 mrg device address specified by DATA_DEV. 4908 1.8 mrg 4909 1.8 mrg _C/C++_: 4910 1.19 mrg _Prototype_: 'void *acc_hostptr(d_void *data_dev);' 4911 1.19 mrg 4912 1.19 mrg _Fortran_: 4913 1.19 mrg _Interface_: 'type(c_ptr) function acc_hostptr(data_dev)' 4914 1.19 mrg 'type(c_ptr), value :: data_dev' 4915 1.8 mrg 4916 1.8 mrg _Reference_: 4917 1.13 mrg OpenACC specification v2.6 (https://www.openacc.org), section 4918 1.19 mrg 3.2.29. OpenACC specification v3.3 (https://www.openacc.org), 4919 1.19 mrg section 3.2.24. 4920 1.8 mrg 4921 1.8 mrg 4922 1.8 mrg File: libgomp.info, Node: acc_is_present, Next: acc_memcpy_to_device, Prev: acc_hostptr, Up: OpenACC Runtime Library Routines 4923 1.8 mrg 4924 1.16 mrg 6.30 'acc_is_present' - Indicate whether host variable / array is present on device. 4925 1.8 mrg ==================================================================================== 4926 1.8 mrg 4927 1.8 mrg _Description_ 4928 1.11 mrg This function indicates whether the specified host address in A and 4929 1.11 mrg a length of LEN bytes is present on the device. In C/C++, a 4930 1.8 mrg non-zero value is returned to indicate the presence of the mapped 4931 1.11 mrg memory on the device. A zero is returned to indicate the memory is 4932 1.8 mrg not mapped on the device. 4933 1.8 mrg 4934 1.11 mrg In Fortran, two (2) forms are supported. In the first form, A 4935 1.11 mrg specifies a contiguous array section. The second form A specifies 4936 1.8 mrg a variable or array element and LEN specifies the length in bytes. 4937 1.11 mrg If the host memory is mapped to device memory, then a 'true' is 4938 1.11 mrg returned. Otherwise, a 'false' is return to indicate the mapped 4939 1.8 mrg memory is not present. 4940 1.8 mrg 4941 1.8 mrg _C/C++_: 4942 1.11 mrg _Prototype_: 'int acc_is_present(h_void *a, size_t len);' 4943 1.8 mrg 4944 1.8 mrg _Fortran_: 4945 1.11 mrg _Interface_: 'function acc_is_present(a)' 4946 1.11 mrg 'type, dimension(:[,:]...) :: a' 4947 1.11 mrg 'logical acc_is_present' 4948 1.11 mrg _Interface_: 'function acc_is_present(a, len)' 4949 1.11 mrg 'type, dimension(:[,:]...) :: a' 4950 1.11 mrg 'integer len' 4951 1.11 mrg 'logical acc_is_present' 4952 1.8 mrg 4953 1.8 mrg _Reference_: 4954 1.13 mrg OpenACC specification v2.6 (https://www.openacc.org), section 4955 1.13 mrg 3.2.30. 4956 1.8 mrg 4957 1.8 mrg 4958 1.8 mrg File: libgomp.info, Node: acc_memcpy_to_device, Next: acc_memcpy_from_device, Prev: acc_is_present, Up: OpenACC Runtime Library Routines 4959 1.8 mrg 4960 1.16 mrg 6.31 'acc_memcpy_to_device' - Copy host memory to device memory. 4961 1.8 mrg ================================================================ 4962 1.8 mrg 4963 1.8 mrg _Description_ 4964 1.19 mrg This function copies host memory specified by host address of 4965 1.19 mrg DATA_HOST_SRC to device memory specified by the device address 4966 1.19 mrg DATA_DEV_DEST for a length of BYTES bytes. 4967 1.19 mrg 4968 1.19 mrg _C/C++_: 4969 1.19 mrg _Prototype_: 'void acc_memcpy_to_device(d_void* data_dev_dest,' 4970 1.19 mrg 'h_void* data_host_src, size_t bytes);' 4971 1.19 mrg _Prototype_: 'void acc_memcpy_to_device_async(d_void* data_dev_dest,' 4972 1.19 mrg 'h_void* data_host_src, size_t bytes, int async_arg);' 4973 1.19 mrg 4974 1.19 mrg _Fortran_: 4975 1.19 mrg _Interface_: 'subroutine acc_memcpy_to_device(data_dev_dest, &' 4976 1.19 mrg 'data_host_src, bytes)' 4977 1.19 mrg _Interface_: 'subroutine acc_memcpy_to_device_async(data_dev_dest, &' 4978 1.19 mrg 'data_host_src, bytes, async_arg)' 4979 1.19 mrg 'type(c_ptr), value :: data_dev_dest' 4980 1.19 mrg 'type(*), dimension(*) :: data_host_src' 4981 1.19 mrg 'integer(c_size_t), value :: bytes' 4982 1.19 mrg 'integer(acc_handle_kind), value :: async_arg' 4983 1.8 mrg 4984 1.8 mrg _Reference_: 4985 1.13 mrg OpenACC specification v2.6 (https://www.openacc.org), section 4986 1.19 mrg 3.2.31 OpenACC specification v3.3 (https://www.openacc.org), 4987 1.19 mrg section 3.2.26. 4988 1.8 mrg 4989 1.8 mrg 4990 1.13 mrg File: libgomp.info, Node: acc_memcpy_from_device, Next: acc_attach, Prev: acc_memcpy_to_device, Up: OpenACC Runtime Library Routines 4991 1.8 mrg 4992 1.16 mrg 6.32 'acc_memcpy_from_device' - Copy device memory to host memory. 4993 1.8 mrg ================================================================== 4994 1.8 mrg 4995 1.8 mrg _Description_ 4996 1.19 mrg This function copies device memory specified by device address of 4997 1.19 mrg DATA_DEV_SRC to host memory specified by the host address 4998 1.19 mrg DATA_HOST_DEST for a length of BYTES bytes. 4999 1.19 mrg 5000 1.19 mrg _C/C++_: 5001 1.19 mrg _Prototype_: 'void acc_memcpy_from_device(h_void* data_host_dest,' 5002 1.19 mrg 'd_void* data_dev_src, size_t bytes);' 5003 1.19 mrg _Prototype_: 'void acc_memcpy_from_device_async(h_void* 5004 1.19 mrg data_host_dest,' 5005 1.19 mrg 'd_void* data_dev_src, size_t bytes, int async_arg);' 5006 1.19 mrg 5007 1.19 mrg _Fortran_: 5008 1.19 mrg _Interface_: 'subroutine acc_memcpy_from_device(data_host_dest, &' 5009 1.19 mrg 'data_dev_src, bytes)' 5010 1.19 mrg _Interface_: 'subroutine acc_memcpy_from_device_async(data_host_dest, 5011 1.19 mrg &' 5012 1.19 mrg 'data_dev_src, bytes, async_arg)' 5013 1.19 mrg 'type(*), dimension(*) :: data_host_dest' 5014 1.19 mrg 'type(c_ptr), value :: data_dev_src' 5015 1.19 mrg 'integer(c_size_t), value :: bytes' 5016 1.19 mrg 'integer(acc_handle_kind), value :: async_arg' 5017 1.8 mrg 5018 1.8 mrg _Reference_: 5019 1.13 mrg OpenACC specification v2.6 (https://www.openacc.org), section 5020 1.19 mrg 3.2.32. OpenACC specification v3.3 (https://www.openacc.org), 5021 1.19 mrg section 3.2.27. 5022 1.13 mrg 5023 1.13 mrg 5024 1.13 mrg File: libgomp.info, Node: acc_attach, Next: acc_detach, Prev: acc_memcpy_from_device, Up: OpenACC Runtime Library Routines 5025 1.13 mrg 5026 1.16 mrg 6.33 'acc_attach' - Let device pointer point to device-pointer target. 5027 1.13 mrg ====================================================================== 5028 1.13 mrg 5029 1.13 mrg _Description_ 5030 1.13 mrg This function updates a pointer on the device from pointing to a 5031 1.13 mrg host-pointer address to pointing to the corresponding device data. 5032 1.13 mrg 5033 1.13 mrg _C/C++_: 5034 1.19 mrg _Prototype_: 'void acc_attach(h_void **ptr_addr);' 5035 1.19 mrg _Prototype_: 'void acc_attach_async(h_void **ptr_addr, int async);' 5036 1.13 mrg 5037 1.13 mrg _Reference_: 5038 1.13 mrg OpenACC specification v2.6 (https://www.openacc.org), section 5039 1.13 mrg 3.2.34. 5040 1.13 mrg 5041 1.13 mrg 5042 1.13 mrg File: libgomp.info, Node: acc_detach, Next: acc_get_current_cuda_device, Prev: acc_attach, Up: OpenACC Runtime Library Routines 5043 1.13 mrg 5044 1.16 mrg 6.34 'acc_detach' - Let device pointer point to host-pointer target. 5045 1.13 mrg ==================================================================== 5046 1.13 mrg 5047 1.13 mrg _Description_ 5048 1.13 mrg This function updates a pointer on the device from pointing to a 5049 1.13 mrg device-pointer address to pointing to the corresponding host data. 5050 1.13 mrg 5051 1.13 mrg _C/C++_: 5052 1.19 mrg _Prototype_: 'void acc_detach(h_void **ptr_addr);' 5053 1.19 mrg _Prototype_: 'void acc_detach_async(h_void **ptr_addr, int async);' 5054 1.19 mrg _Prototype_: 'void acc_detach_finalize(h_void **ptr_addr);' 5055 1.19 mrg _Prototype_: 'void acc_detach_finalize_async(h_void **ptr_addr, int 5056 1.19 mrg async);' 5057 1.13 mrg 5058 1.13 mrg _Reference_: 5059 1.13 mrg OpenACC specification v2.6 (https://www.openacc.org), section 5060 1.13 mrg 3.2.35. 5061 1.8 mrg 5062 1.8 mrg 5063 1.13 mrg File: libgomp.info, Node: acc_get_current_cuda_device, Next: acc_get_current_cuda_context, Prev: acc_detach, Up: OpenACC Runtime Library Routines 5064 1.8 mrg 5065 1.16 mrg 6.35 'acc_get_current_cuda_device' - Get CUDA device handle. 5066 1.8 mrg ============================================================ 5067 1.8 mrg 5068 1.8 mrg _Description_ 5069 1.11 mrg This function returns the CUDA device handle. This handle is the 5070 1.8 mrg same as used by the CUDA Runtime or Driver API's. 5071 1.8 mrg 5072 1.8 mrg _C/C++_: 5073 1.11 mrg _Prototype_: 'void *acc_get_current_cuda_device(void);' 5074 1.8 mrg 5075 1.8 mrg _Reference_: 5076 1.13 mrg OpenACC specification v2.6 (https://www.openacc.org), section 5077 1.8 mrg A.2.1.1. 5078 1.8 mrg 5079 1.8 mrg 5080 1.8 mrg File: libgomp.info, Node: acc_get_current_cuda_context, Next: acc_get_cuda_stream, Prev: acc_get_current_cuda_device, Up: OpenACC Runtime Library Routines 5081 1.8 mrg 5082 1.16 mrg 6.36 'acc_get_current_cuda_context' - Get CUDA context handle. 5083 1.8 mrg ============================================================== 5084 1.8 mrg 5085 1.8 mrg _Description_ 5086 1.11 mrg This function returns the CUDA context handle. This handle is the 5087 1.8 mrg same as used by the CUDA Runtime or Driver API's. 5088 1.8 mrg 5089 1.8 mrg _C/C++_: 5090 1.12 mrg _Prototype_: 'void *acc_get_current_cuda_context(void);' 5091 1.8 mrg 5092 1.8 mrg _Reference_: 5093 1.13 mrg OpenACC specification v2.6 (https://www.openacc.org), section 5094 1.8 mrg A.2.1.2. 5095 1.8 mrg 5096 1.8 mrg 5097 1.8 mrg File: libgomp.info, Node: acc_get_cuda_stream, Next: acc_set_cuda_stream, Prev: acc_get_current_cuda_context, Up: OpenACC Runtime Library Routines 5098 1.8 mrg 5099 1.16 mrg 6.37 'acc_get_cuda_stream' - Get CUDA stream handle. 5100 1.8 mrg ==================================================== 5101 1.8 mrg 5102 1.8 mrg _Description_ 5103 1.12 mrg This function returns the CUDA stream handle for the queue ASYNC. 5104 1.12 mrg This handle is the same as used by the CUDA Runtime or Driver 5105 1.12 mrg API's. 5106 1.8 mrg 5107 1.8 mrg _C/C++_: 5108 1.12 mrg _Prototype_: 'void *acc_get_cuda_stream(int async);' 5109 1.8 mrg 5110 1.8 mrg _Reference_: 5111 1.13 mrg OpenACC specification v2.6 (https://www.openacc.org), section 5112 1.8 mrg A.2.1.3. 5113 1.8 mrg 5114 1.8 mrg 5115 1.13 mrg File: libgomp.info, Node: acc_set_cuda_stream, Next: acc_prof_register, Prev: acc_get_cuda_stream, Up: OpenACC Runtime Library Routines 5116 1.8 mrg 5117 1.16 mrg 6.38 'acc_set_cuda_stream' - Set CUDA stream handle. 5118 1.8 mrg ==================================================== 5119 1.8 mrg 5120 1.8 mrg _Description_ 5121 1.8 mrg This function associates the stream handle specified by STREAM with 5122 1.12 mrg the queue ASYNC. 5123 1.12 mrg 5124 1.12 mrg This cannot be used to change the stream handle associated with 5125 1.12 mrg 'acc_async_sync'. 5126 1.12 mrg 5127 1.12 mrg The return value is not specified. 5128 1.8 mrg 5129 1.8 mrg _C/C++_: 5130 1.12 mrg _Prototype_: 'int acc_set_cuda_stream(int async, void *stream);' 5131 1.8 mrg 5132 1.8 mrg _Reference_: 5133 1.13 mrg OpenACC specification v2.6 (https://www.openacc.org), section 5134 1.8 mrg A.2.1.4. 5135 1.8 mrg 5136 1.8 mrg 5137 1.13 mrg File: libgomp.info, Node: acc_prof_register, Next: acc_prof_unregister, Prev: acc_set_cuda_stream, Up: OpenACC Runtime Library Routines 5138 1.13 mrg 5139 1.16 mrg 6.39 'acc_prof_register' - Register callbacks. 5140 1.13 mrg ============================================== 5141 1.13 mrg 5142 1.13 mrg _Description_: 5143 1.13 mrg This function registers callbacks. 5144 1.13 mrg 5145 1.13 mrg _C/C++_: 5146 1.13 mrg _Prototype_: 'void acc_prof_register (acc_event_t, acc_prof_callback, 5147 1.13 mrg acc_register_t);' 5148 1.13 mrg 5149 1.13 mrg _See also_: 5150 1.13 mrg *note OpenACC Profiling Interface:: 5151 1.13 mrg 5152 1.13 mrg _Reference_: 5153 1.13 mrg OpenACC specification v2.6 (https://www.openacc.org), section 5.3. 5154 1.13 mrg 5155 1.13 mrg 5156 1.13 mrg File: libgomp.info, Node: acc_prof_unregister, Next: acc_prof_lookup, Prev: acc_prof_register, Up: OpenACC Runtime Library Routines 5157 1.13 mrg 5158 1.16 mrg 6.40 'acc_prof_unregister' - Unregister callbacks. 5159 1.13 mrg ================================================== 5160 1.13 mrg 5161 1.13 mrg _Description_: 5162 1.13 mrg This function unregisters callbacks. 5163 1.13 mrg 5164 1.13 mrg _C/C++_: 5165 1.13 mrg _Prototype_: 'void acc_prof_unregister (acc_event_t, 5166 1.13 mrg acc_prof_callback, acc_register_t);' 5167 1.13 mrg 5168 1.13 mrg _See also_: 5169 1.13 mrg *note OpenACC Profiling Interface:: 5170 1.13 mrg 5171 1.13 mrg _Reference_: 5172 1.13 mrg OpenACC specification v2.6 (https://www.openacc.org), section 5.3. 5173 1.13 mrg 5174 1.13 mrg 5175 1.13 mrg File: libgomp.info, Node: acc_prof_lookup, Next: acc_register_library, Prev: acc_prof_unregister, Up: OpenACC Runtime Library Routines 5176 1.13 mrg 5177 1.16 mrg 6.41 'acc_prof_lookup' - Obtain inquiry functions. 5178 1.13 mrg ================================================== 5179 1.13 mrg 5180 1.13 mrg _Description_: 5181 1.13 mrg Function to obtain inquiry functions. 5182 1.13 mrg 5183 1.13 mrg _C/C++_: 5184 1.13 mrg _Prototype_: 'acc_query_fn acc_prof_lookup (const char *);' 5185 1.13 mrg 5186 1.13 mrg _See also_: 5187 1.13 mrg *note OpenACC Profiling Interface:: 5188 1.13 mrg 5189 1.13 mrg _Reference_: 5190 1.13 mrg OpenACC specification v2.6 (https://www.openacc.org), section 5.3. 5191 1.13 mrg 5192 1.13 mrg 5193 1.13 mrg File: libgomp.info, Node: acc_register_library, Prev: acc_prof_lookup, Up: OpenACC Runtime Library Routines 5194 1.13 mrg 5195 1.16 mrg 6.42 'acc_register_library' - Library registration. 5196 1.13 mrg =================================================== 5197 1.13 mrg 5198 1.13 mrg _Description_: 5199 1.13 mrg Function for library registration. 5200 1.13 mrg 5201 1.13 mrg _C/C++_: 5202 1.13 mrg _Prototype_: 'void acc_register_library (acc_prof_reg, acc_prof_reg, 5203 1.13 mrg acc_prof_lookup_func);' 5204 1.13 mrg 5205 1.13 mrg _See also_: 5206 1.13 mrg *note OpenACC Profiling Interface::, *note ACC_PROFLIB:: 5207 1.13 mrg 5208 1.13 mrg _Reference_: 5209 1.13 mrg OpenACC specification v2.6 (https://www.openacc.org), section 5.3. 5210 1.13 mrg 5211 1.13 mrg 5212 1.8 mrg File: libgomp.info, Node: OpenACC Environment Variables, Next: CUDA Streams Usage, Prev: OpenACC Runtime Library Routines, Up: Top 5213 1.8 mrg 5214 1.16 mrg 7 OpenACC Environment Variables 5215 1.8 mrg ******************************* 5216 1.8 mrg 5217 1.11 mrg The variables 'ACC_DEVICE_TYPE' and 'ACC_DEVICE_NUM' are defined by 5218 1.8 mrg section 4 of the OpenACC specification in version 2.0. The variable 5219 1.13 mrg 'ACC_PROFLIB' is defined by section 4 of the OpenACC specification in 5220 1.19 mrg version 2.6. 5221 1.8 mrg 5222 1.8 mrg * Menu: 5223 1.8 mrg 5224 1.8 mrg * ACC_DEVICE_TYPE:: 5225 1.8 mrg * ACC_DEVICE_NUM:: 5226 1.13 mrg * ACC_PROFLIB:: 5227 1.8 mrg 5228 1.8 mrg 5229 1.8 mrg File: libgomp.info, Node: ACC_DEVICE_TYPE, Next: ACC_DEVICE_NUM, Up: OpenACC Environment Variables 5230 1.8 mrg 5231 1.16 mrg 7.1 'ACC_DEVICE_TYPE' 5232 1.8 mrg ===================== 5233 1.8 mrg 5234 1.19 mrg _Description_: 5235 1.19 mrg Control the default device type to use when executing compute 5236 1.19 mrg regions. If unset, the code can be run on any device type, 5237 1.19 mrg favoring a non-host device type. 5238 1.19 mrg 5239 1.19 mrg Supported values in GCC (if compiled in) are 5240 1.19 mrg * 'host' 5241 1.19 mrg * 'nvidia' 5242 1.19 mrg * 'radeon' 5243 1.8 mrg _Reference_: 5244 1.13 mrg OpenACC specification v2.6 (https://www.openacc.org), section 4.1. 5245 1.8 mrg 5246 1.8 mrg 5247 1.13 mrg File: libgomp.info, Node: ACC_DEVICE_NUM, Next: ACC_PROFLIB, Prev: ACC_DEVICE_TYPE, Up: OpenACC Environment Variables 5248 1.8 mrg 5249 1.16 mrg 7.2 'ACC_DEVICE_NUM' 5250 1.8 mrg ==================== 5251 1.8 mrg 5252 1.19 mrg _Description_: 5253 1.19 mrg Control which device, identified by device number, is the default 5254 1.19 mrg device. The value must be a nonnegative integer less than the 5255 1.19 mrg number of devices. If unset, device number zero is used. 5256 1.8 mrg _Reference_: 5257 1.13 mrg OpenACC specification v2.6 (https://www.openacc.org), section 4.2. 5258 1.13 mrg 5259 1.13 mrg 5260 1.19 mrg File: libgomp.info, Node: ACC_PROFLIB, Prev: ACC_DEVICE_NUM, Up: OpenACC Environment Variables 5261 1.13 mrg 5262 1.16 mrg 7.3 'ACC_PROFLIB' 5263 1.13 mrg ================= 5264 1.13 mrg 5265 1.19 mrg _Description_: 5266 1.19 mrg Semicolon-separated list of dynamic libraries that are loaded as 5267 1.19 mrg profiling libraries. Each library must provide at least the 5268 1.19 mrg 'acc_register_library' routine. Each library file is found as 5269 1.19 mrg described by the documentation of 'dlopen' of your operating 5270 1.19 mrg system. 5271 1.13 mrg _See also_: 5272 1.13 mrg *note acc_register_library::, *note OpenACC Profiling Interface:: 5273 1.13 mrg 5274 1.13 mrg _Reference_: 5275 1.13 mrg OpenACC specification v2.6 (https://www.openacc.org), section 4.3. 5276 1.8 mrg 5277 1.8 mrg 5278 1.8 mrg File: libgomp.info, Node: CUDA Streams Usage, Next: OpenACC Library Interoperability, Prev: OpenACC Environment Variables, Up: Top 5279 1.8 mrg 5280 1.16 mrg 8 CUDA Streams Usage 5281 1.8 mrg ******************** 5282 1.8 mrg 5283 1.11 mrg This applies to the 'nvptx' plugin only. 5284 1.8 mrg 5285 1.8 mrg The library provides elements that perform asynchronous movement of 5286 1.8 mrg data and asynchronous operation of computing constructs. This 5287 1.8 mrg asynchronous functionality is implemented by making use of CUDA 5288 1.8 mrg streams(1). 5289 1.8 mrg 5290 1.13 mrg The primary means by that the asynchronous functionality is accessed 5291 1.8 mrg is through the use of those OpenACC directives which make use of the 5292 1.11 mrg 'async' and 'wait' clauses. When the 'async' clause is first used with 5293 1.11 mrg a directive, it creates a CUDA stream. If an 'async-argument' is used 5294 1.11 mrg with the 'async' clause, then the stream is associated with the 5295 1.11 mrg specified 'async-argument'. 5296 1.8 mrg 5297 1.8 mrg Following the creation of an association between a CUDA stream and 5298 1.11 mrg the 'async-argument' of an 'async' clause, both the 'wait' clause and 5299 1.11 mrg the 'wait' directive can be used. When either the clause or directive 5300 1.8 mrg is used after stream creation, it creates a rendezvous point whereby 5301 1.8 mrg execution waits until all operations associated with the 5302 1.11 mrg 'async-argument', that is, stream, have completed. 5303 1.8 mrg 5304 1.8 mrg Normally, the management of the streams that are created as a result 5305 1.11 mrg of using the 'async' clause, is done without any intervention by the 5306 1.11 mrg caller. This implies the association between the 'async-argument' and 5307 1.19 mrg the CUDA stream is maintained for the lifetime of the program. However, 5308 1.19 mrg this association can be changed through the use of the library function 5309 1.19 mrg 'acc_set_cuda_stream'. When the function 'acc_set_cuda_stream' is 5310 1.19 mrg called, the CUDA stream that was originally associated with the 'async' 5311 1.19 mrg clause is destroyed. Caution should be taken when changing the 5312 1.19 mrg association as subsequent references to the 'async-argument' refer to a 5313 1.19 mrg different CUDA stream. 5314 1.8 mrg 5315 1.8 mrg ---------- Footnotes ---------- 5316 1.8 mrg 5317 1.8 mrg (1) See "Stream Management" in "CUDA Driver API", TRM-06703-001, 5318 1.8 mrg Version 5.5, for additional information 5319 1.8 mrg 5320 1.8 mrg 5321 1.13 mrg File: libgomp.info, Node: OpenACC Library Interoperability, Next: OpenACC Profiling Interface, Prev: CUDA Streams Usage, Up: Top 5322 1.8 mrg 5323 1.16 mrg 9 OpenACC Library Interoperability 5324 1.8 mrg ********************************** 5325 1.8 mrg 5326 1.16 mrg 9.1 Introduction 5327 1.8 mrg ================ 5328 1.8 mrg 5329 1.8 mrg The OpenACC library uses the CUDA Driver API, and may interact with 5330 1.11 mrg programs that use the Runtime library directly, or another library based 5331 1.11 mrg on the Runtime library, e.g., CUBLAS(1). This chapter describes the use 5332 1.11 mrg cases and what changes are required in order to use both the OpenACC 5333 1.11 mrg library and the CUBLAS and Runtime libraries within a program. 5334 1.8 mrg 5335 1.16 mrg 9.2 First invocation: NVIDIA CUBLAS library API 5336 1.8 mrg =============================================== 5337 1.8 mrg 5338 1.8 mrg In this first use case (see below), a function in the CUBLAS library is 5339 1.11 mrg called prior to any of the functions in the OpenACC library. More 5340 1.11 mrg specifically, the function 'cublasCreate()'. 5341 1.8 mrg 5342 1.8 mrg When invoked, the function initializes the library and allocates the 5343 1.8 mrg hardware resources on the host and the device on behalf of the caller. 5344 1.8 mrg Once the initialization and allocation has completed, a handle is 5345 1.11 mrg returned to the caller. The OpenACC library also requires 5346 1.11 mrg initialization and allocation of hardware resources. Since the CUBLAS 5347 1.11 mrg library has already allocated the hardware resources for the device, all 5348 1.11 mrg that is left to do is to initialize the OpenACC library and acquire the 5349 1.11 mrg hardware resources on the host. 5350 1.8 mrg 5351 1.8 mrg Prior to calling the OpenACC function that initializes the library 5352 1.11 mrg and allocate the host hardware resources, you need to acquire the device 5353 1.11 mrg number that was allocated during the call to 'cublasCreate()'. The 5354 1.11 mrg invoking of the runtime library function 'cudaGetDevice()' accomplishes 5355 1.11 mrg this. Once acquired, the device number is passed along with the device 5356 1.11 mrg type as parameters to the OpenACC library function 5357 1.11 mrg 'acc_set_device_num()'. 5358 1.11 mrg 5359 1.11 mrg Once the call to 'acc_set_device_num()' has completed, the OpenACC 5360 1.11 mrg library uses the context that was created during the call to 5361 1.19 mrg 'cublasCreate()'. In other words, both libraries share the same 5362 1.19 mrg context. 5363 1.8 mrg 5364 1.8 mrg /* Create the handle */ 5365 1.8 mrg s = cublasCreate(&h); 5366 1.8 mrg if (s != CUBLAS_STATUS_SUCCESS) 5367 1.8 mrg { 5368 1.8 mrg fprintf(stderr, "cublasCreate failed %d\n", s); 5369 1.8 mrg exit(EXIT_FAILURE); 5370 1.8 mrg } 5371 1.8 mrg 5372 1.8 mrg /* Get the device number */ 5373 1.8 mrg e = cudaGetDevice(&dev); 5374 1.8 mrg if (e != cudaSuccess) 5375 1.8 mrg { 5376 1.8 mrg fprintf(stderr, "cudaGetDevice failed %d\n", e); 5377 1.8 mrg exit(EXIT_FAILURE); 5378 1.8 mrg } 5379 1.8 mrg 5380 1.8 mrg /* Initialize OpenACC library and use device 'dev' */ 5381 1.8 mrg acc_set_device_num(dev, acc_device_nvidia); 5382 1.11 mrg 5383 1.11 mrg Use Case 1 5384 1.8 mrg 5385 1.16 mrg 9.3 First invocation: OpenACC library API 5386 1.8 mrg ========================================= 5387 1.8 mrg 5388 1.8 mrg In this second use case (see below), a function in the OpenACC library 5389 1.11 mrg is called prior to any of the functions in the CUBLAS library. More 5390 1.19 mrg specifically, the function 'acc_set_device_num()'. 5391 1.8 mrg 5392 1.11 mrg In the use case presented here, the function 'acc_set_device_num()' 5393 1.8 mrg is used to both initialize the OpenACC library and allocate the hardware 5394 1.11 mrg resources on the host and the device. In the call to the function, the 5395 1.11 mrg call parameters specify which device to use and what device type to use, 5396 1.11 mrg i.e., 'acc_device_nvidia'. It should be noted that this is but one 5397 1.8 mrg method to initialize the OpenACC library and allocate the appropriate 5398 1.11 mrg hardware resources. Other methods are available through the use of 5399 1.19 mrg environment variables and these is discussed in the next section. 5400 1.8 mrg 5401 1.11 mrg Once the call to 'acc_set_device_num()' has completed, other OpenACC 5402 1.8 mrg functions can be called as seen with multiple calls being made to 5403 1.11 mrg 'acc_copyin()'. In addition, calls can be made to functions in the 5404 1.11 mrg CUBLAS library. In the use case a call to 'cublasCreate()' is made 5405 1.11 mrg subsequent to the calls to 'acc_copyin()'. As seen in the previous use 5406 1.11 mrg case, a call to 'cublasCreate()' initializes the CUBLAS library and 5407 1.8 mrg allocates the hardware resources on the host and the device. However, 5408 1.19 mrg since the device has already been allocated, 'cublasCreate()' only 5409 1.19 mrg initializes the CUBLAS library and allocates the appropriate hardware 5410 1.11 mrg resources on the host. The context that was created as part of the 5411 1.8 mrg OpenACC initialization is shared with the CUBLAS library, similarly to 5412 1.8 mrg the first use case. 5413 1.8 mrg 5414 1.8 mrg dev = 0; 5415 1.8 mrg 5416 1.8 mrg acc_set_device_num(dev, acc_device_nvidia); 5417 1.8 mrg 5418 1.8 mrg /* Copy the first set to the device */ 5419 1.8 mrg d_X = acc_copyin(&h_X[0], N * sizeof (float)); 5420 1.8 mrg if (d_X == NULL) 5421 1.8 mrg { 5422 1.8 mrg fprintf(stderr, "copyin error h_X\n"); 5423 1.8 mrg exit(EXIT_FAILURE); 5424 1.8 mrg } 5425 1.8 mrg 5426 1.8 mrg /* Copy the second set to the device */ 5427 1.8 mrg d_Y = acc_copyin(&h_Y1[0], N * sizeof (float)); 5428 1.8 mrg if (d_Y == NULL) 5429 1.8 mrg { 5430 1.8 mrg fprintf(stderr, "copyin error h_Y1\n"); 5431 1.8 mrg exit(EXIT_FAILURE); 5432 1.8 mrg } 5433 1.8 mrg 5434 1.8 mrg /* Create the handle */ 5435 1.8 mrg s = cublasCreate(&h); 5436 1.8 mrg if (s != CUBLAS_STATUS_SUCCESS) 5437 1.8 mrg { 5438 1.8 mrg fprintf(stderr, "cublasCreate failed %d\n", s); 5439 1.8 mrg exit(EXIT_FAILURE); 5440 1.8 mrg } 5441 1.8 mrg 5442 1.8 mrg /* Perform saxpy using CUBLAS library function */ 5443 1.8 mrg s = cublasSaxpy(h, N, &alpha, d_X, 1, d_Y, 1); 5444 1.8 mrg if (s != CUBLAS_STATUS_SUCCESS) 5445 1.8 mrg { 5446 1.8 mrg fprintf(stderr, "cublasSaxpy failed %d\n", s); 5447 1.8 mrg exit(EXIT_FAILURE); 5448 1.8 mrg } 5449 1.8 mrg 5450 1.8 mrg /* Copy the results from the device */ 5451 1.8 mrg acc_memcpy_from_device(&h_Y1[0], d_Y, N * sizeof (float)); 5452 1.11 mrg 5453 1.11 mrg Use Case 2 5454 1.8 mrg 5455 1.16 mrg 9.4 OpenACC library and environment variables 5456 1.8 mrg ============================================= 5457 1.8 mrg 5458 1.8 mrg There are two environment variables associated with the OpenACC library 5459 1.8 mrg that may be used to control the device type and device number: 5460 1.13 mrg 'ACC_DEVICE_TYPE' and 'ACC_DEVICE_NUM', respectively. These two 5461 1.13 mrg environment variables can be used as an alternative to calling 5462 1.11 mrg 'acc_set_device_num()'. As seen in the second use case, the device type 5463 1.11 mrg and device number were specified using 'acc_set_device_num()'. If 5464 1.8 mrg however, the aforementioned environment variables were set, then the 5465 1.11 mrg call to 'acc_set_device_num()' would not be required. 5466 1.8 mrg 5467 1.11 mrg The use of the environment variables is only relevant when an OpenACC 5468 1.11 mrg function is called prior to a call to 'cudaCreate()'. If 'cudaCreate()' 5469 1.11 mrg is called prior to a call to an OpenACC function, then you must call 5470 1.11 mrg 'acc_set_device_num()'(2) 5471 1.8 mrg 5472 1.8 mrg ---------- Footnotes ---------- 5473 1.8 mrg 5474 1.8 mrg (1) See section 2.26, "Interactions with the CUDA Driver API" in 5475 1.8 mrg "CUDA Runtime API", Version 5.5, and section 2.27, "VDPAU 5476 1.11 mrg Interoperability", in "CUDA Driver API", TRM-06703-001, Version 5.5, for 5477 1.11 mrg additional information on library interoperability. 5478 1.8 mrg 5479 1.11 mrg (2) More complete information about 'ACC_DEVICE_TYPE' and 5480 1.11 mrg 'ACC_DEVICE_NUM' can be found in sections 4.1 and 4.2 of the OpenACC 5481 1.11 mrg (https://www.openacc.org) Application Programming Interface, Version 5482 1.13 mrg 2.6. 5483 1.8 mrg 5484 1.8 mrg 5485 1.19 mrg File: libgomp.info, Node: OpenACC Profiling Interface, Next: OpenMP-Implementation Specifics, Prev: OpenACC Library Interoperability, Up: Top 5486 1.13 mrg 5487 1.16 mrg 10 OpenACC Profiling Interface 5488 1.16 mrg ****************************** 5489 1.13 mrg 5490 1.16 mrg 10.1 Implementation Status and Implementation-Defined Behavior 5491 1.16 mrg ============================================================== 5492 1.8 mrg 5493 1.13 mrg We're implementing the OpenACC Profiling Interface as defined by the 5494 1.13 mrg OpenACC 2.6 specification. We're clarifying some aspects here as 5495 1.13 mrg _implementation-defined behavior_, while they're still under discussion 5496 1.13 mrg within the OpenACC Technical Committee. 5497 1.13 mrg 5498 1.13 mrg This implementation is tuned to keep the performance impact as low as 5499 1.13 mrg possible for the (very common) case that the Profiling Interface is not 5500 1.13 mrg enabled. This is relevant, as the Profiling Interface affects all the 5501 1.13 mrg _hot_ code paths (in the target code, not in the offloaded code). Users 5502 1.13 mrg of the OpenACC Profiling Interface can be expected to understand that 5503 1.19 mrg performance is impacted to some degree once the Profiling Interface is 5504 1.19 mrg enabled: for example, because of the _runtime_ (libgomp) calling into a 5505 1.19 mrg third-party _library_ for every event that has been registered. 5506 1.13 mrg 5507 1.13 mrg We're not yet accounting for the fact that 'OpenACC events may occur 5508 1.13 mrg during event processing'. We just handle one case specially, as 5509 1.13 mrg required by CUDA 9.0 'nvprof', that 'acc_get_device_type' (*note 5510 1.13 mrg acc_get_device_type::)) may be called from 'acc_ev_device_init_start', 5511 1.13 mrg 'acc_ev_device_init_end' callbacks. 5512 1.13 mrg 5513 1.13 mrg We're not yet implementing initialization via a 5514 1.13 mrg 'acc_register_library' function that is either statically linked in, or 5515 1.13 mrg dynamically via 'LD_PRELOAD'. Initialization via 'acc_register_library' 5516 1.13 mrg functions dynamically loaded via the 'ACC_PROFLIB' environment variable 5517 1.13 mrg does work, as does directly calling 'acc_prof_register', 5518 1.13 mrg 'acc_prof_unregister', 'acc_prof_lookup'. 5519 1.13 mrg 5520 1.13 mrg As currently there are no inquiry functions defined, calls to 5521 1.19 mrg 'acc_prof_lookup' always returns 'NULL'. 5522 1.13 mrg 5523 1.13 mrg There aren't separate _start_, _stop_ events defined for the event 5524 1.13 mrg types 'acc_ev_create', 'acc_ev_delete', 'acc_ev_alloc', 'acc_ev_free'. 5525 1.13 mrg It's not clear if these should be triggered before or after the actual 5526 1.13 mrg device-specific call is made. We trigger them after. 5527 1.13 mrg 5528 1.13 mrg Remarks about data provided to callbacks: 5529 1.13 mrg 5530 1.13 mrg 'acc_prof_info.event_type' 5531 1.13 mrg It's not clear if for _nested_ event callbacks (for example, 5532 1.13 mrg 'acc_ev_enqueue_launch_start' as part of a parent compute 5533 1.13 mrg construct), this should be set for the nested event 5534 1.13 mrg ('acc_ev_enqueue_launch_start'), or if the value of the parent 5535 1.13 mrg construct should remain ('acc_ev_compute_construct_start'). In 5536 1.19 mrg this implementation, the value generally corresponds to the 5537 1.13 mrg innermost nested event type. 5538 1.13 mrg 5539 1.13 mrg 'acc_prof_info.device_type' 5540 1.13 mrg 5541 1.13 mrg * For 'acc_ev_compute_construct_start', and in presence of an 5542 1.19 mrg 'if' clause with _false_ argument, this still refers to the 5543 1.19 mrg offloading device type. It's not clear if that's the expected 5544 1.19 mrg behavior. 5545 1.13 mrg 5546 1.13 mrg * Complementary to the item before, for 5547 1.13 mrg 'acc_ev_compute_construct_end', this is set to 5548 1.13 mrg 'acc_device_host' in presence of an 'if' clause with _false_ 5549 1.13 mrg argument. It's not clear if that's the expected behavior. 5550 1.13 mrg 5551 1.13 mrg 'acc_prof_info.thread_id' 5552 1.13 mrg Always '-1'; not yet implemented. 5553 1.13 mrg 5554 1.13 mrg 'acc_prof_info.async' 5555 1.13 mrg 5556 1.13 mrg * Not yet implemented correctly for 5557 1.13 mrg 'acc_ev_compute_construct_start'. 5558 1.13 mrg 5559 1.13 mrg * In a compute construct, for host-fallback 5560 1.19 mrg execution/'acc_device_host' it always is 'acc_async_sync'. It 5561 1.19 mrg is unclear if that is the expected behavior. 5562 1.13 mrg 5563 1.13 mrg * For 'acc_ev_device_init_start' and 'acc_ev_device_init_end', 5564 1.19 mrg it will always be 'acc_async_sync'. It is unclear if that is 5565 1.13 mrg the expected behavior. 5566 1.13 mrg 5567 1.13 mrg 'acc_prof_info.async_queue' 5568 1.13 mrg There is no 'limited number of asynchronous queues' in libgomp. 5569 1.19 mrg This always has the same value as 'acc_prof_info.async'. 5570 1.13 mrg 5571 1.13 mrg 'acc_prof_info.src_file' 5572 1.13 mrg Always 'NULL'; not yet implemented. 5573 1.13 mrg 5574 1.13 mrg 'acc_prof_info.func_name' 5575 1.13 mrg Always 'NULL'; not yet implemented. 5576 1.13 mrg 5577 1.13 mrg 'acc_prof_info.line_no' 5578 1.13 mrg Always '-1'; not yet implemented. 5579 1.13 mrg 5580 1.13 mrg 'acc_prof_info.end_line_no' 5581 1.13 mrg Always '-1'; not yet implemented. 5582 1.13 mrg 5583 1.13 mrg 'acc_prof_info.func_line_no' 5584 1.13 mrg Always '-1'; not yet implemented. 5585 1.13 mrg 5586 1.13 mrg 'acc_prof_info.func_end_line_no' 5587 1.13 mrg Always '-1'; not yet implemented. 5588 1.13 mrg 5589 1.13 mrg 'acc_event_info.event_type', 'acc_event_info.*.event_type' 5590 1.13 mrg Relating to 'acc_prof_info.event_type' discussed above, in this 5591 1.13 mrg implementation, this will always be the same value as 5592 1.13 mrg 'acc_prof_info.event_type'. 5593 1.13 mrg 5594 1.13 mrg 'acc_event_info.*.parent_construct' 5595 1.13 mrg 5596 1.13 mrg * Will be 'acc_construct_parallel' for all OpenACC compute 5597 1.13 mrg constructs as well as many OpenACC Runtime API calls; should 5598 1.13 mrg be the one matching the actual construct, or 5599 1.13 mrg 'acc_construct_runtime_api', respectively. 5600 1.13 mrg 5601 1.13 mrg * Will be 'acc_construct_enter_data' or 5602 1.13 mrg 'acc_construct_exit_data' when processing variable mappings 5603 1.13 mrg specified in OpenACC _declare_ directives; should be 5604 1.13 mrg 'acc_construct_declare'. 5605 1.13 mrg 5606 1.13 mrg * For implicit 'acc_ev_device_init_start', 5607 1.13 mrg 'acc_ev_device_init_end', and explicit as well as implicit 5608 1.13 mrg 'acc_ev_alloc', 'acc_ev_free', 'acc_ev_enqueue_upload_start', 5609 1.13 mrg 'acc_ev_enqueue_upload_end', 'acc_ev_enqueue_download_start', 5610 1.13 mrg and 'acc_ev_enqueue_download_end', will be 5611 1.13 mrg 'acc_construct_parallel'; should reflect the real parent 5612 1.13 mrg construct. 5613 1.13 mrg 5614 1.13 mrg 'acc_event_info.*.implicit' 5615 1.13 mrg For 'acc_ev_alloc', 'acc_ev_free', 'acc_ev_enqueue_upload_start', 5616 1.13 mrg 'acc_ev_enqueue_upload_end', 'acc_ev_enqueue_download_start', and 5617 1.13 mrg 'acc_ev_enqueue_download_end', this currently will be '1' also for 5618 1.13 mrg explicit usage. 5619 1.13 mrg 5620 1.13 mrg 'acc_event_info.data_event.var_name' 5621 1.13 mrg Always 'NULL'; not yet implemented. 5622 1.13 mrg 5623 1.13 mrg 'acc_event_info.data_event.host_ptr' 5624 1.13 mrg For 'acc_ev_alloc', and 'acc_ev_free', this is always 'NULL'. 5625 1.13 mrg 5626 1.13 mrg 'typedef union acc_api_info' 5627 1.13 mrg ... as printed in '5.2.3. Third Argument: API-Specific 5628 1.13 mrg Information'. This should obviously be 'typedef _struct_ 5629 1.13 mrg acc_api_info'. 5630 1.13 mrg 5631 1.13 mrg 'acc_api_info.device_api' 5632 1.13 mrg Possibly not yet implemented correctly for 5633 1.13 mrg 'acc_ev_compute_construct_start', 'acc_ev_device_init_start', 5634 1.13 mrg 'acc_ev_device_init_end': will always be 'acc_device_api_none' for 5635 1.13 mrg these event types. For 'acc_ev_enter_data_start', it will be 5636 1.13 mrg 'acc_device_api_none' in some cases. 5637 1.13 mrg 5638 1.13 mrg 'acc_api_info.device_type' 5639 1.13 mrg Always the same as 'acc_prof_info.device_type'. 5640 1.13 mrg 5641 1.13 mrg 'acc_api_info.vendor' 5642 1.13 mrg Always '-1'; not yet implemented. 5643 1.13 mrg 5644 1.13 mrg 'acc_api_info.device_handle' 5645 1.13 mrg Always 'NULL'; not yet implemented. 5646 1.13 mrg 5647 1.13 mrg 'acc_api_info.context_handle' 5648 1.13 mrg Always 'NULL'; not yet implemented. 5649 1.13 mrg 5650 1.13 mrg 'acc_api_info.async_handle' 5651 1.13 mrg Always 'NULL'; not yet implemented. 5652 1.13 mrg 5653 1.13 mrg Remarks about certain event types: 5654 1.13 mrg 5655 1.13 mrg 'acc_ev_device_init_start', 'acc_ev_device_init_end' 5656 1.13 mrg 5657 1.16 mrg * When a compute construct triggers implicit 5658 1.13 mrg 'acc_ev_device_init_start' and 'acc_ev_device_init_end' 5659 1.13 mrg events, they currently aren't _nested within_ the 5660 1.13 mrg corresponding 'acc_ev_compute_construct_start' and 5661 1.13 mrg 'acc_ev_compute_construct_end', but they're currently observed 5662 1.13 mrg _before_ 'acc_ev_compute_construct_start'. It's not clear 5663 1.13 mrg what to do: the standard asks us provide a lot of details to 5664 1.13 mrg the 'acc_ev_compute_construct_start' callback, without 5665 1.13 mrg (implicitly) initializing a device before? 5666 1.13 mrg 5667 1.13 mrg * Callbacks for these event types will not be invoked for calls 5668 1.13 mrg to the 'acc_set_device_type' and 'acc_set_device_num' 5669 1.13 mrg functions. It's not clear if they should be. 5670 1.13 mrg 5671 1.13 mrg 'acc_ev_enter_data_start', 'acc_ev_enter_data_end', 'acc_ev_exit_data_start', 'acc_ev_exit_data_end' 5672 1.13 mrg 5673 1.13 mrg * Callbacks for these event types will also be invoked for 5674 1.13 mrg OpenACC _host_data_ constructs. It's not clear if they should 5675 1.13 mrg be. 5676 1.13 mrg 5677 1.13 mrg * Callbacks for these event types will also be invoked when 5678 1.13 mrg processing variable mappings specified in OpenACC _declare_ 5679 1.13 mrg directives. It's not clear if they should be. 5680 1.13 mrg 5681 1.13 mrg Callbacks for the following event types will be invoked, but dispatch 5682 1.13 mrg and information provided therein has not yet been thoroughly reviewed: 5683 1.13 mrg 5684 1.13 mrg * 'acc_ev_alloc' 5685 1.13 mrg * 'acc_ev_free' 5686 1.13 mrg * 'acc_ev_update_start', 'acc_ev_update_end' 5687 1.13 mrg * 'acc_ev_enqueue_upload_start', 'acc_ev_enqueue_upload_end' 5688 1.13 mrg * 'acc_ev_enqueue_download_start', 'acc_ev_enqueue_download_end' 5689 1.13 mrg 5690 1.13 mrg During device initialization, and finalization, respectively, 5691 1.13 mrg callbacks for the following event types will not yet be invoked: 5692 1.13 mrg 5693 1.13 mrg * 'acc_ev_alloc' 5694 1.13 mrg * 'acc_ev_free' 5695 1.13 mrg 5696 1.13 mrg Callbacks for the following event types have not yet been 5697 1.13 mrg implemented, so currently won't be invoked: 5698 1.13 mrg 5699 1.13 mrg * 'acc_ev_device_shutdown_start', 'acc_ev_device_shutdown_end' 5700 1.13 mrg * 'acc_ev_runtime_shutdown' 5701 1.13 mrg * 'acc_ev_create', 'acc_ev_delete' 5702 1.13 mrg * 'acc_ev_wait_start', 'acc_ev_wait_end' 5703 1.13 mrg 5704 1.13 mrg For the following runtime library functions, not all expected 5705 1.13 mrg callbacks will be invoked (mostly concerning implicit device 5706 1.13 mrg initialization): 5707 1.13 mrg 5708 1.13 mrg * 'acc_get_num_devices' 5709 1.13 mrg * 'acc_set_device_type' 5710 1.13 mrg * 'acc_get_device_type' 5711 1.13 mrg * 'acc_set_device_num' 5712 1.13 mrg * 'acc_get_device_num' 5713 1.13 mrg * 'acc_init' 5714 1.13 mrg * 'acc_shutdown' 5715 1.13 mrg 5716 1.13 mrg Aside from implicit device initialization, for the following runtime 5717 1.13 mrg library functions, no callbacks will be invoked for shared-memory 5718 1.13 mrg offloading devices (it's not clear if they should be): 5719 1.13 mrg 5720 1.13 mrg * 'acc_malloc' 5721 1.13 mrg * 'acc_free' 5722 1.13 mrg * 'acc_copyin', 'acc_present_or_copyin', 'acc_copyin_async' 5723 1.13 mrg * 'acc_create', 'acc_present_or_create', 'acc_create_async' 5724 1.13 mrg * 'acc_copyout', 'acc_copyout_async', 'acc_copyout_finalize', 5725 1.13 mrg 'acc_copyout_finalize_async' 5726 1.13 mrg * 'acc_delete', 'acc_delete_async', 'acc_delete_finalize', 5727 1.13 mrg 'acc_delete_finalize_async' 5728 1.13 mrg * 'acc_update_device', 'acc_update_device_async' 5729 1.13 mrg * 'acc_update_self', 'acc_update_self_async' 5730 1.13 mrg * 'acc_map_data', 'acc_unmap_data' 5731 1.13 mrg * 'acc_memcpy_to_device', 'acc_memcpy_to_device_async' 5732 1.13 mrg * 'acc_memcpy_from_device', 'acc_memcpy_from_device_async' 5733 1.13 mrg 5734 1.13 mrg 5735 1.19 mrg File: libgomp.info, Node: OpenMP-Implementation Specifics, Next: Offload-Target Specifics, Prev: OpenACC Profiling Interface, Up: Top 5736 1.19 mrg 5737 1.19 mrg 11 OpenMP-Implementation Specifics 5738 1.19 mrg ********************************** 5739 1.19 mrg 5740 1.19 mrg * Menu: 5741 1.19 mrg 5742 1.19 mrg * Implementation-defined ICV Initialization:: 5743 1.19 mrg * OpenMP Context Selectors:: 5744 1.19 mrg * Memory allocation:: 5745 1.19 mrg 5746 1.19 mrg 5747 1.19 mrg File: libgomp.info, Node: Implementation-defined ICV Initialization, Next: OpenMP Context Selectors, Up: OpenMP-Implementation Specifics 5748 1.19 mrg 5749 1.19 mrg 11.1 Implementation-defined ICV Initialization 5750 1.19 mrg ============================================== 5751 1.19 mrg 5752 1.19 mrg AFFINITY-FORMAT-VAR See *note OMP_AFFINITY_FORMAT::. 5753 1.19 mrg DEF-ALLOCATOR-VAR See *note OMP_ALLOCATOR::. 5754 1.19 mrg MAX-ACTIVE-LEVELS-VAR See *note OMP_MAX_ACTIVE_LEVELS::. 5755 1.19 mrg DYN-VAR See *note OMP_DYNAMIC::. 5756 1.19 mrg NTHREADS-VAR See *note OMP_NUM_THREADS::. 5757 1.19 mrg NUM-DEVICES-VAR Number of non-host devices found by GCC's 5758 1.19 mrg run-time library 5759 1.19 mrg NUM-PROCS-VAR The number of CPU cores on the initial device, 5760 1.19 mrg except that affinity settings might lead to a 5761 1.19 mrg smaller number. On non-host devices, the value 5762 1.19 mrg of the NTHREADS-VAR ICV. 5763 1.19 mrg PLACE-PARTITION-VAR See *note OMP_PLACES::. 5764 1.19 mrg RUN-SCHED-VAR See *note OMP_SCHEDULE::. 5765 1.19 mrg STACKSIZE-VAR See *note OMP_STACKSIZE::. 5766 1.19 mrg THREAD-LIMIT-VAR See *note OMP_TEAMS_THREAD_LIMIT:: 5767 1.19 mrg WAIT-POLICY-VAR See *note OMP_WAIT_POLICY:: and 5768 1.19 mrg *note GOMP_SPINCOUNT:: 5769 1.19 mrg 5770 1.19 mrg 5771 1.19 mrg File: libgomp.info, Node: OpenMP Context Selectors, Next: Memory allocation, Prev: Implementation-defined ICV Initialization, Up: OpenMP-Implementation Specifics 5772 1.19 mrg 5773 1.19 mrg 11.2 OpenMP Context Selectors 5774 1.19 mrg ============================= 5775 1.19 mrg 5776 1.19 mrg 'vendor' is always 'gnu'. References are to the GCC manual. 5777 1.19 mrg 5778 1.19 mrg For the host compiler, 'kind' always matches 'host'; for the 5779 1.19 mrg offloading architectures AMD GCN and Nvidia PTX, 'kind' always matches 5780 1.19 mrg 'gpu'. For the x86 family of computers, AMD GCN and Nvidia PTX the 5781 1.19 mrg following traits are supported in addition; while OpenMP is supported on 5782 1.19 mrg more architectures, GCC currently does not match any 'arch' or 'isa' 5783 1.19 mrg traits for those. 5784 1.19 mrg 5785 1.19 mrg 'arch' 'isa' 5786 1.19 mrg ----------------------------------------------------------------------- 5787 1.19 mrg 'x86', 'x86_64', 'i386', 'i486', 'i586', See '-m...' flags in 5788 1.19 mrg 'i686', 'ia32' "x86 Options" 5789 1.19 mrg (without '-m') 5790 1.19 mrg 'amdgcn', 'gcn' See '-march=' in 5791 1.19 mrg "AMD GCN Options"(1) 5792 1.19 mrg 'nvptx', 'nvptx64' See '-march=' in 5793 1.19 mrg "Nvidia PTX Options" 5794 1.19 mrg 5795 1.19 mrg ---------- Footnotes ---------- 5796 1.19 mrg 5797 1.19 mrg (1) Additionally, 'gfx803' is supported as an alias for 'fiji'. 5798 1.19 mrg 5799 1.19 mrg 5800 1.19 mrg File: libgomp.info, Node: Memory allocation, Prev: OpenMP Context Selectors, Up: OpenMP-Implementation Specifics 5801 1.19 mrg 5802 1.19 mrg 11.3 Memory allocation 5803 1.19 mrg ====================== 5804 1.19 mrg 5805 1.19 mrg The description below applies to: 5806 1.19 mrg 5807 1.19 mrg * Explicit use of the OpenMP API routines, see *note Memory 5808 1.19 mrg Management Routines::. 5809 1.19 mrg * The 'allocate' clause, except when the 'allocator' modifier is a 5810 1.19 mrg constant expression with value 'omp_default_mem_alloc' and no 5811 1.19 mrg 'align' modifier has been specified. (In that case, the normal 5812 1.19 mrg 'malloc' allocation is used.) 5813 1.19 mrg * Using the 'allocate' directive for automatic/stack variables, 5814 1.19 mrg except when the 'allocator' clause is a constant expression with 5815 1.19 mrg value 'omp_default_mem_alloc' and no 'align' clause has been 5816 1.19 mrg specified. (In that case, the normal allocation is used: stack 5817 1.19 mrg allocation and, sometimes for Fortran, also 'malloc' [depending on 5818 1.19 mrg flags such as '-fstack-arrays'].) 5819 1.19 mrg * Using the 'allocate' directive for variable in static memory is 5820 1.19 mrg currently not supported (compile time error). 5821 1.19 mrg * In Fortran, the 'allocators' directive and the executable 5822 1.19 mrg 'allocate' directive for Fortran pointers and allocatables is 5823 1.19 mrg supported, but requires that files containing those directives has 5824 1.19 mrg to be compiled with '-fopenmp-allocators'. Additionally, all files 5825 1.19 mrg that might explicitly or implicitly deallocate memory allocated 5826 1.19 mrg that way must also be compiled with that option. 5827 1.19 mrg 5828 1.19 mrg For the available predefined allocators and, as applicable, their 5829 1.19 mrg associated predefined memory spaces and for the available traits and 5830 1.19 mrg their default values, see *note OMP_ALLOCATOR::. Predefined allocators 5831 1.19 mrg without an associated memory space use the 'omp_default_mem_space' 5832 1.19 mrg memory space. 5833 1.19 mrg 5834 1.19 mrg For the memory spaces, the following applies: 5835 1.19 mrg * 'omp_default_mem_space' is supported 5836 1.19 mrg * 'omp_const_mem_space' maps to 'omp_default_mem_space' 5837 1.19 mrg * 'omp_low_lat_mem_space' is only available on supported devices, and 5838 1.19 mrg maps to 'omp_default_mem_space' otherwise. 5839 1.19 mrg * 'omp_large_cap_mem_space' maps to 'omp_default_mem_space', unless 5840 1.19 mrg the memkind library is available 5841 1.19 mrg * 'omp_high_bw_mem_space' maps to 'omp_default_mem_space', unless the 5842 1.19 mrg memkind library is available 5843 1.19 mrg 5844 1.19 mrg On Linux systems, where the memkind library 5845 1.19 mrg (https://github.com/memkind/memkind) ('libmemkind.so.0') is available at 5846 1.19 mrg runtime, it is used when creating memory allocators requesting 5847 1.19 mrg 5848 1.19 mrg * the memory space 'omp_high_bw_mem_space' 5849 1.19 mrg * the memory space 'omp_large_cap_mem_space' 5850 1.19 mrg * the 'partition' trait 'interleaved'; note that for 5851 1.19 mrg 'omp_large_cap_mem_space' the allocation will not be interleaved 5852 1.19 mrg 5853 1.19 mrg On Linux systems, where the numa library 5854 1.19 mrg (https://github.com/numactl/numactl) ('libnuma.so.1') is available at 5855 1.19 mrg runtime, it used when creating memory allocators requesting 5856 1.19 mrg 5857 1.19 mrg * the 'partition' trait 'nearest', except when both the libmemkind 5858 1.19 mrg library is available and the memory space is either 5859 1.19 mrg 'omp_large_cap_mem_space' or 'omp_high_bw_mem_space' 5860 1.19 mrg 5861 1.19 mrg Note that the numa library will round up the allocation size to a 5862 1.19 mrg multiple of the system page size; therefore, consider using it only with 5863 1.19 mrg large data or by sharing allocations via the 'pool_size' trait. 5864 1.19 mrg Furthermore, the Linux kernel does not guarantee that an allocation will 5865 1.19 mrg always be on the nearest NUMA node nor that after reallocation the same 5866 1.19 mrg node will be used. Note additionally that, on Linux, the default 5867 1.19 mrg setting of the memory placement policy is to use the current node; 5868 1.19 mrg therefore, unless the memory placement policy has been overridden, the 5869 1.19 mrg 'partition' trait 'environment' (the default) will be effectively a 5870 1.19 mrg 'nearest' allocation. 5871 1.19 mrg 5872 1.19 mrg Additional notes regarding the traits: 5873 1.19 mrg * The 'pinned' trait is supported on Linux hosts, but is subject to 5874 1.19 mrg the OS 'ulimit'/'rlimit' locked memory settings. 5875 1.19 mrg * The default for the 'pool_size' trait is no pool and for every 5876 1.19 mrg (re)allocation the associated library routine is called, which 5877 1.19 mrg might internally use a memory pool. 5878 1.19 mrg * For the 'partition' trait, the partition part size will be the same 5879 1.19 mrg as the requested size (i.e. 'interleaved' or 'blocked' has no 5880 1.19 mrg effect), except for 'interleaved' when the memkind library is 5881 1.19 mrg available. Furthermore, for 'nearest' and unless the numa library 5882 1.19 mrg is available, the memory might not be on the same NUMA node as 5883 1.19 mrg thread that allocated the memory; on Linux, this is in particular 5884 1.19 mrg the case when the memory placement policy is set to preferred. 5885 1.19 mrg * The 'access' trait has no effect such that memory is always 5886 1.19 mrg accessible by all threads. 5887 1.19 mrg * The 'sync_hint' trait has no effect. 5888 1.19 mrg 5889 1.19 mrg See also: *note Offload-Target Specifics:: 5890 1.19 mrg 5891 1.19 mrg 5892 1.19 mrg File: libgomp.info, Node: Offload-Target Specifics, Next: The libgomp ABI, Prev: OpenMP-Implementation Specifics, Up: Top 5893 1.19 mrg 5894 1.19 mrg 12 Offload-Target Specifics 5895 1.19 mrg *************************** 5896 1.19 mrg 5897 1.19 mrg The following sections present notes on the offload-target specifics 5898 1.19 mrg 5899 1.19 mrg * Menu: 5900 1.19 mrg 5901 1.19 mrg * AMD Radeon:: 5902 1.19 mrg * nvptx:: 5903 1.19 mrg 5904 1.19 mrg 5905 1.19 mrg File: libgomp.info, Node: AMD Radeon, Next: nvptx, Up: Offload-Target Specifics 5906 1.19 mrg 5907 1.19 mrg 12.1 AMD Radeon (GCN) 5908 1.19 mrg ===================== 5909 1.19 mrg 5910 1.19 mrg On the hardware side, there is the hierarchy (fine to coarse): 5911 1.19 mrg * work item (thread) 5912 1.19 mrg * wavefront 5913 1.19 mrg * work group 5914 1.19 mrg * compute unit (CU) 5915 1.19 mrg 5916 1.19 mrg All OpenMP and OpenACC levels are used, i.e. 5917 1.19 mrg * OpenMP's simd and OpenACC's vector map to work items (thread) 5918 1.19 mrg * OpenMP's threads ("parallel") and OpenACC's workers map to 5919 1.19 mrg wavefronts 5920 1.19 mrg * OpenMP's teams and OpenACC's gang use a threadpool with the size of 5921 1.19 mrg the number of teams or gangs, respectively. 5922 1.19 mrg 5923 1.19 mrg The used sizes are 5924 1.19 mrg * Number of teams is the specified 'num_teams' (OpenMP) or 5925 1.19 mrg 'num_gangs' (OpenACC) or otherwise the number of CU. It is limited 5926 1.19 mrg by two times the number of CU. 5927 1.19 mrg * Number of wavefronts is 4 for gfx900 and 16 otherwise; 5928 1.19 mrg 'num_threads' (OpenMP) and 'num_workers' (OpenACC) overrides this 5929 1.19 mrg if smaller. 5930 1.19 mrg * The wavefront has 102 scalars and 64 vectors 5931 1.19 mrg * Number of workitems is always 64 5932 1.19 mrg * The hardware permits maximally 40 workgroups/CU and 16 5933 1.19 mrg wavefronts/workgroup up to a limit of 40 wavefronts in total per 5934 1.19 mrg CU. 5935 1.19 mrg * 80 scalars registers and 24 vector registers in non-kernel 5936 1.19 mrg functions (the chosen procedure-calling API). 5937 1.19 mrg * For the kernel itself: as many as register pressure demands (number 5938 1.19 mrg of teams and number of threads, scaled down if registers are 5939 1.19 mrg exhausted) 5940 1.19 mrg 5941 1.19 mrg The implementation remark: 5942 1.19 mrg * I/O within OpenMP target regions and OpenACC parallel/kernels is 5943 1.19 mrg supported using the C library 'printf' functions and the Fortran 5944 1.19 mrg 'print'/'write' statements. 5945 1.19 mrg * Reverse offload regions (i.e. 'target' regions with 5946 1.19 mrg 'device(ancestor:1)') are processed serially per 'target' region 5947 1.19 mrg such that the next reverse offload region is only executed after 5948 1.19 mrg the previous one returned. 5949 1.19 mrg * OpenMP code that has a 'requires' directive with 5950 1.19 mrg 'unified_shared_memory' will remove any GCN device from the list of 5951 1.19 mrg available devices ("host fallback"). 5952 1.19 mrg * The available stack size can be changed using the 'GCN_STACK_SIZE' 5953 1.19 mrg environment variable; the default is 32 kiB per thread. 5954 1.19 mrg * Low-latency memory ('omp_low_lat_mem_space') is supported when the 5955 1.19 mrg the 'access' trait is set to 'cgroup'. The default pool size is 5956 1.19 mrg automatically scaled to share the 64 kiB LDS memory between the 5957 1.19 mrg number of teams configured to run on each compute-unit, but may be 5958 1.19 mrg adjusted at runtime by setting environment variable 5959 1.19 mrg 'GOMP_GCN_LOWLAT_POOL=BYTES'. 5960 1.19 mrg * 'omp_low_lat_mem_alloc' cannot be used with true low-latency memory 5961 1.19 mrg because the definition implies the 'omp_atv_all' trait; main 5962 1.19 mrg graphics memory is used instead. 5963 1.19 mrg * 'omp_cgroup_mem_alloc', 'omp_pteam_mem_alloc', and 5964 1.19 mrg 'omp_thread_mem_alloc', all use low-latency memory as first 5965 1.19 mrg preference, and fall back to main graphics memory when the 5966 1.19 mrg low-latency pool is exhausted. 5967 1.19 mrg 5968 1.19 mrg 5969 1.19 mrg File: libgomp.info, Node: nvptx, Prev: AMD Radeon, Up: Offload-Target Specifics 5970 1.19 mrg 5971 1.19 mrg 12.2 nvptx 5972 1.19 mrg ========== 5973 1.19 mrg 5974 1.19 mrg On the hardware side, there is the hierarchy (fine to coarse): 5975 1.19 mrg * thread 5976 1.19 mrg * warp 5977 1.19 mrg * thread block 5978 1.19 mrg * streaming multiprocessor 5979 1.19 mrg 5980 1.19 mrg All OpenMP and OpenACC levels are used, i.e. 5981 1.19 mrg * OpenMP's simd and OpenACC's vector map to threads 5982 1.19 mrg * OpenMP's threads ("parallel") and OpenACC's workers map to warps 5983 1.19 mrg * OpenMP's teams and OpenACC's gang use a threadpool with the size of 5984 1.19 mrg the number of teams or gangs, respectively. 5985 1.19 mrg 5986 1.19 mrg The used sizes are 5987 1.19 mrg * The 'warp_size' is always 32 5988 1.19 mrg * CUDA kernel launched: 'dim={#teams,1,1}, 5989 1.19 mrg blocks={#threads,warp_size,1}'. 5990 1.19 mrg * The number of teams is limited by the number of blocks the device 5991 1.19 mrg can host simultaneously. 5992 1.19 mrg 5993 1.19 mrg Additional information can be obtained by setting the environment 5994 1.19 mrg variable to 'GOMP_DEBUG=1' (very verbose; grep for 'kernel.*launch' for 5995 1.19 mrg launch parameters). 5996 1.19 mrg 5997 1.19 mrg GCC generates generic PTX ISA code, which is just-in-time compiled by 5998 1.19 mrg CUDA, which caches the JIT in the user's directory (see CUDA 5999 1.19 mrg documentation; can be tuned by the environment variables 6000 1.19 mrg 'CUDA_CACHE_{DISABLE,MAXSIZE,PATH}'. 6001 1.19 mrg 6002 1.19 mrg Note: While PTX ISA is generic, the '-mptx=' and '-march=' 6003 1.19 mrg commandline options still affect the used PTX ISA code and, thus, the 6004 1.19 mrg requirements on CUDA version and hardware. 6005 1.19 mrg 6006 1.19 mrg The implementation remark: 6007 1.19 mrg * I/O within OpenMP target regions and OpenACC parallel/kernels is 6008 1.19 mrg supported using the C library 'printf' functions. Note that the 6009 1.19 mrg Fortran 'print'/'write' statements are not supported, yet. 6010 1.19 mrg * Compilation OpenMP code that contains 'requires reverse_offload' 6011 1.19 mrg requires at least '-march=sm_35', compiling for '-march=sm_30' is 6012 1.19 mrg not supported. 6013 1.19 mrg * For code containing reverse offload (i.e. 'target' regions with 6014 1.19 mrg 'device(ancestor:1)'), there is a slight performance penalty for 6015 1.19 mrg _all_ target regions, consisting mostly of shutdown delay Per 6016 1.19 mrg device, reverse offload regions are processed serially such that 6017 1.19 mrg the next reverse offload region is only executed after the previous 6018 1.19 mrg one returned. 6019 1.19 mrg * OpenMP code that has a 'requires' directive with 6020 1.19 mrg 'unified_shared_memory' will remove any nvptx device from the list 6021 1.19 mrg of available devices ("host fallback"). 6022 1.19 mrg * The default per-warp stack size is 128 kiB; see also '-msoft-stack' 6023 1.19 mrg in the GCC manual. 6024 1.19 mrg * The OpenMP routines 'omp_target_memcpy_rect' and 6025 1.19 mrg 'omp_target_memcpy_rect_async' and the 'target update' directive 6026 1.19 mrg for non-contiguous list items will use the 2D and 3D memory-copy 6027 1.19 mrg functions of the CUDA library. Higher dimensions will call those 6028 1.19 mrg functions in a loop and are therefore supported. 6029 1.19 mrg * Low-latency memory ('omp_low_lat_mem_space') is supported when the 6030 1.19 mrg the 'access' trait is set to 'cgroup', the ISA is at least 'sm_53', 6031 1.19 mrg and the PTX version is at least 4.1. The default pool size is 8 6032 1.19 mrg kiB per team, but may be adjusted at runtime by setting environment 6033 1.19 mrg variable 'GOMP_NVPTX_LOWLAT_POOL=BYTES'. The maximum value is 6034 1.19 mrg limited by the available hardware, and care should be taken that 6035 1.19 mrg the selected pool size does not unduly limit the number of teams 6036 1.19 mrg that can run simultaneously. 6037 1.19 mrg * 'omp_low_lat_mem_alloc' cannot be used with true low-latency memory 6038 1.19 mrg because the definition implies the 'omp_atv_all' trait; main 6039 1.19 mrg graphics memory is used instead. 6040 1.19 mrg * 'omp_cgroup_mem_alloc', 'omp_pteam_mem_alloc', and 6041 1.19 mrg 'omp_thread_mem_alloc', all use low-latency memory as first 6042 1.19 mrg preference, and fall back to main graphics memory when the 6043 1.19 mrg low-latency pool is exhausted. 6044 1.19 mrg 6045 1.19 mrg 6046 1.19 mrg File: libgomp.info, Node: The libgomp ABI, Next: Reporting Bugs, Prev: Offload-Target Specifics, Up: Top 6047 1.13 mrg 6048 1.19 mrg 13 The libgomp ABI 6049 1.13 mrg ****************** 6050 1.1 mrg 6051 1.11 mrg The following sections present notes on the external ABI as presented by 6052 1.11 mrg libgomp. Only maintainers should need them. 6053 1.1 mrg 6054 1.1 mrg * Menu: 6055 1.1 mrg 6056 1.1 mrg * Implementing MASTER construct:: 6057 1.1 mrg * Implementing CRITICAL construct:: 6058 1.1 mrg * Implementing ATOMIC construct:: 6059 1.1 mrg * Implementing FLUSH construct:: 6060 1.1 mrg * Implementing BARRIER construct:: 6061 1.1 mrg * Implementing THREADPRIVATE construct:: 6062 1.1 mrg * Implementing PRIVATE clause:: 6063 1.1 mrg * Implementing FIRSTPRIVATE LASTPRIVATE COPYIN and COPYPRIVATE clauses:: 6064 1.1 mrg * Implementing REDUCTION clause:: 6065 1.1 mrg * Implementing PARALLEL construct:: 6066 1.1 mrg * Implementing FOR construct:: 6067 1.1 mrg * Implementing ORDERED construct:: 6068 1.1 mrg * Implementing SECTIONS construct:: 6069 1.1 mrg * Implementing SINGLE construct:: 6070 1.8 mrg * Implementing OpenACC's PARALLEL construct:: 6071 1.1 mrg 6072 1.1 mrg 6073 1.1 mrg File: libgomp.info, Node: Implementing MASTER construct, Next: Implementing CRITICAL construct, Up: The libgomp ABI 6074 1.1 mrg 6075 1.19 mrg 13.1 Implementing MASTER construct 6076 1.13 mrg ================================== 6077 1.1 mrg 6078 1.1 mrg if (omp_get_thread_num () == 0) 6079 1.1 mrg block 6080 1.1 mrg 6081 1.1 mrg Alternately, we generate two copies of the parallel subfunction and 6082 1.16 mrg only include this in the version run by the primary thread. Surely this 6083 1.3 skrll is not worthwhile though... 6084 1.1 mrg 6085 1.1 mrg 6086 1.1 mrg File: libgomp.info, Node: Implementing CRITICAL construct, Next: Implementing ATOMIC construct, Prev: Implementing MASTER construct, Up: The libgomp ABI 6087 1.1 mrg 6088 1.19 mrg 13.2 Implementing CRITICAL construct 6089 1.13 mrg ==================================== 6090 1.1 mrg 6091 1.1 mrg Without a specified name, 6092 1.1 mrg 6093 1.1 mrg void GOMP_critical_start (void); 6094 1.1 mrg void GOMP_critical_end (void); 6095 1.1 mrg 6096 1.1 mrg so that we don't get COPY relocations from libgomp to the main 6097 1.1 mrg application. 6098 1.1 mrg 6099 1.1 mrg With a specified name, use omp_set_lock and omp_unset_lock with name 6100 1.1 mrg being transformed into a variable declared like 6101 1.1 mrg 6102 1.1 mrg omp_lock_t gomp_critical_user_<name> __attribute__((common)) 6103 1.1 mrg 6104 1.1 mrg Ideally the ABI would specify that all zero is a valid unlocked 6105 1.3 skrll state, and so we wouldn't need to initialize this at startup. 6106 1.1 mrg 6107 1.1 mrg 6108 1.1 mrg File: libgomp.info, Node: Implementing ATOMIC construct, Next: Implementing FLUSH construct, Prev: Implementing CRITICAL construct, Up: The libgomp ABI 6109 1.1 mrg 6110 1.19 mrg 13.3 Implementing ATOMIC construct 6111 1.13 mrg ================================== 6112 1.1 mrg 6113 1.11 mrg The target should implement the '__sync' builtins. 6114 1.1 mrg 6115 1.1 mrg Failing that we could add 6116 1.1 mrg 6117 1.1 mrg void GOMP_atomic_enter (void) 6118 1.1 mrg void GOMP_atomic_exit (void) 6119 1.1 mrg 6120 1.1 mrg which reuses the regular lock code, but with yet another lock object 6121 1.1 mrg private to the library. 6122 1.1 mrg 6123 1.1 mrg 6124 1.1 mrg File: libgomp.info, Node: Implementing FLUSH construct, Next: Implementing BARRIER construct, Prev: Implementing ATOMIC construct, Up: The libgomp ABI 6125 1.1 mrg 6126 1.19 mrg 13.4 Implementing FLUSH construct 6127 1.13 mrg ================================= 6128 1.1 mrg 6129 1.11 mrg Expands to the '__sync_synchronize' builtin. 6130 1.1 mrg 6131 1.1 mrg 6132 1.1 mrg File: libgomp.info, Node: Implementing BARRIER construct, Next: Implementing THREADPRIVATE construct, Prev: Implementing FLUSH construct, Up: The libgomp ABI 6133 1.1 mrg 6134 1.19 mrg 13.5 Implementing BARRIER construct 6135 1.13 mrg =================================== 6136 1.1 mrg 6137 1.1 mrg void GOMP_barrier (void) 6138 1.1 mrg 6139 1.1 mrg 6140 1.1 mrg File: libgomp.info, Node: Implementing THREADPRIVATE construct, Next: Implementing PRIVATE clause, Prev: Implementing BARRIER construct, Up: The libgomp ABI 6141 1.1 mrg 6142 1.19 mrg 13.6 Implementing THREADPRIVATE construct 6143 1.13 mrg ========================================= 6144 1.1 mrg 6145 1.11 mrg In _most_ cases we can map this directly to '__thread'. Except that OMP 6146 1.11 mrg allows constructors for C++ objects. We can either refuse to support 6147 1.11 mrg this (how often is it used?) or we can implement something akin to 6148 1.11 mrg .ctors. 6149 1.1 mrg 6150 1.1 mrg Even more ideally, this ctor feature is handled by extensions to the 6151 1.1 mrg main pthreads library. Failing that, we can have a set of entry points 6152 1.1 mrg to register ctor functions to be called. 6153 1.1 mrg 6154 1.1 mrg 6155 1.1 mrg File: libgomp.info, Node: Implementing PRIVATE clause, Next: Implementing FIRSTPRIVATE LASTPRIVATE COPYIN and COPYPRIVATE clauses, Prev: Implementing THREADPRIVATE construct, Up: The libgomp ABI 6156 1.1 mrg 6157 1.19 mrg 13.7 Implementing PRIVATE clause 6158 1.13 mrg ================================ 6159 1.1 mrg 6160 1.1 mrg In association with a PARALLEL, or within the lexical extent of a 6161 1.1 mrg PARALLEL block, the variable becomes a local variable in the parallel 6162 1.1 mrg subfunction. 6163 1.1 mrg 6164 1.1 mrg In association with FOR or SECTIONS blocks, create a new automatic 6165 1.1 mrg variable within the current function. This preserves the semantic of 6166 1.1 mrg new variable creation. 6167 1.1 mrg 6168 1.1 mrg 6169 1.1 mrg File: libgomp.info, Node: Implementing FIRSTPRIVATE LASTPRIVATE COPYIN and COPYPRIVATE clauses, Next: Implementing REDUCTION clause, Prev: Implementing PRIVATE clause, Up: The libgomp ABI 6170 1.1 mrg 6171 1.19 mrg 13.8 Implementing FIRSTPRIVATE LASTPRIVATE COPYIN and COPYPRIVATE clauses 6172 1.13 mrg ========================================================================= 6173 1.1 mrg 6174 1.3 skrll This seems simple enough for PARALLEL blocks. Create a private struct 6175 1.3 skrll for communicating between the parent and subfunction. In the parent, 6176 1.3 skrll copy in values for scalar and "small" structs; copy in addresses for 6177 1.3 skrll others TREE_ADDRESSABLE types. In the subfunction, copy the value into 6178 1.3 skrll the local variable. 6179 1.1 mrg 6180 1.11 mrg It is not clear what to do with bare FOR or SECTION blocks. The only 6181 1.11 mrg thing I can figure is that we do something like: 6182 1.1 mrg 6183 1.1 mrg #pragma omp for firstprivate(x) lastprivate(y) 6184 1.1 mrg for (int i = 0; i < n; ++i) 6185 1.1 mrg body; 6186 1.1 mrg 6187 1.1 mrg which becomes 6188 1.1 mrg 6189 1.1 mrg { 6190 1.1 mrg int x = x, y; 6191 1.1 mrg 6192 1.1 mrg // for stuff 6193 1.1 mrg 6194 1.1 mrg if (i == n) 6195 1.1 mrg y = y; 6196 1.1 mrg } 6197 1.1 mrg 6198 1.1 mrg where the "x=x" and "y=y" assignments actually have different uids 6199 1.11 mrg for the two variables, i.e. not something you could write directly in 6200 1.11 mrg C. Presumably this only makes sense if the "outer" x and y are global 6201 1.1 mrg variables. 6202 1.1 mrg 6203 1.1 mrg COPYPRIVATE would work the same way, except the structure broadcast 6204 1.1 mrg would have to happen via SINGLE machinery instead. 6205 1.1 mrg 6206 1.1 mrg 6207 1.1 mrg File: libgomp.info, Node: Implementing REDUCTION clause, Next: Implementing PARALLEL construct, Prev: Implementing FIRSTPRIVATE LASTPRIVATE COPYIN and COPYPRIVATE clauses, Up: The libgomp ABI 6208 1.1 mrg 6209 1.19 mrg 13.9 Implementing REDUCTION clause 6210 1.13 mrg ================================== 6211 1.1 mrg 6212 1.1 mrg The private struct mentioned in the previous section should have a 6213 1.11 mrg pointer to an array of the type of the variable, indexed by the thread's 6214 1.11 mrg TEAM_ID. The thread stores its final value into the array, and after 6215 1.16 mrg the barrier, the primary thread iterates over the array to collect the 6216 1.11 mrg values. 6217 1.1 mrg 6218 1.1 mrg 6219 1.1 mrg File: libgomp.info, Node: Implementing PARALLEL construct, Next: Implementing FOR construct, Prev: Implementing REDUCTION clause, Up: The libgomp ABI 6220 1.1 mrg 6221 1.19 mrg 13.10 Implementing PARALLEL construct 6222 1.13 mrg ===================================== 6223 1.1 mrg 6224 1.1 mrg #pragma omp parallel 6225 1.1 mrg { 6226 1.1 mrg body; 6227 1.1 mrg } 6228 1.1 mrg 6229 1.1 mrg becomes 6230 1.1 mrg 6231 1.1 mrg void subfunction (void *data) 6232 1.1 mrg { 6233 1.1 mrg use data; 6234 1.1 mrg body; 6235 1.1 mrg } 6236 1.1 mrg 6237 1.1 mrg setup data; 6238 1.1 mrg GOMP_parallel_start (subfunction, &data, num_threads); 6239 1.1 mrg subfunction (&data); 6240 1.1 mrg GOMP_parallel_end (); 6241 1.1 mrg 6242 1.1 mrg void GOMP_parallel_start (void (*fn)(void *), void *data, unsigned num_threads) 6243 1.1 mrg 6244 1.1 mrg The FN argument is the subfunction to be run in parallel. 6245 1.1 mrg 6246 1.1 mrg The DATA argument is a pointer to a structure used to communicate 6247 1.1 mrg data in and out of the subfunction, as discussed above with respect to 6248 1.1 mrg FIRSTPRIVATE et al. 6249 1.1 mrg 6250 1.1 mrg The NUM_THREADS argument is 1 if an IF clause is present and false, 6251 1.1 mrg or the value of the NUM_THREADS clause, if present, or 0. 6252 1.1 mrg 6253 1.11 mrg The function needs to create the appropriate number of threads and/or 6254 1.11 mrg launch them from the dock. It needs to create the team structure and 6255 1.11 mrg assign team ids. 6256 1.1 mrg 6257 1.1 mrg void GOMP_parallel_end (void) 6258 1.1 mrg 6259 1.1 mrg Tears down the team and returns us to the previous 6260 1.11 mrg 'omp_in_parallel()' state. 6261 1.1 mrg 6262 1.1 mrg 6263 1.1 mrg File: libgomp.info, Node: Implementing FOR construct, Next: Implementing ORDERED construct, Prev: Implementing PARALLEL construct, Up: The libgomp ABI 6264 1.1 mrg 6265 1.19 mrg 13.11 Implementing FOR construct 6266 1.13 mrg ================================ 6267 1.1 mrg 6268 1.1 mrg #pragma omp parallel for 6269 1.1 mrg for (i = lb; i <= ub; i++) 6270 1.1 mrg body; 6271 1.1 mrg 6272 1.1 mrg becomes 6273 1.1 mrg 6274 1.1 mrg void subfunction (void *data) 6275 1.1 mrg { 6276 1.1 mrg long _s0, _e0; 6277 1.1 mrg while (GOMP_loop_static_next (&_s0, &_e0)) 6278 1.1 mrg { 6279 1.1 mrg long _e1 = _e0, i; 6280 1.1 mrg for (i = _s0; i < _e1; i++) 6281 1.1 mrg body; 6282 1.1 mrg } 6283 1.1 mrg GOMP_loop_end_nowait (); 6284 1.1 mrg } 6285 1.1 mrg 6286 1.1 mrg GOMP_parallel_loop_static (subfunction, NULL, 0, lb, ub+1, 1, 0); 6287 1.1 mrg subfunction (NULL); 6288 1.1 mrg GOMP_parallel_end (); 6289 1.1 mrg 6290 1.1 mrg #pragma omp for schedule(runtime) 6291 1.1 mrg for (i = 0; i < n; i++) 6292 1.1 mrg body; 6293 1.1 mrg 6294 1.1 mrg becomes 6295 1.1 mrg 6296 1.1 mrg { 6297 1.1 mrg long i, _s0, _e0; 6298 1.1 mrg if (GOMP_loop_runtime_start (0, n, 1, &_s0, &_e0)) 6299 1.1 mrg do { 6300 1.1 mrg long _e1 = _e0; 6301 1.1 mrg for (i = _s0, i < _e0; i++) 6302 1.1 mrg body; 6303 1.1 mrg } while (GOMP_loop_runtime_next (&_s0, _&e0)); 6304 1.1 mrg GOMP_loop_end (); 6305 1.1 mrg } 6306 1.1 mrg 6307 1.3 skrll Note that while it looks like there is trickiness to propagating a 6308 1.1 mrg non-constant STEP, there isn't really. We're explicitly allowed to 6309 1.1 mrg evaluate it as many times as we want, and any variables involved should 6310 1.1 mrg automatically be handled as PRIVATE or SHARED like any other variables. 6311 1.1 mrg So the expression should remain evaluable in the subfunction. We can 6312 1.11 mrg also pull it into a local variable if we like, but since its supposed to 6313 1.11 mrg remain unchanged, we can also not if we like. 6314 1.1 mrg 6315 1.11 mrg If we have SCHEDULE(STATIC), and no ORDERED, then we ought to be able 6316 1.11 mrg to get away with no work-sharing context at all, since we can simply 6317 1.11 mrg perform the arithmetic directly in each thread to divide up the 6318 1.11 mrg iterations. Which would mean that we wouldn't need to call any of these 6319 1.11 mrg routines. 6320 1.1 mrg 6321 1.1 mrg There are separate routines for handling loops with an ORDERED 6322 1.1 mrg clause. Bookkeeping for that is non-trivial... 6323 1.1 mrg 6324 1.1 mrg 6325 1.1 mrg File: libgomp.info, Node: Implementing ORDERED construct, Next: Implementing SECTIONS construct, Prev: Implementing FOR construct, Up: The libgomp ABI 6326 1.1 mrg 6327 1.19 mrg 13.12 Implementing ORDERED construct 6328 1.13 mrg ==================================== 6329 1.1 mrg 6330 1.1 mrg void GOMP_ordered_start (void) 6331 1.1 mrg void GOMP_ordered_end (void) 6332 1.1 mrg 6333 1.1 mrg 6334 1.1 mrg File: libgomp.info, Node: Implementing SECTIONS construct, Next: Implementing SINGLE construct, Prev: Implementing ORDERED construct, Up: The libgomp ABI 6335 1.1 mrg 6336 1.19 mrg 13.13 Implementing SECTIONS construct 6337 1.13 mrg ===================================== 6338 1.1 mrg 6339 1.1 mrg A block as 6340 1.1 mrg 6341 1.1 mrg #pragma omp sections 6342 1.1 mrg { 6343 1.1 mrg #pragma omp section 6344 1.1 mrg stmt1; 6345 1.1 mrg #pragma omp section 6346 1.1 mrg stmt2; 6347 1.1 mrg #pragma omp section 6348 1.1 mrg stmt3; 6349 1.1 mrg } 6350 1.1 mrg 6351 1.1 mrg becomes 6352 1.1 mrg 6353 1.1 mrg for (i = GOMP_sections_start (3); i != 0; i = GOMP_sections_next ()) 6354 1.1 mrg switch (i) 6355 1.1 mrg { 6356 1.1 mrg case 1: 6357 1.1 mrg stmt1; 6358 1.1 mrg break; 6359 1.1 mrg case 2: 6360 1.1 mrg stmt2; 6361 1.1 mrg break; 6362 1.1 mrg case 3: 6363 1.1 mrg stmt3; 6364 1.1 mrg break; 6365 1.1 mrg } 6366 1.1 mrg GOMP_barrier (); 6367 1.1 mrg 6368 1.1 mrg 6369 1.8 mrg File: libgomp.info, Node: Implementing SINGLE construct, Next: Implementing OpenACC's PARALLEL construct, Prev: Implementing SECTIONS construct, Up: The libgomp ABI 6370 1.1 mrg 6371 1.19 mrg 13.14 Implementing SINGLE construct 6372 1.13 mrg =================================== 6373 1.1 mrg 6374 1.1 mrg A block like 6375 1.1 mrg 6376 1.1 mrg #pragma omp single 6377 1.1 mrg { 6378 1.1 mrg body; 6379 1.1 mrg } 6380 1.1 mrg 6381 1.1 mrg becomes 6382 1.1 mrg 6383 1.1 mrg if (GOMP_single_start ()) 6384 1.1 mrg body; 6385 1.1 mrg GOMP_barrier (); 6386 1.1 mrg 6387 1.1 mrg while 6388 1.1 mrg 6389 1.1 mrg #pragma omp single copyprivate(x) 6390 1.1 mrg body; 6391 1.1 mrg 6392 1.1 mrg becomes 6393 1.1 mrg 6394 1.1 mrg datap = GOMP_single_copy_start (); 6395 1.1 mrg if (datap == NULL) 6396 1.1 mrg { 6397 1.1 mrg body; 6398 1.1 mrg data.x = x; 6399 1.1 mrg GOMP_single_copy_end (&data); 6400 1.1 mrg } 6401 1.1 mrg else 6402 1.1 mrg x = datap->x; 6403 1.1 mrg GOMP_barrier (); 6404 1.1 mrg 6405 1.1 mrg 6406 1.8 mrg File: libgomp.info, Node: Implementing OpenACC's PARALLEL construct, Prev: Implementing SINGLE construct, Up: The libgomp ABI 6407 1.8 mrg 6408 1.19 mrg 13.15 Implementing OpenACC's PARALLEL construct 6409 1.13 mrg =============================================== 6410 1.8 mrg 6411 1.8 mrg void GOACC_parallel () 6412 1.8 mrg 6413 1.8 mrg 6414 1.1 mrg File: libgomp.info, Node: Reporting Bugs, Next: Copying, Prev: The libgomp ABI, Up: Top 6415 1.1 mrg 6416 1.19 mrg 14 Reporting Bugs 6417 1.8 mrg ***************** 6418 1.1 mrg 6419 1.5 mrg Bugs in the GNU Offloading and Multi Processing Runtime Library should 6420 1.13 mrg be reported via Bugzilla (https://gcc.gnu.org/bugzilla/). Please add 6421 1.11 mrg "openacc", or "openmp", or both to the keywords field in the bug report, 6422 1.11 mrg as appropriate. 6423 1.1 mrg 6424 1.1 mrg 6425 1.1 mrg File: libgomp.info, Node: Copying, Next: GNU Free Documentation License, Prev: Reporting Bugs, Up: Top 6426 1.1 mrg 6427 1.3 skrll GNU General Public License 6428 1.1 mrg ************************** 6429 1.1 mrg 6430 1.3 skrll Version 3, 29 June 2007 6431 1.1 mrg 6432 1.19 mrg Copyright (C) 2007 Free Software Foundation, Inc. <https://www.fsf.org> 6433 1.1 mrg 6434 1.3 skrll Everyone is permitted to copy and distribute verbatim copies of this 6435 1.3 skrll license document, but changing it is not allowed. 6436 1.1 mrg 6437 1.1 mrg Preamble 6438 1.1 mrg ======== 6439 1.1 mrg 6440 1.3 skrll The GNU General Public License is a free, copyleft license for software 6441 1.3 skrll and other kinds of works. 6442 1.3 skrll 6443 1.3 skrll The licenses for most software and other practical works are designed 6444 1.3 skrll to take away your freedom to share and change the works. By contrast, 6445 1.3 skrll the GNU General Public License is intended to guarantee your freedom to 6446 1.3 skrll share and change all versions of a program-to make sure it remains free 6447 1.3 skrll software for all its users. We, the Free Software Foundation, use the 6448 1.3 skrll GNU General Public License for most of our software; it applies also to 6449 1.3 skrll any other work released this way by its authors. You can apply it to 6450 1.1 mrg your programs, too. 6451 1.1 mrg 6452 1.1 mrg When we speak of free software, we are referring to freedom, not 6453 1.1 mrg price. Our General Public Licenses are designed to make sure that you 6454 1.1 mrg have the freedom to distribute copies of free software (and charge for 6455 1.3 skrll them if you wish), that you receive source code or can get it if you 6456 1.3 skrll want it, that you can change the software or use pieces of it in new 6457 1.3 skrll free programs, and that you know you can do these things. 6458 1.3 skrll 6459 1.3 skrll To protect your rights, we need to prevent others from denying you 6460 1.11 mrg these rights or asking you to surrender the rights. Therefore, you have 6461 1.11 mrg certain responsibilities if you distribute copies of the software, or if 6462 1.11 mrg you modify it: responsibilities to respect the freedom of others. 6463 1.1 mrg 6464 1.1 mrg For example, if you distribute copies of such a program, whether 6465 1.3 skrll gratis or for a fee, you must pass on to the recipients the same 6466 1.3 skrll freedoms that you received. You must make sure that they, too, receive 6467 1.3 skrll or can get the source code. And you must show them these terms so they 6468 1.3 skrll know their rights. 6469 1.3 skrll 6470 1.3 skrll Developers that use the GNU GPL protect your rights with two steps: 6471 1.3 skrll (1) assert copyright on the software, and (2) offer you this License 6472 1.3 skrll giving you legal permission to copy, distribute and/or modify it. 6473 1.3 skrll 6474 1.3 skrll For the developers' and authors' protection, the GPL clearly explains 6475 1.3 skrll that there is no warranty for this free software. For both users' and 6476 1.3 skrll authors' sake, the GPL requires that modified versions be marked as 6477 1.3 skrll changed, so that their problems will not be attributed erroneously to 6478 1.3 skrll authors of previous versions. 6479 1.3 skrll 6480 1.3 skrll Some devices are designed to deny users access to install or run 6481 1.11 mrg modified versions of the software inside them, although the manufacturer 6482 1.11 mrg can do so. This is fundamentally incompatible with the aim of 6483 1.11 mrg protecting users' freedom to change the software. The systematic 6484 1.11 mrg pattern of such abuse occurs in the area of products for individuals to 6485 1.11 mrg use, which is precisely where it is most unacceptable. Therefore, we 6486 1.11 mrg have designed this version of the GPL to prohibit the practice for those 6487 1.11 mrg products. If such problems arise substantially in other domains, we 6488 1.11 mrg stand ready to extend this provision to those domains in future versions 6489 1.11 mrg of the GPL, as needed to protect the freedom of users. 6490 1.3 skrll 6491 1.3 skrll Finally, every program is threatened constantly by software patents. 6492 1.3 skrll States should not allow patents to restrict development and use of 6493 1.3 skrll software on general-purpose computers, but in those that do, we wish to 6494 1.3 skrll avoid the special danger that patents applied to a free program could 6495 1.3 skrll make it effectively proprietary. To prevent this, the GPL assures that 6496 1.3 skrll patents cannot be used to render the program non-free. 6497 1.1 mrg 6498 1.1 mrg The precise terms and conditions for copying, distribution and 6499 1.1 mrg modification follow. 6500 1.1 mrg 6501 1.3 skrll TERMS AND CONDITIONS 6502 1.3 skrll ==================== 6503 1.3 skrll 6504 1.3 skrll 0. Definitions. 6505 1.3 skrll 6506 1.3 skrll "This License" refers to version 3 of the GNU General Public 6507 1.3 skrll License. 6508 1.1 mrg 6509 1.3 skrll "Copyright" also means copyright-like laws that apply to other 6510 1.3 skrll kinds of works, such as semiconductor masks. 6511 1.3 skrll 6512 1.3 skrll "The Program" refers to any copyrightable work licensed under this 6513 1.3 skrll License. Each licensee is addressed as "you". "Licensees" and 6514 1.3 skrll "recipients" may be individuals or organizations. 6515 1.3 skrll 6516 1.3 skrll To "modify" a work means to copy from or adapt all or part of the 6517 1.3 skrll work in a fashion requiring copyright permission, other than the 6518 1.3 skrll making of an exact copy. The resulting work is called a "modified 6519 1.3 skrll version" of the earlier work or a work "based on" the earlier work. 6520 1.3 skrll 6521 1.3 skrll A "covered work" means either the unmodified Program or a work 6522 1.3 skrll based on the Program. 6523 1.3 skrll 6524 1.3 skrll To "propagate" a work means to do anything with it that, without 6525 1.3 skrll permission, would make you directly or secondarily liable for 6526 1.11 mrg infringement under applicable copyright law, except executing it on 6527 1.11 mrg a computer or modifying a private copy. Propagation includes 6528 1.3 skrll copying, distribution (with or without modification), making 6529 1.3 skrll available to the public, and in some countries other activities as 6530 1.3 skrll well. 6531 1.3 skrll 6532 1.3 skrll To "convey" a work means any kind of propagation that enables other 6533 1.3 skrll parties to make or receive copies. Mere interaction with a user 6534 1.3 skrll through a computer network, with no transfer of a copy, is not 6535 1.3 skrll conveying. 6536 1.3 skrll 6537 1.3 skrll An interactive user interface displays "Appropriate Legal Notices" 6538 1.3 skrll to the extent that it includes a convenient and prominently visible 6539 1.3 skrll feature that (1) displays an appropriate copyright notice, and (2) 6540 1.3 skrll tells the user that there is no warranty for the work (except to 6541 1.11 mrg the extent that warranties are provided), that licensees may convey 6542 1.11 mrg the work under this License, and how to view a copy of this 6543 1.3 skrll License. If the interface presents a list of user commands or 6544 1.3 skrll options, such as a menu, a prominent item in the list meets this 6545 1.3 skrll criterion. 6546 1.3 skrll 6547 1.3 skrll 1. Source Code. 6548 1.3 skrll 6549 1.3 skrll The "source code" for a work means the preferred form of the work 6550 1.11 mrg for making modifications to it. "Object code" means any non-source 6551 1.11 mrg form of a work. 6552 1.3 skrll 6553 1.3 skrll A "Standard Interface" means an interface that either is an 6554 1.3 skrll official standard defined by a recognized standards body, or, in 6555 1.3 skrll the case of interfaces specified for a particular programming 6556 1.3 skrll language, one that is widely used among developers working in that 6557 1.3 skrll language. 6558 1.3 skrll 6559 1.3 skrll The "System Libraries" of an executable work include anything, 6560 1.3 skrll other than the work as a whole, that (a) is included in the normal 6561 1.3 skrll form of packaging a Major Component, but which is not part of that 6562 1.11 mrg Major Component, and (b) serves only to enable use of the work with 6563 1.11 mrg that Major Component, or to implement a Standard Interface for 6564 1.11 mrg which an implementation is available to the public in source code 6565 1.11 mrg form. A "Major Component", in this context, means a major 6566 1.3 skrll essential component (kernel, window system, and so on) of the 6567 1.3 skrll specific operating system (if any) on which the executable work 6568 1.3 skrll runs, or a compiler used to produce the work, or an object code 6569 1.3 skrll interpreter used to run it. 6570 1.3 skrll 6571 1.3 skrll The "Corresponding Source" for a work in object code form means all 6572 1.3 skrll the source code needed to generate, install, and (for an executable 6573 1.11 mrg work) run the object code and to modify the work, including scripts 6574 1.11 mrg to control those activities. However, it does not include the 6575 1.11 mrg work's System Libraries, or general-purpose tools or generally 6576 1.3 skrll available free programs which are used unmodified in performing 6577 1.3 skrll those activities but which are not part of the work. For example, 6578 1.11 mrg Corresponding Source includes interface definition files associated 6579 1.11 mrg with source files for the work, and the source code for shared 6580 1.11 mrg libraries and dynamically linked subprograms that the work is 6581 1.11 mrg specifically designed to require, such as by intimate data 6582 1.3 skrll communication or control flow between those subprograms and other 6583 1.3 skrll parts of the work. 6584 1.3 skrll 6585 1.3 skrll The Corresponding Source need not include anything that users can 6586 1.3 skrll regenerate automatically from other parts of the Corresponding 6587 1.3 skrll Source. 6588 1.3 skrll 6589 1.3 skrll The Corresponding Source for a work in source code form is that 6590 1.3 skrll same work. 6591 1.3 skrll 6592 1.3 skrll 2. Basic Permissions. 6593 1.3 skrll 6594 1.3 skrll All rights granted under this License are granted for the term of 6595 1.3 skrll copyright on the Program, and are irrevocable provided the stated 6596 1.3 skrll conditions are met. This License explicitly affirms your unlimited 6597 1.3 skrll permission to run the unmodified Program. The output from running 6598 1.11 mrg a covered work is covered by this License only if the output, given 6599 1.11 mrg its content, constitutes a covered work. This License acknowledges 6600 1.11 mrg your rights of fair use or other equivalent, as provided by 6601 1.11 mrg copyright law. 6602 1.3 skrll 6603 1.3 skrll You may make, run and propagate covered works that you do not 6604 1.3 skrll convey, without conditions so long as your license otherwise 6605 1.3 skrll remains in force. You may convey covered works to others for the 6606 1.11 mrg sole purpose of having them make modifications exclusively for you, 6607 1.11 mrg or provide you with facilities for running those works, provided 6608 1.11 mrg that you comply with the terms of this License in conveying all 6609 1.11 mrg material for which you do not control copyright. Those thus making 6610 1.11 mrg or running the covered works for you must do so exclusively on your 6611 1.11 mrg behalf, under your direction and control, on terms that prohibit 6612 1.11 mrg them from making any copies of your copyrighted material outside 6613 1.11 mrg their relationship with you. 6614 1.3 skrll 6615 1.3 skrll Conveying under any other circumstances is permitted solely under 6616 1.3 skrll the conditions stated below. Sublicensing is not allowed; section 6617 1.3 skrll 10 makes it unnecessary. 6618 1.3 skrll 6619 1.3 skrll 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 6620 1.3 skrll 6621 1.3 skrll No covered work shall be deemed part of an effective technological 6622 1.3 skrll measure under any applicable law fulfilling obligations under 6623 1.3 skrll article 11 of the WIPO copyright treaty adopted on 20 December 6624 1.3 skrll 1996, or similar laws prohibiting or restricting circumvention of 6625 1.3 skrll such measures. 6626 1.3 skrll 6627 1.3 skrll When you convey a covered work, you waive any legal power to forbid 6628 1.3 skrll circumvention of technological measures to the extent such 6629 1.3 skrll circumvention is effected by exercising rights under this License 6630 1.11 mrg with respect to the covered work, and you disclaim any intention to 6631 1.11 mrg limit operation or modification of the work as a means of 6632 1.3 skrll enforcing, against the work's users, your or third parties' legal 6633 1.3 skrll rights to forbid circumvention of technological measures. 6634 1.3 skrll 6635 1.3 skrll 4. Conveying Verbatim Copies. 6636 1.3 skrll 6637 1.3 skrll You may convey verbatim copies of the Program's source code as you 6638 1.3 skrll receive it, in any medium, provided that you conspicuously and 6639 1.3 skrll appropriately publish on each copy an appropriate copyright notice; 6640 1.3 skrll keep intact all notices stating that this License and any 6641 1.3 skrll non-permissive terms added in accord with section 7 apply to the 6642 1.3 skrll code; keep intact all notices of the absence of any warranty; and 6643 1.3 skrll give all recipients a copy of this License along with the Program. 6644 1.3 skrll 6645 1.3 skrll You may charge any price or no price for each copy that you convey, 6646 1.3 skrll and you may offer support or warranty protection for a fee. 6647 1.3 skrll 6648 1.3 skrll 5. Conveying Modified Source Versions. 6649 1.3 skrll 6650 1.3 skrll You may convey a work based on the Program, or the modifications to 6651 1.3 skrll produce it from the Program, in the form of source code under the 6652 1.3 skrll terms of section 4, provided that you also meet all of these 6653 1.3 skrll conditions: 6654 1.3 skrll 6655 1.3 skrll a. The work must carry prominent notices stating that you 6656 1.3 skrll modified it, and giving a relevant date. 6657 1.3 skrll 6658 1.3 skrll b. The work must carry prominent notices stating that it is 6659 1.3 skrll released under this License and any conditions added under 6660 1.3 skrll section 7. This requirement modifies the requirement in 6661 1.3 skrll section 4 to "keep intact all notices". 6662 1.3 skrll 6663 1.3 skrll c. You must license the entire work, as a whole, under this 6664 1.3 skrll License to anyone who comes into possession of a copy. This 6665 1.3 skrll License will therefore apply, along with any applicable 6666 1.3 skrll section 7 additional terms, to the whole of the work, and all 6667 1.3 skrll its parts, regardless of how they are packaged. This License 6668 1.3 skrll gives no permission to license the work in any other way, but 6669 1.3 skrll it does not invalidate such permission if you have separately 6670 1.3 skrll received it. 6671 1.3 skrll 6672 1.3 skrll d. If the work has interactive user interfaces, each must display 6673 1.3 skrll Appropriate Legal Notices; however, if the Program has 6674 1.3 skrll interactive interfaces that do not display Appropriate Legal 6675 1.3 skrll Notices, your work need not make them do so. 6676 1.3 skrll 6677 1.3 skrll A compilation of a covered work with other separate and independent 6678 1.3 skrll works, which are not by their nature extensions of the covered 6679 1.3 skrll work, and which are not combined with it such as to form a larger 6680 1.3 skrll program, in or on a volume of a storage or distribution medium, is 6681 1.3 skrll called an "aggregate" if the compilation and its resulting 6682 1.3 skrll copyright are not used to limit the access or legal rights of the 6683 1.3 skrll compilation's users beyond what the individual works permit. 6684 1.3 skrll Inclusion of a covered work in an aggregate does not cause this 6685 1.3 skrll License to apply to the other parts of the aggregate. 6686 1.3 skrll 6687 1.3 skrll 6. Conveying Non-Source Forms. 6688 1.3 skrll 6689 1.3 skrll You may convey a covered work in object code form under the terms 6690 1.3 skrll of sections 4 and 5, provided that you also convey the 6691 1.3 skrll machine-readable Corresponding Source under the terms of this 6692 1.3 skrll License, in one of these ways: 6693 1.3 skrll 6694 1.3 skrll a. Convey the object code in, or embodied in, a physical product 6695 1.3 skrll (including a physical distribution medium), accompanied by the 6696 1.3 skrll Corresponding Source fixed on a durable physical medium 6697 1.3 skrll customarily used for software interchange. 6698 1.3 skrll 6699 1.3 skrll b. Convey the object code in, or embodied in, a physical product 6700 1.3 skrll (including a physical distribution medium), accompanied by a 6701 1.11 mrg written offer, valid for at least three years and valid for as 6702 1.11 mrg long as you offer spare parts or customer support for that 6703 1.3 skrll product model, to give anyone who possesses the object code 6704 1.3 skrll either (1) a copy of the Corresponding Source for all the 6705 1.3 skrll software in the product that is covered by this License, on a 6706 1.3 skrll durable physical medium customarily used for software 6707 1.3 skrll interchange, for a price no more than your reasonable cost of 6708 1.3 skrll physically performing this conveying of source, or (2) access 6709 1.3 skrll to copy the Corresponding Source from a network server at no 6710 1.3 skrll charge. 6711 1.3 skrll 6712 1.11 mrg c. Convey individual copies of the object code with a copy of the 6713 1.11 mrg written offer to provide the Corresponding Source. This 6714 1.3 skrll alternative is allowed only occasionally and noncommercially, 6715 1.3 skrll and only if you received the object code with such an offer, 6716 1.3 skrll in accord with subsection 6b. 6717 1.3 skrll 6718 1.3 skrll d. Convey the object code by offering access from a designated 6719 1.11 mrg place (gratis or for a charge), and offer equivalent access to 6720 1.11 mrg the Corresponding Source in the same way through the same 6721 1.3 skrll place at no further charge. You need not require recipients 6722 1.3 skrll to copy the Corresponding Source along with the object code. 6723 1.3 skrll If the place to copy the object code is a network server, the 6724 1.11 mrg Corresponding Source may be on a different server (operated by 6725 1.11 mrg you or a third party) that supports equivalent copying 6726 1.11 mrg facilities, provided you maintain clear directions next to the 6727 1.11 mrg object code saying where to find the Corresponding Source. 6728 1.3 skrll Regardless of what server hosts the Corresponding Source, you 6729 1.11 mrg remain obligated to ensure that it is available for as long as 6730 1.11 mrg needed to satisfy these requirements. 6731 1.3 skrll 6732 1.3 skrll e. Convey the object code using peer-to-peer transmission, 6733 1.3 skrll provided you inform other peers where the object code and 6734 1.3 skrll Corresponding Source of the work are being offered to the 6735 1.3 skrll general public at no charge under subsection 6d. 6736 1.3 skrll 6737 1.3 skrll A separable portion of the object code, whose source code is 6738 1.3 skrll excluded from the Corresponding Source as a System Library, need 6739 1.3 skrll not be included in conveying the object code work. 6740 1.3 skrll 6741 1.3 skrll A "User Product" is either (1) a "consumer product", which means 6742 1.3 skrll any tangible personal property which is normally used for personal, 6743 1.3 skrll family, or household purposes, or (2) anything designed or sold for 6744 1.11 mrg incorporation into a dwelling. In determining whether a product is 6745 1.11 mrg a consumer product, doubtful cases shall be resolved in favor of 6746 1.3 skrll coverage. For a particular product received by a particular user, 6747 1.3 skrll "normally used" refers to a typical or common use of that class of 6748 1.3 skrll product, regardless of the status of the particular user or of the 6749 1.3 skrll way in which the particular user actually uses, or expects or is 6750 1.3 skrll expected to use, the product. A product is a consumer product 6751 1.3 skrll regardless of whether the product has substantial commercial, 6752 1.3 skrll industrial or non-consumer uses, unless such uses represent the 6753 1.3 skrll only significant mode of use of the product. 6754 1.3 skrll 6755 1.3 skrll "Installation Information" for a User Product means any methods, 6756 1.3 skrll procedures, authorization keys, or other information required to 6757 1.3 skrll install and execute modified versions of a covered work in that 6758 1.3 skrll User Product from a modified version of its Corresponding Source. 6759 1.3 skrll The information must suffice to ensure that the continued 6760 1.3 skrll functioning of the modified object code is in no case prevented or 6761 1.3 skrll interfered with solely because modification has been made. 6762 1.3 skrll 6763 1.3 skrll If you convey an object code work under this section in, or with, 6764 1.3 skrll or specifically for use in, a User Product, and the conveying 6765 1.3 skrll occurs as part of a transaction in which the right of possession 6766 1.3 skrll and use of the User Product is transferred to the recipient in 6767 1.3 skrll perpetuity or for a fixed term (regardless of how the transaction 6768 1.3 skrll is characterized), the Corresponding Source conveyed under this 6769 1.3 skrll section must be accompanied by the Installation Information. But 6770 1.3 skrll this requirement does not apply if neither you nor any third party 6771 1.3 skrll retains the ability to install modified object code on the User 6772 1.3 skrll Product (for example, the work has been installed in ROM). 6773 1.3 skrll 6774 1.3 skrll The requirement to provide Installation Information does not 6775 1.3 skrll include a requirement to continue to provide support service, 6776 1.11 mrg warranty, or updates for a work that has been modified or installed 6777 1.11 mrg by the recipient, or for the User Product in which it has been 6778 1.11 mrg modified or installed. Access to a network may be denied when the 6779 1.11 mrg modification itself materially and adversely affects the operation 6780 1.11 mrg of the network or violates the rules and protocols for 6781 1.3 skrll communication across the network. 6782 1.3 skrll 6783 1.3 skrll Corresponding Source conveyed, and Installation Information 6784 1.3 skrll provided, in accord with this section must be in a format that is 6785 1.3 skrll publicly documented (and with an implementation available to the 6786 1.3 skrll public in source code form), and must require no special password 6787 1.3 skrll or key for unpacking, reading or copying. 6788 1.3 skrll 6789 1.3 skrll 7. Additional Terms. 6790 1.3 skrll 6791 1.3 skrll "Additional permissions" are terms that supplement the terms of 6792 1.3 skrll this License by making exceptions from one or more of its 6793 1.3 skrll conditions. Additional permissions that are applicable to the 6794 1.3 skrll entire Program shall be treated as though they were included in 6795 1.3 skrll this License, to the extent that they are valid under applicable 6796 1.3 skrll law. If additional permissions apply only to part of the Program, 6797 1.3 skrll that part may be used separately under those permissions, but the 6798 1.3 skrll entire Program remains governed by this License without regard to 6799 1.3 skrll the additional permissions. 6800 1.3 skrll 6801 1.3 skrll When you convey a copy of a covered work, you may at your option 6802 1.3 skrll remove any additional permissions from that copy, or from any part 6803 1.3 skrll of it. (Additional permissions may be written to require their own 6804 1.3 skrll removal in certain cases when you modify the work.) You may place 6805 1.3 skrll additional permissions on material, added by you to a covered work, 6806 1.3 skrll for which you have or can give appropriate copyright permission. 6807 1.3 skrll 6808 1.3 skrll Notwithstanding any other provision of this License, for material 6809 1.3 skrll you add to a covered work, you may (if authorized by the copyright 6810 1.11 mrg holders of that material) supplement the terms of this License with 6811 1.11 mrg terms: 6812 1.3 skrll 6813 1.3 skrll a. Disclaiming warranty or limiting liability differently from 6814 1.3 skrll the terms of sections 15 and 16 of this License; or 6815 1.3 skrll 6816 1.3 skrll b. Requiring preservation of specified reasonable legal notices 6817 1.3 skrll or author attributions in that material or in the Appropriate 6818 1.3 skrll Legal Notices displayed by works containing it; or 6819 1.3 skrll 6820 1.3 skrll c. Prohibiting misrepresentation of the origin of that material, 6821 1.11 mrg or requiring that modified versions of such material be marked 6822 1.11 mrg in reasonable ways as different from the original version; or 6823 1.3 skrll 6824 1.3 skrll d. Limiting the use for publicity purposes of names of licensors 6825 1.3 skrll or authors of the material; or 6826 1.3 skrll 6827 1.3 skrll e. Declining to grant rights under trademark law for use of some 6828 1.3 skrll trade names, trademarks, or service marks; or 6829 1.3 skrll 6830 1.3 skrll f. Requiring indemnification of licensors and authors of that 6831 1.3 skrll material by anyone who conveys the material (or modified 6832 1.3 skrll versions of it) with contractual assumptions of liability to 6833 1.3 skrll the recipient, for any liability that these contractual 6834 1.3 skrll assumptions directly impose on those licensors and authors. 6835 1.3 skrll 6836 1.3 skrll All other non-permissive additional terms are considered "further 6837 1.3 skrll restrictions" within the meaning of section 10. If the Program as 6838 1.3 skrll you received it, or any part of it, contains a notice stating that 6839 1.3 skrll it is governed by this License along with a term that is a further 6840 1.3 skrll restriction, you may remove that term. If a license document 6841 1.11 mrg contains a further restriction but permits relicensing or conveying 6842 1.11 mrg under this License, you may add to a covered work material governed 6843 1.11 mrg by the terms of that license document, provided that the further 6844 1.11 mrg restriction does not survive such relicensing or conveying. 6845 1.3 skrll 6846 1.3 skrll If you add terms to a covered work in accord with this section, you 6847 1.3 skrll must place, in the relevant source files, a statement of the 6848 1.3 skrll additional terms that apply to those files, or a notice indicating 6849 1.3 skrll where to find the applicable terms. 6850 1.3 skrll 6851 1.3 skrll Additional terms, permissive or non-permissive, may be stated in 6852 1.3 skrll the form of a separately written license, or stated as exceptions; 6853 1.3 skrll the above requirements apply either way. 6854 1.3 skrll 6855 1.3 skrll 8. Termination. 6856 1.3 skrll 6857 1.3 skrll You may not propagate or modify a covered work except as expressly 6858 1.3 skrll provided under this License. Any attempt otherwise to propagate or 6859 1.3 skrll modify it is void, and will automatically terminate your rights 6860 1.11 mrg under this License (including any patent licenses granted under the 6861 1.11 mrg third paragraph of section 11). 6862 1.3 skrll 6863 1.3 skrll However, if you cease all violation of this License, then your 6864 1.3 skrll license from a particular copyright holder is reinstated (a) 6865 1.11 mrg provisionally, unless and until the copyright holder explicitly and 6866 1.11 mrg finally terminates your license, and (b) permanently, if the 6867 1.3 skrll copyright holder fails to notify you of the violation by some 6868 1.3 skrll reasonable means prior to 60 days after the cessation. 6869 1.3 skrll 6870 1.3 skrll Moreover, your license from a particular copyright holder is 6871 1.3 skrll reinstated permanently if the copyright holder notifies you of the 6872 1.3 skrll violation by some reasonable means, this is the first time you have 6873 1.3 skrll received notice of violation of this License (for any work) from 6874 1.3 skrll that copyright holder, and you cure the violation prior to 30 days 6875 1.3 skrll after your receipt of the notice. 6876 1.3 skrll 6877 1.3 skrll Termination of your rights under this section does not terminate 6878 1.11 mrg the licenses of parties who have received copies or rights from you 6879 1.11 mrg under this License. If your rights have been terminated and not 6880 1.11 mrg permanently reinstated, you do not qualify to receive new licenses 6881 1.11 mrg for the same material under section 10. 6882 1.3 skrll 6883 1.3 skrll 9. Acceptance Not Required for Having Copies. 6884 1.3 skrll 6885 1.3 skrll You are not required to accept this License in order to receive or 6886 1.3 skrll run a copy of the Program. Ancillary propagation of a covered work 6887 1.3 skrll occurring solely as a consequence of using peer-to-peer 6888 1.3 skrll transmission to receive a copy likewise does not require 6889 1.3 skrll acceptance. However, nothing other than this License grants you 6890 1.3 skrll permission to propagate or modify any covered work. These actions 6891 1.3 skrll infringe copyright if you do not accept this License. Therefore, 6892 1.3 skrll by modifying or propagating a covered work, you indicate your 6893 1.3 skrll acceptance of this License to do so. 6894 1.3 skrll 6895 1.11 mrg 10. Automatic Licensing of Downstream Recipients. 6896 1.3 skrll 6897 1.3 skrll Each time you convey a covered work, the recipient automatically 6898 1.3 skrll receives a license from the original licensors, to run, modify and 6899 1.3 skrll propagate that work, subject to this License. You are not 6900 1.3 skrll responsible for enforcing compliance by third parties with this 6901 1.3 skrll License. 6902 1.3 skrll 6903 1.3 skrll An "entity transaction" is a transaction transferring control of an 6904 1.3 skrll organization, or substantially all assets of one, or subdividing an 6905 1.3 skrll organization, or merging organizations. If propagation of a 6906 1.3 skrll covered work results from an entity transaction, each party to that 6907 1.3 skrll transaction who receives a copy of the work also receives whatever 6908 1.3 skrll licenses to the work the party's predecessor in interest had or 6909 1.11 mrg could give under the previous paragraph, plus a right to possession 6910 1.11 mrg of the Corresponding Source of the work from the predecessor in 6911 1.11 mrg interest, if the predecessor has it or can get it with reasonable 6912 1.11 mrg efforts. 6913 1.3 skrll 6914 1.3 skrll You may not impose any further restrictions on the exercise of the 6915 1.3 skrll rights granted or affirmed under this License. For example, you 6916 1.11 mrg may not impose a license fee, royalty, or other charge for exercise 6917 1.11 mrg of rights granted under this License, and you may not initiate 6918 1.11 mrg litigation (including a cross-claim or counterclaim in a lawsuit) 6919 1.11 mrg alleging that any patent claim is infringed by making, using, 6920 1.11 mrg selling, offering for sale, or importing the Program or any portion 6921 1.11 mrg of it. 6922 1.3 skrll 6923 1.11 mrg 11. Patents. 6924 1.3 skrll 6925 1.3 skrll A "contributor" is a copyright holder who authorizes use under this 6926 1.3 skrll License of the Program or a work on which the Program is based. 6927 1.3 skrll The work thus licensed is called the contributor's "contributor 6928 1.3 skrll version". 6929 1.3 skrll 6930 1.3 skrll A contributor's "essential patent claims" are all patent claims 6931 1.3 skrll owned or controlled by the contributor, whether already acquired or 6932 1.3 skrll hereafter acquired, that would be infringed by some manner, 6933 1.3 skrll permitted by this License, of making, using, or selling its 6934 1.3 skrll contributor version, but do not include claims that would be 6935 1.3 skrll infringed only as a consequence of further modification of the 6936 1.3 skrll contributor version. For purposes of this definition, "control" 6937 1.3 skrll includes the right to grant patent sublicenses in a manner 6938 1.3 skrll consistent with the requirements of this License. 6939 1.3 skrll 6940 1.3 skrll Each contributor grants you a non-exclusive, worldwide, 6941 1.3 skrll royalty-free patent license under the contributor's essential 6942 1.3 skrll patent claims, to make, use, sell, offer for sale, import and 6943 1.11 mrg otherwise run, modify and propagate the contents of its contributor 6944 1.11 mrg version. 6945 1.3 skrll 6946 1.3 skrll In the following three paragraphs, a "patent license" is any 6947 1.3 skrll express agreement or commitment, however denominated, not to 6948 1.3 skrll enforce a patent (such as an express permission to practice a 6949 1.11 mrg patent or covenant not to sue for patent infringement). To "grant" 6950 1.11 mrg such a patent license to a party means to make such an agreement or 6951 1.11 mrg commitment not to enforce a patent against the party. 6952 1.3 skrll 6953 1.3 skrll If you convey a covered work, knowingly relying on a patent 6954 1.3 skrll license, and the Corresponding Source of the work is not available 6955 1.3 skrll for anyone to copy, free of charge and under the terms of this 6956 1.3 skrll License, through a publicly available network server or other 6957 1.3 skrll readily accessible means, then you must either (1) cause the 6958 1.3 skrll Corresponding Source to be so available, or (2) arrange to deprive 6959 1.3 skrll yourself of the benefit of the patent license for this particular 6960 1.3 skrll work, or (3) arrange, in a manner consistent with the requirements 6961 1.3 skrll of this License, to extend the patent license to downstream 6962 1.3 skrll recipients. "Knowingly relying" means you have actual knowledge 6963 1.3 skrll that, but for the patent license, your conveying the covered work 6964 1.3 skrll in a country, or your recipient's use of the covered work in a 6965 1.3 skrll country, would infringe one or more identifiable patents in that 6966 1.3 skrll country that you have reason to believe are valid. 6967 1.3 skrll 6968 1.3 skrll If, pursuant to or in connection with a single transaction or 6969 1.3 skrll arrangement, you convey, or propagate by procuring conveyance of, a 6970 1.3 skrll covered work, and grant a patent license to some of the parties 6971 1.3 skrll receiving the covered work authorizing them to use, propagate, 6972 1.3 skrll modify or convey a specific copy of the covered work, then the 6973 1.3 skrll patent license you grant is automatically extended to all 6974 1.3 skrll recipients of the covered work and works based on it. 6975 1.3 skrll 6976 1.3 skrll A patent license is "discriminatory" if it does not include within 6977 1.3 skrll the scope of its coverage, prohibits the exercise of, or is 6978 1.3 skrll conditioned on the non-exercise of one or more of the rights that 6979 1.3 skrll are specifically granted under this License. You may not convey a 6980 1.3 skrll covered work if you are a party to an arrangement with a third 6981 1.11 mrg party that is in the business of distributing software, under which 6982 1.11 mrg you make payment to the third party based on the extent of your 6983 1.11 mrg activity of conveying the work, and under which the third party 6984 1.11 mrg grants, to any of the parties who would receive the covered work 6985 1.11 mrg from you, a discriminatory patent license (a) in connection with 6986 1.11 mrg copies of the covered work conveyed by you (or copies made from 6987 1.11 mrg those copies), or (b) primarily for and in connection with specific 6988 1.11 mrg products or compilations that contain the covered work, unless you 6989 1.11 mrg entered into that arrangement, or that patent license was granted, 6990 1.11 mrg prior to 28 March 2007. 6991 1.3 skrll 6992 1.3 skrll Nothing in this License shall be construed as excluding or limiting 6993 1.3 skrll any implied license or other defenses to infringement that may 6994 1.3 skrll otherwise be available to you under applicable patent law. 6995 1.3 skrll 6996 1.11 mrg 12. No Surrender of Others' Freedom. 6997 1.3 skrll 6998 1.11 mrg If conditions are imposed on you (whether by court order, agreement 6999 1.11 mrg or otherwise) that contradict the conditions of this License, they 7000 1.11 mrg do not excuse you from the conditions of this License. If you 7001 1.11 mrg cannot convey a covered work so as to satisfy simultaneously your 7002 1.11 mrg obligations under this License and any other pertinent obligations, 7003 1.11 mrg then as a consequence you may not convey it at all. For example, 7004 1.11 mrg if you agree to terms that obligate you to collect a royalty for 7005 1.11 mrg further conveying from those to whom you convey the Program, the 7006 1.11 mrg only way you could satisfy both those terms and this License would 7007 1.11 mrg be to refrain entirely from conveying the Program. 7008 1.3 skrll 7009 1.11 mrg 13. Use with the GNU Affero General Public License. 7010 1.3 skrll 7011 1.3 skrll Notwithstanding any other provision of this License, you have 7012 1.3 skrll permission to link or combine any covered work with a work licensed 7013 1.3 skrll under version 3 of the GNU Affero General Public License into a 7014 1.3 skrll single combined work, and to convey the resulting work. The terms 7015 1.3 skrll of this License will continue to apply to the part which is the 7016 1.3 skrll covered work, but the special requirements of the GNU Affero 7017 1.3 skrll General Public License, section 13, concerning interaction through 7018 1.3 skrll a network will apply to the combination as such. 7019 1.3 skrll 7020 1.11 mrg 14. Revised Versions of this License. 7021 1.3 skrll 7022 1.3 skrll The Free Software Foundation may publish revised and/or new 7023 1.11 mrg versions of the GNU General Public License from time to time. Such 7024 1.11 mrg new versions will be similar in spirit to the present version, but 7025 1.11 mrg may differ in detail to address new problems or concerns. 7026 1.1 mrg 7027 1.1 mrg Each version is given a distinguishing version number. If the 7028 1.3 skrll Program specifies that a certain numbered version of the GNU 7029 1.3 skrll General Public License "or any later version" applies to it, you 7030 1.3 skrll have the option of following the terms and conditions either of 7031 1.11 mrg that numbered version or of any later version published by the Free 7032 1.11 mrg Software Foundation. If the Program does not specify a version 7033 1.11 mrg number of the GNU General Public License, you may choose any 7034 1.11 mrg version ever published by the Free Software Foundation. 7035 1.1 mrg 7036 1.3 skrll If the Program specifies that a proxy can decide which future 7037 1.3 skrll versions of the GNU General Public License can be used, that 7038 1.3 skrll proxy's public statement of acceptance of a version permanently 7039 1.3 skrll authorizes you to choose that version for the Program. 7040 1.3 skrll 7041 1.3 skrll Later license versions may give you additional or different 7042 1.3 skrll permissions. However, no additional obligations are imposed on any 7043 1.3 skrll author or copyright holder as a result of your choosing to follow a 7044 1.3 skrll later version. 7045 1.3 skrll 7046 1.11 mrg 15. Disclaimer of Warranty. 7047 1.3 skrll 7048 1.3 skrll THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 7049 1.11 mrg APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE 7050 1.3 skrll COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" 7051 1.3 skrll WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, 7052 1.3 skrll INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 7053 1.11 mrg MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE 7054 1.3 skrll RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. 7055 1.3 skrll SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL 7056 1.3 skrll NECESSARY SERVICING, REPAIR OR CORRECTION. 7057 1.3 skrll 7058 1.11 mrg 16. Limitation of Liability. 7059 1.3 skrll 7060 1.3 skrll IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN 7061 1.3 skrll WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES 7062 1.11 mrg AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR 7063 1.11 mrg DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR 7064 1.3 skrll CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE 7065 1.3 skrll THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA 7066 1.3 skrll BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 7067 1.3 skrll PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 7068 1.3 skrll PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF 7069 1.3 skrll THE POSSIBILITY OF SUCH DAMAGES. 7070 1.3 skrll 7071 1.11 mrg 17. Interpretation of Sections 15 and 16. 7072 1.3 skrll 7073 1.3 skrll If the disclaimer of warranty and limitation of liability provided 7074 1.3 skrll above cannot be given local legal effect according to their terms, 7075 1.3 skrll reviewing courts shall apply local law that most closely 7076 1.3 skrll approximates an absolute waiver of all civil liability in 7077 1.3 skrll connection with the Program, unless a warranty or assumption of 7078 1.3 skrll liability accompanies a copy of the Program in return for a fee. 7079 1.1 mrg 7080 1.3 skrll END OF TERMS AND CONDITIONS 7081 1.3 skrll =========================== 7082 1.3 skrll 7083 1.3 skrll How to Apply These Terms to Your New Programs 7084 1.3 skrll ============================================= 7085 1.1 mrg 7086 1.1 mrg If you develop a new program, and you want it to be of the greatest 7087 1.1 mrg possible use to the public, the best way to achieve this is to make it 7088 1.1 mrg free software which everyone can redistribute and change under these 7089 1.1 mrg terms. 7090 1.1 mrg 7091 1.1 mrg To do so, attach the following notices to the program. It is safest 7092 1.1 mrg to attach them to the start of each source file to most effectively 7093 1.3 skrll state the exclusion of warranty; and each file should have at least the 7094 1.3 skrll "copyright" line and a pointer to where the full notice is found. 7095 1.1 mrg 7096 1.1 mrg ONE LINE TO GIVE THE PROGRAM'S NAME AND A BRIEF IDEA OF WHAT IT DOES. 7097 1.3 skrll Copyright (C) YEAR NAME OF AUTHOR 7098 1.1 mrg 7099 1.3 skrll This program is free software: you can redistribute it and/or modify 7100 1.1 mrg it under the terms of the GNU General Public License as published by 7101 1.3 skrll the Free Software Foundation, either version 3 of the License, or (at 7102 1.3 skrll your option) any later version. 7103 1.1 mrg 7104 1.3 skrll This program is distributed in the hope that it will be useful, but 7105 1.3 skrll WITHOUT ANY WARRANTY; without even the implied warranty of 7106 1.3 skrll MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 7107 1.3 skrll General Public License for more details. 7108 1.1 mrg 7109 1.1 mrg You should have received a copy of the GNU General Public License 7110 1.16 mrg along with this program. If not, see <https://www.gnu.org/licenses/>. 7111 1.1 mrg 7112 1.1 mrg Also add information on how to contact you by electronic and paper 7113 1.1 mrg mail. 7114 1.1 mrg 7115 1.3 skrll If the program does terminal interaction, make it output a short 7116 1.3 skrll notice like this when it starts in an interactive mode: 7117 1.1 mrg 7118 1.3 skrll PROGRAM Copyright (C) YEAR NAME OF AUTHOR 7119 1.11 mrg This program comes with ABSOLUTELY NO WARRANTY; for details type 'show w'. 7120 1.1 mrg This is free software, and you are welcome to redistribute it 7121 1.11 mrg under certain conditions; type 'show c' for details. 7122 1.1 mrg 7123 1.11 mrg The hypothetical commands 'show w' and 'show c' should show the 7124 1.3 skrll appropriate parts of the General Public License. Of course, your 7125 1.3 skrll program's commands might be different; for a GUI interface, you would 7126 1.3 skrll use an "about box". 7127 1.1 mrg 7128 1.1 mrg You should also get your employer (if you work as a programmer) or 7129 1.3 skrll school, if any, to sign a "copyright disclaimer" for the program, if 7130 1.3 skrll necessary. For more information on this, and how to apply and follow 7131 1.16 mrg the GNU GPL, see <https://www.gnu.org/licenses/>. 7132 1.1 mrg 7133 1.3 skrll The GNU General Public License does not permit incorporating your 7134 1.1 mrg program into proprietary programs. If your program is a subroutine 7135 1.1 mrg library, you may consider it more useful to permit linking proprietary 7136 1.1 mrg applications with the library. If this is what you want to do, use the 7137 1.3 skrll GNU Lesser General Public License instead of this License. But first, 7138 1.13 mrg please read <https://www.gnu.org/licenses/why-not-lgpl.html>. 7139 1.1 mrg 7140 1.1 mrg 7141 1.1 mrg File: libgomp.info, Node: GNU Free Documentation License, Next: Funding, Prev: Copying, Up: Top 7142 1.1 mrg 7143 1.1 mrg GNU Free Documentation License 7144 1.1 mrg ****************************** 7145 1.1 mrg 7146 1.3 skrll Version 1.3, 3 November 2008 7147 1.1 mrg 7148 1.3 skrll Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. 7149 1.19 mrg <https://www.fsf.org> 7150 1.1 mrg 7151 1.1 mrg Everyone is permitted to copy and distribute verbatim copies 7152 1.1 mrg of this license document, but changing it is not allowed. 7153 1.1 mrg 7154 1.1 mrg 0. PREAMBLE 7155 1.1 mrg 7156 1.1 mrg The purpose of this License is to make a manual, textbook, or other 7157 1.1 mrg functional and useful document "free" in the sense of freedom: to 7158 1.1 mrg assure everyone the effective freedom to copy and redistribute it, 7159 1.1 mrg with or without modifying it, either commercially or 7160 1.1 mrg noncommercially. Secondarily, this License preserves for the 7161 1.1 mrg author and publisher a way to get credit for their work, while not 7162 1.1 mrg being considered responsible for modifications made by others. 7163 1.1 mrg 7164 1.1 mrg This License is a kind of "copyleft", which means that derivative 7165 1.1 mrg works of the document must themselves be free in the same sense. 7166 1.1 mrg It complements the GNU General Public License, which is a copyleft 7167 1.1 mrg license designed for free software. 7168 1.1 mrg 7169 1.1 mrg We have designed this License in order to use it for manuals for 7170 1.1 mrg free software, because free software needs free documentation: a 7171 1.1 mrg free program should come with manuals providing the same freedoms 7172 1.1 mrg that the software does. But this License is not limited to 7173 1.1 mrg software manuals; it can be used for any textual work, regardless 7174 1.11 mrg of subject matter or whether it is published as a printed book. We 7175 1.11 mrg recommend this License principally for works whose purpose is 7176 1.1 mrg instruction or reference. 7177 1.1 mrg 7178 1.1 mrg 1. APPLICABILITY AND DEFINITIONS 7179 1.1 mrg 7180 1.1 mrg This License applies to any manual or other work, in any medium, 7181 1.11 mrg that contains a notice placed by the copyright holder saying it can 7182 1.11 mrg be distributed under the terms of this License. Such a notice 7183 1.1 mrg grants a world-wide, royalty-free license, unlimited in duration, 7184 1.1 mrg to use that work under the conditions stated herein. The 7185 1.1 mrg "Document", below, refers to any such manual or work. Any member 7186 1.11 mrg of the public is a licensee, and is addressed as "you". You accept 7187 1.11 mrg the license if you copy, modify or distribute the work in a way 7188 1.11 mrg requiring permission under copyright law. 7189 1.1 mrg 7190 1.1 mrg A "Modified Version" of the Document means any work containing the 7191 1.1 mrg Document or a portion of it, either copied verbatim, or with 7192 1.1 mrg modifications and/or translated into another language. 7193 1.1 mrg 7194 1.1 mrg A "Secondary Section" is a named appendix or a front-matter section 7195 1.1 mrg of the Document that deals exclusively with the relationship of the 7196 1.1 mrg publishers or authors of the Document to the Document's overall 7197 1.1 mrg subject (or to related matters) and contains nothing that could 7198 1.1 mrg fall directly within that overall subject. (Thus, if the Document 7199 1.1 mrg is in part a textbook of mathematics, a Secondary Section may not 7200 1.1 mrg explain any mathematics.) The relationship could be a matter of 7201 1.1 mrg historical connection with the subject or with related matters, or 7202 1.1 mrg of legal, commercial, philosophical, ethical or political position 7203 1.1 mrg regarding them. 7204 1.1 mrg 7205 1.1 mrg The "Invariant Sections" are certain Secondary Sections whose 7206 1.11 mrg titles are designated, as being those of Invariant Sections, in the 7207 1.11 mrg notice that says that the Document is released under this License. 7208 1.11 mrg If a section does not fit the above definition of Secondary then it 7209 1.11 mrg is not allowed to be designated as Invariant. The Document may 7210 1.11 mrg contain zero Invariant Sections. If the Document does not identify 7211 1.11 mrg any Invariant Sections then there are none. 7212 1.1 mrg 7213 1.1 mrg The "Cover Texts" are certain short passages of text that are 7214 1.1 mrg listed, as Front-Cover Texts or Back-Cover Texts, in the notice 7215 1.1 mrg that says that the Document is released under this License. A 7216 1.1 mrg Front-Cover Text may be at most 5 words, and a Back-Cover Text may 7217 1.1 mrg be at most 25 words. 7218 1.1 mrg 7219 1.1 mrg A "Transparent" copy of the Document means a machine-readable copy, 7220 1.1 mrg represented in a format whose specification is available to the 7221 1.1 mrg general public, that is suitable for revising the document 7222 1.11 mrg straightforwardly with generic text editors or (for images composed 7223 1.11 mrg of pixels) generic paint programs or (for drawings) some widely 7224 1.11 mrg available drawing editor, and that is suitable for input to text 7225 1.11 mrg formatters or for automatic translation to a variety of formats 7226 1.11 mrg suitable for input to text formatters. A copy made in an otherwise 7227 1.11 mrg Transparent file format whose markup, or absence of markup, has 7228 1.11 mrg been arranged to thwart or discourage subsequent modification by 7229 1.11 mrg readers is not Transparent. An image format is not Transparent if 7230 1.11 mrg used for any substantial amount of text. A copy that is not 7231 1.11 mrg "Transparent" is called "Opaque". 7232 1.1 mrg 7233 1.1 mrg Examples of suitable formats for Transparent copies include plain 7234 1.1 mrg ASCII without markup, Texinfo input format, LaTeX input format, 7235 1.11 mrg SGML or XML using a publicly available DTD, and standard-conforming 7236 1.11 mrg simple HTML, PostScript or PDF designed for human modification. 7237 1.11 mrg Examples of transparent image formats include PNG, XCF and JPG. 7238 1.11 mrg Opaque formats include proprietary formats that can be read and 7239 1.11 mrg edited only by proprietary word processors, SGML or XML for which 7240 1.11 mrg the DTD and/or processing tools are not generally available, and 7241 1.11 mrg the machine-generated HTML, PostScript or PDF produced by some word 7242 1.11 mrg processors for output purposes only. 7243 1.1 mrg 7244 1.1 mrg The "Title Page" means, for a printed book, the title page itself, 7245 1.1 mrg plus such following pages as are needed to hold, legibly, the 7246 1.1 mrg material this License requires to appear in the title page. For 7247 1.1 mrg works in formats which do not have any title page as such, "Title 7248 1.1 mrg Page" means the text near the most prominent appearance of the 7249 1.1 mrg work's title, preceding the beginning of the body of the text. 7250 1.1 mrg 7251 1.3 skrll The "publisher" means any person or entity that distributes copies 7252 1.3 skrll of the Document to the public. 7253 1.3 skrll 7254 1.1 mrg A section "Entitled XYZ" means a named subunit of the Document 7255 1.1 mrg whose title either is precisely XYZ or contains XYZ in parentheses 7256 1.1 mrg following text that translates XYZ in another language. (Here XYZ 7257 1.1 mrg stands for a specific section name mentioned below, such as 7258 1.1 mrg "Acknowledgements", "Dedications", "Endorsements", or "History".) 7259 1.1 mrg To "Preserve the Title" of such a section when you modify the 7260 1.1 mrg Document means that it remains a section "Entitled XYZ" according 7261 1.1 mrg to this definition. 7262 1.1 mrg 7263 1.1 mrg The Document may include Warranty Disclaimers next to the notice 7264 1.1 mrg which states that this License applies to the Document. These 7265 1.1 mrg Warranty Disclaimers are considered to be included by reference in 7266 1.1 mrg this License, but only as regards disclaiming warranties: any other 7267 1.1 mrg implication that these Warranty Disclaimers may have is void and 7268 1.1 mrg has no effect on the meaning of this License. 7269 1.1 mrg 7270 1.1 mrg 2. VERBATIM COPYING 7271 1.1 mrg 7272 1.1 mrg You may copy and distribute the Document in any medium, either 7273 1.1 mrg commercially or noncommercially, provided that this License, the 7274 1.1 mrg copyright notices, and the license notice saying this License 7275 1.1 mrg applies to the Document are reproduced in all copies, and that you 7276 1.1 mrg add no other conditions whatsoever to those of this License. You 7277 1.1 mrg may not use technical measures to obstruct or control the reading 7278 1.1 mrg or further copying of the copies you make or distribute. However, 7279 1.1 mrg you may accept compensation in exchange for copies. If you 7280 1.11 mrg distribute a large enough number of copies you must also follow the 7281 1.11 mrg conditions in section 3. 7282 1.1 mrg 7283 1.1 mrg You may also lend copies, under the same conditions stated above, 7284 1.1 mrg and you may publicly display copies. 7285 1.1 mrg 7286 1.1 mrg 3. COPYING IN QUANTITY 7287 1.1 mrg 7288 1.1 mrg If you publish printed copies (or copies in media that commonly 7289 1.1 mrg have printed covers) of the Document, numbering more than 100, and 7290 1.1 mrg the Document's license notice requires Cover Texts, you must 7291 1.1 mrg enclose the copies in covers that carry, clearly and legibly, all 7292 1.1 mrg these Cover Texts: Front-Cover Texts on the front cover, and 7293 1.1 mrg Back-Cover Texts on the back cover. Both covers must also clearly 7294 1.1 mrg and legibly identify you as the publisher of these copies. The 7295 1.11 mrg front cover must present the full title with all words of the title 7296 1.11 mrg equally prominent and visible. You may add other material on the 7297 1.11 mrg covers in addition. Copying with changes limited to the covers, as 7298 1.11 mrg long as they preserve the title of the Document and satisfy these 7299 1.11 mrg conditions, can be treated as verbatim copying in other respects. 7300 1.1 mrg 7301 1.1 mrg If the required texts for either cover are too voluminous to fit 7302 1.1 mrg legibly, you should put the first ones listed (as many as fit 7303 1.1 mrg reasonably) on the actual cover, and continue the rest onto 7304 1.1 mrg adjacent pages. 7305 1.1 mrg 7306 1.1 mrg If you publish or distribute Opaque copies of the Document 7307 1.11 mrg numbering more than 100, you must either include a machine-readable 7308 1.11 mrg Transparent copy along with each Opaque copy, or state in or with 7309 1.11 mrg each Opaque copy a computer-network location from which the general 7310 1.11 mrg network-using public has access to download using public-standard 7311 1.11 mrg network protocols a complete Transparent copy of the Document, free 7312 1.11 mrg of added material. If you use the latter option, you must take 7313 1.11 mrg reasonably prudent steps, when you begin distribution of Opaque 7314 1.11 mrg copies in quantity, to ensure that this Transparent copy will 7315 1.11 mrg remain thus accessible at the stated location until at least one 7316 1.11 mrg year after the last time you distribute an Opaque copy (directly or 7317 1.11 mrg through your agents or retailers) of that edition to the public. 7318 1.1 mrg 7319 1.1 mrg It is requested, but not required, that you contact the authors of 7320 1.11 mrg the Document well before redistributing any large number of copies, 7321 1.11 mrg to give them a chance to provide you with an updated version of the 7322 1.11 mrg Document. 7323 1.1 mrg 7324 1.1 mrg 4. MODIFICATIONS 7325 1.1 mrg 7326 1.1 mrg You may copy and distribute a Modified Version of the Document 7327 1.1 mrg under the conditions of sections 2 and 3 above, provided that you 7328 1.11 mrg release the Modified Version under precisely this License, with the 7329 1.11 mrg Modified Version filling the role of the Document, thus licensing 7330 1.11 mrg distribution and modification of the Modified Version to whoever 7331 1.11 mrg possesses a copy of it. In addition, you must do these things in 7332 1.11 mrg the Modified Version: 7333 1.1 mrg 7334 1.1 mrg A. Use in the Title Page (and on the covers, if any) a title 7335 1.11 mrg distinct from that of the Document, and from those of previous 7336 1.11 mrg versions (which should, if there were any, be listed in the 7337 1.11 mrg History section of the Document). You may use the same title 7338 1.11 mrg as a previous version if the original publisher of that 7339 1.11 mrg version gives permission. 7340 1.1 mrg 7341 1.1 mrg B. List on the Title Page, as authors, one or more persons or 7342 1.1 mrg entities responsible for authorship of the modifications in 7343 1.1 mrg the Modified Version, together with at least five of the 7344 1.1 mrg principal authors of the Document (all of its principal 7345 1.1 mrg authors, if it has fewer than five), unless they release you 7346 1.1 mrg from this requirement. 7347 1.1 mrg 7348 1.1 mrg C. State on the Title page the name of the publisher of the 7349 1.1 mrg Modified Version, as the publisher. 7350 1.1 mrg 7351 1.1 mrg D. Preserve all the copyright notices of the Document. 7352 1.1 mrg 7353 1.1 mrg E. Add an appropriate copyright notice for your modifications 7354 1.1 mrg adjacent to the other copyright notices. 7355 1.1 mrg 7356 1.1 mrg F. Include, immediately after the copyright notices, a license 7357 1.1 mrg notice giving the public permission to use the Modified 7358 1.1 mrg Version under the terms of this License, in the form shown in 7359 1.1 mrg the Addendum below. 7360 1.1 mrg 7361 1.1 mrg G. Preserve in that license notice the full lists of Invariant 7362 1.1 mrg Sections and required Cover Texts given in the Document's 7363 1.1 mrg license notice. 7364 1.1 mrg 7365 1.1 mrg H. Include an unaltered copy of this License. 7366 1.1 mrg 7367 1.1 mrg I. Preserve the section Entitled "History", Preserve its Title, 7368 1.1 mrg and add to it an item stating at least the title, year, new 7369 1.11 mrg authors, and publisher of the Modified Version as given on the 7370 1.11 mrg Title Page. If there is no section Entitled "History" in the 7371 1.11 mrg Document, create one stating the title, year, authors, and 7372 1.11 mrg publisher of the Document as given on its Title Page, then add 7373 1.11 mrg an item describing the Modified Version as stated in the 7374 1.11 mrg previous sentence. 7375 1.1 mrg 7376 1.1 mrg J. Preserve the network location, if any, given in the Document 7377 1.1 mrg for public access to a Transparent copy of the Document, and 7378 1.1 mrg likewise the network locations given in the Document for 7379 1.11 mrg previous versions it was based on. These may be placed in the 7380 1.11 mrg "History" section. You may omit a network location for a work 7381 1.11 mrg that was published at least four years before the Document 7382 1.11 mrg itself, or if the original publisher of the version it refers 7383 1.11 mrg to gives permission. 7384 1.1 mrg 7385 1.1 mrg K. For any section Entitled "Acknowledgements" or "Dedications", 7386 1.11 mrg Preserve the Title of the section, and preserve in the section 7387 1.11 mrg all the substance and tone of each of the contributor 7388 1.1 mrg acknowledgements and/or dedications given therein. 7389 1.1 mrg 7390 1.11 mrg L. Preserve all the Invariant Sections of the Document, unaltered 7391 1.11 mrg in their text and in their titles. Section numbers or the 7392 1.11 mrg equivalent are not considered part of the section titles. 7393 1.1 mrg 7394 1.1 mrg M. Delete any section Entitled "Endorsements". Such a section 7395 1.1 mrg may not be included in the Modified Version. 7396 1.1 mrg 7397 1.1 mrg N. Do not retitle any existing section to be Entitled 7398 1.1 mrg "Endorsements" or to conflict in title with any Invariant 7399 1.1 mrg Section. 7400 1.1 mrg 7401 1.1 mrg O. Preserve any Warranty Disclaimers. 7402 1.1 mrg 7403 1.1 mrg If the Modified Version includes new front-matter sections or 7404 1.1 mrg appendices that qualify as Secondary Sections and contain no 7405 1.11 mrg material copied from the Document, you may at your option designate 7406 1.11 mrg some or all of these sections as invariant. To do this, add their 7407 1.11 mrg titles to the list of Invariant Sections in the Modified Version's 7408 1.11 mrg license notice. These titles must be distinct from any other 7409 1.11 mrg section titles. 7410 1.1 mrg 7411 1.1 mrg You may add a section Entitled "Endorsements", provided it contains 7412 1.1 mrg nothing but endorsements of your Modified Version by various 7413 1.1 mrg parties--for example, statements of peer review or that the text 7414 1.1 mrg has been approved by an organization as the authoritative 7415 1.1 mrg definition of a standard. 7416 1.1 mrg 7417 1.1 mrg You may add a passage of up to five words as a Front-Cover Text, 7418 1.11 mrg and a passage of up to 25 words as a Back-Cover Text, to the end of 7419 1.11 mrg the list of Cover Texts in the Modified Version. Only one passage 7420 1.11 mrg of Front-Cover Text and one of Back-Cover Text may be added by (or 7421 1.11 mrg through arrangements made by) any one entity. If the Document 7422 1.11 mrg already includes a cover text for the same cover, previously added 7423 1.11 mrg by you or by arrangement made by the same entity you are acting on 7424 1.11 mrg behalf of, you may not add another; but you may replace the old 7425 1.11 mrg one, on explicit permission from the previous publisher that added 7426 1.11 mrg the old one. 7427 1.1 mrg 7428 1.1 mrg The author(s) and publisher(s) of the Document do not by this 7429 1.1 mrg License give permission to use their names for publicity for or to 7430 1.1 mrg assert or imply endorsement of any Modified Version. 7431 1.1 mrg 7432 1.1 mrg 5. COMBINING DOCUMENTS 7433 1.1 mrg 7434 1.1 mrg You may combine the Document with other documents released under 7435 1.1 mrg this License, under the terms defined in section 4 above for 7436 1.11 mrg modified versions, provided that you include in the combination all 7437 1.11 mrg of the Invariant Sections of all of the original documents, 7438 1.1 mrg unmodified, and list them all as Invariant Sections of your 7439 1.1 mrg combined work in its license notice, and that you preserve all 7440 1.1 mrg their Warranty Disclaimers. 7441 1.1 mrg 7442 1.1 mrg The combined work need only contain one copy of this License, and 7443 1.1 mrg multiple identical Invariant Sections may be replaced with a single 7444 1.1 mrg copy. If there are multiple Invariant Sections with the same name 7445 1.1 mrg but different contents, make the title of each such section unique 7446 1.1 mrg by adding at the end of it, in parentheses, the name of the 7447 1.1 mrg original author or publisher of that section if known, or else a 7448 1.1 mrg unique number. Make the same adjustment to the section titles in 7449 1.1 mrg the list of Invariant Sections in the license notice of the 7450 1.1 mrg combined work. 7451 1.1 mrg 7452 1.1 mrg In the combination, you must combine any sections Entitled 7453 1.1 mrg "History" in the various original documents, forming one section 7454 1.1 mrg Entitled "History"; likewise combine any sections Entitled 7455 1.1 mrg "Acknowledgements", and any sections Entitled "Dedications". You 7456 1.1 mrg must delete all sections Entitled "Endorsements." 7457 1.1 mrg 7458 1.1 mrg 6. COLLECTIONS OF DOCUMENTS 7459 1.1 mrg 7460 1.1 mrg You may make a collection consisting of the Document and other 7461 1.1 mrg documents released under this License, and replace the individual 7462 1.1 mrg copies of this License in the various documents with a single copy 7463 1.1 mrg that is included in the collection, provided that you follow the 7464 1.11 mrg rules of this License for verbatim copying of each of the documents 7465 1.11 mrg in all other respects. 7466 1.1 mrg 7467 1.1 mrg You may extract a single document from such a collection, and 7468 1.1 mrg distribute it individually under this License, provided you insert 7469 1.11 mrg a copy of this License into the extracted document, and follow this 7470 1.11 mrg License in all other respects regarding verbatim copying of that 7471 1.11 mrg document. 7472 1.1 mrg 7473 1.1 mrg 7. AGGREGATION WITH INDEPENDENT WORKS 7474 1.1 mrg 7475 1.1 mrg A compilation of the Document or its derivatives with other 7476 1.11 mrg separate and independent documents or works, in or on a volume of a 7477 1.11 mrg storage or distribution medium, is called an "aggregate" if the 7478 1.1 mrg copyright resulting from the compilation is not used to limit the 7479 1.1 mrg legal rights of the compilation's users beyond what the individual 7480 1.1 mrg works permit. When the Document is included in an aggregate, this 7481 1.1 mrg License does not apply to the other works in the aggregate which 7482 1.1 mrg are not themselves derivative works of the Document. 7483 1.1 mrg 7484 1.1 mrg If the Cover Text requirement of section 3 is applicable to these 7485 1.1 mrg copies of the Document, then if the Document is less than one half 7486 1.1 mrg of the entire aggregate, the Document's Cover Texts may be placed 7487 1.1 mrg on covers that bracket the Document within the aggregate, or the 7488 1.1 mrg electronic equivalent of covers if the Document is in electronic 7489 1.1 mrg form. Otherwise they must appear on printed covers that bracket 7490 1.1 mrg the whole aggregate. 7491 1.1 mrg 7492 1.1 mrg 8. TRANSLATION 7493 1.1 mrg 7494 1.1 mrg Translation is considered a kind of modification, so you may 7495 1.1 mrg distribute translations of the Document under the terms of section 7496 1.1 mrg 4. Replacing Invariant Sections with translations requires special 7497 1.1 mrg permission from their copyright holders, but you may include 7498 1.1 mrg translations of some or all Invariant Sections in addition to the 7499 1.1 mrg original versions of these Invariant Sections. You may include a 7500 1.1 mrg translation of this License, and all the license notices in the 7501 1.1 mrg Document, and any Warranty Disclaimers, provided that you also 7502 1.1 mrg include the original English version of this License and the 7503 1.1 mrg original versions of those notices and disclaimers. In case of a 7504 1.1 mrg disagreement between the translation and the original version of 7505 1.1 mrg this License or a notice or disclaimer, the original version will 7506 1.1 mrg prevail. 7507 1.1 mrg 7508 1.1 mrg If a section in the Document is Entitled "Acknowledgements", 7509 1.1 mrg "Dedications", or "History", the requirement (section 4) to 7510 1.1 mrg Preserve its Title (section 1) will typically require changing the 7511 1.1 mrg actual title. 7512 1.1 mrg 7513 1.1 mrg 9. TERMINATION 7514 1.1 mrg 7515 1.1 mrg You may not copy, modify, sublicense, or distribute the Document 7516 1.3 skrll except as expressly provided under this License. Any attempt 7517 1.3 skrll otherwise to copy, modify, sublicense, or distribute it is void, 7518 1.3 skrll and will automatically terminate your rights under this License. 7519 1.3 skrll 7520 1.3 skrll However, if you cease all violation of this License, then your 7521 1.3 skrll license from a particular copyright holder is reinstated (a) 7522 1.11 mrg provisionally, unless and until the copyright holder explicitly and 7523 1.11 mrg finally terminates your license, and (b) permanently, if the 7524 1.3 skrll copyright holder fails to notify you of the violation by some 7525 1.3 skrll reasonable means prior to 60 days after the cessation. 7526 1.3 skrll 7527 1.3 skrll Moreover, your license from a particular copyright holder is 7528 1.3 skrll reinstated permanently if the copyright holder notifies you of the 7529 1.3 skrll violation by some reasonable means, this is the first time you have 7530 1.3 skrll received notice of violation of this License (for any work) from 7531 1.3 skrll that copyright holder, and you cure the violation prior to 30 days 7532 1.3 skrll after your receipt of the notice. 7533 1.3 skrll 7534 1.3 skrll Termination of your rights under this section does not terminate 7535 1.11 mrg the licenses of parties who have received copies or rights from you 7536 1.11 mrg under this License. If your rights have been terminated and not 7537 1.11 mrg permanently reinstated, receipt of a copy of some or all of the 7538 1.11 mrg same material does not give you any rights to use it. 7539 1.1 mrg 7540 1.11 mrg 10. FUTURE REVISIONS OF THIS LICENSE 7541 1.1 mrg 7542 1.1 mrg The Free Software Foundation may publish new, revised versions of 7543 1.1 mrg the GNU Free Documentation License from time to time. Such new 7544 1.1 mrg versions will be similar in spirit to the present version, but may 7545 1.1 mrg differ in detail to address new problems or concerns. See 7546 1.16 mrg <https://www.gnu.org/copyleft/>. 7547 1.1 mrg 7548 1.1 mrg Each version of the License is given a distinguishing version 7549 1.1 mrg number. If the Document specifies that a particular numbered 7550 1.1 mrg version of this License "or any later version" applies to it, you 7551 1.1 mrg have the option of following the terms and conditions either of 7552 1.1 mrg that specified version or of any later version that has been 7553 1.11 mrg published (not as a draft) by the Free Software Foundation. If the 7554 1.11 mrg Document does not specify a version number of this License, you may 7555 1.11 mrg choose any version ever published (not as a draft) by the Free 7556 1.11 mrg Software Foundation. If the Document specifies that a proxy can 7557 1.11 mrg decide which future versions of this License can be used, that 7558 1.3 skrll proxy's public statement of acceptance of a version permanently 7559 1.3 skrll authorizes you to choose that version for the Document. 7560 1.3 skrll 7561 1.11 mrg 11. RELICENSING 7562 1.3 skrll 7563 1.3 skrll "Massive Multiauthor Collaboration Site" (or "MMC Site") means any 7564 1.3 skrll World Wide Web server that publishes copyrightable works and also 7565 1.3 skrll provides prominent facilities for anybody to edit those works. A 7566 1.3 skrll public wiki that anybody can edit is an example of such a server. 7567 1.3 skrll A "Massive Multiauthor Collaboration" (or "MMC") contained in the 7568 1.3 skrll site means any set of copyrightable works thus published on the MMC 7569 1.3 skrll site. 7570 1.3 skrll 7571 1.3 skrll "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0 7572 1.3 skrll license published by Creative Commons Corporation, a not-for-profit 7573 1.3 skrll corporation with a principal place of business in San Francisco, 7574 1.3 skrll California, as well as future copyleft versions of that license 7575 1.3 skrll published by that same organization. 7576 1.3 skrll 7577 1.3 skrll "Incorporate" means to publish or republish a Document, in whole or 7578 1.3 skrll in part, as part of another Document. 7579 1.3 skrll 7580 1.3 skrll An MMC is "eligible for relicensing" if it is licensed under this 7581 1.3 skrll License, and if all works that were first published under this 7582 1.3 skrll License somewhere other than this MMC, and subsequently 7583 1.3 skrll incorporated in whole or in part into the MMC, (1) had no cover 7584 1.3 skrll texts or invariant sections, and (2) were thus incorporated prior 7585 1.3 skrll to November 1, 2008. 7586 1.3 skrll 7587 1.3 skrll The operator of an MMC Site may republish an MMC contained in the 7588 1.3 skrll site under CC-BY-SA on the same site at any time before August 1, 7589 1.3 skrll 2009, provided the MMC is eligible for relicensing. 7590 1.3 skrll 7591 1.1 mrg ADDENDUM: How to use this License for your documents 7592 1.1 mrg ==================================================== 7593 1.1 mrg 7594 1.1 mrg To use this License in a document you have written, include a copy of 7595 1.1 mrg the License in the document and put the following copyright and license 7596 1.1 mrg notices just after the title page: 7597 1.1 mrg 7598 1.1 mrg Copyright (C) YEAR YOUR NAME. 7599 1.1 mrg Permission is granted to copy, distribute and/or modify this document 7600 1.3 skrll under the terms of the GNU Free Documentation License, Version 1.3 7601 1.1 mrg or any later version published by the Free Software Foundation; 7602 1.1 mrg with no Invariant Sections, no Front-Cover Texts, and no Back-Cover 7603 1.1 mrg Texts. A copy of the license is included in the section entitled ``GNU 7604 1.1 mrg Free Documentation License''. 7605 1.1 mrg 7606 1.1 mrg If you have Invariant Sections, Front-Cover Texts and Back-Cover 7607 1.11 mrg Texts, replace the "with...Texts." line with this: 7608 1.1 mrg 7609 1.1 mrg with the Invariant Sections being LIST THEIR TITLES, with 7610 1.1 mrg the Front-Cover Texts being LIST, and with the Back-Cover Texts 7611 1.1 mrg being LIST. 7612 1.1 mrg 7613 1.1 mrg If you have Invariant Sections without Cover Texts, or some other 7614 1.1 mrg combination of the three, merge those two alternatives to suit the 7615 1.1 mrg situation. 7616 1.1 mrg 7617 1.1 mrg If your document contains nontrivial examples of program code, we 7618 1.11 mrg recommend releasing these examples in parallel under your choice of free 7619 1.11 mrg software license, such as the GNU General Public License, to permit 7620 1.11 mrg their use in free software. 7621 1.1 mrg 7622 1.1 mrg 7623 1.3 skrll File: libgomp.info, Node: Funding, Next: Library Index, Prev: GNU Free Documentation License, Up: Top 7624 1.1 mrg 7625 1.1 mrg Funding Free Software 7626 1.1 mrg ********************* 7627 1.1 mrg 7628 1.1 mrg If you want to have more free software a few years from now, it makes 7629 1.1 mrg sense for you to help encourage people to contribute funds for its 7630 1.1 mrg development. The most effective approach known is to encourage 7631 1.1 mrg commercial redistributors to donate. 7632 1.1 mrg 7633 1.1 mrg Users of free software systems can boost the pace of development by 7634 1.1 mrg encouraging for-a-fee distributors to donate part of their selling price 7635 1.1 mrg to free software developers--the Free Software Foundation, and others. 7636 1.1 mrg 7637 1.1 mrg The way to convince distributors to do this is to demand it and 7638 1.1 mrg expect it from them. So when you compare distributors, judge them 7639 1.1 mrg partly by how much they give to free software development. Show 7640 1.1 mrg distributors they must compete to be the one who gives the most. 7641 1.1 mrg 7642 1.1 mrg To make this approach work, you must insist on numbers that you can 7643 1.1 mrg compare, such as, "We will donate ten dollars to the Frobnitz project 7644 1.1 mrg for each disk sold." Don't be satisfied with a vague promise, such as 7645 1.1 mrg "A portion of the profits are donated," since it doesn't give a basis 7646 1.1 mrg for comparison. 7647 1.1 mrg 7648 1.1 mrg Even a precise fraction "of the profits from this disk" is not very 7649 1.1 mrg meaningful, since creative accounting and unrelated business decisions 7650 1.11 mrg can greatly alter what fraction of the sales price counts as profit. If 7651 1.11 mrg the price you pay is $50, ten percent of the profit is probably less 7652 1.1 mrg than a dollar; it might be a few cents, or nothing at all. 7653 1.1 mrg 7654 1.1 mrg Some redistributors do development work themselves. This is useful 7655 1.1 mrg too; but to keep everyone honest, you need to inquire how much they do, 7656 1.1 mrg and what kind. Some kinds of development make much more long-term 7657 1.1 mrg difference than others. For example, maintaining a separate version of 7658 1.1 mrg a program contributes very little; maintaining the standard version of a 7659 1.1 mrg program for the whole community contributes much. Easy new ports 7660 1.1 mrg contribute little, since someone else would surely do them; difficult 7661 1.11 mrg ports such as adding a new CPU to the GNU Compiler Collection contribute 7662 1.11 mrg more; major new features or packages contribute the most. 7663 1.1 mrg 7664 1.1 mrg By establishing the idea that supporting further development is "the 7665 1.1 mrg proper thing to do" when distributing free software for a fee, we can 7666 1.1 mrg assure a steady flow of resources into making more free software. 7667 1.1 mrg 7668 1.1 mrg Copyright (C) 1994 Free Software Foundation, Inc. 7669 1.1 mrg Verbatim copying and redistribution of this section is permitted 7670 1.1 mrg without royalty; alteration is not permitted. 7671 1.1 mrg 7672 1.1 mrg 7673 1.3 skrll File: libgomp.info, Node: Library Index, Prev: Funding, Up: Top 7674 1.1 mrg 7675 1.3 skrll Library Index 7676 1.3 skrll ************* 7677 1.1 mrg 7678 1.1 mrg [index] 7679 1.1 mrg * Menu: 7680 1.1 mrg 7681 1.13 mrg * acc_get_property: acc_get_property. (line 6) 7682 1.13 mrg * acc_get_property_string: acc_get_property. (line 6) 7683 1.19 mrg * Environment Variable: OMP_ALLOCATOR. (line 6) 7684 1.19 mrg * Environment Variable <1>: OMP_AFFINITY_FORMAT. (line 6) 7685 1.19 mrg * Environment Variable <2>: OMP_CANCELLATION. (line 6) 7686 1.19 mrg * Environment Variable <3>: OMP_DISPLAY_AFFINITY. (line 6) 7687 1.19 mrg * Environment Variable <4>: OMP_DISPLAY_ENV. (line 6) 7688 1.19 mrg * Environment Variable <5>: OMP_DEFAULT_DEVICE. (line 6) 7689 1.19 mrg * Environment Variable <6>: OMP_DYNAMIC. (line 6) 7690 1.19 mrg * Environment Variable <7>: OMP_MAX_ACTIVE_LEVELS. (line 6) 7691 1.19 mrg * Environment Variable <8>: OMP_MAX_TASK_PRIORITY. (line 6) 7692 1.19 mrg * Environment Variable <9>: OMP_NESTED. (line 6) 7693 1.19 mrg * Environment Variable <10>: OMP_NUM_TEAMS. (line 6) 7694 1.19 mrg * Environment Variable <11>: OMP_NUM_THREADS. (line 6) 7695 1.19 mrg * Environment Variable <12>: OMP_PROC_BIND. (line 6) 7696 1.19 mrg * Environment Variable <13>: OMP_PLACES. (line 6) 7697 1.19 mrg * Environment Variable <14>: OMP_STACKSIZE. (line 6) 7698 1.19 mrg * Environment Variable <15>: OMP_SCHEDULE. (line 6) 7699 1.19 mrg * Environment Variable <16>: OMP_TARGET_OFFLOAD. (line 6) 7700 1.19 mrg * Environment Variable <17>: OMP_TEAMS_THREAD_LIMIT. 7701 1.16 mrg (line 6) 7702 1.19 mrg * Environment Variable <18>: OMP_THREAD_LIMIT. (line 6) 7703 1.19 mrg * Environment Variable <19>: OMP_WAIT_POLICY. (line 6) 7704 1.19 mrg * Environment Variable <20>: GOMP_CPU_AFFINITY. (line 6) 7705 1.19 mrg * Environment Variable <21>: GOMP_DEBUG. (line 6) 7706 1.19 mrg * Environment Variable <22>: GOMP_STACKSIZE. (line 6) 7707 1.19 mrg * Environment Variable <23>: GOMP_SPINCOUNT. (line 6) 7708 1.19 mrg * Environment Variable <24>: GOMP_RTEMS_THREAD_POOLS. 7709 1.10 mrg (line 6) 7710 1.10 mrg * FDL, GNU Free Documentation License: GNU Free Documentation License. 7711 1.8 mrg (line 6) 7712 1.11 mrg * Implementation specific setting: OMP_NESTED. (line 6) 7713 1.11 mrg * Implementation specific setting <1>: OMP_NUM_THREADS. (line 6) 7714 1.11 mrg * Implementation specific setting <2>: OMP_SCHEDULE. (line 6) 7715 1.16 mrg * Implementation specific setting <3>: OMP_TARGET_OFFLOAD. (line 6) 7716 1.16 mrg * Implementation specific setting <4>: GOMP_STACKSIZE. (line 6) 7717 1.16 mrg * Implementation specific setting <5>: GOMP_SPINCOUNT. (line 6) 7718 1.16 mrg * Implementation specific setting <6>: GOMP_RTEMS_THREAD_POOLS. 7719 1.1 mrg (line 6) 7720 1.19 mrg * Implementation specific setting <7>: Implementation-defined ICV Initialization. 7721 1.19 mrg (line 6) 7722 1.1 mrg * Introduction: Top. (line 6) 7723 1.1 mrg 7724 1.1 mrg 7725 1.1 mrg 7726 1.1 mrg Tag Table: 7727 1.11 mrg Node: Top2083 7728 1.19 mrg Node: Enabling OpenMP4900 7729 1.19 mrg Node: OpenMP Implementation Status6081 7730 1.19 mrg Node: OpenMP 4.56777 7731 1.19 mrg Node: OpenMP 5.06953 7732 1.19 mrg Node: OpenMP 5.112374 7733 1.19 mrg Node: OpenMP 5.216686 7734 1.19 mrg Ref: OpenMP 5.2-Footnote-119831 7735 1.19 mrg Node: OpenMP Technical Report 1220232 7736 1.19 mrg Node: Runtime Library Routines24759 7737 1.19 mrg Node: Thread Team Routines25392 7738 1.19 mrg Node: omp_set_num_threads26979 7739 1.19 mrg Node: omp_get_num_threads27825 7740 1.19 mrg Node: omp_get_max_threads28916 7741 1.19 mrg Node: omp_get_thread_num29671 7742 1.19 mrg Node: omp_in_parallel30540 7743 1.19 mrg Node: omp_set_dynamic31190 7744 1.19 mrg Node: omp_get_dynamic32057 7745 1.19 mrg Node: omp_get_cancellation32932 7746 1.19 mrg Node: omp_set_nested33726 7747 1.19 mrg Node: omp_get_nested35045 7748 1.19 mrg Node: omp_set_schedule36787 7749 1.19 mrg Node: omp_get_schedule37866 7750 1.19 mrg Node: omp_get_teams_thread_limit38814 7751 1.19 mrg Node: omp_get_supported_active_levels39582 7752 1.19 mrg Node: omp_set_max_active_levels40387 7753 1.19 mrg Node: omp_get_max_active_levels41336 7754 1.19 mrg Node: omp_get_level42059 7755 1.19 mrg Node: omp_get_ancestor_thread_num42693 7756 1.19 mrg Node: omp_get_team_size43615 7757 1.19 mrg Node: omp_get_active_level44586 7758 1.19 mrg Node: Thread Affinity Routines45278 7759 1.19 mrg Node: omp_get_proc_bind45678 7760 1.19 mrg Node: Teams Region Routines46650 7761 1.19 mrg Node: omp_get_num_teams47358 7762 1.19 mrg Node: omp_get_team_num47844 7763 1.19 mrg Node: omp_set_num_teams48343 7764 1.19 mrg Node: omp_get_max_teams49215 7765 1.19 mrg Node: omp_set_teams_thread_limit49907 7766 1.19 mrg Node: omp_get_thread_limit50912 7767 1.19 mrg Node: Tasking Routines51512 7768 1.19 mrg Node: omp_get_max_task_priority52023 7769 1.19 mrg Node: omp_in_explicit_task52606 7770 1.19 mrg Node: omp_in_final53496 7771 1.19 mrg Node: Resource Relinquishing Routines54139 7772 1.19 mrg Node: omp_pause_resource54611 7773 1.19 mrg Node: omp_pause_resource_all55704 7774 1.19 mrg Node: Device Information Routines56691 7775 1.19 mrg Node: omp_get_num_procs57509 7776 1.19 mrg Node: omp_set_default_device58030 7777 1.19 mrg Node: omp_get_default_device58829 7778 1.19 mrg Node: omp_get_num_devices59518 7779 1.19 mrg Node: omp_get_device_num60053 7780 1.19 mrg Node: omp_is_initial_device60868 7781 1.19 mrg Node: omp_get_initial_device61572 7782 1.19 mrg Node: Device Memory Routines62307 7783 1.19 mrg Node: omp_target_alloc63347 7784 1.19 mrg Node: omp_target_free64922 7785 1.19 mrg Node: omp_target_is_present66110 7786 1.19 mrg Node: omp_target_is_accessible67782 7787 1.19 mrg Node: omp_target_memcpy69596 7788 1.19 mrg Node: omp_target_memcpy_async71410 7789 1.19 mrg Node: omp_target_memcpy_rect73789 7790 1.19 mrg Node: omp_target_memcpy_rect_async76993 7791 1.19 mrg Node: omp_target_associate_ptr80765 7792 1.19 mrg Node: omp_target_disassociate_ptr83730 7793 1.19 mrg Node: omp_get_mapped_ptr85483 7794 1.19 mrg Node: Lock Routines87026 7795 1.19 mrg Node: omp_init_lock87874 7796 1.19 mrg Node: omp_init_nest_lock88499 7797 1.19 mrg Node: omp_destroy_lock89221 7798 1.19 mrg Node: omp_destroy_nest_lock89896 7799 1.19 mrg Node: omp_set_lock90634 7800 1.19 mrg Node: omp_set_nest_lock91492 7801 1.19 mrg Node: omp_unset_lock92388 7802 1.19 mrg Node: omp_unset_nest_lock93317 7803 1.19 mrg Node: omp_test_lock94311 7804 1.19 mrg Node: omp_test_nest_lock95289 7805 1.19 mrg Node: Timing Routines96277 7806 1.19 mrg Node: omp_get_wtick96654 7807 1.19 mrg Node: omp_get_wtime97209 7808 1.19 mrg Node: Event Routine97978 7809 1.19 mrg Node: omp_fulfill_event98311 7810 1.19 mrg Node: Memory Management Routines99303 7811 1.19 mrg Node: omp_init_allocator100219 7812 1.19 mrg Node: omp_destroy_allocator101848 7813 1.19 mrg Node: omp_set_default_allocator102832 7814 1.19 mrg Node: omp_get_default_allocator103866 7815 1.19 mrg Node: omp_alloc104807 7816 1.19 mrg Node: omp_aligned_alloc106910 7817 1.19 mrg Node: omp_free109440 7818 1.19 mrg Node: omp_calloc111095 7819 1.19 mrg Node: omp_aligned_calloc113314 7820 1.19 mrg Node: omp_realloc115866 7821 1.19 mrg Node: Environment Display Routine119252 7822 1.19 mrg Node: omp_display_env119628 7823 1.19 mrg Node: Environment Variables122462 7824 1.19 mrg Node: OMP_ALLOCATOR125243 7825 1.19 mrg Node: OMP_AFFINITY_FORMAT129053 7826 1.19 mrg Node: OMP_CANCELLATION131661 7827 1.19 mrg Node: OMP_DISPLAY_AFFINITY132261 7828 1.19 mrg Node: OMP_DISPLAY_ENV132956 7829 1.19 mrg Node: OMP_DEFAULT_DEVICE133806 7830 1.19 mrg Node: OMP_DYNAMIC134814 7831 1.19 mrg Node: OMP_MAX_ACTIVE_LEVELS135441 7832 1.19 mrg Node: OMP_MAX_TASK_PRIORITY136466 7833 1.19 mrg Node: OMP_NESTED137169 7834 1.19 mrg Node: OMP_NUM_TEAMS138418 7835 1.19 mrg Node: OMP_NUM_THREADS139127 7836 1.19 mrg Node: OMP_PROC_BIND140143 7837 1.19 mrg Node: OMP_PLACES141664 7838 1.19 mrg Node: OMP_STACKSIZE144400 7839 1.19 mrg Node: OMP_SCHEDULE145302 7840 1.19 mrg Node: OMP_TARGET_OFFLOAD146049 7841 1.19 mrg Node: OMP_TEAMS_THREAD_LIMIT147536 7842 1.19 mrg Node: OMP_THREAD_LIMIT148389 7843 1.19 mrg Node: OMP_WAIT_POLICY149049 7844 1.19 mrg Node: GOMP_CPU_AFFINITY149741 7845 1.19 mrg Node: GOMP_DEBUG151459 7846 1.19 mrg Node: GOMP_STACKSIZE151961 7847 1.19 mrg Node: GOMP_SPINCOUNT152792 7848 1.19 mrg Node: GOMP_RTEMS_THREAD_POOLS153996 7849 1.19 mrg Node: Enabling OpenACC156171 7850 1.19 mrg Node: OpenACC Runtime Library Routines156993 7851 1.19 mrg Node: acc_get_num_devices161274 7852 1.19 mrg Node: acc_set_device_type162000 7853 1.19 mrg Node: acc_get_device_type162764 7854 1.19 mrg Node: acc_set_device_num163777 7855 1.19 mrg Node: acc_get_device_num164594 7856 1.19 mrg Node: acc_get_property165393 7857 1.19 mrg Node: acc_async_test167605 7858 1.19 mrg Node: acc_async_test_all168576 7859 1.19 mrg Node: acc_wait169459 7860 1.19 mrg Node: acc_wait_all170322 7861 1.19 mrg Node: acc_wait_all_async171083 7862 1.19 mrg Node: acc_wait_async171835 7863 1.19 mrg Node: acc_init172543 7864 1.19 mrg Node: acc_shutdown173188 7865 1.19 mrg Node: acc_on_device173855 7866 1.19 mrg Node: acc_malloc174844 7867 1.19 mrg Node: acc_free175552 7868 1.19 mrg Node: acc_copyin176196 7869 1.19 mrg Node: acc_present_or_copyin177783 7870 1.19 mrg Node: acc_create179551 7871 1.19 mrg Node: acc_present_or_create181183 7872 1.19 mrg Node: acc_copyout182959 7873 1.19 mrg Node: acc_delete185263 7874 1.19 mrg Node: acc_update_device187510 7875 1.19 mrg Node: acc_update_self189084 7876 1.19 mrg Node: acc_map_data190674 7877 1.19 mrg Node: acc_unmap_data191746 7878 1.19 mrg Node: acc_deviceptr192488 7879 1.19 mrg Node: acc_hostptr193283 7880 1.19 mrg Node: acc_is_present194067 7881 1.19 mrg Node: acc_memcpy_to_device195594 7882 1.19 mrg Node: acc_memcpy_from_device197029 7883 1.19 mrg Node: acc_attach198514 7884 1.19 mrg Node: acc_detach199181 7885 1.19 mrg Node: acc_get_current_cuda_device200020 7886 1.19 mrg Node: acc_get_current_cuda_context200605 7887 1.19 mrg Node: acc_get_cuda_stream201205 7888 1.19 mrg Node: acc_set_cuda_stream201796 7889 1.19 mrg Node: acc_prof_register202467 7890 1.19 mrg Node: acc_prof_unregister203026 7891 1.19 mrg Node: acc_prof_lookup203593 7892 1.19 mrg Node: acc_register_library204114 7893 1.19 mrg Node: OpenACC Environment Variables204680 7894 1.19 mrg Node: ACC_DEVICE_TYPE205169 7895 1.19 mrg Node: ACC_DEVICE_NUM205696 7896 1.19 mrg Node: ACC_PROFLIB206167 7897 1.19 mrg Node: CUDA Streams Usage206773 7898 1.19 mrg Ref: CUDA Streams Usage-Footnote-1208665 7899 1.19 mrg Node: OpenACC Library Interoperability208774 7900 1.19 mrg Ref: OpenACC Library Interoperability-Footnote-1215123 7901 1.19 mrg Ref: OpenACC Library Interoperability-Footnote-2215375 7902 1.19 mrg Node: OpenACC Profiling Interface215583 7903 1.19 mrg Node: OpenMP-Implementation Specifics225581 7904 1.19 mrg Node: Implementation-defined ICV Initialization225900 7905 1.19 mrg Node: OpenMP Context Selectors227071 7906 1.19 mrg Ref: OpenMP Context Selectors-Footnote-1228352 7907 1.19 mrg Node: Memory allocation228420 7908 1.19 mrg Node: Offload-Target Specifics233065 7909 1.19 mrg Node: AMD Radeon233356 7910 1.19 mrg Node: nvptx236294 7911 1.19 mrg Node: The libgomp ABI239921 7912 1.19 mrg Node: Implementing MASTER construct240771 7913 1.19 mrg Node: Implementing CRITICAL construct241188 7914 1.19 mrg Node: Implementing ATOMIC construct241929 7915 1.19 mrg Node: Implementing FLUSH construct242412 7916 1.19 mrg Node: Implementing BARRIER construct242685 7917 1.19 mrg Node: Implementing THREADPRIVATE construct242956 7918 1.19 mrg Node: Implementing PRIVATE clause243611 7919 1.19 mrg Node: Implementing FIRSTPRIVATE LASTPRIVATE COPYIN and COPYPRIVATE clauses244194 7920 1.19 mrg Node: Implementing REDUCTION clause245520 7921 1.19 mrg Node: Implementing PARALLEL construct246080 7922 1.19 mrg Node: Implementing FOR construct247339 7923 1.19 mrg Node: Implementing ORDERED construct249339 7924 1.19 mrg Node: Implementing SECTIONS construct249647 7925 1.19 mrg Node: Implementing SINGLE construct250415 7926 1.19 mrg Node: Implementing OpenACC's PARALLEL construct251129 7927 1.19 mrg Node: Reporting Bugs251389 7928 1.19 mrg Node: Copying251752 7929 1.19 mrg Node: GNU Free Documentation License289304 7930 1.19 mrg Node: Funding314432 7931 1.19 mrg Node: Library Index316958 7932 1.1 mrg 7933 1.1 mrg End Tag Table 7934