mirror of
https://github.com/paboyle/Grid.git
synced 2025-04-04 11:15:55 +01:00
Test that fails on Cuda 11.0
This commit is contained in:
parent
ce1fc1f48a
commit
cd5891eecd
@ -51,87 +51,93 @@ int main (int argc, char ** argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
GridCartesian GRID(latt_size,simd_layout,mpi_layout);
|
GridCartesian GRID(latt_size,simd_layout,mpi_layout);
|
||||||
|
|
||||||
LatticeComplexD zz(&GRID);
|
|
||||||
LatticeInteger coor(&GRID);
|
|
||||||
LatticeComplexD rn(&GRID);
|
|
||||||
LatticeComplexD sl(&GRID);
|
|
||||||
|
|
||||||
zz = ComplexD(0.0,0.0);
|
|
||||||
|
|
||||||
GridParallelRNG RNG(&GRID);
|
GridParallelRNG RNG(&GRID);
|
||||||
RNG.SeedFixedIntegers(std::vector<int>({45,12,81,9}));
|
RNG.SeedFixedIntegers(std::vector<int>({45,12,81,9}));
|
||||||
gaussian(RNG,rn);
|
|
||||||
|
|
||||||
RealD nn=norm2(rn);
|
std::cout<<GridLogMessage<<"=============================================================="<<std::endl;
|
||||||
for(int mu=0;mu<nd;mu++){
|
std::cout<<GridLogMessage<<"== LatticeComplex =="<<std::endl;
|
||||||
RealD ns=0.0;
|
std::cout<<GridLogMessage<<"=============================================================="<<std::endl;
|
||||||
for(int t=0;t<latt_size[mu];t++){
|
{
|
||||||
LatticeCoordinate(coor,mu);
|
LatticeComplexD zz(&GRID);
|
||||||
sl=where(coor==Integer(t),rn,zz);
|
LatticeInteger coor(&GRID);
|
||||||
std::cout <<GridLogMessage<< " sl " << sl<<std::endl;
|
LatticeComplexD rn(&GRID);
|
||||||
std::cout <<GridLogMessage<<" slice "<<t<<" " << norm2(sl)<<std::endl;
|
LatticeComplexD sl(&GRID);
|
||||||
ns=ns+norm2(sl);
|
|
||||||
|
zz = ComplexD(0.0,0.0);
|
||||||
|
|
||||||
|
gaussian(RNG,rn);
|
||||||
|
|
||||||
|
RealD nn=norm2(rn);
|
||||||
|
for(int mu=0;mu<nd;mu++){
|
||||||
|
RealD ns=0.0;
|
||||||
|
for(int t=0;t<latt_size[mu];t++){
|
||||||
|
LatticeCoordinate(coor,mu);
|
||||||
|
sl=where(coor==Integer(t),rn,zz);
|
||||||
|
std::cout <<GridLogMessage<<" slice "<<t<<" " << norm2(sl)<<std::endl;
|
||||||
|
ns=ns+norm2(sl);
|
||||||
|
}
|
||||||
|
std::cout <<GridLogMessage <<" sliceNorm" <<mu<<" "<< nn <<" "<<ns<<" err " << nn-ns<<std::endl;
|
||||||
|
assert(abs(nn-ns) < 1.0e-10);
|
||||||
}
|
}
|
||||||
std::cout <<GridLogMessage <<" sliceNorm" <<mu<<" "<< nn <<" "<<ns<<" " << nn-ns<<std::endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int tmin = 3;
|
|
||||||
|
|
||||||
int Ls = 2;
|
|
||||||
GridCartesian * UGrid = SpaceTimeGrid::makeFourDimGrid(GridDefaultLatt(), GridDefaultSimd(Nd,vComplex::Nsimd()),GridDefaultMpi());
|
|
||||||
GridCartesian * FGrid = SpaceTimeGrid::makeFiveDimGrid(Ls,UGrid);
|
|
||||||
std::vector<int> seeds4({1,2,3,4});
|
|
||||||
GridParallelRNG RNG4(UGrid); RNG4.SeedFixedIntegers(seeds4);
|
|
||||||
LatticeInteger lcoor(UGrid); LatticeCoordinate(lcoor,Nd-1);
|
|
||||||
|
|
||||||
|
|
||||||
std::cout<<GridLogMessage<<"=============================================================="<<std::endl;
|
std::cout<<GridLogMessage<<"=============================================================="<<std::endl;
|
||||||
std::cout<<GridLogMessage<<"== LatticeFermion =="<<std::endl;
|
std::cout<<GridLogMessage<<"== LatticeFermion =="<<std::endl;
|
||||||
std::cout<<GridLogMessage<<"=============================================================="<<std::endl;
|
std::cout<<GridLogMessage<<"=============================================================="<<std::endl;
|
||||||
|
{
|
||||||
|
LatticeFermionD zz(&GRID);
|
||||||
|
LatticeInteger coor(&GRID);
|
||||||
|
LatticeFermionD rn(&GRID);
|
||||||
|
LatticeFermionD sl(&GRID);
|
||||||
|
|
||||||
LatticeFermion q_outF(FGrid); q_outF=0.0;
|
zz = ComplexD(0.0,0.0);
|
||||||
LatticeFermion tmpF(UGrid); random(RNG4,tmpF);
|
|
||||||
LatticeFermion tmp2F(UGrid);
|
|
||||||
LatticeFermion ZZF (UGrid); ZZF=0.0;
|
|
||||||
|
|
||||||
RealD nA=0.0;
|
gaussian(RNG,rn);
|
||||||
RealD nB=0.0;
|
|
||||||
for(int s=0;s<Ls;s++){
|
RealD nn=norm2(rn);
|
||||||
nB = nB + norm2(tmpF);
|
for(int mu=0;mu<nd;mu++){
|
||||||
tmp2F = where((lcoor>=tmin),tmpF,ZZF);
|
RealD ns=0.0;
|
||||||
nA = nA + norm2(tmp2F);
|
for(int t=0;t<latt_size[mu];t++){
|
||||||
InsertSlice(tmp2F, q_outF, s , 0);
|
LatticeCoordinate(coor,mu);
|
||||||
|
sl=where(coor==Integer(t),rn,zz);
|
||||||
|
std::cout <<GridLogMessage<<" slice "<<t<<" " << norm2(sl)<<std::endl;
|
||||||
|
ns=ns+norm2(sl);
|
||||||
|
}
|
||||||
|
std::cout <<GridLogMessage <<" sliceNorm" <<mu<<" "<< nn <<" "<<ns<<" err " << nn-ns<<std::endl;
|
||||||
|
assert(abs(nn-ns) < 1.0e-10);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RealD nQO=norm2(q_outF);
|
|
||||||
std::cout <<GridLogMessage << "norm_before_where: " << nB << std::endl;
|
|
||||||
std::cout <<GridLogMessage << "norm_after_where: " << nA << std::endl;
|
|
||||||
std::cout <<GridLogMessage << "norm_q_out: " << nQO << std::endl;
|
|
||||||
|
|
||||||
|
|
||||||
std::cout<<GridLogMessage<<"=============================================================="<<std::endl;
|
std::cout<<GridLogMessage<<"=============================================================="<<std::endl;
|
||||||
std::cout<<GridLogMessage<<"== LatticePropagator =="<<std::endl;
|
std::cout<<GridLogMessage<<"== LatticePropagator =="<<std::endl;
|
||||||
std::cout<<GridLogMessage<<"=============================================================="<<std::endl;
|
std::cout<<GridLogMessage<<"=============================================================="<<std::endl;
|
||||||
|
|
||||||
LatticePropagator q_outP(FGrid); q_outP=0.0;
|
{
|
||||||
LatticePropagator tmpP(UGrid); random(RNG4,tmpP);
|
LatticePropagatorD zz(&GRID);
|
||||||
LatticePropagator tmp2P(UGrid);
|
LatticeInteger coor(&GRID);
|
||||||
LatticePropagator ZZP (UGrid); ZZP=0.0;
|
LatticePropagatorD rn(&GRID);
|
||||||
|
LatticePropagatorD sl(&GRID);
|
||||||
|
|
||||||
nA=0.0;
|
zz = ComplexD(0.0,0.0);
|
||||||
nB=0.0;
|
|
||||||
for(int s=0;s<Ls;s++){
|
gaussian(RNG,rn);
|
||||||
nB = nB + norm2(tmpP);
|
|
||||||
tmp2P = where((lcoor>=tmin),tmpP,ZZP);
|
RealD nn=norm2(rn);
|
||||||
nA = nA + norm2(tmp2P);
|
for(int mu=0;mu<nd;mu++){
|
||||||
InsertSlice(tmp2P, q_outP, s , 0);
|
RealD ns=0.0;
|
||||||
|
for(int t=0;t<latt_size[mu];t++){
|
||||||
|
LatticeCoordinate(coor,mu);
|
||||||
|
sl=where(coor==Integer(t),rn,zz);
|
||||||
|
std::cout <<GridLogMessage<<" slice "<<t<<" " << norm2(sl)<<std::endl;
|
||||||
|
ns=ns+norm2(sl);
|
||||||
|
}
|
||||||
|
std::cout <<GridLogMessage <<" sliceNorm" <<mu<<" "<< nn <<" "<<ns<<" err " << nn-ns<<std::endl;
|
||||||
|
assert(abs(nn-ns) < 1.0e-10);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
nQO=norm2(q_outP);
|
|
||||||
std::cout <<GridLogMessage << "norm_before_where: " << nB << std::endl;
|
|
||||||
std::cout <<GridLogMessage << "norm_after_where: " << nA << std::endl;
|
|
||||||
std::cout <<GridLogMessage << "norm_q_out: " << nQO << std::endl;
|
|
||||||
|
|
||||||
Grid_finalize();
|
Grid_finalize();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user