8 releases
| 0.2.3 | Sep 25, 2025 |
|---|---|
| 0.2.2 | Sep 25, 2025 |
| 0.1.4 | Sep 24, 2025 |
#1866 in Machine learning
57 downloads per month
Used in 3 crates
(via tblis)
28KB
659 lines
tblis-ffi: TBLIS FFI bindings
This crate contains TBLIS FFI bindings.
TBLIS (Tensor BLIS, The Tensor-Based Library Instantiation Software) can perform various tensor operations (multiplication, addition, reduction, transposition, etc.) efficiently on single-node CPU. This library can be an underlying driver for performing einsum (Einstein summation).
Current FFI version is TBLIS 9b95712 after v1.3.0. If you are using an older version of TBLIS, this crate should still work if you do not explicitly call the function that only occurs in higher version of TBLIS.
TBLIS (C++) 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 TBLIS function may also find it useful, not only RSTSR or REST program developers.
- Pure Extern or Dynamic Loading: This crate supports either pure extern (usual FFI, requires dynamic or static linking) and dynamic-loading, by cargo feature
dynamic_loading.
Dynamic loading
This crate supports dynamic loading.
If you want to use dynamic loading, please enable cargo feature dynamic_loading when cargo build.
The dynamic loading will try to find proper library when your program initializes.
- This crate will automatically detect proper libraries, if these libraries are in environmental path
LD_LIBRARY_PATH(Linux)DYLD_LIBRARY_PATH(Mac OS),PATH(Windows). - If you want to override the library to be loaded, please set these shell environmental variable
RSTSR_DYLOAD_TBLISto the dynamic library path.
Cargo features
Optional features:
dynamic_loading: Supports dynamic loading.
Crate structure
ffi_base.rs: Basic type, enum, struct definitions.ffi_extern.rs: Unsafe extern "C" bindgen functions. Only activated when not dynamic loading.dyload_struct.rs: StructLibfor dynamic loading.dyload_initializer.rs: The initialization function ofLibfor dynamic loading.dyload_compatible.rs: Unsafe bindgen function that is compatible to that offfi_extern.rs. Only activated when dynamic loading.
Dependencies
~485KB