[eigen] Performance degradation with OpenMP |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: Eigen <eigen@xxxxxxxxxxxxxxxxxxx>
- Subject: [eigen] Performance degradation with OpenMP
- From: Hauke Heibel <hauke.heibel@xxxxxxxxxxxxxx>
- Date: Fri, 17 Dec 2010 13:18:47 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=qS9huS2WyC0SvSXcVaqYR1yPqHauRoj3jiltZO9C2EE=; b=c0luYqCT8b4Mtt6LLPZKDZzmrso3rdsIZNy1pJRvN7z0jHPEMUf8Gx39W5nc+HoMqL /fmWMzks7ujrKazf4VuzVpqOLnNt4DbPx8R9kIAIyDPXM1pF285yc8TxOX8FE+2RjRjw cFQIAsdiJVQqNh6NSTJGWhRdHJ6TKXXvs/sy0=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=Taw/Kh25KgzypoN3aeiZd4HWuBXaDfeFZMiNjRgiU8qHs1rbTPJzITVNULvLnClc5o zxT0STlBSOCAaVNZ+hv0I9rsAi2/5iQwJiYfSKV6czppK43Jf4nHKhEEiGtPqxW5MMkD d8IrkRtQcJRWoiE1r5N7EfeMpMt5zpxi3OllU=
Hi,
somewhere in my code I computed A^T*A (A being 3-by-n) and I recognized a performance degradation of ~20% when compiling with OpenMP.
I attached a simple test program that should be showing the issue.
- Hauke
#include <Eigen/Core>
#include <Bench/BenchTimer.h>
#include <iostream>
using namespace Eigen;
void ata(Matrix3Xf& AtA, const Matrix3Xf& m)
{
AtA = m.transpose() * m;
}
int main()
{
Matrix3Xf m = Matrix3Xf::Random(3,5000);
Matrix3Xf C(3,3);
BenchTimer timer;
BENCH(timer, 3, 20, ata(C,m));
std::cout << "prod cpu " << timer.best(CPU_TIMER) << "s)\n";
std::cout << "prod real " << timer.best(REAL_TIMER) << "s)\n";
}