[eigen] Bug in matrix product with OpenMP? |
[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]
#include <Eigen/Core>
#include <omp.h>
#include <iostream>
using namespace Eigen;
int main(int argc, char*argv[])
{
int size = 1529;//Good:1528, Bad:1529
MatrixXf a = MatrixXf::Random(size, size);
MatrixXf b = MatrixXf::Random(size, size);
omp_set_num_threads(1);
MatrixXf c = a*b;
omp_set_num_threads(2);
MatrixXf d = a*b;
if(!c.isApprox(d))
std::cerr<<size<<" Error!"<<std::endl;
return 0;
}
g++ -I /path/to/eigen -fopenmp -O3 -DNDEBUG product_bug.cpp -o product_bug
Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |