libgomp.info revision 1.12
1This is libgomp.info, produced by makeinfo version 6.5 from
2libgomp.texi.
3
4Copyright (C) 2006-2019 Free Software Foundation, Inc.
5
6   Permission is granted to copy, distribute and/or modify this document
7under the terms of the GNU Free Documentation License, Version 1.3 or
8any later version published by the Free Software Foundation; with the
9Invariant Sections being "Funding Free Software", the Front-Cover texts
10being (a) (see below), and with the Back-Cover Texts being (b) (see
11below).  A copy of the license is included in the section entitled "GNU
12Free Documentation License".
13
14   (a) The FSF's Front-Cover Text is:
15
16   A GNU Manual
17
18   (b) The FSF's Back-Cover Text is:
19
20   You have freedom to copy and modify this GNU Manual, like GNU
21software.  Copies published by the Free Software Foundation raise funds
22for GNU development.
23INFO-DIR-SECTION GNU Libraries
24START-INFO-DIR-ENTRY
25* libgomp: (libgomp).          GNU Offloading and Multi Processing Runtime Library.
26END-INFO-DIR-ENTRY
27
28   This manual documents libgomp, the GNU Offloading and Multi
29Processing Runtime library.  This is the GNU implementation of the
30OpenMP and OpenACC APIs for parallel and accelerator programming in
31C/C++ and Fortran.
32
33   Published by the Free Software Foundation 51 Franklin Street, Fifth
34Floor Boston, MA 02110-1301 USA
35
36   Copyright (C) 2006-2019 Free Software Foundation, Inc.
37
38   Permission is granted to copy, distribute and/or modify this document
39under the terms of the GNU Free Documentation License, Version 1.3 or
40any later version published by the Free Software Foundation; with the
41Invariant Sections being "Funding Free Software", the Front-Cover texts
42being (a) (see below), and with the Back-Cover Texts being (b) (see
43below).  A copy of the license is included in the section entitled "GNU
44Free Documentation License".
45
46   (a) The FSF's Front-Cover Text is:
47
48   A GNU Manual
49
50   (b) The FSF's Back-Cover Text is:
51
52   You have freedom to copy and modify this GNU Manual, like GNU
53software.  Copies published by the Free Software Foundation raise funds
54for GNU development.
55
56
57File: libgomp.info,  Node: Top,  Next: Enabling OpenMP,  Up: (dir)
58
59Introduction
60************
61
62This manual documents the usage of libgomp, the GNU Offloading and Multi
63Processing Runtime Library.  This includes the GNU implementation of the
64OpenMP (https://www.openmp.org) Application Programming Interface (API)
65for multi-platform shared-memory parallel programming in C/C++ and
66Fortran, and the GNU implementation of the OpenACC
67(https://www.openacc.org) Application Programming Interface (API) for
68offloading of code to accelerator devices in C/C++ and Fortran.
69
70   Originally, libgomp implemented the GNU OpenMP Runtime Library.
71Based on this, support for OpenACC and offloading (both OpenACC and
72OpenMP 4's target construct) has been added later on, and the library's
73name changed to GNU Offloading and Multi Processing Runtime Library.
74
75* Menu:
76
77* Enabling OpenMP::            How to enable OpenMP for your applications.
78* OpenMP Runtime Library Routines: Runtime Library Routines.
79                               The OpenMP runtime application programming
80                               interface.
81* OpenMP Environment Variables: Environment Variables.
82                               Influencing OpenMP runtime behavior with
83                               environment variables.
84* Enabling OpenACC::           How to enable OpenACC for your
85                               applications.
86* OpenACC Runtime Library Routines:: The OpenACC runtime application
87                               programming interface.
88* OpenACC Environment Variables:: Influencing OpenACC runtime behavior with
89                               environment variables.
90* CUDA Streams Usage::         Notes on the implementation of
91                               asynchronous operations.
92* OpenACC Library Interoperability:: OpenACC library interoperability with the
93                               NVIDIA CUBLAS library.
94* The libgomp ABI::            Notes on the external ABI presented by libgomp.
95* Reporting Bugs::             How to report bugs in the GNU Offloading and
96                               Multi Processing Runtime Library.
97* Copying::                    GNU general public license says
98                               how you can copy and share libgomp.
99* GNU Free Documentation License::
100                               How you can copy and share this manual.
101* Funding::                    How to help assure continued work for free
102                               software.
103* Library Index::              Index of this documentation.
104
105
106File: libgomp.info,  Node: Enabling OpenMP,  Next: Runtime Library Routines,  Prev: Top,  Up: Top
107
1081 Enabling OpenMP
109*****************
110
111To activate the OpenMP extensions for C/C++ and Fortran, the
112compile-time flag '-fopenmp' must be specified.  This enables the OpenMP
113directive '#pragma omp' in C/C++ and '!$omp' directives in free form,
114'c$omp', '*$omp' and '!$omp' directives in fixed form, '!$' conditional
115compilation sentinels in free form and 'c$', '*$' and '!$' sentinels in
116fixed form, for Fortran.  The flag also arranges for automatic linking
117of the OpenMP runtime library (*note Runtime Library Routines::).
118
119   A complete description of all OpenMP directives accepted may be found
120in the OpenMP Application Program Interface (https://www.openmp.org)
121manual, version 4.5.
122
123
124File: libgomp.info,  Node: Runtime Library Routines,  Next: Environment Variables,  Prev: Enabling OpenMP,  Up: Top
125
1262 OpenMP Runtime Library Routines
127*********************************
128
129The runtime routines described here are defined by Section 3 of the
130OpenMP specification in version 4.5.  The routines are structured in
131following three parts:
132
133* Menu:
134
135Control threads, processors and the parallel environment.  They have C
136linkage, and do not throw exceptions.
137
138* omp_get_active_level::        Number of active parallel regions
139* omp_get_ancestor_thread_num:: Ancestor thread ID
140* omp_get_cancellation::        Whether cancellation support is enabled
141* omp_get_default_device::      Get the default device for target regions
142* omp_get_dynamic::             Dynamic teams setting
143* omp_get_level::               Number of parallel regions
144* omp_get_max_active_levels::   Maximum number of active regions
145* omp_get_max_task_priority::   Maximum task priority value that can be set
146* omp_get_max_threads::         Maximum number of threads of parallel region
147* omp_get_nested::              Nested parallel regions
148* omp_get_num_devices::         Number of target devices
149* omp_get_num_procs::           Number of processors online
150* omp_get_num_teams::           Number of teams
151* omp_get_num_threads::         Size of the active team
152* omp_get_proc_bind::           Whether theads may be moved between CPUs
153* omp_get_schedule::            Obtain the runtime scheduling method
154* omp_get_team_num::            Get team number
155* omp_get_team_size::           Number of threads in a team
156* omp_get_thread_limit::        Maximum number of threads
157* omp_get_thread_num::          Current thread ID
158* omp_in_parallel::             Whether a parallel region is active
159* omp_in_final::                Whether in final or included task region
160* omp_is_initial_device::       Whether executing on the host device
161* omp_set_default_device::      Set the default device for target regions
162* omp_set_dynamic::             Enable/disable dynamic teams
163* omp_set_max_active_levels::   Limits the number of active parallel regions
164* omp_set_nested::              Enable/disable nested parallel regions
165* omp_set_num_threads::         Set upper team size limit
166* omp_set_schedule::            Set the runtime scheduling method
167
168Initialize, set, test, unset and destroy simple and nested locks.
169
170* omp_init_lock::            Initialize simple lock
171* omp_set_lock::             Wait for and set simple lock
172* omp_test_lock::            Test and set simple lock if available
173* omp_unset_lock::           Unset simple lock
174* omp_destroy_lock::         Destroy simple lock
175* omp_init_nest_lock::       Initialize nested lock
176* omp_set_nest_lock::        Wait for and set simple lock
177* omp_test_nest_lock::       Test and set nested lock if available
178* omp_unset_nest_lock::      Unset nested lock
179* omp_destroy_nest_lock::    Destroy nested lock
180
181Portable, thread-based, wall clock timer.
182
183* omp_get_wtick::            Get timer precision.
184* omp_get_wtime::            Elapsed wall clock time.
185
186
187File: libgomp.info,  Node: omp_get_active_level,  Next: omp_get_ancestor_thread_num,  Up: Runtime Library Routines
188
1892.1 'omp_get_active_level' - Number of parallel regions
190=======================================================
191
192_Description_:
193     This function returns the nesting level for the active parallel
194     blocks, which enclose the calling call.
195
196_C/C++_
197     _Prototype_:   'int omp_get_active_level(void);'
198
199_Fortran_:
200     _Interface_:   'integer function omp_get_active_level()'
201
202_See also_:
203     *note omp_get_level::, *note omp_get_max_active_levels::, *note
204     omp_set_max_active_levels::
205
206_Reference_:
207     OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.20.
208
209
210File: libgomp.info,  Node: omp_get_ancestor_thread_num,  Next: omp_get_cancellation,  Prev: omp_get_active_level,  Up: Runtime Library Routines
211
2122.2 'omp_get_ancestor_thread_num' - Ancestor thread ID
213======================================================
214
215_Description_:
216     This function returns the thread identification number for the
217     given nesting level of the current thread.  For values of LEVEL
218     outside zero to 'omp_get_level' -1 is returned; if LEVEL is
219     'omp_get_level' the result is identical to 'omp_get_thread_num'.
220
221_C/C++_
222     _Prototype_:   'int omp_get_ancestor_thread_num(int level);'
223
224_Fortran_:
225     _Interface_:   'integer function omp_get_ancestor_thread_num(level)'
226                    'integer level'
227
228_See also_:
229     *note omp_get_level::, *note omp_get_thread_num::, *note
230     omp_get_team_size::
231
232_Reference_:
233     OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.18.
234
235
236File: libgomp.info,  Node: omp_get_cancellation,  Next: omp_get_default_device,  Prev: omp_get_ancestor_thread_num,  Up: Runtime Library Routines
237
2382.3 'omp_get_cancellation' - Whether cancellation support is enabled
239====================================================================
240
241_Description_:
242     This function returns 'true' if cancellation is activated, 'false'
243     otherwise.  Here, 'true' and 'false' represent their
244     language-specific counterparts.  Unless 'OMP_CANCELLATION' is set
245     true, cancellations are deactivated.
246
247_C/C++_:
248     _Prototype_:   'int omp_get_cancellation(void);'
249
250_Fortran_:
251     _Interface_:   'logical function omp_get_cancellation()'
252
253_See also_:
254     *note OMP_CANCELLATION::
255
256_Reference_:
257     OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.9.
258
259
260File: libgomp.info,  Node: omp_get_default_device,  Next: omp_get_dynamic,  Prev: omp_get_cancellation,  Up: Runtime Library Routines
261
2622.4 'omp_get_default_device' - Get the default device for target regions
263========================================================================
264
265_Description_:
266     Get the default device for target regions without device clause.
267
268_C/C++_:
269     _Prototype_:   'int omp_get_default_device(void);'
270
271_Fortran_:
272     _Interface_:   'integer function omp_get_default_device()'
273
274_See also_:
275     *note OMP_DEFAULT_DEVICE::, *note omp_set_default_device::
276
277_Reference_:
278     OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.30.
279
280
281File: libgomp.info,  Node: omp_get_dynamic,  Next: omp_get_level,  Prev: omp_get_default_device,  Up: Runtime Library Routines
282
2832.5 'omp_get_dynamic' - Dynamic teams setting
284=============================================
285
286_Description_:
287     This function returns 'true' if enabled, 'false' otherwise.  Here,
288     'true' and 'false' represent their language-specific counterparts.
289
290     The dynamic team setting may be initialized at startup by the
291     'OMP_DYNAMIC' environment variable or at runtime using
292     'omp_set_dynamic'.  If undefined, dynamic adjustment is disabled by
293     default.
294
295_C/C++_:
296     _Prototype_:   'int omp_get_dynamic(void);'
297
298_Fortran_:
299     _Interface_:   'logical function omp_get_dynamic()'
300
301_See also_:
302     *note omp_set_dynamic::, *note OMP_DYNAMIC::
303
304_Reference_:
305     OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.8.
306
307
308File: libgomp.info,  Node: omp_get_level,  Next: omp_get_max_active_levels,  Prev: omp_get_dynamic,  Up: Runtime Library Routines
309
3102.6 'omp_get_level' - Obtain the current nesting level
311======================================================
312
313_Description_:
314     This function returns the nesting level for the parallel blocks,
315     which enclose the calling call.
316
317_C/C++_
318     _Prototype_:   'int omp_get_level(void);'
319
320_Fortran_:
321     _Interface_:   'integer function omp_level()'
322
323_See also_:
324     *note omp_get_active_level::
325
326_Reference_:
327     OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.17.
328
329
330File: libgomp.info,  Node: omp_get_max_active_levels,  Next: omp_get_max_task_priority,  Prev: omp_get_level,  Up: Runtime Library Routines
331
3322.7 'omp_get_max_active_levels' - Maximum number of active regions
333==================================================================
334
335_Description_:
336     This function obtains the maximum allowed number of nested, active
337     parallel regions.
338
339_C/C++_
340     _Prototype_:   'int omp_get_max_active_levels(void);'
341
342_Fortran_:
343     _Interface_:   'integer function omp_get_max_active_levels()'
344
345_See also_:
346     *note omp_set_max_active_levels::, *note omp_get_active_level::
347
348_Reference_:
349     OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.16.
350
351
352File: libgomp.info,  Node: omp_get_max_task_priority,  Next: omp_get_max_threads,  Prev: omp_get_max_active_levels,  Up: Runtime Library Routines
353
3542.8 'omp_get_max_task_priority' - Maximum priority value
355========================================================
356
357that can be set for tasks.
358_Description_:
359     This function obtains the maximum allowed priority number for
360     tasks.
361
362_C/C++_
363     _Prototype_:   'int omp_get_max_task_priority(void);'
364
365_Fortran_:
366     _Interface_:   'integer function omp_get_max_task_priority()'
367
368_Reference_:
369     OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.29.
370
371
372File: libgomp.info,  Node: omp_get_max_threads,  Next: omp_get_nested,  Prev: omp_get_max_task_priority,  Up: Runtime Library Routines
373
3742.9 'omp_get_max_threads' - Maximum number of threads of parallel region
375========================================================================
376
377_Description_:
378     Return the maximum number of threads used for the current parallel
379     region that does not use the clause 'num_threads'.
380
381_C/C++_:
382     _Prototype_:   'int omp_get_max_threads(void);'
383
384_Fortran_:
385     _Interface_:   'integer function omp_get_max_threads()'
386
387_See also_:
388     *note omp_set_num_threads::, *note omp_set_dynamic::, *note
389     omp_get_thread_limit::
390
391_Reference_:
392     OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.3.
393
394
395File: libgomp.info,  Node: omp_get_nested,  Next: omp_get_num_devices,  Prev: omp_get_max_threads,  Up: Runtime Library Routines
396
3972.10 'omp_get_nested' - Nested parallel regions
398===============================================
399
400_Description_:
401     This function returns 'true' if nested parallel regions are
402     enabled, 'false' otherwise.  Here, 'true' and 'false' represent
403     their language-specific counterparts.
404
405     Nested parallel regions may be initialized at startup by the
406     'OMP_NESTED' environment variable or at runtime using
407     'omp_set_nested'.  If undefined, nested parallel regions are
408     disabled by default.
409
410_C/C++_:
411     _Prototype_:   'int omp_get_nested(void);'
412
413_Fortran_:
414     _Interface_:   'logical function omp_get_nested()'
415
416_See also_:
417     *note omp_set_nested::, *note OMP_NESTED::
418
419_Reference_:
420     OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.11.
421
422
423File: libgomp.info,  Node: omp_get_num_devices,  Next: omp_get_num_procs,  Prev: omp_get_nested,  Up: Runtime Library Routines
424
4252.11 'omp_get_num_devices' - Number of target devices
426=====================================================
427
428_Description_:
429     Returns the number of target devices.
430
431_C/C++_:
432     _Prototype_:   'int omp_get_num_devices(void);'
433
434_Fortran_:
435     _Interface_:   'integer function omp_get_num_devices()'
436
437_Reference_:
438     OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.31.
439
440
441File: libgomp.info,  Node: omp_get_num_procs,  Next: omp_get_num_teams,  Prev: omp_get_num_devices,  Up: Runtime Library Routines
442
4432.12 'omp_get_num_procs' - Number of processors online
444======================================================
445
446_Description_:
447     Returns the number of processors online on that device.
448
449_C/C++_:
450     _Prototype_:   'int omp_get_num_procs(void);'
451
452_Fortran_:
453     _Interface_:   'integer function omp_get_num_procs()'
454
455_Reference_:
456     OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.5.
457
458
459File: libgomp.info,  Node: omp_get_num_teams,  Next: omp_get_num_threads,  Prev: omp_get_num_procs,  Up: Runtime Library Routines
460
4612.13 'omp_get_num_teams' - Number of teams
462==========================================
463
464_Description_:
465     Returns the number of teams in the current team region.
466
467_C/C++_:
468     _Prototype_:   'int omp_get_num_teams(void);'
469
470_Fortran_:
471     _Interface_:   'integer function omp_get_num_teams()'
472
473_Reference_:
474     OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.32.
475
476
477File: libgomp.info,  Node: omp_get_num_threads,  Next: omp_get_proc_bind,  Prev: omp_get_num_teams,  Up: Runtime Library Routines
478
4792.14 'omp_get_num_threads' - Size of the active team
480====================================================
481
482_Description_:
483     Returns the number of threads in the current team.  In a sequential
484     section of the program 'omp_get_num_threads' returns 1.
485
486     The default team size may be initialized at startup by the
487     'OMP_NUM_THREADS' environment variable.  At runtime, the size of
488     the current team may be set either by the 'NUM_THREADS' clause or
489     by 'omp_set_num_threads'.  If none of the above were used to define
490     a specific value and 'OMP_DYNAMIC' is disabled, one thread per CPU
491     online is used.
492
493_C/C++_:
494     _Prototype_:   'int omp_get_num_threads(void);'
495
496_Fortran_:
497     _Interface_:   'integer function omp_get_num_threads()'
498
499_See also_:
500     *note omp_get_max_threads::, *note omp_set_num_threads::, *note
501     OMP_NUM_THREADS::
502
503_Reference_:
504     OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.2.
505
506
507File: libgomp.info,  Node: omp_get_proc_bind,  Next: omp_get_schedule,  Prev: omp_get_num_threads,  Up: Runtime Library Routines
508
5092.15 'omp_get_proc_bind' - Whether theads may be moved between CPUs
510===================================================================
511
512_Description_:
513     This functions returns the currently active thread affinity policy,
514     which is set via 'OMP_PROC_BIND'.  Possible values are
515     'omp_proc_bind_false', 'omp_proc_bind_true',
516     'omp_proc_bind_master', 'omp_proc_bind_close' and
517     'omp_proc_bind_spread'.
518
519_C/C++_:
520     _Prototype_:   'omp_proc_bind_t omp_get_proc_bind(void);'
521
522_Fortran_:
523     _Interface_:   'integer(kind=omp_proc_bind_kind) function
524                    omp_get_proc_bind()'
525
526_See also_:
527     *note OMP_PROC_BIND::, *note OMP_PLACES::, *note
528     GOMP_CPU_AFFINITY::,
529
530_Reference_:
531     OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.22.
532
533
534File: libgomp.info,  Node: omp_get_schedule,  Next: omp_get_team_num,  Prev: omp_get_proc_bind,  Up: Runtime Library Routines
535
5362.16 'omp_get_schedule' - Obtain the runtime scheduling method
537==============================================================
538
539_Description_:
540     Obtain the runtime scheduling method.  The KIND argument will be
541     set to the value 'omp_sched_static', 'omp_sched_dynamic',
542     'omp_sched_guided' or 'omp_sched_auto'.  The second argument,
543     CHUNK_SIZE, is set to the chunk size.
544
545_C/C++_
546     _Prototype_:   'void omp_get_schedule(omp_sched_t *kind, int
547                    *chunk_size);'
548
549_Fortran_:
550     _Interface_:   'subroutine omp_get_schedule(kind, chunk_size)'
551                    'integer(kind=omp_sched_kind) kind'
552                    'integer chunk_size'
553
554_See also_:
555     *note omp_set_schedule::, *note OMP_SCHEDULE::
556
557_Reference_:
558     OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.13.
559
560
561File: libgomp.info,  Node: omp_get_team_num,  Next: omp_get_team_size,  Prev: omp_get_schedule,  Up: Runtime Library Routines
562
5632.17 'omp_get_team_num' - Get team number
564=========================================
565
566_Description_:
567     Returns the team number of the calling thread.
568
569_C/C++_:
570     _Prototype_:   'int omp_get_team_num(void);'
571
572_Fortran_:
573     _Interface_:   'integer function omp_get_team_num()'
574
575_Reference_:
576     OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.33.
577
578
579File: libgomp.info,  Node: omp_get_team_size,  Next: omp_get_thread_limit,  Prev: omp_get_team_num,  Up: Runtime Library Routines
580
5812.18 'omp_get_team_size' - Number of threads in a team
582======================================================
583
584_Description_:
585     This function returns the number of threads in a thread team to
586     which either the current thread or its ancestor belongs.  For
587     values of LEVEL outside zero to 'omp_get_level', -1 is returned; if
588     LEVEL is zero, 1 is returned, and for 'omp_get_level', the result
589     is identical to 'omp_get_num_threads'.
590
591_C/C++_:
592     _Prototype_:   'int omp_get_team_size(int level);'
593
594_Fortran_:
595     _Interface_:   'integer function omp_get_team_size(level)'
596                    'integer level'
597
598_See also_:
599     *note omp_get_num_threads::, *note omp_get_level::, *note
600     omp_get_ancestor_thread_num::
601
602_Reference_:
603     OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.19.
604
605
606File: libgomp.info,  Node: omp_get_thread_limit,  Next: omp_get_thread_num,  Prev: omp_get_team_size,  Up: Runtime Library Routines
607
6082.19 'omp_get_thread_limit' - Maximum number of threads
609=======================================================
610
611_Description_:
612     Return the maximum number of threads of the program.
613
614_C/C++_:
615     _Prototype_:   'int omp_get_thread_limit(void);'
616
617_Fortran_:
618     _Interface_:   'integer function omp_get_thread_limit()'
619
620_See also_:
621     *note omp_get_max_threads::, *note OMP_THREAD_LIMIT::
622
623_Reference_:
624     OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.14.
625
626
627File: libgomp.info,  Node: omp_get_thread_num,  Next: omp_in_parallel,  Prev: omp_get_thread_limit,  Up: Runtime Library Routines
628
6292.20 'omp_get_thread_num' - Current thread ID
630=============================================
631
632_Description_:
633     Returns a unique thread identification number within the current
634     team.  In a sequential parts of the program, 'omp_get_thread_num'
635     always returns 0.  In parallel regions the return value varies from
636     0 to 'omp_get_num_threads'-1 inclusive.  The return value of the
637     master thread of a team is always 0.
638
639_C/C++_:
640     _Prototype_:   'int omp_get_thread_num(void);'
641
642_Fortran_:
643     _Interface_:   'integer function omp_get_thread_num()'
644
645_See also_:
646     *note omp_get_num_threads::, *note omp_get_ancestor_thread_num::
647
648_Reference_:
649     OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.4.
650
651
652File: libgomp.info,  Node: omp_in_parallel,  Next: omp_in_final,  Prev: omp_get_thread_num,  Up: Runtime Library Routines
653
6542.21 'omp_in_parallel' - Whether a parallel region is active
655============================================================
656
657_Description_:
658     This function returns 'true' if currently running in parallel,
659     'false' otherwise.  Here, 'true' and 'false' represent their
660     language-specific counterparts.
661
662_C/C++_:
663     _Prototype_:   'int omp_in_parallel(void);'
664
665_Fortran_:
666     _Interface_:   'logical function omp_in_parallel()'
667
668_Reference_:
669     OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.6.
670
671
672File: libgomp.info,  Node: omp_in_final,  Next: omp_is_initial_device,  Prev: omp_in_parallel,  Up: Runtime Library Routines
673
6742.22 'omp_in_final' - Whether in final or included task region
675==============================================================
676
677_Description_:
678     This function returns 'true' if currently running in a final or
679     included task region, 'false' otherwise.  Here, 'true' and 'false'
680     represent their language-specific counterparts.
681
682_C/C++_:
683     _Prototype_:   'int omp_in_final(void);'
684
685_Fortran_:
686     _Interface_:   'logical function omp_in_final()'
687
688_Reference_:
689     OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.21.
690
691
692File: libgomp.info,  Node: omp_is_initial_device,  Next: omp_set_default_device,  Prev: omp_in_final,  Up: Runtime Library Routines
693
6942.23 'omp_is_initial_device' - Whether executing on the host device
695===================================================================
696
697_Description_:
698     This function returns 'true' if currently running on the host
699     device, 'false' otherwise.  Here, 'true' and 'false' represent
700     their language-specific counterparts.
701
702_C/C++_:
703     _Prototype_:   'int omp_is_initial_device(void);'
704
705_Fortran_:
706     _Interface_:   'logical function omp_is_initial_device()'
707
708_Reference_:
709     OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.34.
710
711
712File: libgomp.info,  Node: omp_set_default_device,  Next: omp_set_dynamic,  Prev: omp_is_initial_device,  Up: Runtime Library Routines
713
7142.24 'omp_set_default_device' - Set the default device for target regions
715=========================================================================
716
717_Description_:
718     Set the default device for target regions without device clause.
719     The argument shall be a nonnegative device number.
720
721_C/C++_:
722     _Prototype_:   'void omp_set_default_device(int device_num);'
723
724_Fortran_:
725     _Interface_:   'subroutine omp_set_default_device(device_num)'
726                    'integer device_num'
727
728_See also_:
729     *note OMP_DEFAULT_DEVICE::, *note omp_get_default_device::
730
731_Reference_:
732     OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.29.
733
734
735File: libgomp.info,  Node: omp_set_dynamic,  Next: omp_set_max_active_levels,  Prev: omp_set_default_device,  Up: Runtime Library Routines
736
7372.25 'omp_set_dynamic' - Enable/disable dynamic teams
738=====================================================
739
740_Description_:
741     Enable or disable the dynamic adjustment of the number of threads
742     within a team.  The function takes the language-specific equivalent
743     of 'true' and 'false', where 'true' enables dynamic adjustment of
744     team sizes and 'false' disables it.
745
746_C/C++_:
747     _Prototype_:   'void omp_set_dynamic(int dynamic_threads);'
748
749_Fortran_:
750     _Interface_:   'subroutine omp_set_dynamic(dynamic_threads)'
751                    'logical, intent(in) :: dynamic_threads'
752
753_See also_:
754     *note OMP_DYNAMIC::, *note omp_get_dynamic::
755
756_Reference_:
757     OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.7.
758
759
760File: libgomp.info,  Node: omp_set_max_active_levels,  Next: omp_set_nested,  Prev: omp_set_dynamic,  Up: Runtime Library Routines
761
7622.26 'omp_set_max_active_levels' - Limits the number of active parallel regions
763===============================================================================
764
765_Description_:
766     This function limits the maximum allowed number of nested, active
767     parallel regions.
768
769_C/C++_
770     _Prototype_:   'void omp_set_max_active_levels(int max_levels);'
771
772_Fortran_:
773     _Interface_:   'subroutine omp_set_max_active_levels(max_levels)'
774                    'integer max_levels'
775
776_See also_:
777     *note omp_get_max_active_levels::, *note omp_get_active_level::
778
779_Reference_:
780     OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.15.
781
782
783File: libgomp.info,  Node: omp_set_nested,  Next: omp_set_num_threads,  Prev: omp_set_max_active_levels,  Up: Runtime Library Routines
784
7852.27 'omp_set_nested' - Enable/disable nested parallel regions
786==============================================================
787
788_Description_:
789     Enable or disable nested parallel regions, i.e., whether team
790     members are allowed to create new teams.  The function takes the
791     language-specific equivalent of 'true' and 'false', where 'true'
792     enables dynamic adjustment of team sizes and 'false' disables it.
793
794_C/C++_:
795     _Prototype_:   'void omp_set_nested(int nested);'
796
797_Fortran_:
798     _Interface_:   'subroutine omp_set_nested(nested)'
799                    'logical, intent(in) :: nested'
800
801_See also_:
802     *note OMP_NESTED::, *note omp_get_nested::
803
804_Reference_:
805     OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.10.
806
807
808File: libgomp.info,  Node: omp_set_num_threads,  Next: omp_set_schedule,  Prev: omp_set_nested,  Up: Runtime Library Routines
809
8102.28 'omp_set_num_threads' - Set upper team size limit
811======================================================
812
813_Description_:
814     Specifies the number of threads used by default in subsequent
815     parallel sections, if those do not specify a 'num_threads' clause.
816     The argument of 'omp_set_num_threads' shall be a positive integer.
817
818_C/C++_:
819     _Prototype_:   'void omp_set_num_threads(int num_threads);'
820
821_Fortran_:
822     _Interface_:   'subroutine omp_set_num_threads(num_threads)'
823                    'integer, intent(in) :: num_threads'
824
825_See also_:
826     *note OMP_NUM_THREADS::, *note omp_get_num_threads::, *note
827     omp_get_max_threads::
828
829_Reference_:
830     OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.1.
831
832
833File: libgomp.info,  Node: omp_set_schedule,  Next: omp_init_lock,  Prev: omp_set_num_threads,  Up: Runtime Library Routines
834
8352.29 'omp_set_schedule' - Set the runtime scheduling method
836===========================================================
837
838_Description_:
839     Sets the runtime scheduling method.  The KIND argument can have the
840     value 'omp_sched_static', 'omp_sched_dynamic', 'omp_sched_guided'
841     or 'omp_sched_auto'.  Except for 'omp_sched_auto', the chunk size
842     is set to the value of CHUNK_SIZE if positive, or to the default
843     value if zero or negative.  For 'omp_sched_auto' the CHUNK_SIZE
844     argument is ignored.
845
846_C/C++_
847     _Prototype_:   'void omp_set_schedule(omp_sched_t kind, int
848                    chunk_size);'
849
850_Fortran_:
851     _Interface_:   'subroutine omp_set_schedule(kind, chunk_size)'
852                    'integer(kind=omp_sched_kind) kind'
853                    'integer chunk_size'
854
855_See also_:
856     *note omp_get_schedule:: *note OMP_SCHEDULE::
857
858_Reference_:
859     OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.12.
860
861
862File: libgomp.info,  Node: omp_init_lock,  Next: omp_set_lock,  Prev: omp_set_schedule,  Up: Runtime Library Routines
863
8642.30 'omp_init_lock' - Initialize simple lock
865=============================================
866
867_Description_:
868     Initialize a simple lock.  After initialization, the lock is in an
869     unlocked state.
870
871_C/C++_:
872     _Prototype_:   'void omp_init_lock(omp_lock_t *lock);'
873
874_Fortran_:
875     _Interface_:   'subroutine omp_init_lock(svar)'
876                    'integer(omp_lock_kind), intent(out) :: svar'
877
878_See also_:
879     *note omp_destroy_lock::
880
881_Reference_:
882     OpenMP specification v4.5 (https://www.openmp.org), Section 3.3.1.
883
884
885File: libgomp.info,  Node: omp_set_lock,  Next: omp_test_lock,  Prev: omp_init_lock,  Up: Runtime Library Routines
886
8872.31 'omp_set_lock' - Wait for and set simple lock
888==================================================
889
890_Description_:
891     Before setting a simple lock, the lock variable must be initialized
892     by 'omp_init_lock'.  The calling thread is blocked until the lock
893     is available.  If the lock is already held by the current thread, a
894     deadlock occurs.
895
896_C/C++_:
897     _Prototype_:   'void omp_set_lock(omp_lock_t *lock);'
898
899_Fortran_:
900     _Interface_:   'subroutine omp_set_lock(svar)'
901                    'integer(omp_lock_kind), intent(inout) :: svar'
902
903_See also_:
904     *note omp_init_lock::, *note omp_test_lock::, *note
905     omp_unset_lock::
906
907_Reference_:
908     OpenMP specification v4.5 (https://www.openmp.org), Section 3.3.4.
909
910
911File: libgomp.info,  Node: omp_test_lock,  Next: omp_unset_lock,  Prev: omp_set_lock,  Up: Runtime Library Routines
912
9132.32 'omp_test_lock' - Test and set simple lock if available
914============================================================
915
916_Description_:
917     Before setting a simple lock, the lock variable must be initialized
918     by 'omp_init_lock'.  Contrary to 'omp_set_lock', 'omp_test_lock'
919     does not block if the lock is not available.  This function returns
920     'true' upon success, 'false' otherwise.  Here, 'true' and 'false'
921     represent their language-specific counterparts.
922
923_C/C++_:
924     _Prototype_:   'int omp_test_lock(omp_lock_t *lock);'
925
926_Fortran_:
927     _Interface_:   'logical function omp_test_lock(svar)'
928                    'integer(omp_lock_kind), intent(inout) :: svar'
929
930_See also_:
931     *note omp_init_lock::, *note omp_set_lock::, *note omp_set_lock::
932
933_Reference_:
934     OpenMP specification v4.5 (https://www.openmp.org), Section 3.3.6.
935
936
937File: libgomp.info,  Node: omp_unset_lock,  Next: omp_destroy_lock,  Prev: omp_test_lock,  Up: Runtime Library Routines
938
9392.33 'omp_unset_lock' - Unset simple lock
940=========================================
941
942_Description_:
943     A simple lock about to be unset must have been locked by
944     'omp_set_lock' or 'omp_test_lock' before.  In addition, the lock
945     must be held by the thread calling 'omp_unset_lock'.  Then, the
946     lock becomes unlocked.  If one or more threads attempted to set the
947     lock before, one of them is chosen to, again, set the lock to
948     itself.
949
950_C/C++_:
951     _Prototype_:   'void omp_unset_lock(omp_lock_t *lock);'
952
953_Fortran_:
954     _Interface_:   'subroutine omp_unset_lock(svar)'
955                    'integer(omp_lock_kind), intent(inout) :: svar'
956
957_See also_:
958     *note omp_set_lock::, *note omp_test_lock::
959
960_Reference_:
961     OpenMP specification v4.5 (https://www.openmp.org), Section 3.3.5.
962
963
964File: libgomp.info,  Node: omp_destroy_lock,  Next: omp_init_nest_lock,  Prev: omp_unset_lock,  Up: Runtime Library Routines
965
9662.34 'omp_destroy_lock' - Destroy simple lock
967=============================================
968
969_Description_:
970     Destroy a simple lock.  In order to be destroyed, a simple lock
971     must be in the unlocked state.
972
973_C/C++_:
974     _Prototype_:   'void omp_destroy_lock(omp_lock_t *lock);'
975
976_Fortran_:
977     _Interface_:   'subroutine omp_destroy_lock(svar)'
978                    'integer(omp_lock_kind), intent(inout) :: svar'
979
980_See also_:
981     *note omp_init_lock::
982
983_Reference_:
984     OpenMP specification v4.5 (https://www.openmp.org), Section 3.3.3.
985
986
987File: libgomp.info,  Node: omp_init_nest_lock,  Next: omp_set_nest_lock,  Prev: omp_destroy_lock,  Up: Runtime Library Routines
988
9892.35 'omp_init_nest_lock' - Initialize nested lock
990==================================================
991
992_Description_:
993     Initialize a nested lock.  After initialization, the lock is in an
994     unlocked state and the nesting count is set to zero.
995
996_C/C++_:
997     _Prototype_:   'void omp_init_nest_lock(omp_nest_lock_t *lock);'
998
999_Fortran_:
1000     _Interface_:   'subroutine omp_init_nest_lock(nvar)'
1001                    'integer(omp_nest_lock_kind), intent(out) :: nvar'
1002
1003_See also_:
1004     *note omp_destroy_nest_lock::
1005
1006_Reference_:
1007     OpenMP specification v4.5 (https://www.openmp.org), Section 3.3.1.
1008
1009
1010File: libgomp.info,  Node: omp_set_nest_lock,  Next: omp_test_nest_lock,  Prev: omp_init_nest_lock,  Up: Runtime Library Routines
1011
10122.36 'omp_set_nest_lock' - Wait for and set nested lock
1013=======================================================
1014
1015_Description_:
1016     Before setting a nested lock, the lock variable must be initialized
1017     by 'omp_init_nest_lock'.  The calling thread is blocked until the
1018     lock is available.  If the lock is already held by the current
1019     thread, the nesting count for the lock is incremented.
1020
1021_C/C++_:
1022     _Prototype_:   'void omp_set_nest_lock(omp_nest_lock_t *lock);'
1023
1024_Fortran_:
1025     _Interface_:   'subroutine omp_set_nest_lock(nvar)'
1026                    'integer(omp_nest_lock_kind), intent(inout) :: nvar'
1027
1028_See also_:
1029     *note omp_init_nest_lock::, *note omp_unset_nest_lock::
1030
1031_Reference_:
1032     OpenMP specification v4.5 (https://www.openmp.org), Section 3.3.4.
1033
1034
1035File: libgomp.info,  Node: omp_test_nest_lock,  Next: omp_unset_nest_lock,  Prev: omp_set_nest_lock,  Up: Runtime Library Routines
1036
10372.37 'omp_test_nest_lock' - Test and set nested lock if available
1038=================================================================
1039
1040_Description_:
1041     Before setting a nested lock, the lock variable must be initialized
1042     by 'omp_init_nest_lock'.  Contrary to 'omp_set_nest_lock',
1043     'omp_test_nest_lock' does not block if the lock is not available.
1044     If the lock is already held by the current thread, the new nesting
1045     count is returned.  Otherwise, the return value equals zero.
1046
1047_C/C++_:
1048     _Prototype_:   'int omp_test_nest_lock(omp_nest_lock_t *lock);'
1049
1050_Fortran_:
1051     _Interface_:   'logical function omp_test_nest_lock(nvar)'
1052                    'integer(omp_nest_lock_kind), intent(inout) :: nvar'
1053
1054_See also_:
1055     *note omp_init_lock::, *note omp_set_lock::, *note omp_set_lock::
1056
1057_Reference_:
1058     OpenMP specification v4.5 (https://www.openmp.org), Section 3.3.6.
1059
1060
1061File: libgomp.info,  Node: omp_unset_nest_lock,  Next: omp_destroy_nest_lock,  Prev: omp_test_nest_lock,  Up: Runtime Library Routines
1062
10632.38 'omp_unset_nest_lock' - Unset nested lock
1064==============================================
1065
1066_Description_:
1067     A nested lock about to be unset must have been locked by
1068     'omp_set_nested_lock' or 'omp_test_nested_lock' before.  In
1069     addition, the lock must be held by the thread calling
1070     'omp_unset_nested_lock'.  If the nesting count drops to zero, the
1071     lock becomes unlocked.  If one ore more threads attempted to set
1072     the lock before, one of them is chosen to, again, set the lock to
1073     itself.
1074
1075_C/C++_:
1076     _Prototype_:   'void omp_unset_nest_lock(omp_nest_lock_t *lock);'
1077
1078_Fortran_:
1079     _Interface_:   'subroutine omp_unset_nest_lock(nvar)'
1080                    'integer(omp_nest_lock_kind), intent(inout) :: nvar'
1081
1082_See also_:
1083     *note omp_set_nest_lock::
1084
1085_Reference_:
1086     OpenMP specification v4.5 (https://www.openmp.org), Section 3.3.5.
1087
1088
1089File: libgomp.info,  Node: omp_destroy_nest_lock,  Next: omp_get_wtick,  Prev: omp_unset_nest_lock,  Up: Runtime Library Routines
1090
10912.39 'omp_destroy_nest_lock' - Destroy nested lock
1092==================================================
1093
1094_Description_:
1095     Destroy a nested lock.  In order to be destroyed, a nested lock
1096     must be in the unlocked state and its nesting count must equal
1097     zero.
1098
1099_C/C++_:
1100     _Prototype_:   'void omp_destroy_nest_lock(omp_nest_lock_t *);'
1101
1102_Fortran_:
1103     _Interface_:   'subroutine omp_destroy_nest_lock(nvar)'
1104                    'integer(omp_nest_lock_kind), intent(inout) :: nvar'
1105
1106_See also_:
1107     *note omp_init_lock::
1108
1109_Reference_:
1110     OpenMP specification v4.5 (https://www.openmp.org), Section 3.3.3.
1111
1112
1113File: libgomp.info,  Node: omp_get_wtick,  Next: omp_get_wtime,  Prev: omp_destroy_nest_lock,  Up: Runtime Library Routines
1114
11152.40 'omp_get_wtick' - Get timer precision
1116==========================================
1117
1118_Description_:
1119     Gets the timer precision, i.e., the number of seconds between two
1120     successive clock ticks.
1121
1122_C/C++_:
1123     _Prototype_:   'double omp_get_wtick(void);'
1124
1125_Fortran_:
1126     _Interface_:   'double precision function omp_get_wtick()'
1127
1128_See also_:
1129     *note omp_get_wtime::
1130
1131_Reference_:
1132     OpenMP specification v4.5 (https://www.openmp.org), Section 3.4.2.
1133
1134
1135File: libgomp.info,  Node: omp_get_wtime,  Prev: omp_get_wtick,  Up: Runtime Library Routines
1136
11372.41 'omp_get_wtime' - Elapsed wall clock time
1138==============================================
1139
1140_Description_:
1141     Elapsed wall clock time in seconds.  The time is measured per
1142     thread, no guarantee can be made that two distinct threads measure
1143     the same time.  Time is measured from some "time in the past",
1144     which is an arbitrary time guaranteed not to change during the
1145     execution of the program.
1146
1147_C/C++_:
1148     _Prototype_:   'double omp_get_wtime(void);'
1149
1150_Fortran_:
1151     _Interface_:   'double precision function omp_get_wtime()'
1152
1153_See also_:
1154     *note omp_get_wtick::
1155
1156_Reference_:
1157     OpenMP specification v4.5 (https://www.openmp.org), Section 3.4.1.
1158
1159
1160File: libgomp.info,  Node: Environment Variables,  Next: Enabling OpenACC,  Prev: Runtime Library Routines,  Up: Top
1161
11623 OpenMP Environment Variables
1163******************************
1164
1165The environment variables which beginning with 'OMP_' are defined by
1166section 4 of the OpenMP specification in version 4.5, while those
1167beginning with 'GOMP_' are GNU extensions.
1168
1169* Menu:
1170
1171* OMP_CANCELLATION::        Set whether cancellation is activated
1172* OMP_DISPLAY_ENV::         Show OpenMP version and environment variables
1173* OMP_DEFAULT_DEVICE::      Set the device used in target regions
1174* OMP_DYNAMIC::             Dynamic adjustment of threads
1175* OMP_MAX_ACTIVE_LEVELS::   Set the maximum number of nested parallel regions
1176* OMP_MAX_TASK_PRIORITY::   Set the maximum task priority value
1177* OMP_NESTED::              Nested parallel regions
1178* OMP_NUM_THREADS::         Specifies the number of threads to use
1179* OMP_PROC_BIND::           Whether theads may be moved between CPUs
1180* OMP_PLACES::              Specifies on which CPUs the theads should be placed
1181* OMP_STACKSIZE::           Set default thread stack size
1182* OMP_SCHEDULE::            How threads are scheduled
1183* OMP_THREAD_LIMIT::        Set the maximum number of threads
1184* OMP_WAIT_POLICY::         How waiting threads are handled
1185* GOMP_CPU_AFFINITY::       Bind threads to specific CPUs
1186* GOMP_DEBUG::              Enable debugging output
1187* GOMP_STACKSIZE::          Set default thread stack size
1188* GOMP_SPINCOUNT::          Set the busy-wait spin count
1189* GOMP_RTEMS_THREAD_POOLS:: Set the RTEMS specific thread pools
1190
1191
1192File: libgomp.info,  Node: OMP_CANCELLATION,  Next: OMP_DISPLAY_ENV,  Up: Environment Variables
1193
11943.1 'OMP_CANCELLATION' - Set whether cancellation is activated
1195==============================================================
1196
1197_Description_:
1198     If set to 'TRUE', the cancellation is activated.  If set to 'FALSE'
1199     or if unset, cancellation is disabled and the 'cancel' construct is
1200     ignored.
1201
1202_See also_:
1203     *note omp_get_cancellation::
1204
1205_Reference_:
1206     OpenMP specification v4.5 (https://www.openmp.org), Section 4.11
1207
1208
1209File: libgomp.info,  Node: OMP_DISPLAY_ENV,  Next: OMP_DEFAULT_DEVICE,  Prev: OMP_CANCELLATION,  Up: Environment Variables
1210
12113.2 'OMP_DISPLAY_ENV' - Show OpenMP version and environment variables
1212=====================================================================
1213
1214_Description_:
1215     If set to 'TRUE', the OpenMP version number and the values
1216     associated with the OpenMP environment variables are printed to
1217     'stderr'.  If set to 'VERBOSE', it additionally shows the value of
1218     the environment variables which are GNU extensions.  If undefined
1219     or set to 'FALSE', this information will not be shown.
1220
1221_Reference_:
1222     OpenMP specification v4.5 (https://www.openmp.org), Section 4.12
1223
1224
1225File: libgomp.info,  Node: OMP_DEFAULT_DEVICE,  Next: OMP_DYNAMIC,  Prev: OMP_DISPLAY_ENV,  Up: Environment Variables
1226
12273.3 'OMP_DEFAULT_DEVICE' - Set the device used in target regions
1228================================================================
1229
1230_Description_:
1231     Set to choose the device which is used in a 'target' region, unless
1232     the value is overridden by 'omp_set_default_device' or by a
1233     'device' clause.  The value shall be the nonnegative device number.
1234     If no device with the given device number exists, the code is
1235     executed on the host.  If unset, device number 0 will be used.
1236
1237_See also_:
1238     *note omp_get_default_device::, *note omp_set_default_device::,
1239
1240_Reference_:
1241     OpenMP specification v4.5 (https://www.openmp.org), Section 4.13
1242
1243
1244File: libgomp.info,  Node: OMP_DYNAMIC,  Next: OMP_MAX_ACTIVE_LEVELS,  Prev: OMP_DEFAULT_DEVICE,  Up: Environment Variables
1245
12463.4 'OMP_DYNAMIC' - Dynamic adjustment of threads
1247=================================================
1248
1249_Description_:
1250     Enable or disable the dynamic adjustment of the number of threads
1251     within a team.  The value of this environment variable shall be
1252     'TRUE' or 'FALSE'.  If undefined, dynamic adjustment is disabled by
1253     default.
1254
1255_See also_:
1256     *note omp_set_dynamic::
1257
1258_Reference_:
1259     OpenMP specification v4.5 (https://www.openmp.org), Section 4.3
1260
1261
1262File: libgomp.info,  Node: OMP_MAX_ACTIVE_LEVELS,  Next: OMP_MAX_TASK_PRIORITY,  Prev: OMP_DYNAMIC,  Up: Environment Variables
1263
12643.5 'OMP_MAX_ACTIVE_LEVELS' - Set the maximum number of nested parallel regions
1265===============================================================================
1266
1267_Description_:
1268     Specifies the initial value for the maximum number of nested
1269     parallel regions.  The value of this variable shall be a positive
1270     integer.  If undefined, the number of active levels is unlimited.
1271
1272_See also_:
1273     *note omp_set_max_active_levels::
1274
1275_Reference_:
1276     OpenMP specification v4.5 (https://www.openmp.org), Section 4.9
1277
1278
1279File: libgomp.info,  Node: OMP_MAX_TASK_PRIORITY,  Next: OMP_NESTED,  Prev: OMP_MAX_ACTIVE_LEVELS,  Up: Environment Variables
1280
12813.6 'OMP_MAX_TASK_PRIORITY' - Set the maximum priority
1282======================================================
1283
1284number that can be set for a task.
1285_Description_:
1286     Specifies the initial value for the maximum priority value that can
1287     be set for a task.  The value of this variable shall be a
1288     non-negative integer, and zero is allowed.  If undefined, the
1289     default priority is 0.
1290
1291_See also_:
1292     *note omp_get_max_task_priority::
1293
1294_Reference_:
1295     OpenMP specification v4.5 (https://www.openmp.org), Section 4.14
1296
1297
1298File: libgomp.info,  Node: OMP_NESTED,  Next: OMP_NUM_THREADS,  Prev: OMP_MAX_TASK_PRIORITY,  Up: Environment Variables
1299
13003.7 'OMP_NESTED' - Nested parallel regions
1301==========================================
1302
1303_Description_:
1304     Enable or disable nested parallel regions, i.e., whether team
1305     members are allowed to create new teams.  The value of this
1306     environment variable shall be 'TRUE' or 'FALSE'.  If undefined,
1307     nested parallel regions are disabled by default.
1308
1309_See also_:
1310     *note omp_set_nested::
1311
1312_Reference_:
1313     OpenMP specification v4.5 (https://www.openmp.org), Section 4.6
1314
1315
1316File: libgomp.info,  Node: OMP_NUM_THREADS,  Next: OMP_PROC_BIND,  Prev: OMP_NESTED,  Up: Environment Variables
1317
13183.8 'OMP_NUM_THREADS' - Specifies the number of threads to use
1319==============================================================
1320
1321_Description_:
1322     Specifies the default number of threads to use in parallel regions.
1323     The value of this variable shall be a comma-separated list of
1324     positive integers; the value specified the number of threads to use
1325     for the corresponding nested level.  If undefined one thread per
1326     CPU is used.
1327
1328_See also_:
1329     *note omp_set_num_threads::
1330
1331_Reference_:
1332     OpenMP specification v4.5 (https://www.openmp.org), Section 4.2
1333
1334
1335File: libgomp.info,  Node: OMP_PROC_BIND,  Next: OMP_PLACES,  Prev: OMP_NUM_THREADS,  Up: Environment Variables
1336
13373.9 'OMP_PROC_BIND' - Whether theads may be moved between CPUs
1338==============================================================
1339
1340_Description_:
1341     Specifies whether threads may be moved between processors.  If set
1342     to 'TRUE', OpenMP theads should not be moved; if set to 'FALSE'
1343     they may be moved.  Alternatively, a comma separated list with the
1344     values 'MASTER', 'CLOSE' and 'SPREAD' can be used to specify the
1345     thread affinity policy for the corresponding nesting level.  With
1346     'MASTER' the worker threads are in the same place partition as the
1347     master thread.  With 'CLOSE' those are kept close to the master
1348     thread in contiguous place partitions.  And with 'SPREAD' a sparse
1349     distribution across the place partitions is used.
1350
1351     When undefined, 'OMP_PROC_BIND' defaults to 'TRUE' when
1352     'OMP_PLACES' or 'GOMP_CPU_AFFINITY' is set and 'FALSE' otherwise.
1353
1354_See also_:
1355     *note OMP_PLACES::, *note GOMP_CPU_AFFINITY::, *note
1356     omp_get_proc_bind::
1357
1358_Reference_:
1359     OpenMP specification v4.5 (https://www.openmp.org), Section 4.4
1360
1361
1362File: libgomp.info,  Node: OMP_PLACES,  Next: OMP_STACKSIZE,  Prev: OMP_PROC_BIND,  Up: Environment Variables
1363
13643.10 'OMP_PLACES' - Specifies on which CPUs the theads should be placed
1365=======================================================================
1366
1367_Description_:
1368     The thread placement can be either specified using an abstract name
1369     or by an explicit list of the places.  The abstract names
1370     'threads', 'cores' and 'sockets' can be optionally followed by a
1371     positive number in parentheses, which denotes the how many places
1372     shall be created.  With 'threads' each place corresponds to a
1373     single hardware thread; 'cores' to a single core with the
1374     corresponding number of hardware threads; and with 'sockets' the
1375     place corresponds to a single socket.  The resulting placement can
1376     be shown by setting the 'OMP_DISPLAY_ENV' environment variable.
1377
1378     Alternatively, the placement can be specified explicitly as
1379     comma-separated list of places.  A place is specified by set of
1380     nonnegative numbers in curly braces, denoting the denoting the
1381     hardware threads.  The hardware threads belonging to a place can
1382     either be specified as comma-separated list of nonnegative thread
1383     numbers or using an interval.  Multiple places can also be either
1384     specified by a comma-separated list of places or by an interval.
1385     To specify an interval, a colon followed by the count is placed
1386     after after the hardware thread number or the place.  Optionally,
1387     the length can be followed by a colon and the stride number -
1388     otherwise a unit stride is assumed.  For instance, the following
1389     specifies the same places list: '"{0,1,2}, {3,4,6}, {7,8,9},
1390     {10,11,12}"'; '"{0:3}, {3:3}, {7:3}, {10:3}"'; and '"{0:2}:4:3"'.
1391
1392     If 'OMP_PLACES' and 'GOMP_CPU_AFFINITY' are unset and
1393     'OMP_PROC_BIND' is either unset or 'false', threads may be moved
1394     between CPUs following no placement policy.
1395
1396_See also_:
1397     *note OMP_PROC_BIND::, *note GOMP_CPU_AFFINITY::, *note
1398     omp_get_proc_bind::, *note OMP_DISPLAY_ENV::
1399
1400_Reference_:
1401     OpenMP specification v4.5 (https://www.openmp.org), Section 4.5
1402
1403
1404File: libgomp.info,  Node: OMP_STACKSIZE,  Next: OMP_SCHEDULE,  Prev: OMP_PLACES,  Up: Environment Variables
1405
14063.11 'OMP_STACKSIZE' - Set default thread stack size
1407====================================================
1408
1409_Description_:
1410     Set the default thread stack size in kilobytes, unless the number
1411     is suffixed by 'B', 'K', 'M' or 'G', in which case the size is,
1412     respectively, in bytes, kilobytes, megabytes or gigabytes.  This is
1413     different from 'pthread_attr_setstacksize' which gets the number of
1414     bytes as an argument.  If the stack size cannot be set due to
1415     system constraints, an error is reported and the initial stack size
1416     is left unchanged.  If undefined, the stack size is system
1417     dependent.
1418
1419_Reference_:
1420     OpenMP specification v4.5 (https://www.openmp.org), Section 4.7
1421
1422
1423File: libgomp.info,  Node: OMP_SCHEDULE,  Next: OMP_THREAD_LIMIT,  Prev: OMP_STACKSIZE,  Up: Environment Variables
1424
14253.12 'OMP_SCHEDULE' - How threads are scheduled
1426===============================================
1427
1428_Description_:
1429     Allows to specify 'schedule type' and 'chunk size'.  The value of
1430     the variable shall have the form: 'type[,chunk]' where 'type' is
1431     one of 'static', 'dynamic', 'guided' or 'auto' The optional 'chunk'
1432     size shall be a positive integer.  If undefined, dynamic scheduling
1433     and a chunk size of 1 is used.
1434
1435_See also_:
1436     *note omp_set_schedule::
1437
1438_Reference_:
1439     OpenMP specification v4.5 (https://www.openmp.org), Sections
1440     2.7.1.1 and 4.1
1441
1442
1443File: libgomp.info,  Node: OMP_THREAD_LIMIT,  Next: OMP_WAIT_POLICY,  Prev: OMP_SCHEDULE,  Up: Environment Variables
1444
14453.13 'OMP_THREAD_LIMIT' - Set the maximum number of threads
1446===========================================================
1447
1448_Description_:
1449     Specifies the number of threads to use for the whole program.  The
1450     value of this variable shall be a positive integer.  If undefined,
1451     the number of threads is not limited.
1452
1453_See also_:
1454     *note OMP_NUM_THREADS::, *note omp_get_thread_limit::
1455
1456_Reference_:
1457     OpenMP specification v4.5 (https://www.openmp.org), Section 4.10
1458
1459
1460File: libgomp.info,  Node: OMP_WAIT_POLICY,  Next: GOMP_CPU_AFFINITY,  Prev: OMP_THREAD_LIMIT,  Up: Environment Variables
1461
14623.14 'OMP_WAIT_POLICY' - How waiting threads are handled
1463========================================================
1464
1465_Description_:
1466     Specifies whether waiting threads should be active or passive.  If
1467     the value is 'PASSIVE', waiting threads should not consume CPU
1468     power while waiting; while the value is 'ACTIVE' specifies that
1469     they should.  If undefined, threads wait actively for a short time
1470     before waiting passively.
1471
1472_See also_:
1473     *note GOMP_SPINCOUNT::
1474
1475_Reference_:
1476     OpenMP specification v4.5 (https://www.openmp.org), Section 4.8
1477
1478
1479File: libgomp.info,  Node: GOMP_CPU_AFFINITY,  Next: GOMP_DEBUG,  Prev: OMP_WAIT_POLICY,  Up: Environment Variables
1480
14813.15 'GOMP_CPU_AFFINITY' - Bind threads to specific CPUs
1482========================================================
1483
1484_Description_:
1485     Binds threads to specific CPUs.  The variable should contain a
1486     space-separated or comma-separated list of CPUs.  This list may
1487     contain different kinds of entries: either single CPU numbers in
1488     any order, a range of CPUs (M-N) or a range with some stride
1489     (M-N:S). CPU numbers are zero based.  For example,
1490     'GOMP_CPU_AFFINITY="0 3 1-2 4-15:2"' will bind the initial thread
1491     to CPU 0, the second to CPU 3, the third to CPU 1, the fourth to
1492     CPU 2, the fifth to CPU 4, the sixth through tenth to CPUs 6, 8,
1493     10, 12, and 14 respectively and then start assigning back from the
1494     beginning of the list.  'GOMP_CPU_AFFINITY=0' binds all threads to
1495     CPU 0.
1496
1497     There is no libgomp library routine to determine whether a CPU
1498     affinity specification is in effect.  As a workaround,
1499     language-specific library functions, e.g., 'getenv' in C or
1500     'GET_ENVIRONMENT_VARIABLE' in Fortran, may be used to query the
1501     setting of the 'GOMP_CPU_AFFINITY' environment variable.  A defined
1502     CPU affinity on startup cannot be changed or disabled during the
1503     runtime of the application.
1504
1505     If both 'GOMP_CPU_AFFINITY' and 'OMP_PROC_BIND' are set,
1506     'OMP_PROC_BIND' has a higher precedence.  If neither has been set
1507     and 'OMP_PROC_BIND' is unset, or when 'OMP_PROC_BIND' is set to
1508     'FALSE', the host system will handle the assignment of threads to
1509     CPUs.
1510
1511_See also_:
1512     *note OMP_PLACES::, *note OMP_PROC_BIND::
1513
1514
1515File: libgomp.info,  Node: GOMP_DEBUG,  Next: GOMP_STACKSIZE,  Prev: GOMP_CPU_AFFINITY,  Up: Environment Variables
1516
15173.16 'GOMP_DEBUG' - Enable debugging output
1518===========================================
1519
1520_Description_:
1521     Enable debugging output.  The variable should be set to '0'
1522     (disabled, also the default if not set), or '1' (enabled).
1523
1524     If enabled, some debugging output will be printed during execution.
1525     This is currently not specified in more detail, and subject to
1526     change.
1527
1528
1529File: libgomp.info,  Node: GOMP_STACKSIZE,  Next: GOMP_SPINCOUNT,  Prev: GOMP_DEBUG,  Up: Environment Variables
1530
15313.17 'GOMP_STACKSIZE' - Set default thread stack size
1532=====================================================
1533
1534_Description_:
1535     Set the default thread stack size in kilobytes.  This is different
1536     from 'pthread_attr_setstacksize' which gets the number of bytes as
1537     an argument.  If the stack size cannot be set due to system
1538     constraints, an error is reported and the initial stack size is
1539     left unchanged.  If undefined, the stack size is system dependent.
1540
1541_See also_:
1542     *note OMP_STACKSIZE::
1543
1544_Reference_:
1545     GCC Patches Mailinglist
1546     (http://gcc.gnu.org/ml/gcc-patches/2006-06/msg00493.html), GCC
1547     Patches Mailinglist
1548     (http://gcc.gnu.org/ml/gcc-patches/2006-06/msg00496.html)
1549
1550
1551File: libgomp.info,  Node: GOMP_SPINCOUNT,  Next: GOMP_RTEMS_THREAD_POOLS,  Prev: GOMP_STACKSIZE,  Up: Environment Variables
1552
15533.18 'GOMP_SPINCOUNT' - Set the busy-wait spin count
1554====================================================
1555
1556_Description_:
1557     Determines how long a threads waits actively with consuming CPU
1558     power before waiting passively without consuming CPU power.  The
1559     value may be either 'INFINITE', 'INFINITY' to always wait actively
1560     or an integer which gives the number of spins of the busy-wait
1561     loop.  The integer may optionally be followed by the following
1562     suffixes acting as multiplication factors: 'k' (kilo, thousand),
1563     'M' (mega, million), 'G' (giga, billion), or 'T' (tera, trillion).
1564     If undefined, 0 is used when 'OMP_WAIT_POLICY' is 'PASSIVE',
1565     300,000 is used when 'OMP_WAIT_POLICY' is undefined and 30 billion
1566     is used when 'OMP_WAIT_POLICY' is 'ACTIVE'.  If there are more
1567     OpenMP threads than available CPUs, 1000 and 100 spins are used for
1568     'OMP_WAIT_POLICY' being 'ACTIVE' or undefined, respectively; unless
1569     the 'GOMP_SPINCOUNT' is lower or 'OMP_WAIT_POLICY' is 'PASSIVE'.
1570
1571_See also_:
1572     *note OMP_WAIT_POLICY::
1573
1574
1575File: libgomp.info,  Node: GOMP_RTEMS_THREAD_POOLS,  Prev: GOMP_SPINCOUNT,  Up: Environment Variables
1576
15773.19 'GOMP_RTEMS_THREAD_POOLS' - Set the RTEMS specific thread pools
1578====================================================================
1579
1580_Description_:
1581     This environment variable is only used on the RTEMS real-time
1582     operating system.  It determines the scheduler instance specific
1583     thread pools.  The format for 'GOMP_RTEMS_THREAD_POOLS' is a list
1584     of optional '<thread-pool-count>[$<priority>]@<scheduler-name>'
1585     configurations separated by ':' where:
1586        * '<thread-pool-count>' is the thread pool count for this
1587          scheduler instance.
1588        * '$<priority>' is an optional priority for the worker threads
1589          of a thread pool according to 'pthread_setschedparam'.  In
1590          case a priority value is omitted, then a worker thread will
1591          inherit the priority of the OpenMP master thread that created
1592          it.  The priority of the worker thread is not changed after
1593          creation, even if a new OpenMP master thread using the worker
1594          has a different priority.
1595        * '@<scheduler-name>' is the scheduler instance name according
1596          to the RTEMS application configuration.
1597     In case no thread pool configuration is specified for a scheduler
1598     instance, then each OpenMP master thread of this scheduler instance
1599     will use its own dynamically allocated thread pool.  To limit the
1600     worker thread count of the thread pools, each OpenMP master thread
1601     must call 'omp_set_num_threads'.
1602_Example_:
1603     Lets suppose we have three scheduler instances 'IO', 'WRK0', and
1604     'WRK1' with 'GOMP_RTEMS_THREAD_POOLS' set to '"1@WRK0:3$4@WRK1"'.
1605     Then there are no thread pool restrictions for scheduler instance
1606     'IO'.  In the scheduler instance 'WRK0' there is one thread pool
1607     available.  Since no priority is specified for this scheduler
1608     instance, the worker thread inherits the priority of the OpenMP
1609     master thread that created it.  In the scheduler instance 'WRK1'
1610     there are three thread pools available and their worker threads run
1611     at priority four.
1612
1613
1614File: libgomp.info,  Node: Enabling OpenACC,  Next: OpenACC Runtime Library Routines,  Prev: Environment Variables,  Up: Top
1615
16164 Enabling OpenACC
1617******************
1618
1619To activate the OpenACC extensions for C/C++ and Fortran, the
1620compile-time flag '-fopenacc' must be specified.  This enables the
1621OpenACC directive '#pragma acc' in C/C++ and '!$accp' directives in free
1622form, 'c$acc', '*$acc' and '!$acc' directives in fixed form, '!$'
1623conditional compilation sentinels in free form and 'c$', '*$' and '!$'
1624sentinels in fixed form, for Fortran.  The flag also arranges for
1625automatic linking of the OpenACC runtime library (*note OpenACC Runtime
1626Library Routines::).
1627
1628   A complete description of all OpenACC directives accepted may be
1629found in the OpenACC (https://www.openacc.org) Application Programming
1630Interface manual, version 2.0.
1631
1632   Note that this is an experimental feature and subject to change in
1633future versions of GCC. See <https://gcc.gnu.org/wiki/OpenACC> for more
1634information.
1635
1636
1637File: libgomp.info,  Node: OpenACC Runtime Library Routines,  Next: OpenACC Environment Variables,  Prev: Enabling OpenACC,  Up: Top
1638
16395 OpenACC Runtime Library Routines
1640**********************************
1641
1642The runtime routines described here are defined by section 3 of the
1643OpenACC specifications in version 2.0.  They have C linkage, and do not
1644throw exceptions.  Generally, they are available only for the host, with
1645the exception of 'acc_on_device', which is available for both the host
1646and the acceleration device.
1647
1648* Menu:
1649
1650* acc_get_num_devices::         Get number of devices for the given device
1651                                type.
1652* acc_set_device_type::         Set type of device accelerator to use.
1653* acc_get_device_type::         Get type of device accelerator to be used.
1654* acc_set_device_num::          Set device number to use.
1655* acc_get_device_num::          Get device number to be used.
1656* acc_async_test::              Tests for completion of a specific asynchronous
1657                                operation.
1658* acc_async_test_all::          Tests for completion of all asychronous
1659                                operations.
1660* acc_wait::                    Wait for completion of a specific asynchronous
1661                                operation.
1662* acc_wait_all::                Waits for completion of all asyncrhonous
1663                                operations.
1664* acc_wait_all_async::          Wait for completion of all asynchronous
1665                                operations.
1666* acc_wait_async::              Wait for completion of asynchronous operations.
1667* acc_init::                    Initialize runtime for a specific device type.
1668* acc_shutdown::                Shuts down the runtime for a specific device
1669                                type.
1670* acc_on_device::               Whether executing on a particular device
1671* acc_malloc::                  Allocate device memory.
1672* acc_free::                    Free device memory.
1673* acc_copyin::                  Allocate device memory and copy host memory to
1674                                it.
1675* acc_present_or_copyin::       If the data is not present on the device,
1676                                allocate device memory and copy from host
1677                                memory.
1678* acc_create::                  Allocate device memory and map it to host
1679                                memory.
1680* acc_present_or_create::       If the data is not present on the device,
1681                                allocate device memory and map it to host
1682                                memory.
1683* acc_copyout::                 Copy device memory to host memory.
1684* acc_delete::                  Free device memory.
1685* acc_update_device::           Update device memory from mapped host memory.
1686* acc_update_self::             Update host memory from mapped device memory.
1687* acc_map_data::                Map previously allocated device memory to host
1688                                memory.
1689* acc_unmap_data::              Unmap device memory from host memory.
1690* acc_deviceptr::               Get device pointer associated with specific
1691                                host address.
1692* acc_hostptr::                 Get host pointer associated with specific
1693                                device address.
1694* acc_is_present::              Indiciate whether host variable / array is
1695                                present on device.
1696* acc_memcpy_to_device::        Copy host memory to device memory.
1697* acc_memcpy_from_device::      Copy device memory to host memory.
1698
1699API routines for target platforms.
1700
1701* acc_get_current_cuda_device:: Get CUDA device handle.
1702* acc_get_current_cuda_context::Get CUDA context handle.
1703* acc_get_cuda_stream::         Get CUDA stream handle.
1704* acc_set_cuda_stream::         Set CUDA stream handle.
1705
1706
1707File: libgomp.info,  Node: acc_get_num_devices,  Next: acc_set_device_type,  Up: OpenACC Runtime Library Routines
1708
17095.1 'acc_get_num_devices' - Get number of devices for given device type
1710=======================================================================
1711
1712_Description_
1713     This function returns a value indicating the number of devices
1714     available for the device type specified in DEVICETYPE.
1715
1716_C/C++_:
1717     _Prototype_:   'int acc_get_num_devices(acc_device_t devicetype);'
1718
1719_Fortran_:
1720     _Interface_:   'integer function acc_get_num_devices(devicetype)'
1721                    'integer(kind=acc_device_kind) devicetype'
1722
1723_Reference_:
1724     OpenACC specification v2.0 (https://www.openacc.org), section
1725     3.2.1.
1726
1727
1728File: libgomp.info,  Node: acc_set_device_type,  Next: acc_get_device_type,  Prev: acc_get_num_devices,  Up: OpenACC Runtime Library Routines
1729
17305.2 'acc_set_device_type' - Set type of device accelerator to use.
1731==================================================================
1732
1733_Description_
1734     This function indicates to the runtime library which device typr,
1735     specified in DEVICETYPE, to use when executing a parallel or
1736     kernels region.
1737
1738_C/C++_:
1739     _Prototype_:   'acc_set_device_type(acc_device_t devicetype);'
1740
1741_Fortran_:
1742     _Interface_:   'subroutine acc_set_device_type(devicetype)'
1743                    'integer(kind=acc_device_kind) devicetype'
1744
1745_Reference_:
1746     OpenACC specification v2.0 (https://www.openacc.org), section
1747     3.2.2.
1748
1749
1750File: libgomp.info,  Node: acc_get_device_type,  Next: acc_set_device_num,  Prev: acc_set_device_type,  Up: OpenACC Runtime Library Routines
1751
17525.3 'acc_get_device_type' - Get type of device accelerator to be used.
1753======================================================================
1754
1755_Description_
1756     This function returns what device type will be used when executing
1757     a parallel or kernels region.
1758
1759_C/C++_:
1760     _Prototype_:   'acc_device_t acc_get_device_type(void);'
1761
1762_Fortran_:
1763     _Interface_:   'function acc_get_device_type(void)'
1764                    'integer(kind=acc_device_kind) acc_get_device_type'
1765
1766_Reference_:
1767     OpenACC specification v2.0 (https://www.openacc.org), section
1768     3.2.3.
1769
1770
1771File: libgomp.info,  Node: acc_set_device_num,  Next: acc_get_device_num,  Prev: acc_get_device_type,  Up: OpenACC Runtime Library Routines
1772
17735.4 'acc_set_device_num' - Set device number to use.
1774====================================================
1775
1776_Description_
1777     This function will indicate to the runtime which device number,
1778     specified by NUM, associated with the specifed device type
1779     DEVICETYPE.
1780
1781_C/C++_:
1782     _Prototype_:   'acc_set_device_num(int num, acc_device_t devicetype);'
1783
1784_Fortran_:
1785     _Interface_:   'subroutine acc_set_device_num(devicenum, devicetype)'
1786                    'integer devicenum'
1787                    'integer(kind=acc_device_kind) devicetype'
1788
1789_Reference_:
1790     OpenACC specification v2.0 (https://www.openacc.org), section
1791     3.2.4.
1792
1793
1794File: libgomp.info,  Node: acc_get_device_num,  Next: acc_async_test,  Prev: acc_set_device_num,  Up: OpenACC Runtime Library Routines
1795
17965.5 'acc_get_device_num' - Get device number to be used.
1797========================================================
1798
1799_Description_
1800     This function returns which device number associated with the
1801     specified device type DEVICETYPE, will be used when executing a
1802     parallel or kernels region.
1803
1804_C/C++_:
1805     _Prototype_:   'int acc_get_device_num(acc_device_t devicetype);'
1806
1807_Fortran_:
1808     _Interface_:   'function acc_get_device_num(devicetype)'
1809                    'integer(kind=acc_device_kind) devicetype'
1810                    'integer acc_get_device_num'
1811
1812_Reference_:
1813     OpenACC specification v2.0 (https://www.openacc.org), section
1814     3.2.5.
1815
1816
1817File: libgomp.info,  Node: acc_async_test,  Next: acc_async_test_all,  Prev: acc_get_device_num,  Up: OpenACC Runtime Library Routines
1818
18195.6 'acc_async_test' - Test for completion of a specific asynchronous operation.
1820================================================================================
1821
1822_Description_
1823     This function tests for completion of the asynchrounous operation
1824     specified in ARG.  In C/C++, a non-zero value will be returned to
1825     indicate the specified asynchronous operation has completed.  While
1826     Fortran will return a 'true'.  If the asynchrounous operation has
1827     not completed, C/C++ returns a zero and Fortran returns a 'false'.
1828
1829_C/C++_:
1830     _Prototype_:   'int acc_async_test(int arg);'
1831
1832_Fortran_:
1833     _Interface_:   'function acc_async_test(arg)'
1834                    'integer(kind=acc_handle_kind) arg'
1835                    'logical acc_async_test'
1836
1837_Reference_:
1838     OpenACC specification v2.0 (https://www.openacc.org), section
1839     3.2.6.
1840
1841
1842File: libgomp.info,  Node: acc_async_test_all,  Next: acc_wait,  Prev: acc_async_test,  Up: OpenACC Runtime Library Routines
1843
18445.7 'acc_async_test_all' - Tests for completion of all asynchronous operations.
1845===============================================================================
1846
1847_Description_
1848     This function tests for completion of all asynchrounous operations.
1849     In C/C++, a non-zero value will be returned to indicate all
1850     asynchronous operations have completed.  While Fortran will return
1851     a 'true'.  If any asynchronous operation has not completed, C/C++
1852     returns a zero and Fortran returns a 'false'.
1853
1854_C/C++_:
1855     _Prototype_:   'int acc_async_test_all(void);'
1856
1857_Fortran_:
1858     _Interface_:   'function acc_async_test()'
1859                    'logical acc_get_device_num'
1860
1861_Reference_:
1862     OpenACC specification v2.0 (https://www.openacc.org), section
1863     3.2.7.
1864
1865
1866File: libgomp.info,  Node: acc_wait,  Next: acc_wait_all,  Prev: acc_async_test_all,  Up: OpenACC Runtime Library Routines
1867
18685.8 'acc_wait' - Wait for completion of a specific asynchronous operation.
1869==========================================================================
1870
1871_Description_
1872     This function waits for completion of the asynchronous operation
1873     specified in ARG.
1874
1875_C/C++_:
1876     _Prototype_:   'acc_wait(arg);'
1877     _Prototype     'acc_async_wait(arg);'
1878     (OpenACC 1.0
1879     compatibility)_:
1880
1881_Fortran_:
1882     _Interface_:   'subroutine acc_wait(arg)'
1883                    'integer(acc_handle_kind) arg'
1884     _Interface     'subroutine acc_async_wait(arg)'
1885     (OpenACC 1.0
1886     compatibility)_:
1887                    'integer(acc_handle_kind) arg'
1888
1889_Reference_:
1890     OpenACC specification v2.0 (https://www.openacc.org), section
1891     3.2.8.
1892
1893
1894File: libgomp.info,  Node: acc_wait_all,  Next: acc_wait_all_async,  Prev: acc_wait,  Up: OpenACC Runtime Library Routines
1895
18965.9 'acc_wait_all' - Waits for completion of all asynchronous operations.
1897=========================================================================
1898
1899_Description_
1900     This function waits for the completion of all asynchronous
1901     operations.
1902
1903_C/C++_:
1904     _Prototype_:   'acc_wait_all(void);'
1905     _Prototype     'acc_async_wait_all(void);'
1906     (OpenACC 1.0
1907     compatibility)_:
1908
1909_Fortran_:
1910     _Interface_:   'subroutine acc_wait_all()'
1911     _Interface     'subroutine acc_async_wait_all()'
1912     (OpenACC 1.0
1913     compatibility)_:
1914
1915_Reference_:
1916     OpenACC specification v2.0 (https://www.openacc.org), section
1917     3.2.10.
1918
1919
1920File: libgomp.info,  Node: acc_wait_all_async,  Next: acc_wait_async,  Prev: acc_wait_all,  Up: OpenACC Runtime Library Routines
1921
19225.10 'acc_wait_all_async' - Wait for completion of all asynchronous operations.
1923===============================================================================
1924
1925_Description_
1926     This function enqueues a wait operation on the queue ASYNC for any
1927     and all asynchronous operations that have been previously enqueued
1928     on any queue.
1929
1930_C/C++_:
1931     _Prototype_:   'acc_wait_all_async(int async);'
1932
1933_Fortran_:
1934     _Interface_:   'subroutine acc_wait_all_async(async)'
1935                    'integer(acc_handle_kind) async'
1936
1937_Reference_:
1938     OpenACC specification v2.0 (https://www.openacc.org), section
1939     3.2.11.
1940
1941
1942File: libgomp.info,  Node: acc_wait_async,  Next: acc_init,  Prev: acc_wait_all_async,  Up: OpenACC Runtime Library Routines
1943
19445.11 'acc_wait_async' - Wait for completion of asynchronous operations.
1945=======================================================================
1946
1947_Description_
1948     This function enqueues a wait operation on queue ASYNC for any and
1949     all asynchronous operations enqueued on queue ARG.
1950
1951_C/C++_:
1952     _Prototype_:   'acc_wait_async(int arg, int async);'
1953
1954_Fortran_:
1955     _Interface_:   'subroutine acc_wait_async(arg, async)'
1956                    'integer(acc_handle_kind) arg, async'
1957
1958_Reference_:
1959     OpenACC specification v2.0 (https://www.openacc.org), section
1960     3.2.9.
1961
1962
1963File: libgomp.info,  Node: acc_init,  Next: acc_shutdown,  Prev: acc_wait_async,  Up: OpenACC Runtime Library Routines
1964
19655.12 'acc_init' - Initialize runtime for a specific device type.
1966================================================================
1967
1968_Description_
1969     This function initializes the runtime for the device type specified
1970     in DEVICETYPE.
1971
1972_C/C++_:
1973     _Prototype_:   'acc_init(acc_device_t devicetype);'
1974
1975_Fortran_:
1976     _Interface_:   'subroutine acc_init(devicetype)'
1977                    'integer(acc_device_kind) devicetype'
1978
1979_Reference_:
1980     OpenACC specification v2.0 (https://www.openacc.org), section
1981     3.2.12.
1982
1983
1984File: libgomp.info,  Node: acc_shutdown,  Next: acc_on_device,  Prev: acc_init,  Up: OpenACC Runtime Library Routines
1985
19865.13 'acc_shutdown' - Shuts down the runtime for a specific device type.
1987========================================================================
1988
1989_Description_
1990     This function shuts down the runtime for the device type specified
1991     in DEVICETYPE.
1992
1993_C/C++_:
1994     _Prototype_:   'acc_shutdown(acc_device_t devicetype);'
1995
1996_Fortran_:
1997     _Interface_:   'subroutine acc_shutdown(devicetype)'
1998                    'integer(acc_device_kind) devicetype'
1999
2000_Reference_:
2001     OpenACC specification v2.0 (https://www.openacc.org), section
2002     3.2.13.
2003
2004
2005File: libgomp.info,  Node: acc_on_device,  Next: acc_malloc,  Prev: acc_shutdown,  Up: OpenACC Runtime Library Routines
2006
20075.14 'acc_on_device' - Whether executing on a particular device
2008===============================================================
2009
2010_Description_:
2011     This function returns whether the program is executing on a
2012     particular device specified in DEVICETYPE.  In C/C++ a non-zero
2013     value is returned to indicate the device is execiting on the
2014     specified device type.  In Fortran, 'true' will be returned.  If
2015     the program is not executing on the specified device type C/C++
2016     will return a zero, while Fortran will return 'false'.
2017
2018_C/C++_:
2019     _Prototype_:   'acc_on_device(acc_device_t devicetype);'
2020
2021_Fortran_:
2022     _Interface_:   'function acc_on_device(devicetype)'
2023                    'integer(acc_device_kind) devicetype'
2024                    'logical acc_on_device'
2025
2026_Reference_:
2027     OpenACC specification v2.0 (https://www.openacc.org), section
2028     3.2.14.
2029
2030
2031File: libgomp.info,  Node: acc_malloc,  Next: acc_free,  Prev: acc_on_device,  Up: OpenACC Runtime Library Routines
2032
20335.15 'acc_malloc' - Allocate device memory.
2034===========================================
2035
2036_Description_
2037     This function allocates LEN bytes of device memory.  It returns the
2038     device address of the allocated memory.
2039
2040_C/C++_:
2041     _Prototype_:   'd_void* acc_malloc(size_t len);'
2042
2043_Reference_:
2044     OpenACC specification v2.0 (https://www.openacc.org), section
2045     3.2.15.
2046
2047
2048File: libgomp.info,  Node: acc_free,  Next: acc_copyin,  Prev: acc_malloc,  Up: OpenACC Runtime Library Routines
2049
20505.16 'acc_free' - Free device memory.
2051=====================================
2052
2053_Description_
2054     Free previously allocated device memory at the device address 'a'.
2055
2056_C/C++_:
2057     _Prototype_:   'acc_free(d_void *a);'
2058
2059_Reference_:
2060     OpenACC specification v2.0 (https://www.openacc.org), section
2061     3.2.16.
2062
2063
2064File: libgomp.info,  Node: acc_copyin,  Next: acc_present_or_copyin,  Prev: acc_free,  Up: OpenACC Runtime Library Routines
2065
20665.17 'acc_copyin' - Allocate device memory and copy host memory to it.
2067======================================================================
2068
2069_Description_
2070     In C/C++, this function allocates LEN bytes of device memory and
2071     maps it to the specified host address in A.  The device address of
2072     the newly allocated device memory is returned.
2073
2074     In Fortran, two (2) forms are supported.  In the first form, A
2075     specifies a contiguous array section.  The second form A specifies
2076     a variable or array element and LEN specifies the length in bytes.
2077
2078_C/C++_:
2079     _Prototype_:   'void *acc_copyin(h_void *a, size_t len);'
2080
2081_Fortran_:
2082     _Interface_:   'subroutine acc_copyin(a)'
2083                    'type, dimension(:[,:]...) :: a'
2084     _Interface_:   'subroutine acc_copyin(a, len)'
2085                    'type, dimension(:[,:]...) :: a'
2086                    'integer len'
2087
2088_Reference_:
2089     OpenACC specification v2.0 (https://www.openacc.org), section
2090     3.2.17.
2091
2092
2093File: libgomp.info,  Node: acc_present_or_copyin,  Next: acc_create,  Prev: acc_copyin,  Up: OpenACC Runtime Library Routines
2094
20955.18 'acc_present_or_copyin' - If the data is not present on the device, allocate device memory and copy from host memory.
2096==========================================================================================================================
2097
2098_Description_
2099     This function tests if the host data specifed by A and of length
2100     LEN is present or not.  If it is not present, then device memory
2101     will be allocated and the host memory copied.  The device address
2102     of the newly allocated device memory is returned.
2103
2104     In Fortran, two (2) forms are supported.  In the first form, A
2105     specifies a contiguous array section.  The second form A specifies
2106     a variable or array element and LEN specifies the length in bytes.
2107
2108_C/C++_:
2109     _Prototype_:   'void *acc_present_or_copyin(h_void *a, size_t len);'
2110     _Prototype_:   'void *acc_pcopyin(h_void *a, size_t len);'
2111
2112_Fortran_:
2113     _Interface_:   'subroutine acc_present_or_copyin(a)'
2114                    'type, dimension(:[,:]...) :: a'
2115     _Interface_:   'subroutine acc_present_or_copyin(a, len)'
2116                    'type, dimension(:[,:]...) :: a'
2117                    'integer len'
2118     _Interface_:   'subroutine acc_pcopyin(a)'
2119                    'type, dimension(:[,:]...) :: a'
2120     _Interface_:   'subroutine acc_pcopyin(a, len)'
2121                    'type, dimension(:[,:]...) :: a'
2122                    'integer len'
2123
2124_Reference_:
2125     OpenACC specification v2.0 (https://www.openacc.org), section
2126     3.2.18.
2127
2128
2129File: libgomp.info,  Node: acc_create,  Next: acc_present_or_create,  Prev: acc_present_or_copyin,  Up: OpenACC Runtime Library Routines
2130
21315.19 'acc_create' - Allocate device memory and map it to host memory.
2132=====================================================================
2133
2134_Description_
2135     This function allocates device memory and maps it to host memory
2136     specified by the host address A with a length of LEN bytes.  In
2137     C/C++, the function returns the device address of the allocated
2138     device memory.
2139
2140     In Fortran, two (2) forms are supported.  In the first form, A
2141     specifies a contiguous array section.  The second form A specifies
2142     a variable or array element and LEN specifies the length in bytes.
2143
2144_C/C++_:
2145     _Prototype_:   'void *acc_create(h_void *a, size_t len);'
2146
2147_Fortran_:
2148     _Interface_:   'subroutine acc_create(a)'
2149                    'type, dimension(:[,:]...) :: a'
2150     _Interface_:   'subroutine acc_create(a, len)'
2151                    'type, dimension(:[,:]...) :: a'
2152                    'integer len'
2153
2154_Reference_:
2155     OpenACC specification v2.0 (https://www.openacc.org), section
2156     3.2.19.
2157
2158
2159File: libgomp.info,  Node: acc_present_or_create,  Next: acc_copyout,  Prev: acc_create,  Up: OpenACC Runtime Library Routines
2160
21615.20 'acc_present_or_create' - If the data is not present on the device, allocate device memory and map it to host memory.
2162==========================================================================================================================
2163
2164_Description_
2165     This function tests if the host data specifed by A and of length
2166     LEN is present or not.  If it is not present, then device memory
2167     will be allocated and mapped to host memory.  In C/C++, the device
2168     address of the newly allocated device memory is returned.
2169
2170     In Fortran, two (2) forms are supported.  In the first form, A
2171     specifies a contiguous array section.  The second form A specifies
2172     a variable or array element and LEN specifies the length in bytes.
2173
2174_C/C++_:
2175     _Prototype_:   'void *acc_present_or_create(h_void *a, size_t len)'
2176     _Prototype_:   'void *acc_pcreate(h_void *a, size_t len)'
2177
2178_Fortran_:
2179     _Interface_:   'subroutine acc_present_or_create(a)'
2180                    'type, dimension(:[,:]...) :: a'
2181     _Interface_:   'subroutine acc_present_or_create(a, len)'
2182                    'type, dimension(:[,:]...) :: a'
2183                    'integer len'
2184     _Interface_:   'subroutine acc_pcreate(a)'
2185                    'type, dimension(:[,:]...) :: a'
2186     _Interface_:   'subroutine acc_pcreate(a, len)'
2187                    'type, dimension(:[,:]...) :: a'
2188                    'integer len'
2189
2190_Reference_:
2191     OpenACC specification v2.0 (https://www.openacc.org), section
2192     3.2.20.
2193
2194
2195File: libgomp.info,  Node: acc_copyout,  Next: acc_delete,  Prev: acc_present_or_create,  Up: OpenACC Runtime Library Routines
2196
21975.21 'acc_copyout' - Copy device memory to host memory.
2198=======================================================
2199
2200_Description_
2201     This function copies mapped device memory to host memory which is
2202     specified by host address A for a length LEN bytes in C/C++.
2203
2204     In Fortran, two (2) forms are supported.  In the first form, A
2205     specifies a contiguous array section.  The second form A specifies
2206     a variable or array element and LEN specifies the length in bytes.
2207
2208_C/C++_:
2209     _Prototype_:   'acc_copyout(h_void *a, size_t len);'
2210
2211_Fortran_:
2212     _Interface_:   'subroutine acc_copyout(a)'
2213                    'type, dimension(:[,:]...) :: a'
2214     _Interface_:   'subroutine acc_copyout(a, len)'
2215                    'type, dimension(:[,:]...) :: a'
2216                    'integer len'
2217
2218_Reference_:
2219     OpenACC specification v2.0 (https://www.openacc.org), section
2220     3.2.21.
2221
2222
2223File: libgomp.info,  Node: acc_delete,  Next: acc_update_device,  Prev: acc_copyout,  Up: OpenACC Runtime Library Routines
2224
22255.22 'acc_delete' - Free device memory.
2226=======================================
2227
2228_Description_
2229     This function frees previously allocated device memory specified by
2230     the device address A and the length of LEN bytes.
2231
2232     In Fortran, two (2) forms are supported.  In the first form, A
2233     specifies a contiguous array section.  The second form A specifies
2234     a variable or array element and LEN specifies the length in bytes.
2235
2236_C/C++_:
2237     _Prototype_:   'acc_delete(h_void *a, size_t len);'
2238
2239_Fortran_:
2240     _Interface_:   'subroutine acc_delete(a)'
2241                    'type, dimension(:[,:]...) :: a'
2242     _Interface_:   'subroutine acc_delete(a, len)'
2243                    'type, dimension(:[,:]...) :: a'
2244                    'integer len'
2245
2246_Reference_:
2247     OpenACC specification v2.0 (https://www.openacc.org), section
2248     3.2.22.
2249
2250
2251File: libgomp.info,  Node: acc_update_device,  Next: acc_update_self,  Prev: acc_delete,  Up: OpenACC Runtime Library Routines
2252
22535.23 'acc_update_device' - Update device memory from mapped host memory.
2254========================================================================
2255
2256_Description_
2257     This function updates the device copy from the previously mapped
2258     host memory.  The host memory is specified with the host address A
2259     and a length of LEN bytes.
2260
2261     In Fortran, two (2) forms are supported.  In the first form, A
2262     specifies a contiguous array section.  The second form A specifies
2263     a variable or array element and LEN specifies the length in bytes.
2264
2265_C/C++_:
2266     _Prototype_:   'acc_update_device(h_void *a, size_t len);'
2267
2268_Fortran_:
2269     _Interface_:   'subroutine acc_update_device(a)'
2270                    'type, dimension(:[,:]...) :: a'
2271     _Interface_:   'subroutine acc_update_device(a, len)'
2272                    'type, dimension(:[,:]...) :: a'
2273                    'integer len'
2274
2275_Reference_:
2276     OpenACC specification v2.0 (https://www.openacc.org), section
2277     3.2.23.
2278
2279
2280File: libgomp.info,  Node: acc_update_self,  Next: acc_map_data,  Prev: acc_update_device,  Up: OpenACC Runtime Library Routines
2281
22825.24 'acc_update_self' - Update host memory from mapped device memory.
2283======================================================================
2284
2285_Description_
2286     This function updates the host copy from the previously mapped
2287     device memory.  The host memory is specified with the host address
2288     A and a length of LEN bytes.
2289
2290     In Fortran, two (2) forms are supported.  In the first form, A
2291     specifies a contiguous array section.  The second form A specifies
2292     a variable or array element and LEN specifies the length in bytes.
2293
2294_C/C++_:
2295     _Prototype_:   'acc_update_self(h_void *a, size_t len);'
2296
2297_Fortran_:
2298     _Interface_:   'subroutine acc_update_self(a)'
2299                    'type, dimension(:[,:]...) :: a'
2300     _Interface_:   'subroutine acc_update_self(a, len)'
2301                    'type, dimension(:[,:]...) :: a'
2302                    'integer len'
2303
2304_Reference_:
2305     OpenACC specification v2.0 (https://www.openacc.org), section
2306     3.2.24.
2307
2308
2309File: libgomp.info,  Node: acc_map_data,  Next: acc_unmap_data,  Prev: acc_update_self,  Up: OpenACC Runtime Library Routines
2310
23115.25 'acc_map_data' - Map previously allocated device memory to host memory.
2312============================================================================
2313
2314_Description_
2315     This function maps previously allocated device and host memory.
2316     The device memory is specified with the device address D.  The host
2317     memory is specified with the host address H and a length of LEN.
2318
2319_C/C++_:
2320     _Prototype_:   'acc_map_data(h_void *h, d_void *d, size_t len);'
2321
2322_Reference_:
2323     OpenACC specification v2.0 (https://www.openacc.org), section
2324     3.2.25.
2325
2326
2327File: libgomp.info,  Node: acc_unmap_data,  Next: acc_deviceptr,  Prev: acc_map_data,  Up: OpenACC Runtime Library Routines
2328
23295.26 'acc_unmap_data' - Unmap device memory from host memory.
2330=============================================================
2331
2332_Description_
2333     This function unmaps previously mapped device and host memory.  The
2334     latter specified by H.
2335
2336_C/C++_:
2337     _Prototype_:   'acc_unmap_data(h_void *h);'
2338
2339_Reference_:
2340     OpenACC specification v2.0 (https://www.openacc.org), section
2341     3.2.26.
2342
2343
2344File: libgomp.info,  Node: acc_deviceptr,  Next: acc_hostptr,  Prev: acc_unmap_data,  Up: OpenACC Runtime Library Routines
2345
23465.27 'acc_deviceptr' - Get device pointer associated with specific host address.
2347================================================================================
2348
2349_Description_
2350     This function returns the device address that has been mapped to
2351     the host address specified by H.
2352
2353_C/C++_:
2354     _Prototype_:   'void *acc_deviceptr(h_void *h);'
2355
2356_Reference_:
2357     OpenACC specification v2.0 (https://www.openacc.org), section
2358     3.2.27.
2359
2360
2361File: libgomp.info,  Node: acc_hostptr,  Next: acc_is_present,  Prev: acc_deviceptr,  Up: OpenACC Runtime Library Routines
2362
23635.28 'acc_hostptr' - Get host pointer associated with specific device address.
2364==============================================================================
2365
2366_Description_
2367     This function returns the host address that has been mapped to the
2368     device address specified by D.
2369
2370_C/C++_:
2371     _Prototype_:   'void *acc_hostptr(d_void *d);'
2372
2373_Reference_:
2374     OpenACC specification v2.0 (https://www.openacc.org), section
2375     3.2.28.
2376
2377
2378File: libgomp.info,  Node: acc_is_present,  Next: acc_memcpy_to_device,  Prev: acc_hostptr,  Up: OpenACC Runtime Library Routines
2379
23805.29 'acc_is_present' - Indicate whether host variable / array is present on device.
2381====================================================================================
2382
2383_Description_
2384     This function indicates whether the specified host address in A and
2385     a length of LEN bytes is present on the device.  In C/C++, a
2386     non-zero value is returned to indicate the presence of the mapped
2387     memory on the device.  A zero is returned to indicate the memory is
2388     not mapped on the device.
2389
2390     In Fortran, two (2) forms are supported.  In the first form, A
2391     specifies a contiguous array section.  The second form A specifies
2392     a variable or array element and LEN specifies the length in bytes.
2393     If the host memory is mapped to device memory, then a 'true' is
2394     returned.  Otherwise, a 'false' is return to indicate the mapped
2395     memory is not present.
2396
2397_C/C++_:
2398     _Prototype_:   'int acc_is_present(h_void *a, size_t len);'
2399
2400_Fortran_:
2401     _Interface_:   'function acc_is_present(a)'
2402                    'type, dimension(:[,:]...) :: a'
2403                    'logical acc_is_present'
2404     _Interface_:   'function acc_is_present(a, len)'
2405                    'type, dimension(:[,:]...) :: a'
2406                    'integer len'
2407                    'logical acc_is_present'
2408
2409_Reference_:
2410     OpenACC specification v2.0 (https://www.openacc.org), section
2411     3.2.29.
2412
2413
2414File: libgomp.info,  Node: acc_memcpy_to_device,  Next: acc_memcpy_from_device,  Prev: acc_is_present,  Up: OpenACC Runtime Library Routines
2415
24165.30 'acc_memcpy_to_device' - Copy host memory to device memory.
2417================================================================
2418
2419_Description_
2420     This function copies host memory specified by host address of SRC
2421     to device memory specified by the device address DEST for a length
2422     of BYTES bytes.
2423
2424_C/C++_:
2425     _Prototype_:   'acc_memcpy_to_device(d_void *dest, h_void *src, size_t
2426                    bytes);'
2427
2428_Reference_:
2429     OpenACC specification v2.0 (https://www.openacc.org), section
2430     3.2.30.
2431
2432
2433File: libgomp.info,  Node: acc_memcpy_from_device,  Next: acc_get_current_cuda_device,  Prev: acc_memcpy_to_device,  Up: OpenACC Runtime Library Routines
2434
24355.31 'acc_memcpy_from_device' - Copy device memory to host memory.
2436==================================================================
2437
2438_Description_
2439     This function copies host memory specified by host address of SRC
2440     from device memory specified by the device address DEST for a
2441     length of BYTES bytes.
2442
2443_C/C++_:
2444     _Prototype_:   'acc_memcpy_from_device(d_void *dest, h_void *src,
2445                    size_t bytes);'
2446
2447_Reference_:
2448     OpenACC specification v2.0 (https://www.openacc.org), section
2449     3.2.31.
2450
2451
2452File: libgomp.info,  Node: acc_get_current_cuda_device,  Next: acc_get_current_cuda_context,  Prev: acc_memcpy_from_device,  Up: OpenACC Runtime Library Routines
2453
24545.32 'acc_get_current_cuda_device' - Get CUDA device handle.
2455============================================================
2456
2457_Description_
2458     This function returns the CUDA device handle.  This handle is the
2459     same as used by the CUDA Runtime or Driver API's.
2460
2461_C/C++_:
2462     _Prototype_:   'void *acc_get_current_cuda_device(void);'
2463
2464_Reference_:
2465     OpenACC specification v2.0 (https://www.openacc.org), section
2466     A.2.1.1.
2467
2468
2469File: libgomp.info,  Node: acc_get_current_cuda_context,  Next: acc_get_cuda_stream,  Prev: acc_get_current_cuda_device,  Up: OpenACC Runtime Library Routines
2470
24715.33 'acc_get_current_cuda_context' - Get CUDA context handle.
2472==============================================================
2473
2474_Description_
2475     This function returns the CUDA context handle.  This handle is the
2476     same as used by the CUDA Runtime or Driver API's.
2477
2478_C/C++_:
2479     _Prototype_:   'void *acc_get_current_cuda_context(void);'
2480
2481_Reference_:
2482     OpenACC specification v2.0 (https://www.openacc.org), section
2483     A.2.1.2.
2484
2485
2486File: libgomp.info,  Node: acc_get_cuda_stream,  Next: acc_set_cuda_stream,  Prev: acc_get_current_cuda_context,  Up: OpenACC Runtime Library Routines
2487
24885.34 'acc_get_cuda_stream' - Get CUDA stream handle.
2489====================================================
2490
2491_Description_
2492     This function returns the CUDA stream handle for the queue ASYNC.
2493     This handle is the same as used by the CUDA Runtime or Driver
2494     API's.
2495
2496_C/C++_:
2497     _Prototype_:   'void *acc_get_cuda_stream(int async);'
2498
2499_Reference_:
2500     OpenACC specification v2.0 (https://www.openacc.org), section
2501     A.2.1.3.
2502
2503
2504File: libgomp.info,  Node: acc_set_cuda_stream,  Prev: acc_get_cuda_stream,  Up: OpenACC Runtime Library Routines
2505
25065.35 'acc_set_cuda_stream' - Set CUDA stream handle.
2507====================================================
2508
2509_Description_
2510     This function associates the stream handle specified by STREAM with
2511     the queue ASYNC.
2512
2513     This cannot be used to change the stream handle associated with
2514     'acc_async_sync'.
2515
2516     The return value is not specified.
2517
2518_C/C++_:
2519     _Prototype_:   'int acc_set_cuda_stream(int async, void *stream);'
2520
2521_Reference_:
2522     OpenACC specification v2.0 (https://www.openacc.org), section
2523     A.2.1.4.
2524
2525
2526File: libgomp.info,  Node: OpenACC Environment Variables,  Next: CUDA Streams Usage,  Prev: OpenACC Runtime Library Routines,  Up: Top
2527
25286 OpenACC Environment Variables
2529*******************************
2530
2531The variables 'ACC_DEVICE_TYPE' and 'ACC_DEVICE_NUM' are defined by
2532section 4 of the OpenACC specification in version 2.0.  The variable
2533'GCC_ACC_NOTIFY' is used for diagnostic purposes.
2534
2535* Menu:
2536
2537* ACC_DEVICE_TYPE::
2538* ACC_DEVICE_NUM::
2539* GCC_ACC_NOTIFY::
2540
2541
2542File: libgomp.info,  Node: ACC_DEVICE_TYPE,  Next: ACC_DEVICE_NUM,  Up: OpenACC Environment Variables
2543
25446.1 'ACC_DEVICE_TYPE'
2545=====================
2546
2547_Reference_:
2548     OpenACC specification v2.0 (https://www.openacc.org), section 4.1.
2549
2550
2551File: libgomp.info,  Node: ACC_DEVICE_NUM,  Next: GCC_ACC_NOTIFY,  Prev: ACC_DEVICE_TYPE,  Up: OpenACC Environment Variables
2552
25536.2 'ACC_DEVICE_NUM'
2554====================
2555
2556_Reference_:
2557     OpenACC specification v2.0 (https://www.openacc.org), section 4.2.
2558
2559
2560File: libgomp.info,  Node: GCC_ACC_NOTIFY,  Prev: ACC_DEVICE_NUM,  Up: OpenACC Environment Variables
2561
25626.3 'GCC_ACC_NOTIFY'
2563====================
2564
2565_Description_:
2566     Print debug information pertaining to the accelerator.
2567
2568
2569File: libgomp.info,  Node: CUDA Streams Usage,  Next: OpenACC Library Interoperability,  Prev: OpenACC Environment Variables,  Up: Top
2570
25717 CUDA Streams Usage
2572********************
2573
2574This applies to the 'nvptx' plugin only.
2575
2576   The library provides elements that perform asynchronous movement of
2577data and asynchronous operation of computing constructs.  This
2578asynchronous functionality is implemented by making use of CUDA
2579streams(1).
2580
2581   The primary means by that the asychronous functionality is accessed
2582is through the use of those OpenACC directives which make use of the
2583'async' and 'wait' clauses.  When the 'async' clause is first used with
2584a directive, it creates a CUDA stream.  If an 'async-argument' is used
2585with the 'async' clause, then the stream is associated with the
2586specified 'async-argument'.
2587
2588   Following the creation of an association between a CUDA stream and
2589the 'async-argument' of an 'async' clause, both the 'wait' clause and
2590the 'wait' directive can be used.  When either the clause or directive
2591is used after stream creation, it creates a rendezvous point whereby
2592execution waits until all operations associated with the
2593'async-argument', that is, stream, have completed.
2594
2595   Normally, the management of the streams that are created as a result
2596of using the 'async' clause, is done without any intervention by the
2597caller.  This implies the association between the 'async-argument' and
2598the CUDA stream will be maintained for the lifetime of the program.
2599However, this association can be changed through the use of the library
2600function 'acc_set_cuda_stream'.  When the function 'acc_set_cuda_stream'
2601is called, the CUDA stream that was originally associated with the
2602'async' clause will be destroyed.  Caution should be taken when changing
2603the association as subsequent references to the 'async-argument' refer
2604to a different CUDA stream.
2605
2606   ---------- Footnotes ----------
2607
2608   (1) See "Stream Management" in "CUDA Driver API", TRM-06703-001,
2609Version 5.5, for additional information
2610
2611
2612File: libgomp.info,  Node: OpenACC Library Interoperability,  Next: The libgomp ABI,  Prev: CUDA Streams Usage,  Up: Top
2613
26148 OpenACC Library Interoperability
2615**********************************
2616
26178.1 Introduction
2618================
2619
2620The OpenACC library uses the CUDA Driver API, and may interact with
2621programs that use the Runtime library directly, or another library based
2622on the Runtime library, e.g., CUBLAS(1). This chapter describes the use
2623cases and what changes are required in order to use both the OpenACC
2624library and the CUBLAS and Runtime libraries within a program.
2625
26268.2 First invocation: NVIDIA CUBLAS library API
2627===============================================
2628
2629In this first use case (see below), a function in the CUBLAS library is
2630called prior to any of the functions in the OpenACC library.  More
2631specifically, the function 'cublasCreate()'.
2632
2633   When invoked, the function initializes the library and allocates the
2634hardware resources on the host and the device on behalf of the caller.
2635Once the initialization and allocation has completed, a handle is
2636returned to the caller.  The OpenACC library also requires
2637initialization and allocation of hardware resources.  Since the CUBLAS
2638library has already allocated the hardware resources for the device, all
2639that is left to do is to initialize the OpenACC library and acquire the
2640hardware resources on the host.
2641
2642   Prior to calling the OpenACC function that initializes the library
2643and allocate the host hardware resources, you need to acquire the device
2644number that was allocated during the call to 'cublasCreate()'.  The
2645invoking of the runtime library function 'cudaGetDevice()' accomplishes
2646this.  Once acquired, the device number is passed along with the device
2647type as parameters to the OpenACC library function
2648'acc_set_device_num()'.
2649
2650   Once the call to 'acc_set_device_num()' has completed, the OpenACC
2651library uses the context that was created during the call to
2652'cublasCreate()'.  In other words, both libraries will be sharing the
2653same context.
2654
2655         /* Create the handle */
2656         s = cublasCreate(&h);
2657         if (s != CUBLAS_STATUS_SUCCESS)
2658         {
2659             fprintf(stderr, "cublasCreate failed %d\n", s);
2660             exit(EXIT_FAILURE);
2661         }
2662
2663         /* Get the device number */
2664         e = cudaGetDevice(&dev);
2665         if (e != cudaSuccess)
2666         {
2667             fprintf(stderr, "cudaGetDevice failed %d\n", e);
2668             exit(EXIT_FAILURE);
2669         }
2670
2671         /* Initialize OpenACC library and use device 'dev' */
2672         acc_set_device_num(dev, acc_device_nvidia);
2673
2674                              Use Case 1
2675
26768.3 First invocation: OpenACC library API
2677=========================================
2678
2679In this second use case (see below), a function in the OpenACC library
2680is called prior to any of the functions in the CUBLAS library.  More
2681specificially, the function 'acc_set_device_num()'.
2682
2683   In the use case presented here, the function 'acc_set_device_num()'
2684is used to both initialize the OpenACC library and allocate the hardware
2685resources on the host and the device.  In the call to the function, the
2686call parameters specify which device to use and what device type to use,
2687i.e., 'acc_device_nvidia'.  It should be noted that this is but one
2688method to initialize the OpenACC library and allocate the appropriate
2689hardware resources.  Other methods are available through the use of
2690environment variables and these will be discussed in the next section.
2691
2692   Once the call to 'acc_set_device_num()' has completed, other OpenACC
2693functions can be called as seen with multiple calls being made to
2694'acc_copyin()'.  In addition, calls can be made to functions in the
2695CUBLAS library.  In the use case a call to 'cublasCreate()' is made
2696subsequent to the calls to 'acc_copyin()'.  As seen in the previous use
2697case, a call to 'cublasCreate()' initializes the CUBLAS library and
2698allocates the hardware resources on the host and the device.  However,
2699since the device has already been allocated, 'cublasCreate()' will only
2700initialize the CUBLAS library and allocate the appropriate hardware
2701resources on the host.  The context that was created as part of the
2702OpenACC initialization is shared with the CUBLAS library, similarly to
2703the first use case.
2704
2705         dev = 0;
2706
2707         acc_set_device_num(dev, acc_device_nvidia);
2708
2709         /* Copy the first set to the device */
2710         d_X = acc_copyin(&h_X[0], N * sizeof (float));
2711         if (d_X == NULL)
2712         {
2713             fprintf(stderr, "copyin error h_X\n");
2714             exit(EXIT_FAILURE);
2715         }
2716
2717         /* Copy the second set to the device */
2718         d_Y = acc_copyin(&h_Y1[0], N * sizeof (float));
2719         if (d_Y == NULL)
2720         {
2721             fprintf(stderr, "copyin error h_Y1\n");
2722             exit(EXIT_FAILURE);
2723         }
2724
2725         /* Create the handle */
2726         s = cublasCreate(&h);
2727         if (s != CUBLAS_STATUS_SUCCESS)
2728         {
2729             fprintf(stderr, "cublasCreate failed %d\n", s);
2730             exit(EXIT_FAILURE);
2731         }
2732
2733         /* Perform saxpy using CUBLAS library function */
2734         s = cublasSaxpy(h, N, &alpha, d_X, 1, d_Y, 1);
2735         if (s != CUBLAS_STATUS_SUCCESS)
2736         {
2737             fprintf(stderr, "cublasSaxpy failed %d\n", s);
2738             exit(EXIT_FAILURE);
2739         }
2740
2741         /* Copy the results from the device */
2742         acc_memcpy_from_device(&h_Y1[0], d_Y, N * sizeof (float));
2743
2744                              Use Case 2
2745
27468.4 OpenACC library and environment variables
2747=============================================
2748
2749There are two environment variables associated with the OpenACC library
2750that may be used to control the device type and device number:
2751'ACC_DEVICE_TYPE' and 'ACC_DEVICE_NUM', respecively.  These two
2752environement variables can be used as an alternative to calling
2753'acc_set_device_num()'.  As seen in the second use case, the device type
2754and device number were specified using 'acc_set_device_num()'.  If
2755however, the aforementioned environment variables were set, then the
2756call to 'acc_set_device_num()' would not be required.
2757
2758   The use of the environment variables is only relevant when an OpenACC
2759function is called prior to a call to 'cudaCreate()'.  If 'cudaCreate()'
2760is called prior to a call to an OpenACC function, then you must call
2761'acc_set_device_num()'(2)
2762
2763   ---------- Footnotes ----------
2764
2765   (1) See section 2.26, "Interactions with the CUDA Driver API" in
2766"CUDA Runtime API", Version 5.5, and section 2.27, "VDPAU
2767Interoperability", in "CUDA Driver API", TRM-06703-001, Version 5.5, for
2768additional information on library interoperability.
2769
2770   (2) More complete information about 'ACC_DEVICE_TYPE' and
2771'ACC_DEVICE_NUM' can be found in sections 4.1 and 4.2 of the OpenACC
2772(https://www.openacc.org) Application Programming Interface���, Version
27732.0.
2774
2775
2776File: libgomp.info,  Node: The libgomp ABI,  Next: Reporting Bugs,  Prev: OpenACC Library Interoperability,  Up: Top
2777
27789 The libgomp ABI
2779*****************
2780
2781The following sections present notes on the external ABI as presented by
2782libgomp.  Only maintainers should need them.
2783
2784* Menu:
2785
2786* Implementing MASTER construct::
2787* Implementing CRITICAL construct::
2788* Implementing ATOMIC construct::
2789* Implementing FLUSH construct::
2790* Implementing BARRIER construct::
2791* Implementing THREADPRIVATE construct::
2792* Implementing PRIVATE clause::
2793* Implementing FIRSTPRIVATE LASTPRIVATE COPYIN and COPYPRIVATE clauses::
2794* Implementing REDUCTION clause::
2795* Implementing PARALLEL construct::
2796* Implementing FOR construct::
2797* Implementing ORDERED construct::
2798* Implementing SECTIONS construct::
2799* Implementing SINGLE construct::
2800* Implementing OpenACC's PARALLEL construct::
2801
2802
2803File: libgomp.info,  Node: Implementing MASTER construct,  Next: Implementing CRITICAL construct,  Up: The libgomp ABI
2804
28059.1 Implementing MASTER construct
2806=================================
2807
2808     if (omp_get_thread_num () == 0)
2809       block
2810
2811   Alternately, we generate two copies of the parallel subfunction and
2812only include this in the version run by the master thread.  Surely this
2813is not worthwhile though...
2814
2815
2816File: libgomp.info,  Node: Implementing CRITICAL construct,  Next: Implementing ATOMIC construct,  Prev: Implementing MASTER construct,  Up: The libgomp ABI
2817
28189.2 Implementing CRITICAL construct
2819===================================
2820
2821Without a specified name,
2822
2823       void GOMP_critical_start (void);
2824       void GOMP_critical_end (void);
2825
2826   so that we don't get COPY relocations from libgomp to the main
2827application.
2828
2829   With a specified name, use omp_set_lock and omp_unset_lock with name
2830being transformed into a variable declared like
2831
2832       omp_lock_t gomp_critical_user_<name> __attribute__((common))
2833
2834   Ideally the ABI would specify that all zero is a valid unlocked
2835state, and so we wouldn't need to initialize this at startup.
2836
2837
2838File: libgomp.info,  Node: Implementing ATOMIC construct,  Next: Implementing FLUSH construct,  Prev: Implementing CRITICAL construct,  Up: The libgomp ABI
2839
28409.3 Implementing ATOMIC construct
2841=================================
2842
2843The target should implement the '__sync' builtins.
2844
2845   Failing that we could add
2846
2847       void GOMP_atomic_enter (void)
2848       void GOMP_atomic_exit (void)
2849
2850   which reuses the regular lock code, but with yet another lock object
2851private to the library.
2852
2853
2854File: libgomp.info,  Node: Implementing FLUSH construct,  Next: Implementing BARRIER construct,  Prev: Implementing ATOMIC construct,  Up: The libgomp ABI
2855
28569.4 Implementing FLUSH construct
2857================================
2858
2859Expands to the '__sync_synchronize' builtin.
2860
2861
2862File: libgomp.info,  Node: Implementing BARRIER construct,  Next: Implementing THREADPRIVATE construct,  Prev: Implementing FLUSH construct,  Up: The libgomp ABI
2863
28649.5 Implementing BARRIER construct
2865==================================
2866
2867       void GOMP_barrier (void)
2868
2869
2870File: libgomp.info,  Node: Implementing THREADPRIVATE construct,  Next: Implementing PRIVATE clause,  Prev: Implementing BARRIER construct,  Up: The libgomp ABI
2871
28729.6 Implementing THREADPRIVATE construct
2873========================================
2874
2875In _most_ cases we can map this directly to '__thread'.  Except that OMP
2876allows constructors for C++ objects.  We can either refuse to support
2877this (how often is it used?)  or we can implement something akin to
2878.ctors.
2879
2880   Even more ideally, this ctor feature is handled by extensions to the
2881main pthreads library.  Failing that, we can have a set of entry points
2882to register ctor functions to be called.
2883
2884
2885File: libgomp.info,  Node: Implementing PRIVATE clause,  Next: Implementing FIRSTPRIVATE LASTPRIVATE COPYIN and COPYPRIVATE clauses,  Prev: Implementing THREADPRIVATE construct,  Up: The libgomp ABI
2886
28879.7 Implementing PRIVATE clause
2888===============================
2889
2890In association with a PARALLEL, or within the lexical extent of a
2891PARALLEL block, the variable becomes a local variable in the parallel
2892subfunction.
2893
2894   In association with FOR or SECTIONS blocks, create a new automatic
2895variable within the current function.  This preserves the semantic of
2896new variable creation.
2897
2898
2899File: libgomp.info,  Node: Implementing FIRSTPRIVATE LASTPRIVATE COPYIN and COPYPRIVATE clauses,  Next: Implementing REDUCTION clause,  Prev: Implementing PRIVATE clause,  Up: The libgomp ABI
2900
29019.8 Implementing FIRSTPRIVATE LASTPRIVATE COPYIN and COPYPRIVATE clauses
2902========================================================================
2903
2904This seems simple enough for PARALLEL blocks.  Create a private struct
2905for communicating between the parent and subfunction.  In the parent,
2906copy in values for scalar and "small" structs; copy in addresses for
2907others TREE_ADDRESSABLE types.  In the subfunction, copy the value into
2908the local variable.
2909
2910   It is not clear what to do with bare FOR or SECTION blocks.  The only
2911thing I can figure is that we do something like:
2912
2913     #pragma omp for firstprivate(x) lastprivate(y)
2914     for (int i = 0; i < n; ++i)
2915       body;
2916
2917   which becomes
2918
2919     {
2920       int x = x, y;
2921
2922       // for stuff
2923
2924       if (i == n)
2925         y = y;
2926     }
2927
2928   where the "x=x" and "y=y" assignments actually have different uids
2929for the two variables, i.e.  not something you could write directly in
2930C. Presumably this only makes sense if the "outer" x and y are global
2931variables.
2932
2933   COPYPRIVATE would work the same way, except the structure broadcast
2934would have to happen via SINGLE machinery instead.
2935
2936
2937File: libgomp.info,  Node: Implementing REDUCTION clause,  Next: Implementing PARALLEL construct,  Prev: Implementing FIRSTPRIVATE LASTPRIVATE COPYIN and COPYPRIVATE clauses,  Up: The libgomp ABI
2938
29399.9 Implementing REDUCTION clause
2940=================================
2941
2942The private struct mentioned in the previous section should have a
2943pointer to an array of the type of the variable, indexed by the thread's
2944TEAM_ID.  The thread stores its final value into the array, and after
2945the barrier, the master thread iterates over the array to collect the
2946values.
2947
2948
2949File: libgomp.info,  Node: Implementing PARALLEL construct,  Next: Implementing FOR construct,  Prev: Implementing REDUCTION clause,  Up: The libgomp ABI
2950
29519.10 Implementing PARALLEL construct
2952====================================
2953
2954       #pragma omp parallel
2955       {
2956         body;
2957       }
2958
2959   becomes
2960
2961       void subfunction (void *data)
2962       {
2963         use data;
2964         body;
2965       }
2966
2967       setup data;
2968       GOMP_parallel_start (subfunction, &data, num_threads);
2969       subfunction (&data);
2970       GOMP_parallel_end ();
2971
2972       void GOMP_parallel_start (void (*fn)(void *), void *data, unsigned num_threads)
2973
2974   The FN argument is the subfunction to be run in parallel.
2975
2976   The DATA argument is a pointer to a structure used to communicate
2977data in and out of the subfunction, as discussed above with respect to
2978FIRSTPRIVATE et al.
2979
2980   The NUM_THREADS argument is 1 if an IF clause is present and false,
2981or the value of the NUM_THREADS clause, if present, or 0.
2982
2983   The function needs to create the appropriate number of threads and/or
2984launch them from the dock.  It needs to create the team structure and
2985assign team ids.
2986
2987       void GOMP_parallel_end (void)
2988
2989   Tears down the team and returns us to the previous
2990'omp_in_parallel()' state.
2991
2992
2993File: libgomp.info,  Node: Implementing FOR construct,  Next: Implementing ORDERED construct,  Prev: Implementing PARALLEL construct,  Up: The libgomp ABI
2994
29959.11 Implementing FOR construct
2996===============================
2997
2998       #pragma omp parallel for
2999       for (i = lb; i <= ub; i++)
3000         body;
3001
3002   becomes
3003
3004       void subfunction (void *data)
3005       {
3006         long _s0, _e0;
3007         while (GOMP_loop_static_next (&_s0, &_e0))
3008         {
3009           long _e1 = _e0, i;
3010           for (i = _s0; i < _e1; i++)
3011             body;
3012         }
3013         GOMP_loop_end_nowait ();
3014       }
3015
3016       GOMP_parallel_loop_static (subfunction, NULL, 0, lb, ub+1, 1, 0);
3017       subfunction (NULL);
3018       GOMP_parallel_end ();
3019
3020       #pragma omp for schedule(runtime)
3021       for (i = 0; i < n; i++)
3022         body;
3023
3024   becomes
3025
3026       {
3027         long i, _s0, _e0;
3028         if (GOMP_loop_runtime_start (0, n, 1, &_s0, &_e0))
3029           do {
3030             long _e1 = _e0;
3031             for (i = _s0, i < _e0; i++)
3032               body;
3033           } while (GOMP_loop_runtime_next (&_s0, _&e0));
3034         GOMP_loop_end ();
3035       }
3036
3037   Note that while it looks like there is trickiness to propagating a
3038non-constant STEP, there isn't really.  We're explicitly allowed to
3039evaluate it as many times as we want, and any variables involved should
3040automatically be handled as PRIVATE or SHARED like any other variables.
3041So the expression should remain evaluable in the subfunction.  We can
3042also pull it into a local variable if we like, but since its supposed to
3043remain unchanged, we can also not if we like.
3044
3045   If we have SCHEDULE(STATIC), and no ORDERED, then we ought to be able
3046to get away with no work-sharing context at all, since we can simply
3047perform the arithmetic directly in each thread to divide up the
3048iterations.  Which would mean that we wouldn't need to call any of these
3049routines.
3050
3051   There are separate routines for handling loops with an ORDERED
3052clause.  Bookkeeping for that is non-trivial...
3053
3054
3055File: libgomp.info,  Node: Implementing ORDERED construct,  Next: Implementing SECTIONS construct,  Prev: Implementing FOR construct,  Up: The libgomp ABI
3056
30579.12 Implementing ORDERED construct
3058===================================
3059
3060       void GOMP_ordered_start (void)
3061       void GOMP_ordered_end (void)
3062
3063
3064File: libgomp.info,  Node: Implementing SECTIONS construct,  Next: Implementing SINGLE construct,  Prev: Implementing ORDERED construct,  Up: The libgomp ABI
3065
30669.13 Implementing SECTIONS construct
3067====================================
3068
3069A block as
3070
3071       #pragma omp sections
3072       {
3073         #pragma omp section
3074         stmt1;
3075         #pragma omp section
3076         stmt2;
3077         #pragma omp section
3078         stmt3;
3079       }
3080
3081   becomes
3082
3083       for (i = GOMP_sections_start (3); i != 0; i = GOMP_sections_next ())
3084         switch (i)
3085           {
3086           case 1:
3087             stmt1;
3088             break;
3089           case 2:
3090             stmt2;
3091             break;
3092           case 3:
3093             stmt3;
3094             break;
3095           }
3096       GOMP_barrier ();
3097
3098
3099File: libgomp.info,  Node: Implementing SINGLE construct,  Next: Implementing OpenACC's PARALLEL construct,  Prev: Implementing SECTIONS construct,  Up: The libgomp ABI
3100
31019.14 Implementing SINGLE construct
3102==================================
3103
3104A block like
3105
3106       #pragma omp single
3107       {
3108         body;
3109       }
3110
3111   becomes
3112
3113       if (GOMP_single_start ())
3114         body;
3115       GOMP_barrier ();
3116
3117   while
3118
3119       #pragma omp single copyprivate(x)
3120         body;
3121
3122   becomes
3123
3124       datap = GOMP_single_copy_start ();
3125       if (datap == NULL)
3126         {
3127           body;
3128           data.x = x;
3129           GOMP_single_copy_end (&data);
3130         }
3131       else
3132         x = datap->x;
3133       GOMP_barrier ();
3134
3135
3136File: libgomp.info,  Node: Implementing OpenACC's PARALLEL construct,  Prev: Implementing SINGLE construct,  Up: The libgomp ABI
3137
31389.15 Implementing OpenACC's PARALLEL construct
3139==============================================
3140
3141       void GOACC_parallel ()
3142
3143
3144File: libgomp.info,  Node: Reporting Bugs,  Next: Copying,  Prev: The libgomp ABI,  Up: Top
3145
314610 Reporting Bugs
3147*****************
3148
3149Bugs in the GNU Offloading and Multi Processing Runtime Library should
3150be reported via Bugzilla (http://gcc.gnu.org/bugzilla/).  Please add
3151"openacc", or "openmp", or both to the keywords field in the bug report,
3152as appropriate.
3153
3154
3155File: libgomp.info,  Node: Copying,  Next: GNU Free Documentation License,  Prev: Reporting Bugs,  Up: Top
3156
3157GNU General Public License
3158**************************
3159
3160                        Version 3, 29 June 2007
3161
3162     Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
3163
3164     Everyone is permitted to copy and distribute verbatim copies of this
3165     license document, but changing it is not allowed.
3166
3167Preamble
3168========
3169
3170The GNU General Public License is a free, copyleft license for software
3171and other kinds of works.
3172
3173   The licenses for most software and other practical works are designed
3174to take away your freedom to share and change the works.  By contrast,
3175the GNU General Public License is intended to guarantee your freedom to
3176share and change all versions of a program-to make sure it remains free
3177software for all its users.  We, the Free Software Foundation, use the
3178GNU General Public License for most of our software; it applies also to
3179any other work released this way by its authors.  You can apply it to
3180your programs, too.
3181
3182   When we speak of free software, we are referring to freedom, not
3183price.  Our General Public Licenses are designed to make sure that you
3184have the freedom to distribute copies of free software (and charge for
3185them if you wish), that you receive source code or can get it if you
3186want it, that you can change the software or use pieces of it in new
3187free programs, and that you know you can do these things.
3188
3189   To protect your rights, we need to prevent others from denying you
3190these rights or asking you to surrender the rights.  Therefore, you have
3191certain responsibilities if you distribute copies of the software, or if
3192you modify it: responsibilities to respect the freedom of others.
3193
3194   For example, if you distribute copies of such a program, whether
3195gratis or for a fee, you must pass on to the recipients the same
3196freedoms that you received.  You must make sure that they, too, receive
3197or can get the source code.  And you must show them these terms so they
3198know their rights.
3199
3200   Developers that use the GNU GPL protect your rights with two steps:
3201(1) assert copyright on the software, and (2) offer you this License
3202giving you legal permission to copy, distribute and/or modify it.
3203
3204   For the developers' and authors' protection, the GPL clearly explains
3205that there is no warranty for this free software.  For both users' and
3206authors' sake, the GPL requires that modified versions be marked as
3207changed, so that their problems will not be attributed erroneously to
3208authors of previous versions.
3209
3210   Some devices are designed to deny users access to install or run
3211modified versions of the software inside them, although the manufacturer
3212can do so.  This is fundamentally incompatible with the aim of
3213protecting users' freedom to change the software.  The systematic
3214pattern of such abuse occurs in the area of products for individuals to
3215use, which is precisely where it is most unacceptable.  Therefore, we
3216have designed this version of the GPL to prohibit the practice for those
3217products.  If such problems arise substantially in other domains, we
3218stand ready to extend this provision to those domains in future versions
3219of the GPL, as needed to protect the freedom of users.
3220
3221   Finally, every program is threatened constantly by software patents.
3222States should not allow patents to restrict development and use of
3223software on general-purpose computers, but in those that do, we wish to
3224avoid the special danger that patents applied to a free program could
3225make it effectively proprietary.  To prevent this, the GPL assures that
3226patents cannot be used to render the program non-free.
3227
3228   The precise terms and conditions for copying, distribution and
3229modification follow.
3230
3231TERMS AND CONDITIONS
3232====================
3233
3234  0. Definitions.
3235
3236     "This License" refers to version 3 of the GNU General Public
3237     License.
3238
3239     "Copyright" also means copyright-like laws that apply to other
3240     kinds of works, such as semiconductor masks.
3241
3242     "The Program" refers to any copyrightable work licensed under this
3243     License.  Each licensee is addressed as "you".  "Licensees" and
3244     "recipients" may be individuals or organizations.
3245
3246     To "modify" a work means to copy from or adapt all or part of the
3247     work in a fashion requiring copyright permission, other than the
3248     making of an exact copy.  The resulting work is called a "modified
3249     version" of the earlier work or a work "based on" the earlier work.
3250
3251     A "covered work" means either the unmodified Program or a work
3252     based on the Program.
3253
3254     To "propagate" a work means to do anything with it that, without
3255     permission, would make you directly or secondarily liable for
3256     infringement under applicable copyright law, except executing it on
3257     a computer or modifying a private copy.  Propagation includes
3258     copying, distribution (with or without modification), making
3259     available to the public, and in some countries other activities as
3260     well.
3261
3262     To "convey" a work means any kind of propagation that enables other
3263     parties to make or receive copies.  Mere interaction with a user
3264     through a computer network, with no transfer of a copy, is not
3265     conveying.
3266
3267     An interactive user interface displays "Appropriate Legal Notices"
3268     to the extent that it includes a convenient and prominently visible
3269     feature that (1) displays an appropriate copyright notice, and (2)
3270     tells the user that there is no warranty for the work (except to
3271     the extent that warranties are provided), that licensees may convey
3272     the work under this License, and how to view a copy of this
3273     License.  If the interface presents a list of user commands or
3274     options, such as a menu, a prominent item in the list meets this
3275     criterion.
3276
3277  1. Source Code.
3278
3279     The "source code" for a work means the preferred form of the work
3280     for making modifications to it.  "Object code" means any non-source
3281     form of a work.
3282
3283     A "Standard Interface" means an interface that either is an
3284     official standard defined by a recognized standards body, or, in
3285     the case of interfaces specified for a particular programming
3286     language, one that is widely used among developers working in that
3287     language.
3288
3289     The "System Libraries" of an executable work include anything,
3290     other than the work as a whole, that (a) is included in the normal
3291     form of packaging a Major Component, but which is not part of that
3292     Major Component, and (b) serves only to enable use of the work with
3293     that Major Component, or to implement a Standard Interface for
3294     which an implementation is available to the public in source code
3295     form.  A "Major Component", in this context, means a major
3296     essential component (kernel, window system, and so on) of the
3297     specific operating system (if any) on which the executable work
3298     runs, or a compiler used to produce the work, or an object code
3299     interpreter used to run it.
3300
3301     The "Corresponding Source" for a work in object code form means all
3302     the source code needed to generate, install, and (for an executable
3303     work) run the object code and to modify the work, including scripts
3304     to control those activities.  However, it does not include the
3305     work's System Libraries, or general-purpose tools or generally
3306     available free programs which are used unmodified in performing
3307     those activities but which are not part of the work.  For example,
3308     Corresponding Source includes interface definition files associated
3309     with source files for the work, and the source code for shared
3310     libraries and dynamically linked subprograms that the work is
3311     specifically designed to require, such as by intimate data
3312     communication or control flow between those subprograms and other
3313     parts of the work.
3314
3315     The Corresponding Source need not include anything that users can
3316     regenerate automatically from other parts of the Corresponding
3317     Source.
3318
3319     The Corresponding Source for a work in source code form is that
3320     same work.
3321
3322  2. Basic Permissions.
3323
3324     All rights granted under this License are granted for the term of
3325     copyright on the Program, and are irrevocable provided the stated
3326     conditions are met.  This License explicitly affirms your unlimited
3327     permission to run the unmodified Program.  The output from running
3328     a covered work is covered by this License only if the output, given
3329     its content, constitutes a covered work.  This License acknowledges
3330     your rights of fair use or other equivalent, as provided by
3331     copyright law.
3332
3333     You may make, run and propagate covered works that you do not
3334     convey, without conditions so long as your license otherwise
3335     remains in force.  You may convey covered works to others for the
3336     sole purpose of having them make modifications exclusively for you,
3337     or provide you with facilities for running those works, provided
3338     that you comply with the terms of this License in conveying all
3339     material for which you do not control copyright.  Those thus making
3340     or running the covered works for you must do so exclusively on your
3341     behalf, under your direction and control, on terms that prohibit
3342     them from making any copies of your copyrighted material outside
3343     their relationship with you.
3344
3345     Conveying under any other circumstances is permitted solely under
3346     the conditions stated below.  Sublicensing is not allowed; section
3347     10 makes it unnecessary.
3348
3349  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
3350
3351     No covered work shall be deemed part of an effective technological
3352     measure under any applicable law fulfilling obligations under
3353     article 11 of the WIPO copyright treaty adopted on 20 December
3354     1996, or similar laws prohibiting or restricting circumvention of
3355     such measures.
3356
3357     When you convey a covered work, you waive any legal power to forbid
3358     circumvention of technological measures to the extent such
3359     circumvention is effected by exercising rights under this License
3360     with respect to the covered work, and you disclaim any intention to
3361     limit operation or modification of the work as a means of
3362     enforcing, against the work's users, your or third parties' legal
3363     rights to forbid circumvention of technological measures.
3364
3365  4. Conveying Verbatim Copies.
3366
3367     You may convey verbatim copies of the Program's source code as you
3368     receive it, in any medium, provided that you conspicuously and
3369     appropriately publish on each copy an appropriate copyright notice;
3370     keep intact all notices stating that this License and any
3371     non-permissive terms added in accord with section 7 apply to the
3372     code; keep intact all notices of the absence of any warranty; and
3373     give all recipients a copy of this License along with the Program.
3374
3375     You may charge any price or no price for each copy that you convey,
3376     and you may offer support or warranty protection for a fee.
3377
3378  5. Conveying Modified Source Versions.
3379
3380     You may convey a work based on the Program, or the modifications to
3381     produce it from the Program, in the form of source code under the
3382     terms of section 4, provided that you also meet all of these
3383     conditions:
3384
3385       a. The work must carry prominent notices stating that you
3386          modified it, and giving a relevant date.
3387
3388       b. The work must carry prominent notices stating that it is
3389          released under this License and any conditions added under
3390          section 7.  This requirement modifies the requirement in
3391          section 4 to "keep intact all notices".
3392
3393       c. You must license the entire work, as a whole, under this
3394          License to anyone who comes into possession of a copy.  This
3395          License will therefore apply, along with any applicable
3396          section 7 additional terms, to the whole of the work, and all
3397          its parts, regardless of how they are packaged.  This License
3398          gives no permission to license the work in any other way, but
3399          it does not invalidate such permission if you have separately
3400          received it.
3401
3402       d. If the work has interactive user interfaces, each must display
3403          Appropriate Legal Notices; however, if the Program has
3404          interactive interfaces that do not display Appropriate Legal
3405          Notices, your work need not make them do so.
3406
3407     A compilation of a covered work with other separate and independent
3408     works, which are not by their nature extensions of the covered
3409     work, and which are not combined with it such as to form a larger
3410     program, in or on a volume of a storage or distribution medium, is
3411     called an "aggregate" if the compilation and its resulting
3412     copyright are not used to limit the access or legal rights of the
3413     compilation's users beyond what the individual works permit.
3414     Inclusion of a covered work in an aggregate does not cause this
3415     License to apply to the other parts of the aggregate.
3416
3417  6. Conveying Non-Source Forms.
3418
3419     You may convey a covered work in object code form under the terms
3420     of sections 4 and 5, provided that you also convey the
3421     machine-readable Corresponding Source under the terms of this
3422     License, in one of these ways:
3423
3424       a. Convey the object code in, or embodied in, a physical product
3425          (including a physical distribution medium), accompanied by the
3426          Corresponding Source fixed on a durable physical medium
3427          customarily used for software interchange.
3428
3429       b. Convey the object code in, or embodied in, a physical product
3430          (including a physical distribution medium), accompanied by a
3431          written offer, valid for at least three years and valid for as
3432          long as you offer spare parts or customer support for that
3433          product model, to give anyone who possesses the object code
3434          either (1) a copy of the Corresponding Source for all the
3435          software in the product that is covered by this License, on a
3436          durable physical medium customarily used for software
3437          interchange, for a price no more than your reasonable cost of
3438          physically performing this conveying of source, or (2) access
3439          to copy the Corresponding Source from a network server at no
3440          charge.
3441
3442       c. Convey individual copies of the object code with a copy of the
3443          written offer to provide the Corresponding Source.  This
3444          alternative is allowed only occasionally and noncommercially,
3445          and only if you received the object code with such an offer,
3446          in accord with subsection 6b.
3447
3448       d. Convey the object code by offering access from a designated
3449          place (gratis or for a charge), and offer equivalent access to
3450          the Corresponding Source in the same way through the same
3451          place at no further charge.  You need not require recipients
3452          to copy the Corresponding Source along with the object code.
3453          If the place to copy the object code is a network server, the
3454          Corresponding Source may be on a different server (operated by
3455          you or a third party) that supports equivalent copying
3456          facilities, provided you maintain clear directions next to the
3457          object code saying where to find the Corresponding Source.
3458          Regardless of what server hosts the Corresponding Source, you
3459          remain obligated to ensure that it is available for as long as
3460          needed to satisfy these requirements.
3461
3462       e. Convey the object code using peer-to-peer transmission,
3463          provided you inform other peers where the object code and
3464          Corresponding Source of the work are being offered to the
3465          general public at no charge under subsection 6d.
3466
3467     A separable portion of the object code, whose source code is
3468     excluded from the Corresponding Source as a System Library, need
3469     not be included in conveying the object code work.
3470
3471     A "User Product" is either (1) a "consumer product", which means
3472     any tangible personal property which is normally used for personal,
3473     family, or household purposes, or (2) anything designed or sold for
3474     incorporation into a dwelling.  In determining whether a product is
3475     a consumer product, doubtful cases shall be resolved in favor of
3476     coverage.  For a particular product received by a particular user,
3477     "normally used" refers to a typical or common use of that class of
3478     product, regardless of the status of the particular user or of the
3479     way in which the particular user actually uses, or expects or is
3480     expected to use, the product.  A product is a consumer product
3481     regardless of whether the product has substantial commercial,
3482     industrial or non-consumer uses, unless such uses represent the
3483     only significant mode of use of the product.
3484
3485     "Installation Information" for a User Product means any methods,
3486     procedures, authorization keys, or other information required to
3487     install and execute modified versions of a covered work in that
3488     User Product from a modified version of its Corresponding Source.
3489     The information must suffice to ensure that the continued
3490     functioning of the modified object code is in no case prevented or
3491     interfered with solely because modification has been made.
3492
3493     If you convey an object code work under this section in, or with,
3494     or specifically for use in, a User Product, and the conveying
3495     occurs as part of a transaction in which the right of possession
3496     and use of the User Product is transferred to the recipient in
3497     perpetuity or for a fixed term (regardless of how the transaction
3498     is characterized), the Corresponding Source conveyed under this
3499     section must be accompanied by the Installation Information.  But
3500     this requirement does not apply if neither you nor any third party
3501     retains the ability to install modified object code on the User
3502     Product (for example, the work has been installed in ROM).
3503
3504     The requirement to provide Installation Information does not
3505     include a requirement to continue to provide support service,
3506     warranty, or updates for a work that has been modified or installed
3507     by the recipient, or for the User Product in which it has been
3508     modified or installed.  Access to a network may be denied when the
3509     modification itself materially and adversely affects the operation
3510     of the network or violates the rules and protocols for
3511     communication across the network.
3512
3513     Corresponding Source conveyed, and Installation Information
3514     provided, in accord with this section must be in a format that is
3515     publicly documented (and with an implementation available to the
3516     public in source code form), and must require no special password
3517     or key for unpacking, reading or copying.
3518
3519  7. Additional Terms.
3520
3521     "Additional permissions" are terms that supplement the terms of
3522     this License by making exceptions from one or more of its
3523     conditions.  Additional permissions that are applicable to the
3524     entire Program shall be treated as though they were included in
3525     this License, to the extent that they are valid under applicable
3526     law.  If additional permissions apply only to part of the Program,
3527     that part may be used separately under those permissions, but the
3528     entire Program remains governed by this License without regard to
3529     the additional permissions.
3530
3531     When you convey a copy of a covered work, you may at your option
3532     remove any additional permissions from that copy, or from any part
3533     of it.  (Additional permissions may be written to require their own
3534     removal in certain cases when you modify the work.)  You may place
3535     additional permissions on material, added by you to a covered work,
3536     for which you have or can give appropriate copyright permission.
3537
3538     Notwithstanding any other provision of this License, for material
3539     you add to a covered work, you may (if authorized by the copyright
3540     holders of that material) supplement the terms of this License with
3541     terms:
3542
3543       a. Disclaiming warranty or limiting liability differently from
3544          the terms of sections 15 and 16 of this License; or
3545
3546       b. Requiring preservation of specified reasonable legal notices
3547          or author attributions in that material or in the Appropriate
3548          Legal Notices displayed by works containing it; or
3549
3550       c. Prohibiting misrepresentation of the origin of that material,
3551          or requiring that modified versions of such material be marked
3552          in reasonable ways as different from the original version; or
3553
3554       d. Limiting the use for publicity purposes of names of licensors
3555          or authors of the material; or
3556
3557       e. Declining to grant rights under trademark law for use of some
3558          trade names, trademarks, or service marks; or
3559
3560       f. Requiring indemnification of licensors and authors of that
3561          material by anyone who conveys the material (or modified
3562          versions of it) with contractual assumptions of liability to
3563          the recipient, for any liability that these contractual
3564          assumptions directly impose on those licensors and authors.
3565
3566     All other non-permissive additional terms are considered "further
3567     restrictions" within the meaning of section 10.  If the Program as
3568     you received it, or any part of it, contains a notice stating that
3569     it is governed by this License along with a term that is a further
3570     restriction, you may remove that term.  If a license document
3571     contains a further restriction but permits relicensing or conveying
3572     under this License, you may add to a covered work material governed
3573     by the terms of that license document, provided that the further
3574     restriction does not survive such relicensing or conveying.
3575
3576     If you add terms to a covered work in accord with this section, you
3577     must place, in the relevant source files, a statement of the
3578     additional terms that apply to those files, or a notice indicating
3579     where to find the applicable terms.
3580
3581     Additional terms, permissive or non-permissive, may be stated in
3582     the form of a separately written license, or stated as exceptions;
3583     the above requirements apply either way.
3584
3585  8. Termination.
3586
3587     You may not propagate or modify a covered work except as expressly
3588     provided under this License.  Any attempt otherwise to propagate or
3589     modify it is void, and will automatically terminate your rights
3590     under this License (including any patent licenses granted under the
3591     third paragraph of section 11).
3592
3593     However, if you cease all violation of this License, then your
3594     license from a particular copyright holder is reinstated (a)
3595     provisionally, unless and until the copyright holder explicitly and
3596     finally terminates your license, and (b) permanently, if the
3597     copyright holder fails to notify you of the violation by some
3598     reasonable means prior to 60 days after the cessation.
3599
3600     Moreover, your license from a particular copyright holder is
3601     reinstated permanently if the copyright holder notifies you of the
3602     violation by some reasonable means, this is the first time you have
3603     received notice of violation of this License (for any work) from
3604     that copyright holder, and you cure the violation prior to 30 days
3605     after your receipt of the notice.
3606
3607     Termination of your rights under this section does not terminate
3608     the licenses of parties who have received copies or rights from you
3609     under this License.  If your rights have been terminated and not
3610     permanently reinstated, you do not qualify to receive new licenses
3611     for the same material under section 10.
3612
3613  9. Acceptance Not Required for Having Copies.
3614
3615     You are not required to accept this License in order to receive or
3616     run a copy of the Program.  Ancillary propagation of a covered work
3617     occurring solely as a consequence of using peer-to-peer
3618     transmission to receive a copy likewise does not require
3619     acceptance.  However, nothing other than this License grants you
3620     permission to propagate or modify any covered work.  These actions
3621     infringe copyright if you do not accept this License.  Therefore,
3622     by modifying or propagating a covered work, you indicate your
3623     acceptance of this License to do so.
3624
3625  10. Automatic Licensing of Downstream Recipients.
3626
3627     Each time you convey a covered work, the recipient automatically
3628     receives a license from the original licensors, to run, modify and
3629     propagate that work, subject to this License.  You are not
3630     responsible for enforcing compliance by third parties with this
3631     License.
3632
3633     An "entity transaction" is a transaction transferring control of an
3634     organization, or substantially all assets of one, or subdividing an
3635     organization, or merging organizations.  If propagation of a
3636     covered work results from an entity transaction, each party to that
3637     transaction who receives a copy of the work also receives whatever
3638     licenses to the work the party's predecessor in interest had or
3639     could give under the previous paragraph, plus a right to possession
3640     of the Corresponding Source of the work from the predecessor in
3641     interest, if the predecessor has it or can get it with reasonable
3642     efforts.
3643
3644     You may not impose any further restrictions on the exercise of the
3645     rights granted or affirmed under this License.  For example, you
3646     may not impose a license fee, royalty, or other charge for exercise
3647     of rights granted under this License, and you may not initiate
3648     litigation (including a cross-claim or counterclaim in a lawsuit)
3649     alleging that any patent claim is infringed by making, using,
3650     selling, offering for sale, or importing the Program or any portion
3651     of it.
3652
3653  11. Patents.
3654
3655     A "contributor" is a copyright holder who authorizes use under this
3656     License of the Program or a work on which the Program is based.
3657     The work thus licensed is called the contributor's "contributor
3658     version".
3659
3660     A contributor's "essential patent claims" are all patent claims
3661     owned or controlled by the contributor, whether already acquired or
3662     hereafter acquired, that would be infringed by some manner,
3663     permitted by this License, of making, using, or selling its
3664     contributor version, but do not include claims that would be
3665     infringed only as a consequence of further modification of the
3666     contributor version.  For purposes of this definition, "control"
3667     includes the right to grant patent sublicenses in a manner
3668     consistent with the requirements of this License.
3669
3670     Each contributor grants you a non-exclusive, worldwide,
3671     royalty-free patent license under the contributor's essential
3672     patent claims, to make, use, sell, offer for sale, import and
3673     otherwise run, modify and propagate the contents of its contributor
3674     version.
3675
3676     In the following three paragraphs, a "patent license" is any
3677     express agreement or commitment, however denominated, not to
3678     enforce a patent (such as an express permission to practice a
3679     patent or covenant not to sue for patent infringement).  To "grant"
3680     such a patent license to a party means to make such an agreement or
3681     commitment not to enforce a patent against the party.
3682
3683     If you convey a covered work, knowingly relying on a patent
3684     license, and the Corresponding Source of the work is not available
3685     for anyone to copy, free of charge and under the terms of this
3686     License, through a publicly available network server or other
3687     readily accessible means, then you must either (1) cause the
3688     Corresponding Source to be so available, or (2) arrange to deprive
3689     yourself of the benefit of the patent license for this particular
3690     work, or (3) arrange, in a manner consistent with the requirements
3691     of this License, to extend the patent license to downstream
3692     recipients.  "Knowingly relying" means you have actual knowledge
3693     that, but for the patent license, your conveying the covered work
3694     in a country, or your recipient's use of the covered work in a
3695     country, would infringe one or more identifiable patents in that
3696     country that you have reason to believe are valid.
3697
3698     If, pursuant to or in connection with a single transaction or
3699     arrangement, you convey, or propagate by procuring conveyance of, a
3700     covered work, and grant a patent license to some of the parties
3701     receiving the covered work authorizing them to use, propagate,
3702     modify or convey a specific copy of the covered work, then the
3703     patent license you grant is automatically extended to all
3704     recipients of the covered work and works based on it.
3705
3706     A patent license is "discriminatory" if it does not include within
3707     the scope of its coverage, prohibits the exercise of, or is
3708     conditioned on the non-exercise of one or more of the rights that
3709     are specifically granted under this License.  You may not convey a
3710     covered work if you are a party to an arrangement with a third
3711     party that is in the business of distributing software, under which
3712     you make payment to the third party based on the extent of your
3713     activity of conveying the work, and under which the third party
3714     grants, to any of the parties who would receive the covered work
3715     from you, a discriminatory patent license (a) in connection with
3716     copies of the covered work conveyed by you (or copies made from
3717     those copies), or (b) primarily for and in connection with specific
3718     products or compilations that contain the covered work, unless you
3719     entered into that arrangement, or that patent license was granted,
3720     prior to 28 March 2007.
3721
3722     Nothing in this License shall be construed as excluding or limiting
3723     any implied license or other defenses to infringement that may
3724     otherwise be available to you under applicable patent law.
3725
3726  12. No Surrender of Others' Freedom.
3727
3728     If conditions are imposed on you (whether by court order, agreement
3729     or otherwise) that contradict the conditions of this License, they
3730     do not excuse you from the conditions of this License.  If you
3731     cannot convey a covered work so as to satisfy simultaneously your
3732     obligations under this License and any other pertinent obligations,
3733     then as a consequence you may not convey it at all.  For example,
3734     if you agree to terms that obligate you to collect a royalty for
3735     further conveying from those to whom you convey the Program, the
3736     only way you could satisfy both those terms and this License would
3737     be to refrain entirely from conveying the Program.
3738
3739  13. Use with the GNU Affero General Public License.
3740
3741     Notwithstanding any other provision of this License, you have
3742     permission to link or combine any covered work with a work licensed
3743     under version 3 of the GNU Affero General Public License into a
3744     single combined work, and to convey the resulting work.  The terms
3745     of this License will continue to apply to the part which is the
3746     covered work, but the special requirements of the GNU Affero
3747     General Public License, section 13, concerning interaction through
3748     a network will apply to the combination as such.
3749
3750  14. Revised Versions of this License.
3751
3752     The Free Software Foundation may publish revised and/or new
3753     versions of the GNU General Public License from time to time.  Such
3754     new versions will be similar in spirit to the present version, but
3755     may differ in detail to address new problems or concerns.
3756
3757     Each version is given a distinguishing version number.  If the
3758     Program specifies that a certain numbered version of the GNU
3759     General Public License "or any later version" applies to it, you
3760     have the option of following the terms and conditions either of
3761     that numbered version or of any later version published by the Free
3762     Software Foundation.  If the Program does not specify a version
3763     number of the GNU General Public License, you may choose any
3764     version ever published by the Free Software Foundation.
3765
3766     If the Program specifies that a proxy can decide which future
3767     versions of the GNU General Public License can be used, that
3768     proxy's public statement of acceptance of a version permanently
3769     authorizes you to choose that version for the Program.
3770
3771     Later license versions may give you additional or different
3772     permissions.  However, no additional obligations are imposed on any
3773     author or copyright holder as a result of your choosing to follow a
3774     later version.
3775
3776  15. Disclaimer of Warranty.
3777
3778     THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
3779     APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE
3780     COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS"
3781     WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
3782     INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
3783     MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE
3784     RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.
3785     SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
3786     NECESSARY SERVICING, REPAIR OR CORRECTION.
3787
3788  16. Limitation of Liability.
3789
3790     IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
3791     WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES
3792     AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR
3793     DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
3794     CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE
3795     THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA
3796     BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
3797     PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
3798     PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF
3799     THE POSSIBILITY OF SUCH DAMAGES.
3800
3801  17. Interpretation of Sections 15 and 16.
3802
3803     If the disclaimer of warranty and limitation of liability provided
3804     above cannot be given local legal effect according to their terms,
3805     reviewing courts shall apply local law that most closely
3806     approximates an absolute waiver of all civil liability in
3807     connection with the Program, unless a warranty or assumption of
3808     liability accompanies a copy of the Program in return for a fee.
3809
3810END OF TERMS AND CONDITIONS
3811===========================
3812
3813How to Apply These Terms to Your New Programs
3814=============================================
3815
3816If you develop a new program, and you want it to be of the greatest
3817possible use to the public, the best way to achieve this is to make it
3818free software which everyone can redistribute and change under these
3819terms.
3820
3821   To do so, attach the following notices to the program.  It is safest
3822to attach them to the start of each source file to most effectively
3823state the exclusion of warranty; and each file should have at least the
3824"copyright" line and a pointer to where the full notice is found.
3825
3826     ONE LINE TO GIVE THE PROGRAM'S NAME AND A BRIEF IDEA OF WHAT IT DOES.
3827     Copyright (C) YEAR NAME OF AUTHOR
3828
3829     This program is free software: you can redistribute it and/or modify
3830     it under the terms of the GNU General Public License as published by
3831     the Free Software Foundation, either version 3 of the License, or (at
3832     your option) any later version.
3833
3834     This program is distributed in the hope that it will be useful, but
3835     WITHOUT ANY WARRANTY; without even the implied warranty of
3836     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
3837     General Public License for more details.
3838
3839     You should have received a copy of the GNU General Public License
3840     along with this program.  If not, see <http://www.gnu.org/licenses/>.
3841
3842   Also add information on how to contact you by electronic and paper
3843mail.
3844
3845   If the program does terminal interaction, make it output a short
3846notice like this when it starts in an interactive mode:
3847
3848     PROGRAM Copyright (C) YEAR NAME OF AUTHOR
3849     This program comes with ABSOLUTELY NO WARRANTY; for details type 'show w'.
3850     This is free software, and you are welcome to redistribute it
3851     under certain conditions; type 'show c' for details.
3852
3853   The hypothetical commands 'show w' and 'show c' should show the
3854appropriate parts of the General Public License.  Of course, your
3855program's commands might be different; for a GUI interface, you would
3856use an "about box".
3857
3858   You should also get your employer (if you work as a programmer) or
3859school, if any, to sign a "copyright disclaimer" for the program, if
3860necessary.  For more information on this, and how to apply and follow
3861the GNU GPL, see <http://www.gnu.org/licenses/>.
3862
3863   The GNU General Public License does not permit incorporating your
3864program into proprietary programs.  If your program is a subroutine
3865library, you may consider it more useful to permit linking proprietary
3866applications with the library.  If this is what you want to do, use the
3867GNU Lesser General Public License instead of this License.  But first,
3868please read <http://www.gnu.org/philosophy/why-not-lgpl.html>.
3869
3870
3871File: libgomp.info,  Node: GNU Free Documentation License,  Next: Funding,  Prev: Copying,  Up: Top
3872
3873GNU Free Documentation License
3874******************************
3875
3876                     Version 1.3, 3 November 2008
3877
3878     Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
3879     <http://fsf.org/>
3880
3881     Everyone is permitted to copy and distribute verbatim copies
3882     of this license document, but changing it is not allowed.
3883
3884  0. PREAMBLE
3885
3886     The purpose of this License is to make a manual, textbook, or other
3887     functional and useful document "free" in the sense of freedom: to
3888     assure everyone the effective freedom to copy and redistribute it,
3889     with or without modifying it, either commercially or
3890     noncommercially.  Secondarily, this License preserves for the
3891     author and publisher a way to get credit for their work, while not
3892     being considered responsible for modifications made by others.
3893
3894     This License is a kind of "copyleft", which means that derivative
3895     works of the document must themselves be free in the same sense.
3896     It complements the GNU General Public License, which is a copyleft
3897     license designed for free software.
3898
3899     We have designed this License in order to use it for manuals for
3900     free software, because free software needs free documentation: a
3901     free program should come with manuals providing the same freedoms
3902     that the software does.  But this License is not limited to
3903     software manuals; it can be used for any textual work, regardless
3904     of subject matter or whether it is published as a printed book.  We
3905     recommend this License principally for works whose purpose is
3906     instruction or reference.
3907
3908  1. APPLICABILITY AND DEFINITIONS
3909
3910     This License applies to any manual or other work, in any medium,
3911     that contains a notice placed by the copyright holder saying it can
3912     be distributed under the terms of this License.  Such a notice
3913     grants a world-wide, royalty-free license, unlimited in duration,
3914     to use that work under the conditions stated herein.  The
3915     "Document", below, refers to any such manual or work.  Any member
3916     of the public is a licensee, and is addressed as "you".  You accept
3917     the license if you copy, modify or distribute the work in a way
3918     requiring permission under copyright law.
3919
3920     A "Modified Version" of the Document means any work containing the
3921     Document or a portion of it, either copied verbatim, or with
3922     modifications and/or translated into another language.
3923
3924     A "Secondary Section" is a named appendix or a front-matter section
3925     of the Document that deals exclusively with the relationship of the
3926     publishers or authors of the Document to the Document's overall
3927     subject (or to related matters) and contains nothing that could
3928     fall directly within that overall subject.  (Thus, if the Document
3929     is in part a textbook of mathematics, a Secondary Section may not
3930     explain any mathematics.)  The relationship could be a matter of
3931     historical connection with the subject or with related matters, or
3932     of legal, commercial, philosophical, ethical or political position
3933     regarding them.
3934
3935     The "Invariant Sections" are certain Secondary Sections whose
3936     titles are designated, as being those of Invariant Sections, in the
3937     notice that says that the Document is released under this License.
3938     If a section does not fit the above definition of Secondary then it
3939     is not allowed to be designated as Invariant.  The Document may
3940     contain zero Invariant Sections.  If the Document does not identify
3941     any Invariant Sections then there are none.
3942
3943     The "Cover Texts" are certain short passages of text that are
3944     listed, as Front-Cover Texts or Back-Cover Texts, in the notice
3945     that says that the Document is released under this License.  A
3946     Front-Cover Text may be at most 5 words, and a Back-Cover Text may
3947     be at most 25 words.
3948
3949     A "Transparent" copy of the Document means a machine-readable copy,
3950     represented in a format whose specification is available to the
3951     general public, that is suitable for revising the document
3952     straightforwardly with generic text editors or (for images composed
3953     of pixels) generic paint programs or (for drawings) some widely
3954     available drawing editor, and that is suitable for input to text
3955     formatters or for automatic translation to a variety of formats
3956     suitable for input to text formatters.  A copy made in an otherwise
3957     Transparent file format whose markup, or absence of markup, has
3958     been arranged to thwart or discourage subsequent modification by
3959     readers is not Transparent.  An image format is not Transparent if
3960     used for any substantial amount of text.  A copy that is not
3961     "Transparent" is called "Opaque".
3962
3963     Examples of suitable formats for Transparent copies include plain
3964     ASCII without markup, Texinfo input format, LaTeX input format,
3965     SGML or XML using a publicly available DTD, and standard-conforming
3966     simple HTML, PostScript or PDF designed for human modification.
3967     Examples of transparent image formats include PNG, XCF and JPG.
3968     Opaque formats include proprietary formats that can be read and
3969     edited only by proprietary word processors, SGML or XML for which
3970     the DTD and/or processing tools are not generally available, and
3971     the machine-generated HTML, PostScript or PDF produced by some word
3972     processors for output purposes only.
3973
3974     The "Title Page" means, for a printed book, the title page itself,
3975     plus such following pages as are needed to hold, legibly, the
3976     material this License requires to appear in the title page.  For
3977     works in formats which do not have any title page as such, "Title
3978     Page" means the text near the most prominent appearance of the
3979     work's title, preceding the beginning of the body of the text.
3980
3981     The "publisher" means any person or entity that distributes copies
3982     of the Document to the public.
3983
3984     A section "Entitled XYZ" means a named subunit of the Document
3985     whose title either is precisely XYZ or contains XYZ in parentheses
3986     following text that translates XYZ in another language.  (Here XYZ
3987     stands for a specific section name mentioned below, such as
3988     "Acknowledgements", "Dedications", "Endorsements", or "History".)
3989     To "Preserve the Title" of such a section when you modify the
3990     Document means that it remains a section "Entitled XYZ" according
3991     to this definition.
3992
3993     The Document may include Warranty Disclaimers next to the notice
3994     which states that this License applies to the Document.  These
3995     Warranty Disclaimers are considered to be included by reference in
3996     this License, but only as regards disclaiming warranties: any other
3997     implication that these Warranty Disclaimers may have is void and
3998     has no effect on the meaning of this License.
3999
4000  2. VERBATIM COPYING
4001
4002     You may copy and distribute the Document in any medium, either
4003     commercially or noncommercially, provided that this License, the
4004     copyright notices, and the license notice saying this License
4005     applies to the Document are reproduced in all copies, and that you
4006     add no other conditions whatsoever to those of this License.  You
4007     may not use technical measures to obstruct or control the reading
4008     or further copying of the copies you make or distribute.  However,
4009     you may accept compensation in exchange for copies.  If you
4010     distribute a large enough number of copies you must also follow the
4011     conditions in section 3.
4012
4013     You may also lend copies, under the same conditions stated above,
4014     and you may publicly display copies.
4015
4016  3. COPYING IN QUANTITY
4017
4018     If you publish printed copies (or copies in media that commonly
4019     have printed covers) of the Document, numbering more than 100, and
4020     the Document's license notice requires Cover Texts, you must
4021     enclose the copies in covers that carry, clearly and legibly, all
4022     these Cover Texts: Front-Cover Texts on the front cover, and
4023     Back-Cover Texts on the back cover.  Both covers must also clearly
4024     and legibly identify you as the publisher of these copies.  The
4025     front cover must present the full title with all words of the title
4026     equally prominent and visible.  You may add other material on the
4027     covers in addition.  Copying with changes limited to the covers, as
4028     long as they preserve the title of the Document and satisfy these
4029     conditions, can be treated as verbatim copying in other respects.
4030
4031     If the required texts for either cover are too voluminous to fit
4032     legibly, you should put the first ones listed (as many as fit
4033     reasonably) on the actual cover, and continue the rest onto
4034     adjacent pages.
4035
4036     If you publish or distribute Opaque copies of the Document
4037     numbering more than 100, you must either include a machine-readable
4038     Transparent copy along with each Opaque copy, or state in or with
4039     each Opaque copy a computer-network location from which the general
4040     network-using public has access to download using public-standard
4041     network protocols a complete Transparent copy of the Document, free
4042     of added material.  If you use the latter option, you must take
4043     reasonably prudent steps, when you begin distribution of Opaque
4044     copies in quantity, to ensure that this Transparent copy will
4045     remain thus accessible at the stated location until at least one
4046     year after the last time you distribute an Opaque copy (directly or
4047     through your agents or retailers) of that edition to the public.
4048
4049     It is requested, but not required, that you contact the authors of
4050     the Document well before redistributing any large number of copies,
4051     to give them a chance to provide you with an updated version of the
4052     Document.
4053
4054  4. MODIFICATIONS
4055
4056     You may copy and distribute a Modified Version of the Document
4057     under the conditions of sections 2 and 3 above, provided that you
4058     release the Modified Version under precisely this License, with the
4059     Modified Version filling the role of the Document, thus licensing
4060     distribution and modification of the Modified Version to whoever
4061     possesses a copy of it.  In addition, you must do these things in
4062     the Modified Version:
4063
4064       A. Use in the Title Page (and on the covers, if any) a title
4065          distinct from that of the Document, and from those of previous
4066          versions (which should, if there were any, be listed in the
4067          History section of the Document).  You may use the same title
4068          as a previous version if the original publisher of that
4069          version gives permission.
4070
4071       B. List on the Title Page, as authors, one or more persons or
4072          entities responsible for authorship of the modifications in
4073          the Modified Version, together with at least five of the
4074          principal authors of the Document (all of its principal
4075          authors, if it has fewer than five), unless they release you
4076          from this requirement.
4077
4078       C. State on the Title page the name of the publisher of the
4079          Modified Version, as the publisher.
4080
4081       D. Preserve all the copyright notices of the Document.
4082
4083       E. Add an appropriate copyright notice for your modifications
4084          adjacent to the other copyright notices.
4085
4086       F. Include, immediately after the copyright notices, a license
4087          notice giving the public permission to use the Modified
4088          Version under the terms of this License, in the form shown in
4089          the Addendum below.
4090
4091       G. Preserve in that license notice the full lists of Invariant
4092          Sections and required Cover Texts given in the Document's
4093          license notice.
4094
4095       H. Include an unaltered copy of this License.
4096
4097       I. Preserve the section Entitled "History", Preserve its Title,
4098          and add to it an item stating at least the title, year, new
4099          authors, and publisher of the Modified Version as given on the
4100          Title Page.  If there is no section Entitled "History" in the
4101          Document, create one stating the title, year, authors, and
4102          publisher of the Document as given on its Title Page, then add
4103          an item describing the Modified Version as stated in the
4104          previous sentence.
4105
4106       J. Preserve the network location, if any, given in the Document
4107          for public access to a Transparent copy of the Document, and
4108          likewise the network locations given in the Document for
4109          previous versions it was based on.  These may be placed in the
4110          "History" section.  You may omit a network location for a work
4111          that was published at least four years before the Document
4112          itself, or if the original publisher of the version it refers
4113          to gives permission.
4114
4115       K. For any section Entitled "Acknowledgements" or "Dedications",
4116          Preserve the Title of the section, and preserve in the section
4117          all the substance and tone of each of the contributor
4118          acknowledgements and/or dedications given therein.
4119
4120       L. Preserve all the Invariant Sections of the Document, unaltered
4121          in their text and in their titles.  Section numbers or the
4122          equivalent are not considered part of the section titles.
4123
4124       M. Delete any section Entitled "Endorsements".  Such a section
4125          may not be included in the Modified Version.
4126
4127       N. Do not retitle any existing section to be Entitled
4128          "Endorsements" or to conflict in title with any Invariant
4129          Section.
4130
4131       O. Preserve any Warranty Disclaimers.
4132
4133     If the Modified Version includes new front-matter sections or
4134     appendices that qualify as Secondary Sections and contain no
4135     material copied from the Document, you may at your option designate
4136     some or all of these sections as invariant.  To do this, add their
4137     titles to the list of Invariant Sections in the Modified Version's
4138     license notice.  These titles must be distinct from any other
4139     section titles.
4140
4141     You may add a section Entitled "Endorsements", provided it contains
4142     nothing but endorsements of your Modified Version by various
4143     parties--for example, statements of peer review or that the text
4144     has been approved by an organization as the authoritative
4145     definition of a standard.
4146
4147     You may add a passage of up to five words as a Front-Cover Text,
4148     and a passage of up to 25 words as a Back-Cover Text, to the end of
4149     the list of Cover Texts in the Modified Version.  Only one passage
4150     of Front-Cover Text and one of Back-Cover Text may be added by (or
4151     through arrangements made by) any one entity.  If the Document
4152     already includes a cover text for the same cover, previously added
4153     by you or by arrangement made by the same entity you are acting on
4154     behalf of, you may not add another; but you may replace the old
4155     one, on explicit permission from the previous publisher that added
4156     the old one.
4157
4158     The author(s) and publisher(s) of the Document do not by this
4159     License give permission to use their names for publicity for or to
4160     assert or imply endorsement of any Modified Version.
4161
4162  5. COMBINING DOCUMENTS
4163
4164     You may combine the Document with other documents released under
4165     this License, under the terms defined in section 4 above for
4166     modified versions, provided that you include in the combination all
4167     of the Invariant Sections of all of the original documents,
4168     unmodified, and list them all as Invariant Sections of your
4169     combined work in its license notice, and that you preserve all
4170     their Warranty Disclaimers.
4171
4172     The combined work need only contain one copy of this License, and
4173     multiple identical Invariant Sections may be replaced with a single
4174     copy.  If there are multiple Invariant Sections with the same name
4175     but different contents, make the title of each such section unique
4176     by adding at the end of it, in parentheses, the name of the
4177     original author or publisher of that section if known, or else a
4178     unique number.  Make the same adjustment to the section titles in
4179     the list of Invariant Sections in the license notice of the
4180     combined work.
4181
4182     In the combination, you must combine any sections Entitled
4183     "History" in the various original documents, forming one section
4184     Entitled "History"; likewise combine any sections Entitled
4185     "Acknowledgements", and any sections Entitled "Dedications".  You
4186     must delete all sections Entitled "Endorsements."
4187
4188  6. COLLECTIONS OF DOCUMENTS
4189
4190     You may make a collection consisting of the Document and other
4191     documents released under this License, and replace the individual
4192     copies of this License in the various documents with a single copy
4193     that is included in the collection, provided that you follow the
4194     rules of this License for verbatim copying of each of the documents
4195     in all other respects.
4196
4197     You may extract a single document from such a collection, and
4198     distribute it individually under this License, provided you insert
4199     a copy of this License into the extracted document, and follow this
4200     License in all other respects regarding verbatim copying of that
4201     document.
4202
4203  7. AGGREGATION WITH INDEPENDENT WORKS
4204
4205     A compilation of the Document or its derivatives with other
4206     separate and independent documents or works, in or on a volume of a
4207     storage or distribution medium, is called an "aggregate" if the
4208     copyright resulting from the compilation is not used to limit the
4209     legal rights of the compilation's users beyond what the individual
4210     works permit.  When the Document is included in an aggregate, this
4211     License does not apply to the other works in the aggregate which
4212     are not themselves derivative works of the Document.
4213
4214     If the Cover Text requirement of section 3 is applicable to these
4215     copies of the Document, then if the Document is less than one half
4216     of the entire aggregate, the Document's Cover Texts may be placed
4217     on covers that bracket the Document within the aggregate, or the
4218     electronic equivalent of covers if the Document is in electronic
4219     form.  Otherwise they must appear on printed covers that bracket
4220     the whole aggregate.
4221
4222  8. TRANSLATION
4223
4224     Translation is considered a kind of modification, so you may
4225     distribute translations of the Document under the terms of section
4226     4.  Replacing Invariant Sections with translations requires special
4227     permission from their copyright holders, but you may include
4228     translations of some or all Invariant Sections in addition to the
4229     original versions of these Invariant Sections.  You may include a
4230     translation of this License, and all the license notices in the
4231     Document, and any Warranty Disclaimers, provided that you also
4232     include the original English version of this License and the
4233     original versions of those notices and disclaimers.  In case of a
4234     disagreement between the translation and the original version of
4235     this License or a notice or disclaimer, the original version will
4236     prevail.
4237
4238     If a section in the Document is Entitled "Acknowledgements",
4239     "Dedications", or "History", the requirement (section 4) to
4240     Preserve its Title (section 1) will typically require changing the
4241     actual title.
4242
4243  9. TERMINATION
4244
4245     You may not copy, modify, sublicense, or distribute the Document
4246     except as expressly provided under this License.  Any attempt
4247     otherwise to copy, modify, sublicense, or distribute it is void,
4248     and will automatically terminate your rights under this License.
4249
4250     However, if you cease all violation of this License, then your
4251     license from a particular copyright holder is reinstated (a)
4252     provisionally, unless and until the copyright holder explicitly and
4253     finally terminates your license, and (b) permanently, if the
4254     copyright holder fails to notify you of the violation by some
4255     reasonable means prior to 60 days after the cessation.
4256
4257     Moreover, your license from a particular copyright holder is
4258     reinstated permanently if the copyright holder notifies you of the
4259     violation by some reasonable means, this is the first time you have
4260     received notice of violation of this License (for any work) from
4261     that copyright holder, and you cure the violation prior to 30 days
4262     after your receipt of the notice.
4263
4264     Termination of your rights under this section does not terminate
4265     the licenses of parties who have received copies or rights from you
4266     under this License.  If your rights have been terminated and not
4267     permanently reinstated, receipt of a copy of some or all of the
4268     same material does not give you any rights to use it.
4269
4270  10. FUTURE REVISIONS OF THIS LICENSE
4271
4272     The Free Software Foundation may publish new, revised versions of
4273     the GNU Free Documentation License from time to time.  Such new
4274     versions will be similar in spirit to the present version, but may
4275     differ in detail to address new problems or concerns.  See
4276     <http://www.gnu.org/copyleft/>.
4277
4278     Each version of the License is given a distinguishing version
4279     number.  If the Document specifies that a particular numbered
4280     version of this License "or any later version" applies to it, you
4281     have the option of following the terms and conditions either of
4282     that specified version or of any later version that has been
4283     published (not as a draft) by the Free Software Foundation.  If the
4284     Document does not specify a version number of this License, you may
4285     choose any version ever published (not as a draft) by the Free
4286     Software Foundation.  If the Document specifies that a proxy can
4287     decide which future versions of this License can be used, that
4288     proxy's public statement of acceptance of a version permanently
4289     authorizes you to choose that version for the Document.
4290
4291  11. RELICENSING
4292
4293     "Massive Multiauthor Collaboration Site" (or "MMC Site") means any
4294     World Wide Web server that publishes copyrightable works and also
4295     provides prominent facilities for anybody to edit those works.  A
4296     public wiki that anybody can edit is an example of such a server.
4297     A "Massive Multiauthor Collaboration" (or "MMC") contained in the
4298     site means any set of copyrightable works thus published on the MMC
4299     site.
4300
4301     "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0
4302     license published by Creative Commons Corporation, a not-for-profit
4303     corporation with a principal place of business in San Francisco,
4304     California, as well as future copyleft versions of that license
4305     published by that same organization.
4306
4307     "Incorporate" means to publish or republish a Document, in whole or
4308     in part, as part of another Document.
4309
4310     An MMC is "eligible for relicensing" if it is licensed under this
4311     License, and if all works that were first published under this
4312     License somewhere other than this MMC, and subsequently
4313     incorporated in whole or in part into the MMC, (1) had no cover
4314     texts or invariant sections, and (2) were thus incorporated prior
4315     to November 1, 2008.
4316
4317     The operator of an MMC Site may republish an MMC contained in the
4318     site under CC-BY-SA on the same site at any time before August 1,
4319     2009, provided the MMC is eligible for relicensing.
4320
4321ADDENDUM: How to use this License for your documents
4322====================================================
4323
4324To use this License in a document you have written, include a copy of
4325the License in the document and put the following copyright and license
4326notices just after the title page:
4327
4328       Copyright (C)  YEAR  YOUR NAME.
4329       Permission is granted to copy, distribute and/or modify this document
4330       under the terms of the GNU Free Documentation License, Version 1.3
4331       or any later version published by the Free Software Foundation;
4332       with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
4333       Texts.  A copy of the license is included in the section entitled ``GNU
4334       Free Documentation License''.
4335
4336   If you have Invariant Sections, Front-Cover Texts and Back-Cover
4337Texts, replace the "with...Texts."  line with this:
4338
4339         with the Invariant Sections being LIST THEIR TITLES, with
4340         the Front-Cover Texts being LIST, and with the Back-Cover Texts
4341         being LIST.
4342
4343   If you have Invariant Sections without Cover Texts, or some other
4344combination of the three, merge those two alternatives to suit the
4345situation.
4346
4347   If your document contains nontrivial examples of program code, we
4348recommend releasing these examples in parallel under your choice of free
4349software license, such as the GNU General Public License, to permit
4350their use in free software.
4351
4352
4353File: libgomp.info,  Node: Funding,  Next: Library Index,  Prev: GNU Free Documentation License,  Up: Top
4354
4355Funding Free Software
4356*********************
4357
4358If you want to have more free software a few years from now, it makes
4359sense for you to help encourage people to contribute funds for its
4360development.  The most effective approach known is to encourage
4361commercial redistributors to donate.
4362
4363   Users of free software systems can boost the pace of development by
4364encouraging for-a-fee distributors to donate part of their selling price
4365to free software developers--the Free Software Foundation, and others.
4366
4367   The way to convince distributors to do this is to demand it and
4368expect it from them.  So when you compare distributors, judge them
4369partly by how much they give to free software development.  Show
4370distributors they must compete to be the one who gives the most.
4371
4372   To make this approach work, you must insist on numbers that you can
4373compare, such as, "We will donate ten dollars to the Frobnitz project
4374for each disk sold."  Don't be satisfied with a vague promise, such as
4375"A portion of the profits are donated," since it doesn't give a basis
4376for comparison.
4377
4378   Even a precise fraction "of the profits from this disk" is not very
4379meaningful, since creative accounting and unrelated business decisions
4380can greatly alter what fraction of the sales price counts as profit.  If
4381the price you pay is $50, ten percent of the profit is probably less
4382than a dollar; it might be a few cents, or nothing at all.
4383
4384   Some redistributors do development work themselves.  This is useful
4385too; but to keep everyone honest, you need to inquire how much they do,
4386and what kind.  Some kinds of development make much more long-term
4387difference than others.  For example, maintaining a separate version of
4388a program contributes very little; maintaining the standard version of a
4389program for the whole community contributes much.  Easy new ports
4390contribute little, since someone else would surely do them; difficult
4391ports such as adding a new CPU to the GNU Compiler Collection contribute
4392more; major new features or packages contribute the most.
4393
4394   By establishing the idea that supporting further development is "the
4395proper thing to do" when distributing free software for a fee, we can
4396assure a steady flow of resources into making more free software.
4397
4398     Copyright (C) 1994 Free Software Foundation, Inc.
4399     Verbatim copying and redistribution of this section is permitted
4400     without royalty; alteration is not permitted.
4401
4402
4403File: libgomp.info,  Node: Library Index,  Prev: Funding,  Up: Top
4404
4405Library Index
4406*************
4407
4408[index]
4409* Menu:
4410
4411* Environment Variable:                  OMP_CANCELLATION.      (line 6)
4412* Environment Variable <1>:              OMP_DISPLAY_ENV.       (line 6)
4413* Environment Variable <2>:              OMP_DEFAULT_DEVICE.    (line 6)
4414* Environment Variable <3>:              OMP_DYNAMIC.           (line 6)
4415* Environment Variable <4>:              OMP_MAX_ACTIVE_LEVELS. (line 6)
4416* Environment Variable <5>:              OMP_MAX_TASK_PRIORITY. (line 6)
4417* Environment Variable <6>:              OMP_NESTED.            (line 6)
4418* Environment Variable <7>:              OMP_NUM_THREADS.       (line 6)
4419* Environment Variable <8>:              OMP_PROC_BIND.         (line 6)
4420* Environment Variable <9>:              OMP_PLACES.            (line 6)
4421* Environment Variable <10>:             OMP_STACKSIZE.         (line 6)
4422* Environment Variable <11>:             OMP_SCHEDULE.          (line 6)
4423* Environment Variable <12>:             OMP_THREAD_LIMIT.      (line 6)
4424* Environment Variable <13>:             OMP_WAIT_POLICY.       (line 6)
4425* Environment Variable <14>:             GOMP_CPU_AFFINITY.     (line 6)
4426* Environment Variable <15>:             GOMP_DEBUG.            (line 6)
4427* Environment Variable <16>:             GOMP_STACKSIZE.        (line 6)
4428* Environment Variable <17>:             GOMP_SPINCOUNT.        (line 6)
4429* Environment Variable <18>:             GOMP_RTEMS_THREAD_POOLS.
4430                                                                (line 6)
4431* FDL, GNU Free Documentation License:   GNU Free Documentation License.
4432                                                                (line 6)
4433* Implementation specific setting:       OMP_NESTED.            (line 6)
4434* Implementation specific setting <1>:   OMP_NUM_THREADS.       (line 6)
4435* Implementation specific setting <2>:   OMP_SCHEDULE.          (line 6)
4436* Implementation specific setting <3>:   GOMP_STACKSIZE.        (line 6)
4437* Implementation specific setting <4>:   GOMP_SPINCOUNT.        (line 6)
4438* Implementation specific setting <5>:   GOMP_RTEMS_THREAD_POOLS.
4439                                                                (line 6)
4440* Introduction:                          Top.                   (line 6)
4441
4442
4443
4444Tag Table:
4445Node: Top2083
4446Node: Enabling OpenMP4613
4447Node: Runtime Library Routines5401
4448Node: omp_get_active_level8478
4449Node: omp_get_ancestor_thread_num9178
4450Node: omp_get_cancellation10108
4451Node: omp_get_default_device10922
4452Node: omp_get_dynamic11598
4453Node: omp_get_level12473
4454Node: omp_get_max_active_levels13093
4455Node: omp_get_max_task_priority13798
4456Node: omp_get_max_threads14418
4457Node: omp_get_nested15175
4458Node: omp_get_num_devices16089
4459Node: omp_get_num_procs16610
4460Node: omp_get_num_teams17149
4461Node: omp_get_num_threads17665
4462Node: omp_get_proc_bind18754
4463Node: omp_get_schedule19675
4464Node: omp_get_team_num20629
4465Node: omp_get_team_size21128
4466Node: omp_get_thread_limit22088
4467Node: omp_get_thread_num22707
4468Node: omp_in_parallel23578
4469Node: omp_in_final24227
4470Node: omp_is_initial_device24901
4471Node: omp_set_default_device25594
4472Node: omp_set_dynamic26385
4473Node: omp_set_max_active_levels27271
4474Node: omp_set_nested28048
4475Node: omp_set_num_threads28940
4476Node: omp_set_schedule29808
4477Node: omp_init_lock30889
4478Node: omp_set_lock31542
4479Node: omp_test_lock32397
4480Node: omp_unset_lock33373
4481Node: omp_destroy_lock34304
4482Node: omp_init_nest_lock34981
4483Node: omp_set_nest_lock35716
4484Node: omp_test_nest_lock36631
4485Node: omp_unset_nest_lock37658
4486Node: omp_destroy_nest_lock38673
4487Node: omp_get_wtick39424
4488Node: omp_get_wtime40016
4489Node: Environment Variables40792
4490Node: OMP_CANCELLATION42361
4491Node: OMP_DISPLAY_ENV42894
4492Node: OMP_DEFAULT_DEVICE43597
4493Node: OMP_DYNAMIC44377
4494Node: OMP_MAX_ACTIVE_LEVELS44973
4495Node: OMP_MAX_TASK_PRIORITY45623
4496Node: OMP_NESTED46281
4497Node: OMP_NUM_THREADS46886
4498Node: OMP_PROC_BIND47574
4499Node: OMP_PLACES48766
4500Node: OMP_STACKSIZE50943
4501Node: OMP_SCHEDULE51767
4502Node: OMP_THREAD_LIMIT52465
4503Node: OMP_WAIT_POLICY53065
4504Node: GOMP_CPU_AFFINITY53757
4505Node: GOMP_DEBUG55487
4506Node: GOMP_STACKSIZE55994
4507Node: GOMP_SPINCOUNT56823
4508Node: GOMP_RTEMS_THREAD_POOLS58027
4509Node: Enabling OpenACC60205
4510Node: OpenACC Runtime Library Routines61198
4511Node: acc_get_num_devices64992
4512Node: acc_set_device_type65718
4513Node: acc_get_device_type66482
4514Node: acc_set_device_num67197
4515Node: acc_get_device_num67981
4516Node: acc_async_test68778
4517Node: acc_async_test_all69770
4518Node: acc_wait70670
4519Node: acc_wait_all71532
4520Node: acc_wait_all_async72291
4521Node: acc_wait_async73043
4522Node: acc_init73750
4523Node: acc_shutdown74396
4524Node: acc_on_device75064
4525Node: acc_malloc76068
4526Node: acc_free76567
4527Node: acc_copyin76994
4528Node: acc_present_or_copyin78104
4529Node: acc_create79730
4530Node: acc_present_or_create80885
4531Node: acc_copyout82519
4532Node: acc_delete83542
4533Node: acc_update_device84517
4534Node: acc_update_self85629
4535Node: acc_map_data86733
4536Node: acc_unmap_data87418
4537Node: acc_deviceptr87939
4538Node: acc_hostptr88509
4539Node: acc_is_present89073
4540Node: acc_memcpy_to_device90600
4541Node: acc_memcpy_from_device91263
4542Node: acc_get_current_cuda_device91947
4543Node: acc_get_current_cuda_context92544
4544Node: acc_get_cuda_stream93144
4545Node: acc_set_cuda_stream93735
4546Node: OpenACC Environment Variables94380
4547Node: ACC_DEVICE_TYPE94839
4548Node: ACC_DEVICE_NUM95075
4549Node: GCC_ACC_NOTIFY95332
4550Node: CUDA Streams Usage95555
4551Ref: CUDA Streams Usage-Footnote-197455
4552Node: OpenACC Library Interoperability97564
4553Ref: OpenACC Library Interoperability-Footnote-1103920
4554Ref: OpenACC Library Interoperability-Footnote-2104172
4555Node: The libgomp ABI104380
4556Node: Implementing MASTER construct105236
4557Node: Implementing CRITICAL construct105650
4558Node: Implementing ATOMIC construct106389
4559Node: Implementing FLUSH construct106870
4560Node: Implementing BARRIER construct107141
4561Node: Implementing THREADPRIVATE construct107410
4562Node: Implementing PRIVATE clause108063
4563Node: Implementing FIRSTPRIVATE LASTPRIVATE COPYIN and COPYPRIVATE clauses108644
4564Node: Implementing REDUCTION clause109968
4565Node: Implementing PARALLEL construct110525
4566Node: Implementing FOR construct111782
4567Node: Implementing ORDERED construct113780
4568Node: Implementing SECTIONS construct114086
4569Node: Implementing SINGLE construct114852
4570Node: Implementing OpenACC's PARALLEL construct115564
4571Node: Reporting Bugs115822
4572Node: Copying116184
4573Node: GNU Free Documentation License153731
4574Node: Funding178854
4575Node: Library Index181380
4576
4577End Tag Table
4578