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

Modified entire test directory to suit new GPU constructs for looping

This commit is contained in:
Peter Boyle 2019-06-15 12:53:27 +01:00
parent 0561c2edeb
commit 462900b48d
51 changed files with 47 additions and 69 deletions

View File

@ -29,7 +29,6 @@ See the full license in the file "LICENSE" in the top level distribution directo
#include <Grid/Grid.h>
using namespace Grid;
using namespace QCD;
typedef PeriodicGaugeImpl<QedGImplR> QedPeriodicGImplR;
typedef PhotonR::GaugeField EmField;

View File

@ -30,7 +30,6 @@ Author: paboyle <paboyle@ph.ed.ac.uk>
using namespace std;
using namespace Grid;
;
int main (int argc, char ** argv)
{

View File

@ -30,10 +30,11 @@ Author: paboyle <paboyle@ph.ed.ac.uk>
using namespace std;
using namespace Grid;
;
int main (int argc, char ** argv)
{
#ifndef GRID_NVCC
Grid_init(&argc,&argv);
Coordinate latt_size = GridDefaultLatt();
@ -193,4 +194,5 @@ int main (int argc, char ** argv)
Grid_finalize();
#endif
}

View File

@ -29,7 +29,6 @@
using namespace std;
using namespace Grid;
using namespace Grid::QCD;
int main(int argc, char **argv)
{

View File

@ -29,7 +29,6 @@ Author: Peter Boyle <paboyle@ph.ed.ac.uk>
using namespace std;
using namespace Grid;
using namespace Grid::QCD;
int main (int argc, char ** argv)

View File

@ -101,7 +101,7 @@ int main (int argc, char ** argv)
auto mom_v = mom.View();
auto Uprime_v = Uprime.View();
auto U_v = U.View();
thread_loop( (auto i=mom_v.begin();i<mom_v.end();i++),{
thread_foreach( i,mom_v,{
Uprime_v[i](mu) =
U_v[i](mu)
+ mom_v[i](mu)*U_v[i](mu)*dt

View File

@ -111,12 +111,11 @@ int main (int argc, char ** argv)
// fourth order exponential approx
#if 0
auto mom_v = mom.View();
auto U_v = U.View();
auto Uprime_v = Uprime.View();
thread_loop( (auto i=mom_v.begin();i<mom_v.end();i++),{
thread_foreach( i,mom_v,{
Uprime_v[i](mu) = U_v[i](mu)
+ mom_v[i](mu)*U_v[i](mu)*dt
+ mom_v[i](mu) *mom_v[i](mu) *U_v[i](mu)*(dt*dt/2.0)
@ -126,22 +125,6 @@ int main (int argc, char ** argv)
+ mom_v[i](mu) *mom_v[i](mu) *mom_v[i](mu) *mom_v[i](mu) *mom_v[i](mu) *mom_v[i](mu) *U_v[i](mu)*(dt*dt*dt*dt*dt*dt/720.0)
;
});
#else
auto mom_v = mom.View();
auto U_v = U.View();
auto Uprime_v = Uprime.View();
accelerator_loop( i,mom_v,{
Uprime_v[i](mu) = U_v[i](mu)
+ mom_v[i](mu)*U_v[i](mu)*dt
+ mom_v[i](mu) *mom_v[i](mu) *U_v[i](mu)*(dt*dt/2.0)
+ mom_v[i](mu) *mom_v[i](mu) *mom_v[i](mu) *U_v[i](mu)*(dt*dt*dt/6.0)
+ mom_v[i](mu) *mom_v[i](mu) *mom_v[i](mu) *mom_v[i](mu) *U_v[i](mu)*(dt*dt*dt*dt/24.0)
+ mom_v[i](mu) *mom_v[i](mu) *mom_v[i](mu) *mom_v[i](mu) *mom_v[i](mu) *U_v[i](mu)*(dt*dt*dt*dt*dt/120.0)
+ mom_v[i](mu) *mom_v[i](mu) *mom_v[i](mu) *mom_v[i](mu) *mom_v[i](mu) *mom_v[i](mu) *U_v[i](mu)*(dt*dt*dt*dt*dt*dt/720.0)
;
});
#endif
}
Ddwf.ImportGauge(Uprime);

View File

@ -114,7 +114,7 @@ int main (int argc, char** argv)
auto U_v = U.View();
auto Uprime_v = Uprime.View();
thread_loop( (auto i=mom_v.begin();i<mom_v.end();i++),{
thread_foreach(i,mom_v,{
Uprime_v[i](mu) = U_v[i](mu)
+ mom_v[i](mu)*U_v[i](mu)*dt
+ mom_v[i](mu) *mom_v[i](mu) *U_v[i](mu)*(dt*dt/2.0)

View File

@ -123,7 +123,7 @@ int main (int argc, char ** argv)
auto U_v = U.View();
auto Uprime_v = Uprime.View();
thread_loop( (auto i=mom_v.begin();i<mom_v.end();i++),{
thread_foreach(i,mom_v,{
Uprime_v[i](mu) = U_v[i](mu)
+ mom_v[i](mu)*U_v[i](mu)*dt
+ mom_v[i](mu) *mom_v[i](mu) *U_v[i](mu)*(dt*dt/2.0)

View File

@ -118,7 +118,7 @@ int main (int argc, char** argv)
auto U_v = U.View();
auto Uprime_v = Uprime.View();
thread_loop( (auto i=mom_v.begin();i<mom_v.end();i++),{
thread_foreach(i,mom_v,{
Uprime_v[i](mu) = U_v[i](mu)
+ mom_v[i](mu)*U_v[i](mu)*dt
+ mom_v[i](mu) *mom_v[i](mu) *U_v[i](mu)*(dt*dt/2.0)

View File

@ -88,7 +88,7 @@ int main (int argc, char ** argv)
auto Uprime_v = Uprime.View();
auto U_v = U.View();
auto mom_v = mom.View();
thread_loop( (auto i=mom_v.begin();i<mom_v.end();i++),{ // exp(pmu dt) * Umu
thread_foreach(i,mom_v,{ // exp(pmu dt) * Umu
Uprime_v[i](mu) = U_v[i](mu) + mom_v[i](mu)*U_v[i](mu)*dt ;
});
}

View File

@ -90,7 +90,7 @@ int main (int argc, char ** argv)
auto mom_v = mom.View();
auto Uprime_v= Uprime.View();
auto U_v = U.View();
thread_loop( (auto i=mom_v.begin();i<mom_v.end();i++),{ // exp(pmu dt) * Umu
thread_foreach(i,mom_v,{ // exp(pmu dt) * Umu
Uprime_v[i](mu) = U_v[i](mu) + mom_v[i](mu)*U_v[i](mu)*dt ;
});
}

View File

@ -108,7 +108,7 @@ int main (int argc, char ** argv)
auto U_v = U.View();
auto mom_v = mom.View();
auto Uprime_v = Uprime.View();
thread_loop( (auto i=mom_v.begin();i<mom_v.end();i++),{
thread_foreach(i,mom_v,{
Uprime_v[i](mu) = U_v[i](mu)
+ mom_v[i](mu)*U_v[i](mu)*dt
+ mom_v[i](mu) *mom_v[i](mu) *U_v[i](mu)*(dt*dt/2.0)

View File

@ -103,7 +103,7 @@ int main (int argc, char ** argv)
auto U_v = U.View();
auto Uprime_v = Uprime.View();
thread_loop( (auto i=mom_v.begin();i<mom_v.end();i++),{
thread_foreach(i,mom_v,{
Uprime_v[i](mu) = U_v[i](mu)
+ mom_v[i](mu)*U_v[i](mu)*dt
+ mom_v[i](mu) *mom_v[i](mu) *U_v[i](mu)*(dt*dt/2.0)

View File

@ -104,7 +104,7 @@ int main (int argc, char ** argv)
auto U_v = U.View();
auto mom_v = mom.View();
auto Uprime_v = Uprime.View();
thread_loop( (auto i=mom_v.begin();i<mom_v.end();i++),{
thread_foreach(i,mom_v,{
Uprime_v[i](mu) = U_v[i](mu)
+ mom_v[i](mu)*U_v[i](mu)*dt
+ mom_v[i](mu) *mom_v[i](mu) *U_v[i](mu)*(dt*dt/2.0)

View File

@ -116,7 +116,7 @@ int main (int argc, char** argv)
auto U_v = U.View();
auto Uprime_v = Uprime.View();
thread_loop( (auto i=mom_v.begin();i<mom_v.end();i++),{
thread_foreach(i,mom_v,{
Uprime_v[i](mu) = U_v[i](mu)
+ mom_v[i](mu)*U_v[i](mu)*dt
+ mom_v[i](mu) *mom_v[i](mu) *U_v[i](mu)*(dt*dt/2.0)

View File

@ -119,7 +119,7 @@ int main (int argc, char** argv)
auto mom_v = mom.View();
auto Uprime_v = Uprime.View();
// fourth order exponential approx
thread_loop( (auto i=mom_v.begin(); i<mom_v.end(); i++),{
thread_foreach( i, mom_v,{
Uprime_v[i](mu) = U_v[i](mu) + mom_v[i](mu)*U_v[i](mu)*dt + mom_v[i](mu) *mom_v[i](mu) *U_v[i](mu)*(dt*dt/2.0)
+ mom_v[i](mu) *mom_v[i](mu) *mom_v[i](mu) *U_v[i](mu)*(dt*dt*dt/6.0)
+ mom_v[i](mu) *mom_v[i](mu) *mom_v[i](mu) *mom_v[i](mu) *U_v[i](mu)*(dt*dt*dt*dt/24.0)

View File

@ -104,7 +104,7 @@ int main (int argc, char ** argv)
auto U_v = U.View();
auto mom_v = mom.View();
auto Uprime_v = Uprime.View();
thread_loop( (auto i=mom_v.begin();i<mom_v.end();i++),{
thread_foreach(i,mom_v,{
Uprime_v[i](mu) = U_v[i](mu)
+ mom_v[i](mu)*U_v[i](mu)*dt
+ mom_v[i](mu) *mom_v[i](mu) *U_v[i](mu)*(dt*dt/2.0)

View File

@ -89,7 +89,7 @@ int main (int argc, char ** argv)
auto Uprime_v = Uprime.View();
auto U_v = U.View();
auto mom_v = mom.View();
thread_loop( (auto i=mom_v.begin();i<mom_v.end();i++),{ // exp(pmu dt) * Umu
thread_foreach(i,mom_v,{ // exp(pmu dt) * Umu
Uprime_v[i](mu) = U_v[i](mu) + mom_v[i](mu)*U_v[i](mu)*dt ;
});
}

View File

@ -108,7 +108,7 @@ int main (int argc, char ** argv)
auto U_v = U.View();
auto mom_v = mom.View();
auto Uprime_v = Uprime.View();
thread_loop( (auto i=mom_v.begin();i<mom_v.end();i++) ,{
thread_foreach( i,mom_v,{
Uprime_v[i](mu) = U_v[i](mu);
Uprime_v[i](mu) += mom_v[i](mu)*U_v[i](mu)*dt ;
Uprime_v[i](mu) += mom_v[i](mu) *mom_v[i](mu) *U_v[i](mu)*(dt*dt/2.0);

View File

@ -29,7 +29,6 @@ Author: Peter Boyle <paboyle@ph.ed.ac.uk>
using namespace std;
using namespace Grid;
using namespace Grid::QCD;
int main(int argc, char **argv)
{
@ -109,7 +108,7 @@ int main(int argc, char **argv)
auto Uprime_v = Uprime.View();
auto U_v = U.View();
auto mom_v = mom.View();
thread_loop( (int ss = 0; ss < mom.Grid()->oSites(); ss++),
thread_foreach(ss,mom_v,
{
Uprime_v[ss]._internal[mu] = ProjectOnGroup(Exponentiate(mom_v[ss]._internal[mu], dt, 12) * U_v[ss]._internal[mu]);
});

View File

@ -118,7 +118,7 @@ int main (int argc, char ** argv)
auto U_v = U.View();
auto Uprime_v = Uprime.View();
thread_loop( (auto i=mom_v.begin();i<mom_v.end();i++),{
thread_foreach(i,mom_v,{
Uprime_v[i](mu) = U_v[i](mu)
+ mom_v[i](mu)*U_v[i](mu)*dt
+ mom_v[i](mu) *mom_v[i](mu) *U_v[i](mu)*(dt*dt/2.0)

View File

@ -30,7 +30,6 @@ directory
int main(int argc, char **argv) {
using namespace Grid;
using namespace Grid::QCD;
Grid_init(&argc, &argv);
int threads = GridThread::GetThreads();

View File

@ -69,7 +69,6 @@ namespace Grid{
int main(int argc, char **argv)
{
using namespace Grid;
using namespace Grid::QCD;
typedef Representations< FundamentalRepresentation, TwoIndexAntiSymmetricRepresentation > TheRepresentations;

View File

@ -69,7 +69,7 @@ namespace Grid{
int main(int argc, char **argv)
{
using namespace Grid;
using namespace Grid::QCD;
typedef Representations< FundamentalRepresentation, TwoIndexSymmetricRepresentation > TheRepresentations;

View File

@ -69,7 +69,7 @@ namespace Grid{
int main(int argc, char **argv)
{
using namespace Grid;
using namespace Grid::QCD;
Grid_init(&argc, &argv);
int threads = GridThread::GetThreads();

View File

@ -70,7 +70,7 @@ namespace Grid{
int main(int argc, char **argv) {
using namespace Grid;
using namespace Grid::QCD;
// Here change the allowed (higher) representations
typedef Representations< FundamentalRepresentation, TwoIndexAntiSymmetricRepresentation> TheRepresentations;

View File

@ -69,7 +69,7 @@ namespace Grid{
int main(int argc, char **argv)
{
using namespace Grid;
using namespace Grid::QCD;
typedef Representations< FundamentalRepresentation, AdjointRepresentation > TheRepresentations;

View File

@ -47,7 +47,7 @@ namespace Grid{
int main(int argc, char **argv) {
using namespace Grid;
using namespace Grid::QCD;
Grid_init(&argc, &argv);
GridLogLayout();

View File

@ -31,7 +31,7 @@ directory
int main(int argc, char **argv)
{
using namespace Grid;
using namespace Grid::QCD;
Grid_init(&argc, &argv);
int threads = GridThread::GetThreads();

View File

@ -31,7 +31,7 @@ Author: Peter Boyle <paboyle@ph.ed.ac.uk>
#include <Grid/algorithms/iterative/BlockConjugateGradient.h>
using namespace std;
using namespace Grid;
using namespace Grid::QCD;
int main (int argc, char ** argv)
{

View File

@ -31,7 +31,7 @@ Author: Peter Boyle <paboyle@ph.ed.ac.uk>
#include <Grid/algorithms/iterative/BlockConjugateGradient.h>
using namespace std;
using namespace Grid;
using namespace Grid::QCD;
int main (int argc, char ** argv)
{

View File

@ -31,7 +31,7 @@ Author: Peter Boyle <paboyle@ph.ed.ac.uk>
#include <Grid/algorithms/iterative/BlockConjugateGradient.h>
using namespace std;
using namespace Grid;
using namespace Grid::QCD;
int main (int argc, char ** argv)
{

View File

@ -29,7 +29,7 @@ directory
#include <Grid/Grid.h>
using namespace Grid;
using namespace Grid::QCD;
int main (int argc, char ** argv)
{

View File

@ -29,7 +29,7 @@ directory
#include <Grid/Grid.h>
using namespace Grid;
using namespace Grid::QCD;
int main (int argc, char ** argv)
{

View File

@ -29,7 +29,7 @@ directory
#include <Grid/Grid.h>
using namespace Grid;
using namespace Grid::QCD;
int main (int argc, char ** argv)
{

View File

@ -29,7 +29,7 @@ directory
#include <Grid/Grid.h>
using namespace Grid;
using namespace Grid::QCD;
int main (int argc, char ** argv)
{

View File

@ -29,7 +29,7 @@ directory
#include <Grid/Grid.h>
using namespace Grid;
using namespace Grid::QCD;
int main (int argc, char ** argv)
{

View File

@ -29,7 +29,7 @@ directory
#include <Grid/Grid.h>
using namespace Grid;
using namespace Grid::QCD;
int main (int argc, char ** argv)
{

View File

@ -29,7 +29,7 @@ directory
#include <Grid/Grid.h>
using namespace Grid;
using namespace Grid::QCD;
int main (int argc, char ** argv)
{

View File

@ -29,7 +29,7 @@ directory
#include <Grid/Grid.h>
using namespace Grid;
using namespace Grid::QCD;
int main (int argc, char ** argv)
{

View File

@ -29,7 +29,7 @@ directory
#include <Grid/Grid.h>
using namespace Grid;
using namespace Grid::QCD;
int main (int argc, char ** argv)
{

View File

@ -31,7 +31,7 @@
using namespace std;
using namespace Grid;
using namespace Grid::QCD;
int main(int argc, char **argv) {

View File

@ -29,7 +29,7 @@ directory
#include <Grid/Grid.h>
using namespace Grid;
using namespace Grid::QCD;
int main (int argc, char ** argv)
{

View File

@ -29,7 +29,7 @@ directory
#include <Grid/Grid.h>
using namespace Grid;
using namespace Grid::QCD;
int main (int argc, char ** argv)
{

View File

@ -29,7 +29,7 @@ directory
#include <Grid/Grid.h>
using namespace Grid;
using namespace Grid::QCD;
int main (int argc, char ** argv)
{

View File

@ -29,7 +29,7 @@ directory
#include <Grid/Grid.h>
using namespace Grid;
using namespace Grid::QCD;
int main (int argc, char ** argv)
{

View File

@ -29,7 +29,7 @@ directory
#include <Grid/Grid.h>
using namespace Grid;
using namespace Grid::QCD;
int main (int argc, char ** argv)
{

View File

@ -31,7 +31,7 @@
using namespace std;
using namespace Grid;
using namespace Grid::QCD;
int main(int argc, char **argv) {

View File

@ -31,7 +31,7 @@
using namespace std;
using namespace Grid;
using namespace Grid::QCD;
int main(int argc, char **argv) {

View File

@ -29,7 +29,7 @@ directory
#include <Grid/Grid.h>
using namespace Grid;
using namespace Grid::QCD;
int main (int argc, char ** argv)
{