Global edit with change to View usage. autoView() creates a wrapper object that closes the view when scope closes.

This commit is contained in:
Peter Boyle committed 2020-06-05 18:52:35 -04:00
1 parent f39c2a240b
commit 1a4c8c3387
78 files changed
+773 -778

No files matched your search

+5 -5
View File
@@ -86,8 +86,8 @@ public:
// Move this elsewhere? FIXME
static inline void AddLink(Field &U, LinkField &W, int mu) { // U[mu] += W
auto U_v = U.View(CpuWrite);
auto W_v = W.View(CpuRead);
autoView(U_v,U,CpuWrite);
autoView(W_v,W,CpuRead);
thread_for( ss, U.Grid()->oSites(), {
U_v[ss](mu) = U_v[ss](mu) + W_v[ss]();
});
@@ -131,15 +131,15 @@ public:
//static std::chrono::duration<double> diff;
//auto start = std::chrono::high_resolution_clock::now();
auto U_v = U.View(CpuWrite);
auto P_v = P.View(CpuRead);
autoView(U_v,U,CpuWrite);
autoView(P_v,P,CpuRead);
thread_for(ss, P.Grid()->oSites(),{
for (int mu = 0; mu < Nd; mu++) {
U_v[ss](mu) = ProjectOnGroup(Exponentiate(P_v[ss](mu), ep, Nexp) * U_v[ss](mu));
}
});
//auto end = std::chrono::high_resolution_clock::now();
//auto end = std::chrono::high_resolution_clock::now();
// diff += end - start;
// std::cout << "Time to exponentiate matrix " << diff.count() << " s\n";
}