From 13f01164256f6e670497d40675a2c59ec2b4c12f Mon Sep 17 00:00:00 2001 From: paboyle Date: Wed, 24 Jan 2018 13:35:55 +0000 Subject: [PATCH] Accelerator loops --- lib/lattice/Lattice_local.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/lattice/Lattice_local.h b/lib/lattice/Lattice_local.h index 97e118f0..95b0dd2c 100644 --- a/lib/lattice/Lattice_local.h +++ b/lib/lattice/Lattice_local.h @@ -43,9 +43,9 @@ template inline auto localNorm2 (const Lattice &rhs)-> Lattice { Lattice ret(rhs._grid); - parallel_for(int ss=0;ssoSites(); ss++){ + accelerator_loop(ss,rhs,{ ret._odata[ss]=innerProduct(rhs._odata[ss],rhs._odata[ss]); - } + }); return ret; } @@ -54,9 +54,9 @@ template inline auto localInnerProduct (const Lattice &lhs,const Lattice &rhs) -> Lattice { Lattice ret(rhs._grid); - parallel_for(int ss=0;ssoSites(); ss++){ + accelerator_loop(ss,rhs,{ ret._odata[ss]=innerProduct(lhs._odata[ss],rhs._odata[ss]); - } + }); return ret; } @@ -66,9 +66,9 @@ template inline auto outerProduct (const Lattice &lhs,const Lattice &rhs) -> Lattice { Lattice ret(rhs._grid); - parallel_for(int ss=0;ssoSites(); ss++){ + accelerator_loop(ss,rhs,{ ret._odata[ss]=outerProduct(lhs._odata[ss],rhs._odata[ss]); - } + }); return ret; } NAMESPACE_END(Grid);