How ginkgo-project/ginkgo works
Project type and purpose
• This is Ginkgo, a high-performance numerical linear-algebra library (C++17) targeting sparse linear‐system solvers on many‐core architectures (CPU, NVIDIA/AMD/Intel GPUs, etc.).
• It provides a unified API (“ginkgo.hpp”) and a set of modular “executors” (Reference, OpenMP, CUDA, HIP, DPC++/SYCL) that dispatch core algorithms to hardware-specific kernels.
File structure
• Top‐level build/config: CMakeLists.txt, cmake/ modules, .github & .gitlab CI workflows, codecov.yml.
• Public headers: include/ginkgo/core/... define the API (LinOps, executors, matrix formats, solvers, preconditioners, distributed).
• Core library: core/ (base types & dispatch helpers, core algorithms, distributed support).
• Backends:
• reference/ – generic CPU kernels
• omp/ – OpenMP parallel kernels
• cuda/ + common/cuda_hip/ – NVIDIA GPU kernels & shared CUDA/HIP helpers
• hip/ – AMD GPU kernels
• dpcpp/ – Intel oneAPI (SYCL) kernels
• devices/ – executor abstractions & machine topology
• Tests: test/, core/test/, cuda/test/, hip/test/, dpcpp/test/, reference/test/, extensions/test/
• Examples & benchmarks: examples/, benchmark/
• Third-party: third_party/ (SuiteSparse, gflags, gtest, nlohmann_json, helper tools)
README for additional insights
• API usage via find_package(Ginkgo) → target Ginkgo::ginkgo
• CMake options toggle modules (–DGINKGO_WITH_CUDA=ON, etc.)
• Emphasis on unit tests (Google Test), examples, benchmarks & Ginkgo Performance Explorer (GPE).
Elements
• Blue for library layers (API, Core, Executors)
• Green for backends & hardware
• Orange for third-party dependencies
• Grey for build system (CMake)
• Rectangles for components
• Diamonds for factory/registry
Capture all essential modules rather than every single directory; grouping directories by logical layer (core, backends, API, tooling) ensures clarity without clutter.