11 #ifndef EIGEN_BENCH_TIMERR_H 12 #define EIGEN_BENCH_TIMERR_H 14 #if defined(_WIN32) || defined(__CYGWIN__) 17 # define EIGEN_BT_UNDEF_NOMINMAX 19 # ifndef WIN32_LEAN_AND_MEAN 20 # define WIN32_LEAN_AND_MEAN 21 # define EIGEN_BT_UNDEF_WIN32_LEAN_AND_MEAN 24 #elif defined(__APPLE__) 25 #include <mach/mach_time.h> 31 asm volatile(
"" : :
"g"(
p) :
"memory");
35 asm volatile(
"" : : :
"memory");
61 #if defined(_WIN32) || defined(__CYGWIN__) 63 QueryPerformanceFrequency(&freq);
64 m_frequency = (double)freq.QuadPart;
86 #if EIGEN_VERSION_AT_LEAST(2,90,0) 129 LARGE_INTEGER query_ticks;
130 QueryPerformanceCounter(&query_ticks);
131 return query_ticks.QuadPart/m_frequency;
133 return double(mach_absolute_time())*1
e-9;
136 clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &ts);
137 return double(ts.tv_sec) + 1
e-9 * double(ts.tv_nsec);
146 return (
double)st.wSecond + 1.e-3 * (double)st.wMilliseconds;
148 return double(mach_absolute_time())*1
e-9;
151 clock_gettime(CLOCK_REALTIME, &ts);
152 return double(ts.tv_sec) + 1
e-9 * double(ts.tv_nsec);
157 #if defined(_WIN32) || defined(__CYGWIN__) 170 #define BENCH(TIMER,TRIES,REP,CODE) { \ 172 for(int uglyvarname1=0; uglyvarname1<TRIES; ++uglyvarname1){ \ 174 for(int uglyvarname2=0; uglyvarname2<REP; ++uglyvarname2){ \ 185 #ifdef EIGEN_BT_UNDEF_NOMINMAX 186 # undef EIGEN_BT_UNDEF_NOMINMAX 190 #ifdef EIGEN_BT_UNDEF_WIN32_LEAN_AND_MEAN 191 # undef EIGEN_BT_UNDEF_WIN32_LEAN_AND_MEAN 192 # undef WIN32_LEAN_AND_MEAN 195 #endif // EIGEN_BENCH_TIMERR_H
Namespace containing all symbols from the Eigen library.
#define EIGEN_MAKE_ALIGNED_OPERATOR_NEW
double getRealTime() const
double worst(int TIMER=CPU_TIMER) const
double getCpuTime() const
Array< double, 1, 3 > e(1./3., 0.5, 2.)
double total(int TIMER=CPU_TIMER) const
double value(int TIMER=CPU_TIMER) const
double best(int TIMER=CPU_TIMER) const
static void escape(void *p)