Tridiagonal and band reduction: lower-level API

Overview

Kernel-level reductions and solvers (CTA, single-step band reduction, latrd panel, Francis sweep) and workspace queries.

Functions

◆ tridiagonal_solver_buffer_size()

template<Backend B, typename T>
size_t batchlas::tridiagonal_solver_buffer_size ( Queue & ctx,
size_t n,
size_t batch_size,
JobType jobz )

Required workspace, in bytes, for tridiagonal_solver().

◆ stebz_buffer_size()

template<Backend B, typename T>
size_t batchlas::stebz_buffer_size ( Queue & ctx,
size_t n,
size_t batch_size,
StebzParams< T > params )

Required workspace size, in bytes, for stebz().

Trap
params is REQUIRED, not defaulted: it is the only argument carrying T, and defaulting it silently drops the queue-deducing overload. Pass StebzParams<T>{}.

◆ stein_buffer_size()

template<Backend B, typename T>
size_t batchlas::stein_buffer_size ( Queue & ctx,
size_t n,
size_t k,
size_t batch_size,
SteinParams< T > params )

Required workspace size, in bytes, for stein().

Sizes on the capacity k, so the counts overload needs no sizing entry of its own.

Trap
params is REQUIRED, as for stebz_buffer_size(): it is the only argument carrying T.

◆ steqr_cta()

template<Backend B, typename T>
Event batchlas::steqr_cta ( Queue & ctx,
const VectorView< T > & d,
const VectorView< T > & e,
const VectorView< T > & eigenvalues,
const Span< std::byte > & ws,
JobType jobz = JobType::NoEigenVectors,
SteqrParams< T > params = SteqrParams< T >(),
const MatrixView< T, MatrixFormat::Dense > & eigvects = MatrixView< T, MatrixFormat::Dense >(),
Span< int32_t > info = Span< int32_t >() )

steqr() pinned to the CTA kernel: one sub-group partition per matrix, for small n (runtime-dispatched to compile-time specialised kernels).

Parameters as for steqr().

Exceptions
batchlas::invalid_argumentunless 1 <= n <= 32
batchlas::convergence_errorif BATCHLAS_STEQR_CTA_CHECK is set and an item ran out of sweeps (the check waits on the queue; unset, nothing is thrown)

◆ steqr_buffer_size()

template<typename T>
size_t batchlas::steqr_buffer_size ( Queue & ctx,
const VectorView< T > & d,
const VectorView< T > & e,
const VectorView< T > & eigenvalues,
JobType jobz = JobType::NoEigenVectors,
SteqrParams< T > params = SteqrParams< T >() )

Required workspace, in bytes, for steqr(); arguments as for the call.

◆ steqr_cta_buffer_size()

template<typename T>
size_t batchlas::steqr_cta_buffer_size ( Queue & ctx,
const VectorView< T > & d,
const VectorView< T > & e,
const VectorView< T > & eigenvalues,
JobType jobz = JobType::NoEigenVectors,
SteqrParams< T > params = SteqrParams< T >() )

Required workspace, in bytes, for steqr_cta(); arguments as for the call.

◆ sytrd_cta()

template<Backend B, typename T>
Event batchlas::sytrd_cta ( Queue & ctx,
const MatrixView< T, MatrixFormat::Dense > & a_in,
const VectorView< T > & d_out,
const VectorView< T > & e_out,
const VectorView< T > & tau_out,
Uplo uplo,
const Span< std::byte > & ws,
size_t cta_wg_size_multiplier = 1 )

CTA-optimized symmetric tridiagonal reduction (SYTD2-style), n <= 32.

Overwrites A with the tridiagonal and reflector storage and returns (d,e) plus reflector scalars in tau. ws is unused, kept for API compatibility.

◆ latrd_lower_panel() [1/2]

template<Backend B, typename T>
Event batchlas::latrd_lower_panel ( Queue & ctx,
const MatrixView< T, MatrixFormat::Dense > & a_in,
const VectorView< T > & e_out,
const VectorView< T > & tau_out,
const MatrixView< T, MatrixFormat::Dense > & w_in,
int32_t j0,
int32_t ib,
int32_t wg_hint = 0,
bool fuse_trailing_update = false )

LATRD-like panel factorization used by blocked SYTRD, Uplo::Lower only.

Householder vectors go into A, in sytrd's SYTD2-style reflector layout; only the first ib columns of W are written (W is treated as n x nb).

Parameters
j0first column of the panel
ibpanel width
wg_hintwork-group size hint; 0 lets the implementation choose
fuse_trailing_updatefold the panel's share of the trailing update into the kernel

◆ latrd_lower_panel() [2/2]

template<Backend B, typename T>
Event batchlas::latrd_lower_panel ( Queue & ctx,
const MatrixView< T, MatrixFormat::Dense > & a_panel_in,
const VectorView< T > & e_panel_out,
const VectorView< T > & tau_panel_out,
const MatrixView< T, MatrixFormat::Dense > & w_panel_in,
int32_t wg_hint = 0,
bool fuse_trailing_update = false )

LATRD-like panel factorization (Lower only), view-based overload.

Pass pre-sliced views instead of (j0, ib):

  • a_panel = A({j0, SliceEnd()}, {j0, SliceEnd()}) (must be square)
  • e_panel = E(Slice(j0, j0 + ib))
  • tau_panel = TAU(Slice(j0, j0 + ib))
  • w_panel = Wmat({j0, SliceEnd()}, {0, ib}) e_panel/tau_panel size must match w_panel.cols().

◆ sytrd_blocked_buffer_size()

