3#include <batchlas/export.hh>
152template <Backend B,
typename T>
168template <Backend B,
typename T>
188template <Backend B,
typename T>
193 size_t* bytes_used =
nullptr);
212template <Backend B,
typename T>
221template <Backend B,
typename T>
232template <Backend B,
typename T>
240template <Backend B,
typename T>
Non-owning view of a batch of matrices: the argument type of every entry point.
Owning batch of batch_size() matrices of equal (capacity) shape.
Enumerations, scalar traits and scalar concepts shared by every public header.
size_t iluk_apply_buffer_size(Queue &ctx, const ILUKView< T > &M, const MatrixView< T, MatrixFormat::Dense > &rhs, const MatrixView< T, MatrixFormat::Dense > &out)
Bytes of workspace iluk_apply needs; currently always 0.
void iluk_build_level_schedule(ILUKPreconditioner< T > &M)
Builds the triangular-solve level schedule from M.lu's sparsity pattern.
size_t iluk_buffer_size(Queue &ctx, const MatrixView< T, MatrixFormat::CSR > &A, const ILUKParams< T > ¶ms=ILUKParams< T >())
Bytes of workspace the Span overload of iluk_factorize needs for A.
Event iluk_apply(Queue &ctx, const ILUKView< T > &M, const MatrixView< T, MatrixFormat::Dense > &rhs, const MatrixView< T, MatrixFormat::Dense > &out, Span< std::byte > workspace=Span< std::byte >())
Applies the ILU(k) preconditioner: out := rhs.
ILUKPreconditioner< T > iluk_factorize(Queue &ctx, const MatrixView< T, MatrixFormat::CSR > &A, const ILUKParams< T > ¶ms=ILUKParams< T >())
Computes the ILU(k) factor of a batch of CSR matrices into owned storage.
The batched containers: Matrix (owning), MatrixView (non-owning), KernelMatrixView (device-side),...
Backend deduction from the Queue and the USM pointer check.
#define BATCHLAS_DISPATCH_ON_QUEUE(NAME)
Completion handle of enqueued work, returned by every entry point.
Parameters of an incomplete LU factorization with level-of-fill k, ILU(k).
int levels_of_fill
k; 0 keeps exactly A's pattern. Must be >= 0.
base_type< T >::type drop_tolerance
relative drop threshold; >= 0
base_type< T >::type fill_factor
per-row cap on kept entries relative to A's row; >= 1
base_type< T >::type diag_pivot_threshold
relative pivot threshold; >= 0
bool validate_batch_sparsity
Check that every batch item shares one CSR pattern.
T diagonal_shift
added to (or substituted for) a pivot that is too small
bool modified_ilu
add dropped entries to the diagonal (MILU) instead of discarding them
Owning ILU(k) factor of a batch of CSR matrices sharing one pattern.
UnifiedVector< int > u_rows
row indices ordered by backward-solve level
T diagonal_shift
the ILUKParams value it was built with
bool modified_ilu
the ILUKParams value it was built with
base_type< T >::type drop_tolerance
the ILUKParams value it was built with
int n
order of each matrix
UnifiedVector< int > l_rows
row indices ordered by forward-solve level
UnifiedVector< int > u_level_ptr
size u_levels + 1
UnifiedVector< int > diag_positions
size n * batch_size
int u_levels
number of backward-solve levels
bool u_diagonals_usable
Whether every U diagonal can be made non-singular with diagonal_shift.
int batch_size
number of matrices
int levels_of_fill
the ILUKParams value it was built with
ILUKView< T > view() const
Non-owning view of this factor; valid while *this is alive and unmodified.
ILUKPreconditioner()
1x1 placeholder with a single stored non-zero; iluk_factorize replaces it.
UnifiedVector< int > l_level_ptr
size l_levels + 1
base_type< T >::type fill_factor
the ILUKParams value it was built with
Matrix< T, MatrixFormat::CSR > lu
L (strict lower, unit diagonal implied) and U (upper, with diagonal).
base_type< T >::type diag_pivot_threshold
the ILUKParams value it was built with
int l_levels
number of forward-solve levels
Non-owning description of a factored ILU(k) preconditioner.
int u_levels
number of backward-solve levels
Span< int > l_level_ptr
size l_levels + 1
Span< int > u_level_ptr
size u_levels + 1
int n
order of each matrix
Span< int > diag_positions
size n * batch_size, absolute indices into lu's values
Span< int > l_rows
row indices ordered by forward-solve level
Span< int > u_rows
row indices ordered by backward-solve level
T diagonal_shift
shift the apply uses on U's diagonal
MatrixView< T, MatrixFormat::CSR > lu
L (strict lower, unit diagonal implied) and U (upper, with diagonal).
int batch_size
number of matrices
bool u_diagonals_usable
every U diagonal is non-zero after the shift
int l_levels
number of forward-solve levels
Non-zero count (per-item capacity) of a CSR matrix, as a distinct type.
Where BatchLAS work runs: a device, a backend, an ordered SYCL queue and a workspace arena.
Non-owning view of size() contiguous elements of type T.
Owning, growable array of T in USM shared memory (sycl::malloc_shared).
batchlas::Device, batchlas::Event and batchlas::Queue: where work runs and how it is ordered.
batchlas::Span, the non-owning pointer + length every entry point takes for 1-D data.
batchlas::UnifiedVector, an owning growable array in USM shared memory.