#ifndef EIGEN_BENCH_UTIL_H #define EIGEN_BENCH_UTIL_H #include #include "BenchTimer.h" using namespace std; using namespace Eigen; #include #include #include #include #include #include #include #include #include template void initMatrix_random(MatrixType& mat) __attribute__((noinline)); template void initMatrix_random(MatrixType& mat) { mat.setRandom();// = MatrixType::random(mat.rows(), mat.cols()); } template void initMatrix_identity(MatrixType& mat) __attribute__((noinline)); template void initMatrix_identity(MatrixType& mat) { mat.setIdentity(); } #ifndef __INTEL_COMPILER #define DISABLE_SSE_EXCEPTIONS() { \ int aux; \ asm( \ "stmxcsr %[aux] \n\t" \ "orl $32832, %[aux] \n\t" \ "ldmxcsr %[aux] \n\t" \ : : [aux] "m" (aux)); \ } #else #define DISABLE_SSE_EXCEPTIONS() #endif #ifdef BENCH_GMM #include template void eiToGmm(const EigenMatrixType& src, GmmMatrixType& dst) { dst.resize(src.rows(),src.cols()); for (int j=0; j #include #include template void eiToGsl(const EigenMatrixType& src, gsl_matrix** dst) { for (int j=0; j #include template void eiToUblas(const EigenMatrixType& src, UblasMatrixType& dst) { dst.resize(src.rows(),src.cols()); for (int j=0; j void eiToUblasVec(const EigenType& src, UblasType& dst) { dst.resize(src.size()); for (int j=0; j