Runtime Code Generation in C++ as a Foundation for Domain-Specific Optimisation

The TaskGraph Library is a C++ library for dynamic code generation, which combines specialisation with dependence analysis and loop restructuring. A TaskGraph represents a fragment of code which is constructed and manipulated at runtime, then compiled, dynamically linked and executed. TaskGraphs are initialised using macros and overloading, which forms a simplified, C-like sub-language with first-class arrays and no pointers. Once a TaskGraph has been constructed, we can analyse its dependence structure and perform optimisations. In this Chapter, we present the design of the TaskGraph library, and two sample applications to demonstrate its use for runtime code specialisation and restructuring optimisation.

[1]  Simon L. Peyton Jones,et al.  Template meta-programming for Haskell , 2002, Haskell '02.

[2]  ConselCharles,et al.  Efficient incremental run-time specialization for free , 1999 .

[3]  D J Evans,et al.  Parallel processing , 1986 .

[4]  Markus Mock,et al.  A retrospective on: "an evaluation of staged run-time optimizations in DyC" , 2004, SIGP.

[5]  Charles Consel,et al.  Tempo: specializing systems applications and beyond , 1998, CSUR.

[6]  Paul H. J. Kelly,et al.  Delayed Evaluation, Self-optimising Software Components as a Programming Model , 2002, Euro-Par.

[7]  Walid Taha,et al.  A Gentle Introduction to Multi-stage Programming , 2003, Domain-Specific Program Generation.

[8]  Joel H. Saltz,et al.  Deferred Data-Flow Analysis , 1998 .

[9]  Robert Glück,et al.  Fast Binding-Time Analysis for Multi-Level Specialization , 1996, Ershov Memorial Conference.

[10]  Walid Taha,et al.  MetaML and multi-stage programming with explicit annotations , 2000, Theor. Comput. Sci..

[11]  Neil D. Jones,et al.  Mix ten years later , 1995, PEPM '95.

[12]  Todd L. Veldhuizen,et al.  Arrays in Blitz++ , 1998, ISCOPE.

[13]  Charles Consel,et al.  Efficient incremental run-time specialization for free , 1999, PLDI '99.

[14]  Yannis Smaragdakis,et al.  JTS: tools for implementing domain-specific languages , 1998, Proceedings. Fifth International Conference on Software Reuse (Cat. No.98TB100203).

[15]  Markus Mock,et al.  DyC: an expressive annotation-directed dynamic compiler for C , 2000, Theor. Comput. Sci..

[16]  Eelco Visser,et al.  Program Transformation with Stratego/XT: Rules, Strategies, Tools, and Systems in Stratego/XT 0.9 , 2003, Domain-Specific Program Generation.

[17]  Christian Lengauer,et al.  Program Optimization in the Domain of High-Performance Parallelism , 2003, Domain-Specific Program Generation.

[18]  John McCarthy,et al.  History of LISP , 1978, SIGP.

[19]  Todd L. Veldhuizen C++ Templates as Partial Evaluation , 1999, PEPM.

[20]  Krzysztof Czarnecki,et al.  DSL Implementation in MetaOCaml, Template Haskell, and C++ , 2003, Domain-Specific Program Generation.

[21]  Martin Odersky,et al.  Domain-Specific Program Generation , 2004, Lecture Notes in Computer Science.

[22]  Jack J. Dongarra,et al.  Automated empirical optimizations of software and the ATLAS project , 2001, Parallel Comput..

[23]  Steven W. K. Tjiang,et al.  SUIF: an infrastructure for research on parallelizing and optimizing compilers , 1994, SIGP.

[24]  Yuefan Deng,et al.  New trends in high performance computing , 2001, Parallel Computing.

[25]  Steve Karmesin,et al.  Array Design and Expression Evaluation in POOMA II , 1998, ISCOPE.

[26]  Denis Caromel,et al.  Computing in Object-Oriented Parallel Environments , 2002, Lecture Notes in Computer Science.

[27]  Dawson R. Engler,et al.  C: a language for high-level, efficient, and machine-independent dynamic code generation , 1995, POPL '96.

[28]  Manfred Broy,et al.  Perspectives of System Informatics , 2001, Lecture Notes in Computer Science.