]>
Commit | Line | Data |
---|---|---|
c63539ff ML |
1 | .. |
2 | Copyright 1988-2022 Free Software Foundation, Inc. | |
3 | This is part of the GCC manual. | |
4 | For copying conditions, see the copyright.rst file. | |
5 | ||
6 | .. _implementing-sections-construct: | |
7 | ||
8 | Implementing SECTIONS construct | |
9 | ******************************* | |
10 | ||
11 | A block as | |
12 | ||
13 | .. code-block:: c++ | |
14 | ||
15 | #pragma omp sections | |
16 | { | |
17 | #pragma omp section | |
18 | stmt1; | |
19 | #pragma omp section | |
20 | stmt2; | |
21 | #pragma omp section | |
22 | stmt3; | |
23 | } | |
24 | ||
25 | becomes | |
26 | ||
27 | .. code-block:: c++ | |
28 | ||
29 | for (i = GOMP_sections_start (3); i != 0; i = GOMP_sections_next ()) | |
30 | switch (i) | |
31 | { | |
32 | case 1: | |
33 | stmt1; | |
34 | break; | |
35 | case 2: | |
36 | stmt2; | |
37 | break; | |
38 | case 3: | |
39 | stmt3; | |
40 | break; | |
41 | } | |
42 | GOMP_barrier (); |