From: Daniel Arndt Date: Sun, 19 Aug 2018 22:23:29 +0000 (+0200) Subject: Use SmartPointer X-Git-Tag: v9.1.0-rc1~769^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4320cce7bef35e87fff6bd75f690d5616423f6c7;p=dealii.git Use SmartPointer --- diff --git a/include/deal.II/lac/cuda_precondition.h b/include/deal.II/lac/cuda_precondition.h index 73ce2a6440..8da6e50348 100644 --- a/include/deal.II/lac/cuda_precondition.h +++ b/include/deal.II/lac/cuda_precondition.h @@ -19,6 +19,7 @@ #include #include +#include #include @@ -189,6 +190,11 @@ namespace CUDAWrappers */ csrsv2Info_t info_Lt; + /** + * Pointer to the matrix this object was initialized with. + */ + SmartPointer> matrix_pointer; + /** * Pointer to the values (on the device) of the computed preconditioning * matrix. @@ -197,13 +203,13 @@ namespace CUDAWrappers /** * 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; @@ -403,6 +409,11 @@ namespace CUDAWrappers */ csrsv2Info_t info_U; + /** + * Pointer to the matrix this object was initialized with. + */ + SmartPointer> matrix_pointer; + /** * Pointer to the values (on the device) of the computed preconditioning * matrix. @@ -411,13 +422,13 @@ namespace CUDAWrappers /** * 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; diff --git a/source/lac/cuda_precondition.cu b/source/lac/cuda_precondition.cu index 26ab5d5832..0030d5ca05 100644 --- a/source/lac/cuda_precondition.cu +++ b/source/lac/cuda_precondition.cu @@ -1311,6 +1311,7 @@ namespace CUDAWrappers 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); @@ -1626,7 +1627,7 @@ namespace CUDAWrappers 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());