source:
CIVL/examples/omp/transform/omp_sections_arr.c@
a0b7ab5
| Last change on this file since a0b7ab5 was c7c308c, checked in by , 7 years ago | |
|---|---|
|
|
| File size: 246 bytes | |
| Line | |
|---|---|
| 1 | #include <civlc.cvh> |
| 2 | |
| 3 | |
| 4 | int main () { |
| 5 | int x[4] = {1, 2, 3, 4}; |
| 6 | int y = -1; |
| 7 | |
| 8 | #pragma omp parallel sections firstprivate(y) shared(x) |
| 9 | { |
| 10 | { |
| 11 | x[0] = x[1]; |
| 12 | } |
| 13 | #pragma omp section |
| 14 | { |
| 15 | x[2] = x[3]; |
| 16 | } |
| 17 | #pragma omp section |
| 18 | { |
| 19 | y = x[2]; |
| 20 | } |
| 21 | } |
| 22 | return 0; |
| 23 | } |
Note:
See TracBrowser
for help on using the repository browser.
