3 ms·
here's the problem: These kind of libraries will never come close touching Fortran's built-in features, simply because the compiler can't automatically optimise
by m_mueller 10y ago
here's the problem: These kind of libraries will never come close touching Fortran's built-in features, simply because the compiler can't automatically optimise for knowledge about the code that only the library has. Even arrays not knowing their size is still an issue, let alone array based ops like shown in the article.
Fortran is not the fastest language around the block, but if you don't want to go into non-portable machine-based hand-tuned optimisations (e.g. loop unrolling) it's hard to beat. Basically, if you optimise for both runtime and programmer time for HPC applications I'd argue that Fortran is top of the crop.
- radioactivist 10y agoWell, in the case of Eigen it's an entirely header based library, so the compiler can optimize some things. Not to mention the template based meta-programming strategies [1] Eigen itself uses to simplify and optimize during compilation (including vectorization and loop unrolling). The fact that this kind of infrastructure can be built up in a library in C++, i.e. it doesn't have to be baked into the compiler, is a huge plus I think relative to Fortran. [1] https://eigen.tuxfamily.org/dox/TopicInsideEigenExample.html https://eigen.tuxfamily.org/dox/TopicInsideEigenExample.html
- whyever 10y agoI don't think this is true. C++ matrix template libraries are competitive with anything that Fortran can do.