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