source:
CIVL/examples/omp/DataRaceBench/micro-benchmarks/firstprivate-orig-no.c@
e5cec5ae
| Last change on this file since e5cec5ae was 36a61f3, checked in by , 9 years ago | |
|---|---|
|
|
| File size: 220 bytes | |
| Line | |
|---|---|
| 1 | // use of firstprivate() |
| 2 | |
| 3 | void foo(int * a, int n, int g) |
| 4 | { |
| 5 | int i; |
| 6 | #pragma omp parallel for firstprivate (g) |
| 7 | for (i=0;i<n;i++) |
| 8 | { |
| 9 | a[i] = a[i]+g; |
| 10 | } |
| 11 | } |
| 12 | |
| 13 | int a[100]; |
| 14 | int main() |
| 15 | { |
| 16 | foo(a, 100, 7); |
| 17 | return 0; |
| 18 | } |
Note:
See TracBrowser
for help on using the repository browser.
