Reference documentation for deal.II version 9.6.0
|
#include <deal.II/lac/cuda_precondition.h>
Classes | |
struct | AdditionalData |
Public Types | |
using | size_type = int |
Public Member Functions | |
PreconditionILU (const Utilities::CUDA::Handle &handle) | |
PreconditionILU (const PreconditionILU< Number > &)=delete | |
PreconditionILU & | operator= (const PreconditionILU< Number > &)=delete |
~PreconditionILU () | |
void | initialize (const SparseMatrix< Number > &matrix, const AdditionalData &additional_data=AdditionalData()) |
void | vmult (LinearAlgebra::CUDAWrappers::Vector< Number > &dst, const LinearAlgebra::CUDAWrappers::Vector< Number > &src) const |
void | Tvmult (LinearAlgebra::CUDAWrappers::Vector< Number > &dst, const LinearAlgebra::CUDAWrappers::Vector< Number > &src) const |
size_type | m () const |
size_type | n () const |
Private Attributes | |
cusparseHandle_t | cusparse_handle |
cusparseMatDescr_t | descr_M |
cusparseMatDescr_t | descr_L |
cusparseMatDescr_t | descr_U |
csrilu02Info_t | info_M |
csrsv2Info_t | info_L |
csrsv2Info_t | info_U |
SmartPointer< const SparseMatrix< Number > > | matrix_pointer |
std::unique_ptr< Number[], void(*)(Number *)> | P_val_dev |
const int * | P_row_ptr_dev |
const int * | P_column_index_dev |
std::unique_ptr< Number[], void(*)(Number *)> | tmp_dev |
std::unique_ptr< void, void(*)(void *)> | buffer_dev |
cusparseSolvePolicy_t | policy_L |
cusparseSolvePolicy_t | policy_U |
cusparseSolvePolicy_t | policy_M |
int | n_rows |
int | n_nonzero_elements |
This class implements an incomplete LU factorization preconditioner for CUDAWrappers::SparseMatrix matrices.
The implementation closely follows the one documented in the cuSPARSE documentation (https://docs.nvidia.com/cuda/cusparse/index.html#cusparse-lt-t-gt-csrilu02).
<float> and <double>
. Definition at line 274 of file cuda_precondition.h.
using CUDAWrappers::PreconditionILU< Number >::size_type = int |
Declare the type for container size.
Definition at line 280 of file cuda_precondition.h.
CUDAWrappers::PreconditionILU< Number >::PreconditionILU | ( | const Utilities::CUDA::Handle & | handle | ) |
Constructor.
Definition at line 1503 of file cuda_precondition.cc.
|
delete |
The copy constructor is deleted.
CUDAWrappers::PreconditionILU< Number >::~PreconditionILU | ( | ) |
Destructor. Free all resources that were initialized in this class.
Definition at line 1567 of file cuda_precondition.cc.
|
delete |
The copy assignment operator is deleted.
void CUDAWrappers::PreconditionILU< Number >::initialize | ( | const SparseMatrix< Number > & | matrix, |
const AdditionalData & | additional_data = AdditionalData() ) |
Initialize this object. In particular, the given matrix is copied to be modified in-place. For the underlying sparsity pattern pointers are stored. Specifically, this means that the current object can only be used reliably as long as matrix
is valid and has not been changed since calling this function.
The additional_data
determines if level information are used.
Definition at line 1593 of file cuda_precondition.cc.
void CUDAWrappers::PreconditionILU< Number >::vmult | ( | LinearAlgebra::CUDAWrappers::Vector< Number > & | dst, |
const LinearAlgebra::CUDAWrappers::Vector< Number > & | src ) const |
Apply the preconditioner.
Definition at line 1751 of file cuda_precondition.cc.
void CUDAWrappers::PreconditionILU< Number >::Tvmult | ( | LinearAlgebra::CUDAWrappers::Vector< Number > & | dst, |
const LinearAlgebra::CUDAWrappers::Vector< Number > & | src ) const |
Apply the transposed preconditioner. Not yet implemented.
Definition at line 1806 of file cuda_precondition.cc.
size_type CUDAWrappers::PreconditionILU< Number >::m | ( | ) | const |
Return the dimension of the codomain (or range) space. Note that the matrix is square and has dimension \(m \times m\).
size_type CUDAWrappers::PreconditionILU< Number >::n | ( | ) | const |
Return the dimension of the codomain (or range) space. Note that the matrix is square and has dimension \(n \times n\).
|
private |
cuSPARSE handle used to call cuSPARSE functions.
Definition at line 377 of file cuda_precondition.h.
|
private |
cuSPARSE description of the sparse matrix \(M=LU\).
Definition at line 382 of file cuda_precondition.h.
|
private |
cuSPARSE description of the lower triangular matrix \(L\).
Definition at line 387 of file cuda_precondition.h.
|
private |
cuSPARSE description of the upper triangular matrix \(U\).
Definition at line 392 of file cuda_precondition.h.
|
private |
Solve and analysis structure for \(M=LU\).
Definition at line 397 of file cuda_precondition.h.
|
private |
Solve and analysis structure for the lower triangular matrix \(L\).
Definition at line 402 of file cuda_precondition.h.
|
private |
Solve and analysis structure for the upper triangular matrix \(U\).
Definition at line 407 of file cuda_precondition.h.
|
private |
Pointer to the matrix this object was initialized with.
Definition at line 412 of file cuda_precondition.h.
|
private |
Pointer to the values (on the device) of the computed preconditioning matrix.
Definition at line 418 of file cuda_precondition.h.
|
private |
Pointer to the row pointer (on the device) of the sparse matrix this object was initialized with. Guarded by matrix_pointer.
Definition at line 424 of file cuda_precondition.h.
|
private |
Pointer to the column indices (on the device) of the sparse matrix this object was initialized with. Guarded by matrix_pointer.
Definition at line 430 of file cuda_precondition.h.
|
private |
Pointer to the value (on the device) for a temporary (helper) vector used in vmult().
Definition at line 436 of file cuda_precondition.h.
|
private |
Pointer to an internal buffer (on the device) that is used for computing the decomposition.
Definition at line 442 of file cuda_precondition.h.
|
private |
Determine if level information should be generated for the lower triangular matrix \(L\). This value can be modified through an AdditionalData object.
Definition at line 449 of file cuda_precondition.h.
|
private |
Determine if level information should be generated for the upper triangular matrix \(U\). This value can be modified through an AdditionalData object.
Definition at line 456 of file cuda_precondition.h.
|
private |
Determine if level information should be generated for \(M=LU\). This value can be modified through an AdditionalData object.
Definition at line 462 of file cuda_precondition.h.
|
private |
The number of rows is the same as for the matrix this object has been initialized with.
Definition at line 468 of file cuda_precondition.h.
|
private |
The number of non-zero elements is the same as for the matrix this object has been initialized with.
Definition at line 474 of file cuda_precondition.h.