Skip to content

Commit

Permalink
Fix two 'make test' failures in a CUDA build using HYPRE+CUDA.
Browse files Browse the repository at this point in the history
  • Loading branch information
v-dobrev committed Mar 19, 2024
1 parent e7400c2 commit 1314428
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
8 changes: 5 additions & 3 deletions fem/fespace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -606,13 +606,15 @@ void FiniteElementSpace::GetEssentialTrueDofs(const Array<int> &bdr_attr_is_ess,

int counter = 0;
std::string error_msg = "failed dof: ";
auto ess_tdofs_ = ess_tdofs.HostRead();
auto ess_tdofs2_ = ess_tdofs2.HostRead();
for (int i = 0; i < ess_tdofs2.Size(); ++i)
{
if (bool(ess_tdofs[i]) != bool(ess_tdofs2[i]))
if (bool(ess_tdofs_[i]) != bool(ess_tdofs2_[i]))
{
error_msg += std::to_string(i) += "(R ";
error_msg += std::to_string(bool(ess_tdofs[i])) += " P^T ";
error_msg += std::to_string(bool(ess_tdofs2[i])) += ") ";
error_msg += std::to_string(bool(ess_tdofs_[i])) += " P^T ";
error_msg += std::to_string(bool(ess_tdofs2_[i])) += ") ";
counter++;
}
}
Expand Down
18 changes: 13 additions & 5 deletions linalg/sparsemat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -983,14 +983,22 @@ void SparseMatrix::AddMultTranspose(const Vector &x, Vector &y,
}
else
{
real_t *yp = y.HostReadWrite();
const real_t *xp = x.HostRead();

const int *Ip = HostRead(I, height+1);
const int nnz = Ip[height];
const int *Jp = HostRead(J, nnz);
const real_t *Ap = HostRead(A, nnz);

for (int i = 0; i < height; i++)
{
const real_t xi = a * x[i];
const int end = I[i+1];
for (int j = I[i]; j < end; j++)
const real_t xi = a * xp[i];
const int end = Ip[i+1];
for (int j = Ip[i]; j < end; j++)
{
const int Jj = J[j];
y[Jj] += A[j] * xi;
const int Jj = Jp[j];
yp[Jj] += Ap[j] * xi;
}
}
}
Expand Down

0 comments on commit 1314428

Please sign in to comment.