superlu/superlu-4.3-dont-opt-away.diff

21 lines
537 B
Diff

diff -aruN SuperLU_4.3.orig/INSTALL/timertst.c SuperLU_4.3/INSTALL/timertst.c
--- SuperLU_4.3.orig/INSTALL/timertst.c 2011-10-27 21:49:47.000000000 +0200
+++ SuperLU_4.3/INSTALL/timertst.c 2012-12-20 21:55:13.954437737 +0100
@@ -6,6 +6,8 @@
return;
}
+volatile double _dummy;
+
int main()
{
/* Parameters */
@@ -32,6 +34,7 @@
for (j = 0; j < iters; ++j) {
for (i = 0; i < NMAX; ++i) y[i] += alpha * x[i];
alpha = -alpha;
+ _dummy = y[j%NMAX];
}
t2 = SuperLU_timer_();
tnotim = t2 - t1;