template<Backend B, typename T>
size_t batchlas::sytrd_blocked_buffer_size ( Queue & ctx,
const MatrixView< T, MatrixFormat::Dense > & a,
const VectorView< T > & d,
const VectorView< T > & e,
const VectorView< T > & tau,
Uplo uplo,
int32_t block_size = tuning::SYTRD_BLOCK_SIZE_MEDIUM )

Required workspace, in bytes, for sytrd_blocked(); arguments as for the call.

◆ sytrd_sy2sb()

template<Backend B, typename T>
Event batchlas::sytrd_sy2sb ( Queue & ctx,
const MatrixView< T, MatrixFormat::Dense > & a_in,
const MatrixView< T, MatrixFormat::Dense > & ab_out,
const VectorView< T > & tau_out,
Uplo uplo,
int32_t kd,
const Span< std::byte > & ws )

First stage of two-stage reduction: dense -> band (LAPACK xSYTRD_SY2SB).

Overwrites A with reflector storage and writes the band into AB; tau_out has size (n-kd). In-order queue, Uplo::Lower only.

Band storage (AB), shape (kd+1) x n:

  • Uplo::Lower: AB(1+i-j,j) = A(i,j) for j<=i<=min(n,j+kd).
  • Uplo::Upper: AB(kd+1+i-j,j) = A(i,j) for max(1,j-kd)<=i<=j.

◆ sytrd_sy2sb_buffer_size()

template<Backend B, typename T>
size_t batchlas::sytrd_sy2sb_buffer_size ( Queue & ctx,
const MatrixView< T, MatrixFormat::Dense > & a_in,
const MatrixView< T, MatrixFormat::Dense > & ab_out,
const VectorView< T > & tau_out,
Uplo uplo,
int32_t kd )

Required workspace, in bytes, for sytrd_sy2sb(); arguments as for the call.

◆ sytrd_sb2st()

template<Backend B, typename T>
Event batchlas::sytrd_sb2st ( Queue & ctx,
const MatrixView< T, MatrixFormat::Dense > & ab_in,
const VectorView< typename base_type< T >::type > & d_out,
const VectorView< typename base_type< T >::type > & e_out,
const VectorView< T > & tau_out,
Uplo uplo,
int32_t kd,
const Span< std::byte > & ws,
int32_t block_size )

Second stage of two-stage reduction: band -> tridiagonal (LAPACK xSB2ST/xHB2ST bulge chasing, VECT='N').

In-order queue, Uplo::Lower only.

Band storage (AB) is as for sytrd_sy2sb. d_out (n) and e_out (n-1) are always real-valued; tau_out (n-1) is unused downstream and is set to 0.

◆ sytrd_sb2st_buffer_size()

template<Backend B, typename T>
size_t batchlas::sytrd_sb2st_buffer_size ( Queue & ctx,
const MatrixView< T, MatrixFormat::Dense > & ab_in,
const VectorView< typename base_type< T >::type > & d_out,
const VectorView< typename base_type< T >::type > & e_out,
const VectorView< T > & tau_out,
Uplo uplo,
int32_t kd,
int32_t block_size )

Required workspace, in bytes, for sytrd_sb2st(); arguments as for the call.

◆ sytrd_band_reduction_buffer_size() [1/2]

template<Backend B, typename T>
size_t batchlas::sytrd_band_reduction_buffer_size ( Queue & ctx,
const MatrixView< T, MatrixFormat::Dense > & ab_in,
const VectorView< typename base_type< T >::type > & d_out,
const VectorView< typename base_type< T >::type > & e_out,
const VectorView< T > & tau_out,
Uplo uplo,
int32_t kd,
int32_t block_size )

Required workspace, in bytes, for sytrd_band_reduction() with one block size.

◆ sytrd_band_reduction_buffer_size() [2/2]

template<Backend B, typename T>
size_t batchlas::sytrd_band_reduction_buffer_size ( Queue & ctx,
const MatrixView< T, MatrixFormat::Dense > & ab_in,
const VectorView< typename base_type< T >::type > & d_out,
const VectorView< typename base_type< T >::type > & e_out,
const VectorView< T > & tau_out,
Uplo uplo,
int32_t kd,
SytrdBandReductionParams params )

Required workspace, in bytes, for the schedule-parameter sytrd_band_reduction().

◆ stedc_buffer_size()

template<Backend B, typename T>
size_t batchlas::stedc_buffer_size ( Queue & ctx,
size_t n,
size_t batch_size,
JobType jobz,
StedcParams< T > params )

Required workspace, in bytes, for stedc().

◆ sytrd_band_reduction_single_step()

template<Backend B, typename T>
Event batchlas::sytrd_band_reduction_single_step ( Queue & ctx,
const MatrixView< T, MatrixFormat::Dense > & ab_in,
const MatrixView< T, MatrixFormat::Dense > & abw_out,
Uplo uplo,
int32_t kd,
const Span< std::byte > & ws,
SytrdBandReductionParams params )

Debug/testing hook: execute exactly one BANDR1 “chase step”.

Not a stable public API. ab_in is lower-band with rows == kd+1, abw_out lower-band with rows == kd_work+1 (kd_work from params). In-order queue, Lower only.

◆ sytrd_band_reduction_single_step_buffer_size()

template<Backend B, typename T>
size_t batchlas::sytrd_band_reduction_single_step_buffer_size ( Queue & ctx,
const MatrixView< T, MatrixFormat::Dense > & ab_in,
const MatrixView< T, MatrixFormat::Dense > & abw_out,
Uplo uplo,
int32_t kd,
SytrdBandReductionParams params )

Required workspace, in bytes, for sytrd_band_reduction_single_step().