chol#

Perform a Cholesky factorization.

Note

The input matrix must be symmetric positive-definite

Note

CUDA JIT kernel fusion is supported by cuSolverDx if -DMATX_EN_MATHDX=ON is enabled. The current JIT path supports rank 2 through 4 square matrices with float, double, complex<float>, and complex<double> values. Unsupported ranks, shapes, or data types should use a normal executor and will be rejected by CUDAJITExecutor.

Added in version 0.6.0.

template<typename OpA>
__MATX_INLINE__ auto matx::chol(const OpA &a, SolverFillMode uplo = SolverFillMode::UPPER)#

Performs a Cholesky factorization, saving the result in either the upper or lower triangle of the output.

If rank > 2, operations are batched.

Template Parameters:

OpA – Data type of input a tensor or operator

Parameters:
  • a – Input tensor or operator of shape ... x n x n

  • uplo – Part of matrix to fill

Returns:

Operator that produces the factorization output of shape ... x n x n.

template<typename OpA>
__MATX_INLINE__ auto matx::chol(const OpA &a, const SolverStatus &status, SolverFillMode uplo = SolverFillMode::UPPER)#

Performs a Cholesky factorization, reporting per-matrix errors through a solver status.

Same as chol(a, uplo), except each matrix’s potrf info value is written to stage 0 of status and, on CUDA executors, the call does not synchronize the stream (see the Solver Status docs for when it can). A positive value i means the leading minor of order i is not positive definite. Check the result after synchronizing, as for qr_solver(a, status). Not supported with CUDAJITExecutor or distributed tensors.

Template Parameters:

OpA – Data type of input a tensor or operator

Parameters:
  • a – Input tensor or operator of shape ... x n x n

  • status – Solver status created with make_solver_status() for an input shaped like a

  • uplo – Part of matrix to fill

Returns:

Operator that produces the factorization output of shape ... x n x n.

Note

The overload that takes a solver status writes each matrix’s potrf info value into the status instead of synchronizing the stream to check it. A positive value i means the leading minor of order i is not positive definite. It is not supported with CUDAJITExecutor.

Enums#

The following enums are used for configuring the behavior of Cholesky operations.

enum class matx::SolverFillMode#

Indicates which part (lower or upper) of the dense matrix was filled and should be used by the function.

Values:

enumerator UPPER#

Use the upper part of the matrix

enumerator LOWER#

Use the lower part of the matrix

Examples#

(Bv = chol(Bv, SolverFillMode::LOWER)).run(this->exec);