Expression Templates Revisited: A Performance Analysis of Current Methodologies

In the last decade, expression templates (ETs) have gained a reputation as an efficient performance optimization tool for C++ codes. This reputation builds on several ET-based linear algebra frameworks focused on combining both elegant and high-performance C++ code. However, on closer examination the assumption that ETs are a performance optimization technique cannot be maintained. In this paper we compare the performance of several generations of ET-based frameworks. We analyze different ET methodologies and explain the inability of some ET implementations to deliver high performance for dense and sparse linear algebra operations. Additionally, we introduce the notion of “smart” ETs, which truly allow for a combination of high performance code with the elegance and maintainability of a domain-specific language.

[1]  David Abrahams,et al.  C++ template metaprogramming , 2005 .

[2]  簡聰富,et al.  物件導向軟體之架構(Object-Oriented Software Construction)探討 , 1989 .

[3]  Richard Barrett,et al.  Templates for the Solution of Linear Systems: Building Blocks for Iterative Methods , 1994, Other Titles in Applied Mathematics.

[4]  Todd L. Veldhuizen,et al.  Expression templates , 1996 .

[5]  James O. Coplien,et al.  Curiously recurring template patterns , 1995 .

[6]  Stanley B. Lippman,et al.  Inside the C++ Object Model , 1996 .

[7]  Henrietta Hardy Mrs Hammond The complete guide , 1883 .

[8]  Bertrand Meyer,et al.  Object-Oriented Software Construction, 2nd Edition , 1997 .

[9]  Douglas Gregor,et al.  C++ Templates: The Complete Guide , 2002 .

[10]  David Vandevoorde,et al.  C++ Templates , 2002 .

[11]  Kei Davis,et al.  C++ expression template performance issues in scientific computing , 1998, Proceedings of the First Merged International Parallel Processing Symposium and Symposium on Parallel and Distributed Processing.

[12]  Klaus Iglberger Software Design of a Massively Parallel Rigid Body Framework , 2010 .

[13]  Gerhard Wellein,et al.  LIKWID: A Lightweight Performance-Oriented Tool Suite for x86 Multicore Environments , 2010, 2010 39th International Conference on Parallel Processing Workshops.

[14]  Bjarne Stroustrup,et al.  The Annotated C++ Reference Manual , 1990 .

[15]  Gerhard Wellein,et al.  Introduction to High Performance Computing for Scientists and Engineers , 2010, Chapman and Hall / CRC computational science series.

[16]  Lee R. Nackman,et al.  Algebra for C++ operators , 1996 .

[17]  Carsten H. Wolters,et al.  Advanced expression templates programming , 2009, Comput. Vis. Sci..