CoDiPack  2.2.0
A Code Differentiation Package
SciComp TU Kaiserslautern
Loading...
Searching...
No Matches
Tutorials & Examples

Tutorials provide a detailed explanation of the most common CoDiPack features. They try to explain nearly everything so that also beginners should have no problem to apply AD to a code.

Examples provide in most cases only the code for using the necessary features. Some examples have some helpful remarks or pointers to other features.

Tutorial
Tutorial 1 - Forward mode AD Explains the usage of the codi::RealForward type.
Tutorial 2 - Reverse mode AD Explains the usage of the codi::RealReverse type.
Tutorial 3 - Full Jacobian computation (Multiple reverse evaluations) Full Jacobian computation in CoDiPack with the forward and reverse mode.
Tutorial 4 - Vector mode AD Vector mode examples with CoDiPack.
Tutorial 5 - Repeated tape recordings How different tapes are recorded in in CoDiPack.
Tutorial 6 - Higher order derivatives Describes how higher order AD types can be constructed and used.
Example
Example 1 - Old tangent leftovers in forward mode AD Shows possible errors if the computational path is changed.
Example 2 - Custom adjoint vector evaluation How custom types can be used in an reverse evaluation, on tapes that are already recorded.
Example 3 - Positional tape evaluations Demonstrates how to evaluate only parts of a tape.
Example 4 - Higher order derivatives compile time access Example of the higher order AD types accessed with compile time constructs.
Example 5 - Higher order derivatives direct access Example of higher order AD types accessed with the basic CoDiPack data functions.
Example 6 - Forward mode tape evaluation Demonstrates how a tape can be evaluated in a forward AD mode.
Example 7 - Primal tape evaluation Demonstrates how primal value tapes can be reevaluated for a different point without recording a new tape.
Example 8 - Generalized adjoint vector interface Using a generalized interface for the custom vector access.
Example 9 - OpenMP reverse evaluation Shows how OpenMP can be used to evaluate the same tape concurrently with multiple threads.
Example 10 - External function helper Ease of access structure for adding custom function to the tape.
Example 11 - External function user data How user data can be added to external functions.
Example 12 - Manual statement creation Describes how custom derivatives for small statements can be added to the tape.
Example 13 - MPI communication Demonstrates how MPI constructs can be handled with CoDiPack types.
Example 14 - RefrenceActiveType Shows how the codi::ReferenceActiveType class is used.
Example 15 - Preaccumulation of code parts Provides an example of memory reduction through preaccumulation
Example 16 - TapeHelper Demonstrates a simpler interface for the CoDiPack types.
Example 17 - Hessian and Jacobian computation for function objects Automatic computation of Hessians and Jacobians for function objects. (EvaluationHelper)
Example 18 - EvaluationHelper function object declaration Function object kinds for the EvaluationHelper (Example 17).
Example 19 - EvaluationHelper handle creation Handle creation for the EvaluationHelper (Example 17).
Example 20 - Aggregated active type handling Generalized data extraction of aggregated active types in external functions.
Example 21 - Special handling of linear system solvers Add special handling linear system solvers.
Example 22 - Event system Use CoDiPack's event system to gain insight into the AD workflow.
Example 23 - OpenMP Parallel Codes Use CoDiPack together with OpDiLib for the differentiation of OpenMP parallel codes.
Example 24 - Enzyme external function helper Adding Enzyme-differentiated functions to the CoDiPack tapes.

The graph shows how the tutorials and examples are connected. Usually it is better to understand first the prerequisites of a tutorial/example before reading the actual example.

dot_TutorialsGraph.png