Repository navigation
Triangular solves take a batch of matrices in one call and behave the same on every backend.
Added
- Batched triangular solves —
solve_triangular_lowerandsolve_triangular_uppertakea: [..batch, n, n]withb: [..batch, n, m]. The batch dims ofbmust equal those ofa. Every matrix solves in one call: one kernel launch on CUDA, one dispatch on WebGPU. The result has the shape ofb. A mismatchedbreturns an error that names both shapes. A 2-Dakeeps its 1-D and 2-Dbforms. algorithm::linalg::validate_triangular_solve— the shape rules every backend applies to a triangular solve, withTriangularSolveShapeas the resolved batch, order and column count.
Fixed
- CPU triangular solves — a
bwhose row count differs from the order ofareturnsShapeMismatch, and abof 3 or more dims beside a 2-Dareturns an error, as on CUDA and WebGPU. Before, CPU panicked on too few rows, ignored extra rows, and read a higher-rankbas 2-D. - Triangular solves on strided input — a transposed or offset
aorbsolves correctly on every backend. Before, CPU panicked, CUDA read the underlying memory in storage order, and WebGPU did not honor a strided or offseta.
Changed
- CUDA triangular solves — a solve with several right-hand-side columns runs in one launch instead of a separate launch sequence per column, and returns without a host synchronization.
Full diff: v0.12.0...v0.13.0