EN FR
EN FR


Section: New Results

Towards Algorithmic Differentiation of C++

Participants : Laurent Hascoët, Valérie Pascual, Frederic Cazals [ABS team, Inria Sophia-Antipolis] .

We made progress towards the extension of Tapenade for C++. Last year, an external parser for C++ was built on top of Clang-LLVM https://clang.llvm.org/ and connected to the input formalism “IL” of Tapenade, but the internals of Tapenade were not able to handle the new constructs present in this input. This year, integration of C++ was pushed further by taking into account many of the new constructs (namespaces, classes, constructors and destructors) in the Internal Representation(IR) of Tapenade. Not surprisingly, this implied deep changes in several areas of Tapenade code. The IR of Tapenade now contains classes, constructors and destructors, and also has a faithful representation for namespaces. The textual nested structure and the control-flow parts of the IR are correct. The symbol tables and the representation for memory locations are still under development.

As a result, Tapenade is now able to input its first C++ files and is able to output them, but without transformation. Although not advertised nor documented, the functionality is present in the latest release 3.14. Data-Flow analysis and code transformation (e.g. AD) will not be possible until we have a correct IR about variables and their memory locations. This work is going on.

This work benefited from the expertise in C++ of Frederic Cazals (Inria ABS team). The ABS team provided a large test application code (SBL, https://sbl.inria.fr/) for Molecular Dynamics, which will be our first C++ target.