mirror of
https://github.com/paboyle/Grid.git
synced 2025-04-09 21:50:45 +01:00
Coordinate handling GPU friendly
This commit is contained in:
parent
7574c18cef
commit
bf5fb89aff
@ -100,9 +100,9 @@ void LebesgueOrder::CartesianBlocking(void)
|
|||||||
assert(ND==4);
|
assert(ND==4);
|
||||||
assert(ND==Block.size());
|
assert(ND==Block.size());
|
||||||
|
|
||||||
std::vector<IndexInteger> dims(ND);
|
Coordinate dims(ND);
|
||||||
std::vector<IndexInteger> xo(ND,0);
|
Coordinate xo(ND,0);
|
||||||
std::vector<IndexInteger> xi(ND,0);
|
Coordinate xi(ND,0);
|
||||||
|
|
||||||
for(IndexInteger mu=0;mu<ND;mu++){
|
for(IndexInteger mu=0;mu<ND;mu++){
|
||||||
dims[mu] = grid->_rdimensions[mu];
|
dims[mu] = grid->_rdimensions[mu];
|
||||||
@ -112,9 +112,9 @@ void LebesgueOrder::CartesianBlocking(void)
|
|||||||
};
|
};
|
||||||
|
|
||||||
void LebesgueOrder::IterateO(int ND,int dim,
|
void LebesgueOrder::IterateO(int ND,int dim,
|
||||||
std::vector<IndexInteger> & xo,
|
Coordinate & xo,
|
||||||
std::vector<IndexInteger> & xi,
|
Coordinate & xi,
|
||||||
std::vector<IndexInteger> &dims)
|
Coordinate &dims)
|
||||||
{
|
{
|
||||||
for(xo[dim]=0;xo[dim]<dims[dim];xo[dim]+=Block[dim]){
|
for(xo[dim]=0;xo[dim]<dims[dim];xo[dim]+=Block[dim]){
|
||||||
if ( dim > 0 ) {
|
if ( dim > 0 ) {
|
||||||
@ -127,11 +127,11 @@ void LebesgueOrder::IterateO(int ND,int dim,
|
|||||||
|
|
||||||
void LebesgueOrder::IterateI(int ND,
|
void LebesgueOrder::IterateI(int ND,
|
||||||
int dim,
|
int dim,
|
||||||
std::vector<IndexInteger> & xo,
|
Coordinate & xo,
|
||||||
std::vector<IndexInteger> & xi,
|
Coordinate & xi,
|
||||||
std::vector<IndexInteger> &dims)
|
Coordinate &dims)
|
||||||
{
|
{
|
||||||
std::vector<IndexInteger> x(ND);
|
Coordinate x(ND);
|
||||||
for(xi[dim]=0;xi[dim]<std::min(dims[dim]-xo[dim],Block[dim]);xi[dim]++){
|
for(xi[dim]=0;xi[dim]<std::min(dims[dim]-xo[dim],Block[dim]);xi[dim]++){
|
||||||
if ( dim > 0 ) {
|
if ( dim > 0 ) {
|
||||||
IterateI(ND,dim-1,xo,xi,dims);
|
IterateI(ND,dim-1,xo,xi,dims);
|
||||||
@ -157,8 +157,8 @@ void LebesgueOrder::ZGraph(void)
|
|||||||
const IndexInteger one=1;
|
const IndexInteger one=1;
|
||||||
|
|
||||||
IndexInteger ND = grid->_ndimension;
|
IndexInteger ND = grid->_ndimension;
|
||||||
std::vector<IndexInteger> dims(ND);
|
Coordinate dims(ND);
|
||||||
std::vector<IndexInteger> adims(ND);
|
Coordinate adims(ND);
|
||||||
std::vector<std::vector<IndexInteger> > bitlist(ND);
|
std::vector<std::vector<IndexInteger> > bitlist(ND);
|
||||||
|
|
||||||
for(IndexInteger mu=0;mu<ND;mu++){
|
for(IndexInteger mu=0;mu<ND;mu++){
|
||||||
|
@ -38,7 +38,6 @@ class LebesgueOrder {
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
typedef int32_t IndexInteger;
|
typedef int32_t IndexInteger;
|
||||||
|
|
||||||
static int UseLebesgueOrder;
|
static int UseLebesgueOrder;
|
||||||
GridBase *grid;
|
GridBase *grid;
|
||||||
|
|
||||||
@ -62,13 +61,13 @@ public:
|
|||||||
void NoBlocking(void);
|
void NoBlocking(void);
|
||||||
void CartesianBlocking(void);
|
void CartesianBlocking(void);
|
||||||
void IterateO(int ND,int dim,
|
void IterateO(int ND,int dim,
|
||||||
std::vector<IndexInteger> & xo,
|
Coordinate & xo,
|
||||||
std::vector<IndexInteger> & xi,
|
Coordinate & xi,
|
||||||
std::vector<IndexInteger> &dims);
|
Coordinate &dims);
|
||||||
void IterateI(int ND,int dim,
|
void IterateI(int ND,int dim,
|
||||||
std::vector<IndexInteger> & xo,
|
Coordinate & xo,
|
||||||
std::vector<IndexInteger> & xi,
|
Coordinate & xi,
|
||||||
std::vector<IndexInteger> &dims);
|
Coordinate &dims);
|
||||||
|
|
||||||
void ThreadInterleave(void);
|
void ThreadInterleave(void);
|
||||||
|
|
||||||
|
@ -150,7 +150,7 @@ public:
|
|||||||
std::vector<int> _distances;
|
std::vector<int> _distances;
|
||||||
std::vector<int> _comm_buf_size;
|
std::vector<int> _comm_buf_size;
|
||||||
std::vector<int> _permute_type;
|
std::vector<int> _permute_type;
|
||||||
std::vector<int> _simd_layout;
|
Coordinate _simd_layout;
|
||||||
|
|
||||||
Vector<StencilEntry> _entries; // Resident in managed memory
|
Vector<StencilEntry> _entries; // Resident in managed memory
|
||||||
StencilEntry* _entries_p;
|
StencilEntry* _entries_p;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user