rename parameters to avoid shadowing member variables

This commit is contained in:
Arne Morten Kvarving 2024-08-13 11:24:35 +02:00
parent 9b9ae24909
commit 4577469e19
3 changed files with 19 additions and 19 deletions

View File

@ -95,14 +95,14 @@ analyze_matrix(BlockedMatrix<Scalar> *mat_) {
template <class Scalar, unsigned int block_size> template <class Scalar, unsigned int block_size>
bool rocsparseCPR<Scalar, block_size>:: bool rocsparseCPR<Scalar, block_size>::
analyze_matrix(BlockedMatrix<Scalar> *mat_, analyze_matrix(BlockedMatrix<Scalar> *mat_,
BlockedMatrix<Scalar> *jacMat) BlockedMatrix<Scalar> *jacMat_)
{ {
this->Nb = mat_->Nb; this->Nb = mat_->Nb;
this->nnzb = mat_->nnzbs; this->nnzb = mat_->nnzbs;
this->N = Nb * block_size; this->N = Nb * block_size;
this->nnz = nnzb * block_size * block_size; this->nnz = nnzb * block_size * block_size;
bool success = bilu0->analyze_matrix(mat_, jacMat); bool success = bilu0->analyze_matrix(mat_, jacMat_);
this->mat = mat_; this->mat = mat_;
return success; return success;
@ -111,10 +111,10 @@ analyze_matrix(BlockedMatrix<Scalar> *mat_,
template <class Scalar, unsigned int block_size> template <class Scalar, unsigned int block_size>
bool rocsparseCPR<Scalar, block_size>:: bool rocsparseCPR<Scalar, block_size>::
create_preconditioner(BlockedMatrix<Scalar> *mat_, create_preconditioner(BlockedMatrix<Scalar> *mat_,
BlockedMatrix<Scalar> *jacMat) BlockedMatrix<Scalar> *jacMat_)
{ {
Dune::Timer t_bilu0; Dune::Timer t_bilu0;
bool result = bilu0->create_preconditioner(mat_, jacMat); bool result = bilu0->create_preconditioner(mat_, jacMat_);
if (verbosity >= 3) { if (verbosity >= 3) {
std::ostringstream out; std::ostringstream out;
out << "rocsparseCPR create_preconditioner bilu0(): " << t_bilu0.stop() << " s"; out << "rocsparseCPR create_preconditioner bilu0(): " << t_bilu0.stop() << " s";

View File

@ -46,24 +46,24 @@ create(PreconditionerType type,
template <class Scalar, unsigned int block_size> template <class Scalar, unsigned int block_size>
void rocsparsePreconditioner<Scalar, block_size>:: void rocsparsePreconditioner<Scalar, block_size>::
set_matrix_analysis(rocsparse_mat_descr descr_L, set_matrix_analysis(rocsparse_mat_descr desc_L,
rocsparse_mat_descr descr_U) rocsparse_mat_descr desc_U)
{ {
descr_L = descr_L; descr_L = desc_L;
descr_U = descr_U; descr_U = desc_U;
} }
template <class Scalar, unsigned int block_size> template <class Scalar, unsigned int block_size>
void rocsparsePreconditioner<Scalar, block_size>:: void rocsparsePreconditioner<Scalar, block_size>::
set_context(rocsparse_handle handle, set_context(rocsparse_handle handle_,
rocsparse_direction dir, rocsparse_direction dir_,
rocsparse_operation operation, rocsparse_operation operation_,
hipStream_t stream) hipStream_t stream_)
{ {
this->handle = handle; this->handle = handle_;
this->dir = dir; this->dir = dir_;
this->operation = operation; this->operation = operation_;
this->stream = stream; this->stream = stream_;
} }
template <class Scalar, unsigned int block_size> template <class Scalar, unsigned int block_size>

View File

@ -98,11 +98,11 @@ rocsparseSolverBackend(int verbosity_, int maxit_, Scalar tolerance_,
ROCSPARSE_CHECK(rocsparse_set_stream(handle, stream)); ROCSPARSE_CHECK(rocsparse_set_stream(handle, stream));
ROCBLAS_CHECK(rocblas_set_stream(blas_handle, stream)); ROCBLAS_CHECK(rocblas_set_stream(blas_handle, stream));
using PreconditionerType = typename Opm::Accelerator::PreconditionerType; using PCType = typename Opm::Accelerator::PreconditionerType;
if (use_cpr) { if (use_cpr) {
prec = rocsparsePreconditioner<Scalar, block_size>::create(PreconditionerType::CPR, verbosity); prec = rocsparsePreconditioner<Scalar, block_size>::create(PCType::CPR, verbosity);
} else { } else {
prec = rocsparsePreconditioner<Scalar, block_size>::create(PreconditionerType::BILU0, verbosity); prec = rocsparsePreconditioner<Scalar, block_size>::create(PCType::BILU0, verbosity);
} }
prec->set_context(handle, dir, operation, stream); prec->set_context(handle, dir, operation, stream);