mirror of
https://github.com/paboyle/Grid.git
synced 2025-04-12 15:10:46 +01:00
hip-friendly
This commit is contained in:
parent
49ecbc81d4
commit
2bb374daea
@ -442,6 +442,8 @@ public:
|
|||||||
for(int p=0; p<geom.npoint; p++)
|
for(int p=0; p<geom.npoint; p++)
|
||||||
points[p] = geom.points_dagger[p];
|
points[p] = geom.points_dagger[p];
|
||||||
|
|
||||||
|
auto points_p = &points[0];
|
||||||
|
|
||||||
RealD* dag_factor_p = &dag_factor[0];
|
RealD* dag_factor_p = &dag_factor[0];
|
||||||
|
|
||||||
accelerator_for(sss, Grid()->oSites()*nbasis, Nsimd, {
|
accelerator_for(sss, Grid()->oSites()*nbasis, Nsimd, {
|
||||||
@ -453,7 +455,7 @@ public:
|
|||||||
StencilEntry *SE;
|
StencilEntry *SE;
|
||||||
|
|
||||||
for(int p=0;p<geom_v.npoint;p++){
|
for(int p=0;p<geom_v.npoint;p++){
|
||||||
int point = points[p];
|
int point = points_p[p];
|
||||||
|
|
||||||
SE=Stencil_v.GetEntry(ptype,point,ss);
|
SE=Stencil_v.GetEntry(ptype,point,ss);
|
||||||
|
|
||||||
@ -708,6 +710,8 @@ public:
|
|||||||
for(int p=0; p<npoint; p++)
|
for(int p=0; p<npoint; p++)
|
||||||
points[p] = (dag && !hermitian) ? geom.points_dagger[p] : p;
|
points[p] = (dag && !hermitian) ? geom.points_dagger[p] : p;
|
||||||
|
|
||||||
|
auto points_p = &points[0];
|
||||||
|
|
||||||
Vector<Aview> AcceleratorViewContainer;
|
Vector<Aview> AcceleratorViewContainer;
|
||||||
for(int p=0;p<npoint;p++) AcceleratorViewContainer.push_back(a[p].View(AcceleratorRead));
|
for(int p=0;p<npoint;p++) AcceleratorViewContainer.push_back(a[p].View(AcceleratorRead));
|
||||||
Aview *Aview_p = & AcceleratorViewContainer[0];
|
Aview *Aview_p = & AcceleratorViewContainer[0];
|
||||||
@ -728,7 +732,7 @@ public:
|
|||||||
StencilEntry *SE;
|
StencilEntry *SE;
|
||||||
|
|
||||||
for(int p=0;p<npoint;p++){
|
for(int p=0;p<npoint;p++){
|
||||||
int point = points[p];
|
int point = points_p[p];
|
||||||
SE=st_v.GetEntry(ptype,point,ss);
|
SE=st_v.GetEntry(ptype,point,ss);
|
||||||
|
|
||||||
if(SE->_is_local) {
|
if(SE->_is_local) {
|
||||||
@ -754,7 +758,7 @@ public:
|
|||||||
StencilEntry *SE;
|
StencilEntry *SE;
|
||||||
|
|
||||||
for(int p=0;p<npoint;p++){
|
for(int p=0;p<npoint;p++){
|
||||||
int point = points[p];
|
int point = points_p[p];
|
||||||
SE=st_v.GetEntry(ptype,point,ss);
|
SE=st_v.GetEntry(ptype,point,ss);
|
||||||
|
|
||||||
if(SE->_is_local) {
|
if(SE->_is_local) {
|
||||||
|
@ -360,16 +360,22 @@ inline void blockSum(Lattice<vobj> &coarseData,const Lattice<vobj> &fineData)
|
|||||||
autoView( coarseData_ , coarseData, AcceleratorWrite);
|
autoView( coarseData_ , coarseData, AcceleratorWrite);
|
||||||
autoView( fineData_ , fineData, AcceleratorRead);
|
autoView( fineData_ , fineData, AcceleratorRead);
|
||||||
|
|
||||||
|
auto coarseData_p = &coarseData_[0];
|
||||||
|
auto fineData_p = &fineData_[0];
|
||||||
|
|
||||||
Coordinate fine_rdimensions = fine->_rdimensions;
|
Coordinate fine_rdimensions = fine->_rdimensions;
|
||||||
Coordinate coarse_rdimensions = coarse->_rdimensions;
|
Coordinate coarse_rdimensions = coarse->_rdimensions;
|
||||||
|
|
||||||
|
vobj zz = Zero();
|
||||||
|
|
||||||
accelerator_for(sc,coarse->oSites(),1,{
|
accelerator_for(sc,coarse->oSites(),1,{
|
||||||
|
|
||||||
// One thread per sub block
|
// One thread per sub block
|
||||||
Coordinate coor_c(_ndimension);
|
Coordinate coor_c(_ndimension);
|
||||||
Lexicographic::CoorFromIndex(coor_c,sc,coarse_rdimensions); // Block coordinate
|
Lexicographic::CoorFromIndex(coor_c,sc,coarse_rdimensions); // Block coordinate
|
||||||
coarseData_[sc]=Zero();
|
|
||||||
|
|
||||||
|
vobj cd = zz;
|
||||||
|
|
||||||
for(int sb=0;sb<blockVol;sb++){
|
for(int sb=0;sb<blockVol;sb++){
|
||||||
|
|
||||||
int sf;
|
int sf;
|
||||||
@ -379,9 +385,11 @@ inline void blockSum(Lattice<vobj> &coarseData,const Lattice<vobj> &fineData)
|
|||||||
for(int d=0;d<_ndimension;d++) coor_f[d]=coor_c[d]*block_r[d] + coor_b[d];
|
for(int d=0;d<_ndimension;d++) coor_f[d]=coor_c[d]*block_r[d] + coor_b[d];
|
||||||
Lexicographic::IndexFromCoor(coor_f,sf,fine_rdimensions);
|
Lexicographic::IndexFromCoor(coor_f,sf,fine_rdimensions);
|
||||||
|
|
||||||
coarseData_[sc]=coarseData_[sc]+fineData_[sf];
|
cd=cd+fineData_p[sf];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
coarseData_p[sc] = cd;
|
||||||
|
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user