The following technical report is available from
http://aib.informatik.rwth-aachen.de: <http://aib.informatik.rwth-aachen.de/>
Meta Adjoint Programming in C++
Klaus Leppkes, Johannes Lotz, Uwe Naumann, and Jacques du Toit
AIB 2017-07
Adjoint code development for many-core architectures like GPUs is a major challenge. To address issues arising from the parallelization, currently hand-writing the adjoint code is the most promising approach. Unfortunatly, hand-writing has the fundamental drawback of maintainability, i.e. diverging primal and adjoint codes. To overcome this, supporting tools can and should be used. In this report, we present a new approach for generating adjoint C++ codes by algorithmic differentiation. The approach is called meta adjoint programming and based on the template metaprogramming mechanism. We show that with new developments in the C++ language standard, operator and function overloading techniques can be used to achieve efficient and maintainable adjoint codes. Results are shown for a GPU parallel CVA code. An implementation of meta adjoint programming called dco/map is presented and comparisons with hand-written adjoint code are carried out.