Skip to content

Update BLAS, LAPACK and linear algebra routines #103

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 41 commits into
base: unstable
Choose a base branch
from

Conversation

Thoemi09
Copy link
Contributor

  • make BLAS and LAPACK wrapper routines more consistent
    • only allow supported layouts, memory spaces, etc.
    • use the same notation, variable names, etc. across routines
  • the routines in the nda::blas and nda::lapack namespaces are only very thin wrappers around the BLAS/LAPACK calls
  • move all higher level routines in the nda::linalg namespace and use numpy function names whenever it makes sense
  • update tests and docs

Thoemi09 added 30 commits May 22, 2025 12:44
- Allow general nda::MemoryArray types of rank 1 or 2
- do not allow conjugate expressions
- update docs and tests
- Remove outer_product from nda::blas namespace
- Update docs and tests
- move outer_product from blas/ger.hpp to linalg/outer_product.hpp
- move the generic dot routines from the blas to the linalg namespace
- blas::dot and blas::dotc
  - thin wrappers around the BLAS routines
  - restrict to nda::MemoryVectors
- linalg::dot linalg::dotc
  - allow scalar-scalar and vector-vector dot products
  - only call blas::dot and blas::dotc if it is possible without making a copy
- move matvecmul into linalg namespace and into its own linalg/matvecmul.hpp header
- move blas::gemv_generic into linalg::detail namespace in linalg/matvecmul.hpp
- linalg::matvecmul
  - allow non-contiguous matrices
  - move various helper lambdas into linalg::detail namespace
  - avoid unnecessary vector copies
- move blas::gemm_generic into linalg::detail namespace in linalg/matmul.hpp
- linalg::matvecmul
  - allow non-contiguous matrices
  - move various helper lambdas into linalg::detail namespace
- remove explicit throw statements --> always return the LAPACK info
- consistent checks and function layout
- remove explicit throw statement --> always return the LAPACK info
- allow C-layout matrices
- require F-layout for B matrices
- lapack::getrf
  - allow C-layout matrices
- lapack::getri
  - restrict to host (there is not getri for cuda)
- lapack::getrs
  - allow conjugate lazy expressions
  - allow B to be either a vector or matrix
  - restrict B to F-layout
- move norm into linalg namespace
- allow vectors with different value types
- require vectors to have a host compatible address space
- rename inverse to inv, inverse_in_place to inv_in_place, inverse1_in_place to inv_in_place_1d,
inverse2_in_place to inv_place_2d, inverse3_in_place to inv_in_place_3d
- allow in place functions for host compatible address spaces
- use getrf + getrs to allow device matrices in inv
- rename determinant to det, determinant_in_place to det_in_place
- introduce det_1d, det_2d and det_3d
- only allow matrices on host compatible address spaces and with double or complex value types
- call optimized routines for matrices with less than 4 rows/columns
- replace throw statements with std::terminate()
- wrap the BLAS gerc routine
- restrict to Fortran layout matrices
- rename linalg::eigenelements to linalg::eigh
- rename linalg::eigenvalues to linalg::eigvalsh
- rename linalg/eigenelements.hpp to linalg/eigh.hpp
- call the LAPACK wrappers lapack::syev and lapack::heev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant