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