diff --git a/Grid/algorithms/multigrid/Smoothers.h b/Grid/algorithms/multigrid/Smoothers.h index 938a188e2..1fce1cdb7 100644 --- a/Grid/algorithms/multigrid/Smoothers.h +++ b/Grid/algorithms/multigrid/Smoothers.h @@ -215,17 +215,22 @@ public: mmax = c.mmax; GRID_ASSERT(mmax>=1); nstep = c.Steps(); GRID_ASSERT(nstep>=1); a.resize(nstep); b.resize(nstep); + // No std::abs / std::isfinite on ComplexD: it is thrust::complex on HIP + // builds and neither overload exists. Work on the real and imaginary + // parts explicitly. + auto finite = [](ComplexD z){ RealD x=real(z), y=imag(z); return (x==x) && (y==y) && (x-x==0.0) && (y-y==0.0); }; + auto cabs = [](ComplexD z){ RealD x=real(z), y=imag(z); return std::sqrt(x*x+y*y); }; RealD amax=0.0, bmax=0.0; for(int k=0;k