You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
perf: optional FFI-backed BLAS backend for multiply/sum #11
The original README roadmap mentioned "native SSE/AVX assembly methods". A realistic modern take: bind libopenblas/cblas via FFI as an optional fast path for multiply() and sum() on large matrices, keeping the pure-PHP loops as the portable fallback (feature-detect the shared library at bootstrap).
Scope: experimental; should ship with a performance-group benchmark comparing both paths, and must not add a hard dependency — the library stays pure-PHP by default.
Delivered by #19, which shipped this as a full driver architecture: OpenBLAS over FFI (cblas_dgemm/daxpy/dscal) as the optional fast path for multiplication, addition, subtraction and scalar operations — plus a CLBlast/OpenCL GPU driver behind the same interface. Availability is feature-detected at runtime with a real 1×1 probe, the pure-PHP array loops remain the portable fallback (auto routing, with mid-operation fallback), system libraries are suggest-only so there is no hard dependency, and composer bench compares the paths — measured tables are in the README (up to ~×1,900 on 1024² GEMM).
Activity
lisachenko commentedon Oct 19, 2026
Delivered by #19, which shipped this as a full driver architecture: OpenBLAS over FFI (
cblas_dgemm/daxpy/dscal) as the optional fast path for multiplication, addition, subtraction and scalar operations — plus a CLBlast/OpenCL GPU driver behind the same interface. Availability is feature-detected at runtime with a real 1×1 probe, the pure-PHP array loops remain the portable fallback (autorouting, with mid-operation fallback), system libraries aresuggest-only so there is no hard dependency, andcomposer benchcompares the paths — measured tables are in the README (up to ~×1,900 on 1024² GEMM).Generated by Claude Code