1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-04-05 19:55:56 +01:00

Views must be closed

This commit is contained in:
Peter Boyle 2020-06-03 09:10:29 -04:00
parent 32237895bd
commit 1c9f20b15e

View File

@ -140,15 +140,17 @@ public:
b = cp / c;
LinearCombTimer.Start();
auto psi_v = psi.View(AcceleratorWrite);
auto p_v = p.View(AcceleratorWrite);
auto r_v = r.View(AcceleratorWrite);
accelerator_for(ss,p_v.size(), Field::vector_object::Nsimd(),{
coalescedWrite(psi_v[ss], a * p_v(ss) + psi_v(ss));
coalescedWrite(p_v[ss] , b * p_v(ss) + r_v (ss));
});
LinearCombTimer.Stop();
LinalgTimer.Stop();
{
auto psi_v = psi.View(AcceleratorWrite);
auto p_v = p.View(AcceleratorWrite);
auto r_v = r.View(AcceleratorWrite);
accelerator_for(ss,p_v.size(), Field::vector_object::Nsimd(),{
coalescedWrite(psi_v[ss], a * p_v(ss) + psi_v(ss));
coalescedWrite(p_v[ss] , b * p_v(ss) + r_v (ss));
});
LinearCombTimer.Stop();
LinalgTimer.Stop();
}
std::cout << GridLogIterative << "ConjugateGradient: Iteration " << k
<< " residual " << sqrt(cp/ssq) << " target " << Tolerance << std::endl;