source:
CIVL/examples/omp/DataRaceBench/micro-benchmarks/truedepscalar-orig-yes.c@
e5cec5ae
| Last change on this file since e5cec5ae was 36a61f3, checked in by , 9 years ago | |
|---|---|
|
|
| File size: 337 bytes | |
| Line | |
|---|---|
| 1 | // loop carried true dep between tmp =.. and ..= tmp. |
| 2 | #include <stdlib.h> |
| 3 | #include <stdio.h> |
| 4 | |
| 5 | int main(int argc, char* argv[]) |
| 6 | { |
| 7 | int i; |
| 8 | int tmp; |
| 9 | tmp = 10; |
| 10 | int len=100; |
| 11 | |
| 12 | int a[100]; |
| 13 | |
| 14 | #pragma omp parallel for |
| 15 | for (i=0;i<len;i++) |
| 16 | { |
| 17 | a[i] = tmp; |
| 18 | tmp =a[i]+i; |
| 19 | } |
| 20 | |
| 21 | printf("a[50]=%d\n", a[50]); |
| 22 | return 0; |
| 23 | } |
| 24 |
Note:
See TracBrowser
for help on using the repository browser.
