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