Ginkgo  Generated from pipelines/115915993 branch based on develop. Ginkgo version 1.1.1
A numerical linear algebra library targeting many-core architectures
Example programs

Here you can find example programs that demonstrate the usage of Ginkgo. Some examples are built on one another and some are stand-alone and demonstrate a concept of Ginkgo, which can be used in your own code.

You can browse the available example programs

  1. as a graph that shows how example programs build upon each other.
  2. as a list that provides a short synopsis of each program.
  3. or grouped by topic.

By default, all Ginkgo examples are built using CMake.

An example for building the examples and using Ginkgo as an external library without CMake can be found in the script provided for each example, which should be called with the form: ./ PATH_TO_GINKGO_BUILD_DIR

By default, Ginkgo is compiled with at least -DGINKGO_BUILD_REFERENCE=ON. To execute on a GPU, you need to have a GPU on the system and must have compiled Ginkgo with the -DGINKGO_BUILD_CUDA=ON option.

Connections between example programs

The following graph shows the connections between example programs and how they build on each other. Click on any of the boxes to go to one of the programs. If you hover your mouse pointer over a box, a brief description of the program should appear.


Example programs

The simple-solver program

A minimal CG solver in Ginkgo, which reads a matrix from a file.

The minimal-cuda-solver program

A minimal solver on the CUDA executor than can be run on NVIDIA GPU's.

The poisson-solver program

Solve an actual physically relevant problem, the poisson problem. The matrix is generated within Ginkgo.

The preconditioned-solver program

Using a Jacobi preconditioner to solve a linear system.

The ilu-preconditioned-solver program

Using an ILU preconditioner to solve a linear system.

The performance-debugging program

Using Loggers to debug the performance within Ginkgo.

The three-pt-stencil-solver program

Using a three point stencil to solve the poisson equation with array views.

The nine-pt-stencil-solver program

Using a nine point 2D stencil to solve the poisson equation with array views.

The twentyseven-pt-stencil-solver program

Using a twentyseven point 3D stencil to solve the poisson equation with array views.

The external-lib-interfacing program

Using Ginkgo's solver with the external library deal.II.

The custom-logger program

Creating a custom logger specifically for comparing the recurrent and the real residual norms.

The custom-matrix-format program

Creating a matrix-free stencil solver by using Ginkgo's advanced methods to build your own custom matrix format.

The inverse-iteration program

Using Ginkgo to compute eigenvalues of a matrix with the inverse iteration method.

The simple-solver-logging program

Using the logging functionality in Ginkgo to get solver and other information to diagnose and debug your code.

The papi-logging program

Using the PAPI logging library in Ginkgo to get advanced information about your code and its behaviour.

The ginkgo-overhead program

Measuring the overhead of the Ginkgo library.

The custom-stopping-criterion program

Creating a custom stopping criterion for the iterative solution process.

The ginkgo-ranges program

Using the ranges concept to factorize a matrix with the LU factorization.

Example programs grouped by topics

Basic techniques

Solving a simple linear system with choice of executors.

The simple-solver program

Debug the performance of a solver using loggers.

The performance-debugging program

Using the CUDA executor

The minimal-cuda-solver program

Using preconditioners

The preconditioned-solver program, The ilu-preconditioned-solver program

Solving a physically relevant problem

The poisson-solver program, The three-pt-stencil-solver program, The nine-pt-stencil-solver program, The twentyseven-pt-stencil-solver program, The custom-matrix-format program

Reading in a matrix and right hand side from a file.

The simple-solver program, The minimal-cuda-solver program, The preconditioned-solver program, The ilu-preconditioned-solver program, The inverse-iteration program, The simple-solver-logging program, The papi-logging program, The custom-stopping-criterion program, The custom-logger program

Advanced techniques

Using Ginkgo with external libraries.

The external-lib-interfacing program

Customizing Ginkgo

The custom-logger program, The custom-stopping-criterion program, The custom-matrix-format program

Writing your own matrix format

The custom-matrix-format program

Using Ginkgo to construct more complex linear algebra routines.

The inverse-iteration program

Logging within Ginkgo.

The simple-solver-logging program, The papi-logging program, The custom-logger program

Constructing your own stopping criterion.

The custom-stopping-criterion program

Using ranges in Ginkgo. The ginkgo-ranges program