more scalars

This commit is contained in:
Razvan Nane 2024-06-05 15:27:22 +02:00
parent 40c0539bc3
commit b51f27517b
4 changed files with 7 additions and 7 deletions

View File

@ -47,10 +47,10 @@ public:
protected:
int num_levels;
std::vector<double> weights, coarse_vals, coarse_x, coarse_y;
std::vector<Scalar> weights, coarse_vals, coarse_x, coarse_y;
std::vector<Matrix<Scalar>> Amatrices, Rmatrices; // scalar matrices that represent the AMG hierarchy
std::vector<std::vector<int> > PcolIndices; // prolongation does not need a full matrix, only store colIndices
std::vector<std::vector<double> > invDiags; // inverse of diagonal of Amatrices
std::vector<std::vector<Scalar> > invDiags; // inverse of diagonal of Amatrices
BlockedMatrix<Scalar> *mat = nullptr; // input matrix, blocked

View File

@ -43,7 +43,7 @@ RocmMatrix(int Nb_,
nnzbs(nnzbs_),
block_size(block_size_)
{
HIP_CHECK(hipMalloc((void**)&nnzValues, sizeof(double) * block_size * block_size * nnzbs));
HIP_CHECK(hipMalloc((void**)&nnzValues, sizeof(Scalar) * block_size * block_size * nnzbs));
HIP_CHECK(hipMalloc((void**)&colIndices, sizeof(int) * nnzbs));

View File

@ -56,7 +56,7 @@ public:
int verbosity);
// apply preconditioner, x = prec(y)
virtual void apply(double& y, double& x) = 0;
virtual void apply(Scalar& y, Scalar& x) = 0;
// create/update preconditioner, probably used every linear solve
// the version with two params can be overloaded, if not, it will default to using the one param version
@ -70,11 +70,11 @@ public:
rocsparse_int *d_Arows,
rocsparse_int *d_Acols) = 0;
virtual void copy_system_to_gpu(double *b)=0;
virtual void copy_system_to_gpu(Scalar *b)=0;
/// Update linear system to GPU
/// \param[in] b input vector, contains N values
virtual void update_system_on_gpu(double *b)=0;
virtual void update_system_on_gpu(Scalar *b)=0;
void set_matrix_analysis(rocsparse_mat_descr descr_L,
rocsparse_mat_descr descr_U);

View File

@ -127,7 +127,7 @@ public:
std::string linsolver);
/// For the CPR coarse solver
rocsparseSolverBackend(int linear_solver_verbosity, int maxit, double tolerance, bool opencl_ilu_reorder);
rocsparseSolverBackend(int linear_solver_verbosity, int maxit, Scalar tolerance, bool opencl_ilu_reorder);
/// Destroy a openclSolver, and free memory
~rocsparseSolverBackend();