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>
|
||||
#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(); \
|
||||
} \
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user