Skip to content

About

A library of high-performance dense linear algebra functions for AArch64 systems.

Topics

Resources

Contributing

Security policy

Stars

9 stars

Watchers

3 watching

Forks

Repository files navigation

perf-libs-linalg

A library of dense linear algebra functions for AArch64 systems.

It provides a full BLAS/CBLAS interface and a subset of LAPACK routines, using strategies and optimized kernels selected at runtime.

Requirements

  • CMake 3.21 or newer
  • A toolchain with the required C++ and AArch64 ISA support
    • supported build compilers: GCC 14 and LLVM/Clang 22
    • assembler support is required for +sve, +fp16, +bf16, and +sme2
    • compiler runtime support for the SME ABI
    • other C++23-capable compilers may work
  • A Fortran compiler for the Netlib reference sources
  • Python 3.10 or newer with Mako and NumPy
  • make, find, and git
  • OpenMP development support when building with LINALG_THREADING_MODEL=openmp

Support and Limitations

  • Linux and macOS on AArch64 are supported build/test platforms.
  • Experimental Android arm64-v8a cross-compilation is available. See Android build instructions.
  • Windows AArch64 support is experimental and assumes LLVM/Clang in a wenv/MSYS2-style environment.
  • BLAS, CBLAS, and selected LAPACK routines are provided by default.
  • Enable LINALG_LAPACK_FALLBACK for full LAPACK and LAPACKE support.
  • Fortran modules are not currently provided.

Quick Start

python3 -m venv .venv
. .venv/bin/activate
python3 -m pip install mako numpy
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --parallel

This builds the pl_linalg target.

Build Options

  • BUILD_SHARED_LIBS=ON|OFF: builds shared or static libraries where supported. The default is OFF.
  • LINALG_INTEGER_MODEL=lp64|ilp64: selects the public integer ABI. The default is lp64.
  • LINALG_THREADING_MODEL=serial|openmp: selects the threading backend. The default is serial.
  • LINALG_REQUEST_MAX_THREADS=ON|OFF: always request the current maximum OpenMP team size. The default is OFF.
  • LINALG_LAPACK_FALLBACK=ON|OFF: enables full LAPACK and LAPACKE support. The default is OFF.
  • LINALG_BUILD_BENCHMARKS=ON|OFF: builds problem_context_bench. The default is OFF.
  • LINALG_ENABLE_TUNING_OVERRIDES=ON|OFF: enables JSON tuning overrides. The default is OFF.
  • LINALG_SANITIZER=none|address: selects sanitizer instrumentation. The default is none.

Example:

cmake -S . -B build-openmp \
  -DCMAKE_BUILD_TYPE=Release \
  -DLINALG_THREADING_MODEL=openmp \
  -DLINALG_INTEGER_MODEL=ilp64
cmake --build build-openmp --parallel

Testing

ctest --test-dir build --output-on-failure

This runs the Netlib BLAS and CBLAS test suites. With LINALG_LAPACK_FALLBACK=ON, it also runs the LAPACK tests and LAPACKE examples.

Install

cmake --install build --prefix /path/to/install

This installs the built pl_linalg library, its public headers, and license notices.

Source Layout

  • include/: public C headers and ABI types
  • src/core/: problem contexts, interfaces, strategies, and shared linear algebra machinery
  • src/kernels/: optimized AArch64 kernels and kernel generators
  • src/runtime/: CPU and system detection
  • src/dispatch/: runtime dispatch and generated selection sources
  • netlib/: imported Netlib reference sources and test integration
  • cmake/: top-level CMake build options

Contributing

See CONTRIBUTING.md for contribution guidance.

License

This repository is licensed under either MIT or Apache-2.0 with LLVM exception. See LICENSE and LICENSES/.

Third-party source notices are listed in THIRD_PARTY_NOTICES.md.

About

A library of high-performance dense linear algebra functions for AArch64 systems.

Topics

Resources

Contributing

Security policy

Stars

9 stars

Watchers

3 watching

Forks

Releases

Contributors

Languages