mirror of
https://github.com/paboyle/Grid.git
synced 2025-04-25 13:15:55 +01:00
Merge pull request #13 from DanielRichtmann/feature/gpt-coarsenedmatrix
Changes needed for GPT MG
This commit is contained in:
commit
d61ee817f4
@ -268,6 +268,21 @@ public:
|
|||||||
typedef iMatrix<CComplex,nbasis > Cobj;
|
typedef iMatrix<CComplex,nbasis > Cobj;
|
||||||
typedef Lattice< CComplex > CoarseScalar; // used for inner products on fine field
|
typedef Lattice< CComplex > CoarseScalar; // used for inner products on fine field
|
||||||
typedef Lattice<Fobj > FineField;
|
typedef Lattice<Fobj > FineField;
|
||||||
|
typedef CoarseVector FermionField;
|
||||||
|
|
||||||
|
// enrich interface
|
||||||
|
void Meooe(CoarseVector const& in, CoarseVector& out) { assert(0); }
|
||||||
|
void MeooeDag(CoarseVector const& in, CoarseVector& out) { assert(0); }
|
||||||
|
void Mooee(CoarseVector const& in, CoarseVector& out) { assert(0); }
|
||||||
|
void MooeeDag(CoarseVector const& in, CoarseVector& out) { assert(0); }
|
||||||
|
void MooeeInv(CoarseVector const& in, CoarseVector& out) { assert(0); }
|
||||||
|
void MooeeInvDag(CoarseVector const& in, CoarseVector& out) { assert(0); }
|
||||||
|
void Dminus(CoarseVector const& in, CoarseVector& out) { out = in; }
|
||||||
|
void DminusDag(CoarseVector const& in, CoarseVector& out) { out = in; }
|
||||||
|
void ImportPhysicalFermionSource(CoarseVector const& input, CoarseVector& imported) { imported = input; }
|
||||||
|
void ImportUnphysicalFermion(CoarseVector const& input, CoarseVector& imported) { imported = input; }
|
||||||
|
void ExportPhysicalFermionSolution(CoarseVector const& solution, CoarseVector& exported) { exported = solution; };
|
||||||
|
void ExportPhysicalFermionSource(CoarseVector const& solution, CoarseVector& exported) { exported = solution; };
|
||||||
|
|
||||||
////////////////////
|
////////////////////
|
||||||
// Data members
|
// Data members
|
||||||
@ -295,6 +310,8 @@ public:
|
|||||||
Stencil.HaloExchange(in,compressor);
|
Stencil.HaloExchange(in,compressor);
|
||||||
autoView( in_v , in, AcceleratorRead);
|
autoView( in_v , in, AcceleratorRead);
|
||||||
autoView( out_v , out, AcceleratorWrite);
|
autoView( out_v , out, AcceleratorWrite);
|
||||||
|
autoView( Stencil_v , Stencil, AcceleratorRead);
|
||||||
|
auto& geom_v = geom;
|
||||||
typedef LatticeView<Cobj> Aview;
|
typedef LatticeView<Cobj> Aview;
|
||||||
|
|
||||||
Vector<Aview> AcceleratorViewContainer;
|
Vector<Aview> AcceleratorViewContainer;
|
||||||
@ -316,14 +333,14 @@ public:
|
|||||||
int ptype;
|
int ptype;
|
||||||
StencilEntry *SE;
|
StencilEntry *SE;
|
||||||
|
|
||||||
for(int point=0;point<geom.npoint;point++){
|
for(int point=0;point<geom_v.npoint;point++){
|
||||||
|
|
||||||
SE=Stencil.GetEntry(ptype,point,ss);
|
SE=Stencil_v.GetEntry(ptype,point,ss);
|
||||||
|
|
||||||
if(SE->_is_local) {
|
if(SE->_is_local) {
|
||||||
nbr = coalescedReadPermute(in_v[SE->_offset],ptype,SE->_permute);
|
nbr = coalescedReadPermute(in_v[SE->_offset],ptype,SE->_permute);
|
||||||
} else {
|
} else {
|
||||||
nbr = coalescedRead(Stencil.CommBuf()[SE->_offset]);
|
nbr = coalescedRead(Stencil_v.CommBuf()[SE->_offset]);
|
||||||
}
|
}
|
||||||
acceleratorSynchronise();
|
acceleratorSynchronise();
|
||||||
|
|
||||||
@ -367,6 +384,7 @@ public:
|
|||||||
|
|
||||||
autoView( out_v , out, AcceleratorWrite);
|
autoView( out_v , out, AcceleratorWrite);
|
||||||
autoView( in_v , in, AcceleratorRead);
|
autoView( in_v , in, AcceleratorRead);
|
||||||
|
autoView( Stencil_v , Stencil, AcceleratorRead);
|
||||||
|
|
||||||
const int Nsimd = CComplex::Nsimd();
|
const int Nsimd = CComplex::Nsimd();
|
||||||
typedef decltype(coalescedRead(in_v[0])) calcVector;
|
typedef decltype(coalescedRead(in_v[0])) calcVector;
|
||||||
@ -380,12 +398,12 @@ public:
|
|||||||
int ptype;
|
int ptype;
|
||||||
StencilEntry *SE;
|
StencilEntry *SE;
|
||||||
|
|
||||||
SE=Stencil.GetEntry(ptype,point,ss);
|
SE=Stencil_v.GetEntry(ptype,point,ss);
|
||||||
|
|
||||||
if(SE->_is_local) {
|
if(SE->_is_local) {
|
||||||
nbr = coalescedReadPermute(in_v[SE->_offset],ptype,SE->_permute);
|
nbr = coalescedReadPermute(in_v[SE->_offset],ptype,SE->_permute);
|
||||||
} else {
|
} else {
|
||||||
nbr = coalescedRead(Stencil.CommBuf()[SE->_offset]);
|
nbr = coalescedRead(Stencil_v.CommBuf()[SE->_offset]);
|
||||||
}
|
}
|
||||||
acceleratorSynchronise();
|
acceleratorSynchronise();
|
||||||
|
|
||||||
@ -418,24 +436,24 @@ public:
|
|||||||
//////////////
|
//////////////
|
||||||
// 4D action like wilson
|
// 4D action like wilson
|
||||||
// 0+ => 0
|
// 0+ => 0
|
||||||
// 0- => 1
|
// 0- => 4
|
||||||
// 1+ => 2
|
// 1+ => 1
|
||||||
// 1- => 3
|
// 1- => 5
|
||||||
// etc..
|
// etc..
|
||||||
//////////////
|
//////////////
|
||||||
// 5D action like DWF
|
// 5D action like DWF
|
||||||
// 1+ => 0
|
// 1+ => 0
|
||||||
// 1- => 1
|
// 1- => 4
|
||||||
// 2+ => 2
|
// 2+ => 1
|
||||||
// 2- => 3
|
// 2- => 5
|
||||||
// etc..
|
// etc..
|
||||||
auto point = [dir, disp, ndim](){
|
auto point = [dir, disp, ndim](){
|
||||||
if(dir == 0 and disp == 0)
|
if(dir == 0 and disp == 0)
|
||||||
return 8;
|
return 8;
|
||||||
else if ( ndim==4 ) {
|
else if ( ndim==4 ) {
|
||||||
return (4 * dir + 1 - disp) / 2;
|
return (1 - disp) / 2 * 4 + dir;
|
||||||
} else {
|
} else {
|
||||||
return (4 * (dir-1) + 1 - disp) / 2;
|
return (1 - disp) / 2 * 4 + dir - 1;
|
||||||
}
|
}
|
||||||
}();
|
}();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user