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 406 of file PmeSolverUtil.h.

Constructor & Destructor Documentation

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

Definition at line 416 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.

416  :
419  int i0, i1, j0, j1, k0, k1;
420  getPencilDim(pmeGrid, permutation, jblock, kblock, i0, i1, j0, j1, k0, k1);
421  isize = (i1-i0+1);
422  jsize = (j1-j0+1);
423  ksize = (k1-k0+1);
424  dataSize = (i1-i0+1)*(j1-j0+1)*(k1-k0+1);
426  switch(permutation) {
427  case Perm_cX_Y_Z:
428  nblock = pmeGrid.xBlocks;
429  break;
430  case Perm_Y_Z_cX:
431  nblock = pmeGrid.yBlocks;
432  break;
433  case Perm_Z_cX_Y:
434  nblock = pmeGrid.zBlocks;
435  break;
436  default:
437  NAMD_bug("PmeTranspose::PmeTranspose, invalid permutation");
438  break;
439  }
441  // Pos marks the beginning of blocks
442  pos.resize(nblock+1);
444  int x1;
445  for (int iblock=0;iblock < nblock;iblock++) {
446  // Get the dimension of the transpose block
447  // We are transposing nblock of these blocks and storing them into a pencil of size
448  // ny * nz * xsize at location ny*nz*x0
449  int x0, y0dummy, y1dummy, z0dummy, z1dummy;
450  getBlockDim(pmeGrid, permutation, iblock, jblock, kblock, x0, x1, y0dummy, y1dummy, z0dummy, z1dummy);
452  pos[iblock] = x0;
453  }
454  // Last position begins at x1+1
455  pos[nblock] = x1+1;
456  }
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:123
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 457 of file PmeSolverUtil.h.

457 {}

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: