Add helper routines to help bypassing some compiler otpimization when benchmarking

This commit is contained in:
Gael Guennebaud 2015-10-07 15:50:42 +02:00
parent f047ecc36a
commit c6eb17cbe9

View File

@ -28,6 +28,14 @@
# include <unistd.h>
#endif
static void escape(void *p) {
asm volatile("" : : "g"(p) : "memory");
}
static void clobber() {
asm volatile("" : : : "memory");
}
#include <Eigen/Core>
namespace Eigen
@ -168,6 +176,7 @@ public:
CODE; \
} \
TIMER.stop(); \
clobber(); \
} \
}