source:
CIVL/examples/omp/DataRaceBench/micro-benchmarks/inneronly1-orig-no.c@
e5cec5ae
| Last change on this file since e5cec5ae was 36a61f3, checked in by , 9 years ago | |
|---|---|
|
|
| File size: 338 bytes | |
| Rev | Line | |
|---|---|---|
| [36a61f3] | 1 | //Example with loop-carried data dependence at the outer level loop. |
| 2 | ||
| 3 | #include <string.h> | |
| 4 | int main(int argc,char *argv[]) | |
| 5 | { | |
| 6 | int i; | |
| 7 | int j; | |
| 8 | double a[20][20]; | |
| 9 | memset(a,0,(sizeof(a))); | |
| 10 | ||
| 11 | for (i = 0; i < 20 -1; i += 1) { | |
| 12 | #pragma omp parallel for | |
| 13 | for (j = 0; j < 20; j += 1) { | |
| 14 | a[i][j] += a[i + 1][j]; | |
| 15 | } | |
| 16 | } | |
| 17 | return 0; | |
| 18 | } |
Note:
See TracBrowser
for help on using the repository browser.
