问题描述
我在查看效果基准:
我不禁注意到eigen似乎始终优于所有专业供应商库。问题是:怎么可能?我们假设mkl / goto使用处理器专用的调试代码,而eigen则是通用的。
And 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有惰性评估。从:
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 ++在本征库中的性能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!