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