Skip to main content

BatchedSolver

Struct BatchedSolver 

Source
pub struct BatchedSolver { /* private fields */ }
Expand description

Batched matrix factorization engine.

Each thread block handles one matrix. For very small matrices (n <= 16), multiple matrices per thread block. All computation in registers/shared memory.

Implementations§

Source§

impl BatchedSolver

Source

pub fn new(handle: SolverHandle) -> Self

Creates a new batched solver.

Source

pub fn handle(&self) -> &SolverHandle

Returns a reference to the underlying solver handle.

Source

pub fn handle_mut(&mut self) -> &mut SolverHandle

Returns a mutable reference to the underlying solver handle.

Source

pub fn batched_lu<T: GpuFloat>( &mut self, matrices: &mut DeviceBuffer<T>, pivots: &mut DeviceBuffer<i32>, n: usize, batch_count: usize, ) -> SolverResult<BatchedResult>

Batched LU factorization: factorize batch_count matrices of size n x n.

Input: matrices[batch_count * n * n] (column-major, contiguous). Output: in-place LU factors, pivots[batch_count * n].

§Errors

Returns SolverError::DimensionMismatch if buffer sizes are incorrect or matrix size is out of range.

Source

pub fn batched_qr<T: GpuFloat>( &mut self, matrices: &mut DeviceBuffer<T>, tau: &mut DeviceBuffer<T>, m: usize, n: usize, batch_count: usize, ) -> SolverResult<BatchedResult>

Batched QR factorization.

Output: in-place QR factors, tau[batch_count * min(m, n)] (Householder scalars).

§Arguments
  • matrices — contiguous buffer of batch_count matrices, each m x n, column-major.
  • tau — output Householder scalars, length batch_count * min(m, n).
  • m — number of rows per matrix.
  • n — number of columns per matrix.
  • batch_count — number of matrices.
§Errors

Returns SolverError::DimensionMismatch if buffer sizes are incorrect.

Source

pub fn batched_cholesky<T: GpuFloat>( &mut self, matrices: &mut DeviceBuffer<T>, n: usize, batch_count: usize, ) -> SolverResult<BatchedResult>

Batched Cholesky factorization (for SPD matrices).

Output: in-place lower triangular Cholesky factors.

§Arguments
  • matrices — contiguous buffer of batch_count SPD matrices, each n x n.
  • n — matrix dimension.
  • batch_count — number of matrices.
§Errors

Returns SolverError::DimensionMismatch if buffer sizes are incorrect.

Source

pub fn batched_solve<T: GpuFloat>( &mut self, a_matrices: &mut DeviceBuffer<T>, b_matrices: &mut DeviceBuffer<T>, n: usize, nrhs: usize, batch_count: usize, ) -> SolverResult<BatchedResult>

Batched linear solve using LU: solve A_i * X_i = B_i for each i.

First performs batched LU factorization on a_matrices, then uses the factors to solve the system. Both a_matrices and b_matrices are modified in-place.

§Arguments
  • a_matrices — contiguous batch_count coefficient matrices (n x n each).
  • b_matrices — contiguous batch_count RHS matrices (n x nrhs each).
  • n — system dimension.
  • nrhs — number of right-hand sides.
  • batch_count — number of systems to solve.
§Errors

Returns SolverError::DimensionMismatch if dimensions are invalid.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more