问题描述
我正在查看性能基准:
I was looking over the performance benchmarks: http://eigen.tuxfamily.org/index.php?title=Benchmark
我不禁注意到本征似乎始终优于所有专门的供应商库。问题是:怎么可能?有人会假定mkl / goto将使用处理器特定的调整代码,而本征则相当通用。
I could not help but notice that eigen appears to consistently outperform all the specialized vendor libraries. The questions is: how is it possible? One would assume that mkl/goto would use processor specific tuned code, while eigen is rather generic.
请注意,本质上是一个dgemm。对于N = 1000,本征大约为17Gf,而MKL仅12Gf
Notice this http://download.tuxfamily.org/eigen/btl-results-110323/aat.pdf, essentially a dgemm. For N=1000 Eigen gets roughly 17Gf, MKL only 12Gf
推荐答案
本征的评估很懒。来自:
Eigen has lazy evaluation. From How does Eigen compare to BLAS/LAPACK?:
是 Y = a * X + b * Y
,这是Eigen专门设计的。毫无疑问,图书馆在创建基准时胜出。您会注意到,更通用的基准测试(例如矩阵-矩阵乘法)对Eigen没有任何优势。
The second chart in the benchmarks is Y = a*X + b*Y
, which Eigen was specially designed to handle. It should be no wonder that a library wins at a benchmark it was created for. You'll notice that the more generic benchmarks, like matrix-matrix multiplication, don't show any advantage for Eigen.
这篇关于与专门的供应商库相比,C ++ Eigen库的性能如何?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!