Skip to content

Linear Algebra in the Cxx Library

Nasos Iliopoulos edited this page Oct 15, 2018 · 8 revisions

Please feel free to dump initial ideas, links to useful resources, etc on either this wiki or in the repository.

If you don't have write access to the GitHub repository, please email Bryce Adelstein Lelbach ([email protected]) and he'll add you.

Questions we should work on answering:

  • Q: What are we trying to accomplish in this space? What are the intended use cases?
    • Graphics.
    • Scientific Computing and numerical simulation.
    • Neural network training and inference.
    • Data analytics on multidimensional data.
    • Sparse Linear Algebra?
    • Embedded systems.
  • Q: What are the design requirements and principles?
    • Separation of concerns; e.g., multidimensional array storage class does not embed linear algebra mathematics operators
    • Builds on top of the mdspan feature and interoperates with the 2D Graphics proposal.
    • Clear path for implementing operations with a high performance BLAS library.
    • Supports both compile-time and run-time meta-data (extents, striding, padding, etc).
    • Supports mixing compile-time and run-time meta-data (a la mdspan).
    • Separate data storage from algorithms (e.g. the string_view model).
    • Supports mixed precision and mixed type operations.
    • Supports non-fundamental numeric types (e.g. integer, fixed-point, units, chrono::duration etc.)
    • Supports arbitrary dimensions, i.e. is not limited to 2D or 3D arrays. Dimensionality support should be at least as good as Fortran 77.
    • Is compatible with C or Fortran linear algebra libraries.
    • Does not get into the way (or is compatible) with MPI.
    • Allows custom allocators?
    • Off main memory containers?
    • Support fixed size containers.
  • Q: What capabilities must be included in a minimum viable product (e.g. version 1)?
    • Abstractions for element iteration (e.g. multi-dimensional for loop).
    • Efficient (in both human and computer time) expression of array slicing and subarray extraction.
    • Efficient (in both human and computer time) expression of dimension/index/order permutations (aka transposition).
  • Q: What are the risks?
    • Performs poorly (which could be anything from 10% to 10x overhead, depending on the user) and thus many C++ users will continue to rely on non-standard linear algebra libraries/frameworks
    • Fails to match Numpy, Matlab Fortran 90 in terms of ease of use for common operations
    • Is prohibitively difficult to learn for users with basic knowledge of linear algebra
    • Introduces run-time overhead over using graphics oriented geometry libraries (e.g. GLM)
    • Inarticulate, complex or very domain specific interface.
Clone this wiki locally