#include <deal.II/base/config.h>
#include <deal.II/base/cuda.h>
+#include <deal.II/base/smartpointer.h>
#include <memory>
*/
csrsv2Info_t info_Lt;
+ /**
+ * Pointer to the matrix this object was initialized with.
+ */
+ SmartPointer<const SparseMatrix<Number>> matrix_pointer;
+
/**
* Pointer to the values (on the device) of the computed preconditioning
* matrix.
/**
* Pointer to the row pointer (on the device) of the sparse matrix this
- * object was initialized with.
+ * object was initialized with. Guarded by matrix_pointer.
*/
const int *P_row_ptr_dev;
/**
* Pointer to the column indices (on the device) of the sparse matrix this
- * object was initialized with.
+ * object was initialized with. Guarded by matrix_pointer.
*/
const int *P_column_index_dev;
*/
csrsv2Info_t info_U;
+ /**
+ * Pointer to the matrix this object was initialized with.
+ */
+ SmartPointer<const SparseMatrix<Number>> matrix_pointer;
+
/**
* Pointer to the values (on the device) of the computed preconditioning
* matrix.
/**
* Pointer to the row pointer (on the device) of the sparse matrix this
- * object was initialized with.
+ * object was initialized with. Guarded by matrix_pointer.
*/
const int *P_row_ptr_dev;
/**
* Pointer to the column indices (on the device) of the sparse matrix this
- * object was initialized with.
+ * object was initialized with. Guarded by matrix_pointer.
*/
const int *P_column_index_dev;
n_nonzero_elements = A.n_nonzero_elements();
AssertDimension(A.m(), A.n());
+ matrix_pointer = &A;
const auto cusparse_matrix = A.get_cusparse_matrix();
const Number *const A_val_dev = std::get<0>(cusparse_matrix);
policy_M = CUSPARSE_SOLVE_POLICY_NO_LEVEL;
}
-
+ matrix_pointer = &A;
n_rows = A.m();
n_nonzero_elements = A.n_nonzero_elements();
AssertDimension(A.m(), A.n());