1.23
2.0
acw/focus-triggers
main
test-branch
| Line | |
|---|
| 1 | /*
|
|---|
| 2 | * Outer loop has loop carried true dependence
|
|---|
| 3 | */
|
|---|
| 4 | #include <stdlib.h>
|
|---|
| 5 | #include <stdio.h>
|
|---|
| 6 | int main(int argc, char* argv[])
|
|---|
| 7 | {
|
|---|
| 8 | int i,j;
|
|---|
| 9 | int n=1000, m=1000;
|
|---|
| 10 | double b[1000][1000];
|
|---|
| 11 |
|
|---|
| 12 | for (i=0; i<n; i++)
|
|---|
| 13 | for (j=0; j<m; j++)
|
|---|
| 14 | b[i][j] = 0.5;
|
|---|
| 15 |
|
|---|
| 16 | #pragma omp parallel for
|
|---|
| 17 | for (i=1;i<n;i++)
|
|---|
| 18 | for (j=1;j<m;j++)
|
|---|
| 19 | b[i][j]=b[i-1][j-1];
|
|---|
| 20 |
|
|---|
| 21 | printf("b[500][500]=%f\n", b[500][500]);
|
|---|
| 22 | return 0;
|
|---|
| 23 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.