CPL - Chalmers Publication Library
| Utbildning | Forskning | Styrkeområden | Om Chalmers | In English In English Ej inloggad.

From Generic Invocations to Generic Implementations

Andreas Priesnitz (Institutionen för data- och informationsteknik, Datavetenskap (Chalmers)) ; Sibylle Schupp (Institutionen för data- och informationsteknik, Datavetenskap (Chalmers))
5th Workshop on Parallel/High-Performance Object-Oriented Scientific Computing at the 20th European Conference on Object Oriented Programming - POOSC'06 Workshop Notes (2006)
[Konferensbidrag, övrigt]

Software performance benefits from executing computations on constant data statically, at compile time. Unlike most languages, C++ allows expressing static computations by language means (template meta-programming), without relying on separate preprocessing tools. However, static code differs from dynamic code by syntax and even by programming style, as the former is functional, the latter imperative. A library designer who wants to support both a static and a dynamic version of an algorithm is therefore forced to design and maintain two implementations. A common formulation is presented that allows one to implement an algorithm generically by a single definition, while encoding static parameter properties within the argument types. By the choice of argument representation, the user determines how the algorithm is evaluated. This decoupling preserves all information necessary to have the compiler create appropriate code for each case. The realization by an ANSI C++ library of static constructs guarantees portability and allows an optimizing compiler to eliminate run-time overhead.

Nyckelord: generic programming, meta programming, staging, code optimization, library-based software, C++

Denna post skapades 2006-10-09.
CPL Pubid: 22716


Läs direkt!

Länk till annan sajt (kan kräva inloggning)

Institutioner (Chalmers)

Institutionen för data- och informationsteknik, Datavetenskap (Chalmers)



Chalmers infrastruktur