You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
640 B
37 lines
640 B
4 months ago
|
// g++ -fopenmp -I .. -O3 -DNDEBUG -finline-limit=1000 benchmarkX.cpp -o b && time ./b
|
||
|
|
||
|
#include <iostream>
|
||
|
|
||
|
#include <Eigen/Core>
|
||
|
|
||
|
using namespace std;
|
||
|
using namespace Eigen;
|
||
|
|
||
|
#ifndef MATTYPE
|
||
|
#define MATTYPE MatrixXLd
|
||
|
#endif
|
||
|
|
||
|
#ifndef MATSIZE
|
||
|
#define MATSIZE 400
|
||
|
#endif
|
||
|
|
||
|
#ifndef REPEAT
|
||
|
#define REPEAT 100
|
||
|
#endif
|
||
|
|
||
|
int main(int argc, char *argv[])
|
||
|
{
|
||
|
MATTYPE I = MATTYPE::Ones(MATSIZE,MATSIZE);
|
||
|
MATTYPE m(MATSIZE,MATSIZE);
|
||
|
for(int i = 0; i < MATSIZE; i++) for(int j = 0; j < MATSIZE; j++)
|
||
|
{
|
||
|
m(i,j) = (i+j+1)/(MATSIZE*MATSIZE);
|
||
|
}
|
||
|
for(int a = 0; a < REPEAT; a++)
|
||
|
{
|
||
|
m = I + 0.0001 * (m + m*m);
|
||
|
}
|
||
|
cout << m(0,0) << endl;
|
||
|
return 0;
|
||
|
}
|