Public Member Functions | Protected Attributes | List of all members
PmeTranspose Class Referenceabstract

#include <PmeSolverUtil.h>

Inheritance diagram for PmeTranspose:

Public Member Functions

 PmeTranspose (PmeGrid pmeGrid, const int permutation, const int jblock, const int kblock)
virtual ~PmeTranspose ()
virtual void transposeXYZtoYZX (const float2 *data)=0
virtual void transposeXYZtoZXY (const float2 *data)=0

Protected Attributes

PmeGrid pmeGrid
const int permutation
const int jblock
const int kblock
int isize
int jsize
int ksize
int dataSize
int nblock
std::vector< int > pos

Detailed Description

Definition at line 411 of file PmeSolverUtil.h.

Constructor & Destructor Documentation

PmeTranspose::PmeTranspose ( PmeGrid  pmeGrid,
const int  permutation,
const int  jblock,
const int  kblock 

Definition at line 421 of file PmeSolverUtil.h.

References dataSize, getBlockDim(), getPencilDim(), isize, jsize, ksize, NAMD_bug(), nblock, Perm_cX_Y_Z, Perm_Y_Z_cX, Perm_Z_cX_Y, pos, PmeGrid::xBlocks, PmeGrid::yBlocks, and PmeGrid::zBlocks.

421  :
424  int i0, i1, j0, j1, k0, k1;
425  getPencilDim(pmeGrid, permutation, jblock, kblock, i0, i1, j0, j1, k0, k1);
426  isize = (i1-i0+1);
427  jsize = (j1-j0+1);
428  ksize = (k1-k0+1);
429  dataSize = (i1-i0+1)*(j1-j0+1)*(k1-k0+1);
431  switch(permutation) {
432  case Perm_cX_Y_Z:
433  nblock = pmeGrid.xBlocks;
434  break;
435  case Perm_Y_Z_cX:
436  nblock = pmeGrid.yBlocks;
437  break;
438  case Perm_Z_cX_Y:
439  nblock = pmeGrid.zBlocks;
440  break;
441  default:
442  NAMD_bug("PmeTranspose::PmeTranspose, invalid permutation");
443  break;
444  }
446  // Pos marks the beginning of blocks
447  pos.resize(nblock+1);
449  int x1;
450  for (int iblock=0;iblock < nblock;iblock++) {
451  // Get the dimension of the transpose block
452  // We are transposing nblock of these blocks and storing them into a pencil of size
453  // ny * nz * xsize at location ny*nz*x0
454  int x0, y0dummy, y1dummy, z0dummy, z1dummy;
455  getBlockDim(pmeGrid, permutation, iblock, jblock, kblock, x0, x1, y0dummy, y1dummy, z0dummy, z1dummy);
457  pos[iblock] = x0;
458  }
459  // Last position begins at x1+1
460  pos[nblock] = x1+1;
461  }
int zBlocks
Definition: PmeBase.h:22
const int permutation
static void getPencilDim(const PmeGrid &pmeGrid, const int permutation, const int jblock, const int kblock, int &i0, int &i1, int &j0, int &j1, int &k0, int &k1)
Definition: PmeSolverUtil.h:29
std::vector< int > pos
PmeGrid pmeGrid
int yBlocks
Definition: PmeBase.h:22
void NAMD_bug(const char *err_msg)
Definition: common.C:129
const int jblock
const int kblock
static void getBlockDim(const PmeGrid &pmeGrid, const int permutation, const int iblock, const int jblock, const int kblock, int &i0, int &i1, int &j0, int &j1, int &k0, int &k1)
Definition: PmeSolverUtil.h:86
int xBlocks
Definition: PmeBase.h:22
virtual PmeTranspose::~PmeTranspose ( )

Definition at line 462 of file PmeSolverUtil.h.

462 {}

Member Function Documentation

virtual void PmeTranspose::transposeXYZtoYZX ( const float2 data)
pure virtual

Implemented in CudaPmeTranspose.

virtual void PmeTranspose::transposeXYZtoZXY ( const float2 data)
pure virtual

Implemented in CudaPmeTranspose.

Member Data Documentation

int PmeTranspose::dataSize
int PmeTranspose::isize
const int PmeTranspose::jblock
int PmeTranspose::jsize
const int PmeTranspose::kblock
int PmeTranspose::ksize
int PmeTranspose::nblock
const int PmeTranspose::permutation
PmeGrid PmeTranspose::pmeGrid
std::vector<int> PmeTranspose::pos

The documentation for this class was generated from the following file: