diff options
Diffstat (limited to 'gcc/testsuite/melt/topengpu-0.c')
-rw-r--r-- | gcc/testsuite/melt/topengpu-0.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/gcc/testsuite/melt/topengpu-0.c b/gcc/testsuite/melt/topengpu-0.c index 0b9531293aa..5dafa635129 100644 --- a/gcc/testsuite/melt/topengpu-0.c +++ b/gcc/testsuite/melt/topengpu-0.c @@ -5,21 +5,26 @@ ./cc1 -std=gnu99 -fmelt-mode=opengpu -fmelt-module-path=melt-modules -fmelt-source-path=melt-sources -fmelt-debug -O2 -fgraphite -floop-parallelize-all topengpu-0.c ## it could be useful to pass -fdump-tree-all -fdump-ipa-all */ -float foobar(int sz, - float tres[static restrict sz], - float tx[static restrict sz], - float ty[static restrict sz], - float tz[static restrict sz]) +float foobar (int sz, + /* we mean that all four arrays tr tx ty tz cannot be + aliases, and they each are sized by sz ; See + http://www.lysator.liu.se/c/restrict.html */ + float tr[static restrict sz], + float tx[static restrict sz], + float ty[static restrict sz], + float tz[static restrict sz]) { float r = 0.0; // I expect this loop to be parallel for (int i=0; i<sz; i++) { - tres[i] = tx[i] + ty[i] * tz[i]; + tr[i] = + tx[i] + + ty[i] * tz[i]; } for (int i=0; i<sz; i++) { - r += tres[i]; + r += tr[i]; } return r; } |