Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/solvers/cheb_solver.cu
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,15 @@ Chebyshev_Solver<T_Config>::solve_init( VVector &b, VVector &x, bool xIsZero )
int offset, size;
A.getOffsetAndSizeForView(A.getViewExterior(), &offset, &size);

// Ensure x is actually zero when xIsZero is claimed.
// Callers (e.g. PCG) pass xIsZero=true but may not have zeroed the buffer.
// Without this, solve_iteration's "x += gamma*p" accumulates onto stale data
// from the previous outer iteration, causing divergence.
if (xIsZero)
{
fill(x, types::util<ValueTypeB>::get_zero());
}

// Run one iteration of preconditioner with zero initial guess
if (no_preconditioner)
{
Expand Down