11 unstable releases (3 breaking)

new 0.3.1 Apr 15, 2025
0.3.0 Apr 14, 2025
0.2.6 Apr 3, 2025
0.2.5 Mar 31, 2025
0.0.1 Feb 8, 2025

#854 in Machine learning

Download history 187/week @ 2025-02-04 53/week @ 2025-02-11 19/week @ 2025-02-18 8/week @ 2025-02-25 5/week @ 2025-03-04 121/week @ 2025-03-11 90/week @ 2025-03-18 464/week @ 2025-03-25 226/week @ 2025-04-01 82/week @ 2025-04-08

871 downloads per month
Used in 2 crates (via rstsr-openblas)

Apache-2.0

160KB
6K SLoC

OpenBLAS FFI bindings

This crate contains OpenBLAS FFI bindings.

Current FFI version is OpenBLAS v0.3.29.

OpenBLAS (C/Fortran/ASM) source code is available on github.

This crate is not official bindgen project. It is originally intended to serve rust tensor toolkit RSTSR and rust electronic structure toolkit REST.

  • Audience: Anyone uses OpenBLAS function may also find it useful, not only RSTSR or REST program developers.
  • FFI-only: Program developer is not required to actually install every components in OpenBLAS. Rust FFI bindings is only declaration.
  • Do not include LAPACK and LAPACKE: For LAPACK or LAPACKE, we refer to netlib LAPACK FFI bindings (such as lapack-sys or rstsr-lapack-ffi). OpenBLAS's declaration of LAPACK functions is no difference to netlib LAPACK, but only different in implementation.

Cargo features

  • ilp64: Use int64_t for dimension specification, or lapack error code types if this feature specified. Otherwise, use int32_t.
    • Please note that in f77blas.rs, error code is returned by c_int; in cblas.rs, OpenBLAS utility functions use c_int for input or output.
  • quad_precision and ex_precision: Specify type extra-precision xdouble type in f77blas.rs. Probably few people will require these features.

Crate structure

  • header: Header files copied (or renamed) from original source.
  • scripts: Script to generate FFI bindgens.
  • src: FFI bindings:
    • f77blas: Corresponds to f77blas.h header in compiled library include (or common_interface.h in OpenBLAS original source code). BLAS and some LAPACK functions that implemented by OpenBLAS, no post-suffix underscore.
    • cblas: Corresponds to cblas.h header. Original CBLAS included, along with OpenBLAS utility functions (e.g. openblas_get_num_threads) and some BLAS extensions (e.g. cblas_zgemm_batch).

No runtime deps

Features