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