Eigen-Contrib  5.0.1
 
Loading...
Searching...
No Matches
GpuSparseLLT.h
1// This file is part of Eigen, a lightweight C++ template library
2// for linear algebra.
3//
4// Copyright (C) 2026 Rasmus Munk Larsen <rmlarsen@gmail.com>
5//
6// This Source Code Form is subject to the terms of the Mozilla
7// Public License v. 2.0. If a copy of the MPL was not distributed
8// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9// SPDX-License-Identifier: MPL-2.0
10
11// GPU sparse Cholesky (LL^T / LL^H) via cuDSS.
12
13#ifndef EIGEN_GPU_SPARSE_LLT_H
14#define EIGEN_GPU_SPARSE_LLT_H
15
16// IWYU pragma: private
17#include "./InternalHeaderCheck.h"
18
19#include "./GpuSparseSolverBase.h"
20
21namespace Eigen {
22namespace gpu {
23
33template <typename Scalar_, int UpLo_ = Lower>
34class SparseLLT : public internal::SparseSolverBase<Scalar_, SparseLLT<Scalar_, UpLo_>> {
36 friend Base;
37
38 public:
39 using Scalar = Scalar_;
40 static constexpr int UpLo = UpLo_;
41
42 SparseLLT() = default;
43
46 explicit SparseLLT(Context& ctx) : Base(ctx) {}
47
48 template <typename InputType>
49 explicit SparseLLT(const SparseMatrixBase<InputType>& A) {
50 this->compute(A);
51 }
52
54 template <typename InputType>
55 SparseLLT(Context& ctx, const SparseMatrixBase<InputType>& A) : Base(ctx) {
56 this->compute(A);
57 }
58
59 static constexpr bool needs_csr_conversion() { return false; }
60 static constexpr cudssMatrixType_t cudss_matrix_type() { return internal::cudss_spd_type<Scalar>::value; }
61 static constexpr cudssMatrixViewType_t cudss_matrix_view() {
62 return internal::cudss_view_type<UpLo, ColMajor>::value;
63 }
64};
65
66} // namespace gpu
67} // namespace Eigen
68
69#endif // EIGEN_GPU_SPARSE_LLT_H
Unified GPU execution context owning a CUDA stream and library handles.
Definition GpuContext.h:81
Definition GpuSparseLLT.h:34
SparseLLT(Context &ctx)
Definition GpuSparseLLT.h:46
SparseLLT(Context &ctx, const SparseMatrixBase< InputType > &A)
Definition GpuSparseLLT.h:55
Definition GpuSparseSolverBase.h:139
SparseLLT< Scalar_, Lower > & compute(const SparseMatrixBase< InputType > &A)
Definition GpuSparseSolverBase.h:223
Namespace containing all symbols from the Eigen library.