mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-06-04 18:54:00 +08:00
Add helper routines to help bypassing some compiler otpimization when benchmarking
This commit is contained in:
parent
f047ecc36a
commit
c6eb17cbe9
@ -28,6 +28,14 @@
|
|||||||
# include <unistd.h>
|
# include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static void escape(void *p) {
|
||||||
|
asm volatile("" : : "g"(p) : "memory");
|
||||||
|
}
|
||||||
|
|
||||||
|
static void clobber() {
|
||||||
|
asm volatile("" : : : "memory");
|
||||||
|
}
|
||||||
|
|
||||||
#include <Eigen/Core>
|
#include <Eigen/Core>
|
||||||
|
|
||||||
namespace Eigen
|
namespace Eigen
|
||||||
@ -168,6 +176,7 @@ public:
|
|||||||
CODE; \
|
CODE; \
|
||||||
} \
|
} \
|
||||||
TIMER.stop(); \
|
TIMER.stop(); \
|
||||||
|
clobber(); \
|
||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user