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

#include <PmeSolverUtil.h>

Inheritance diagram for PmeTranspose:
CudaPmeTranspose

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

Constructor & Destructor Documentation

◆ PmeTranspose()

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

Definition at line 434 of file PmeSolverUtil.h.

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

434  :
436 
437  int i0, i1, j0, j1, k0, k1;
438  getPencilDim(pmeGrid, permutation, jblock, kblock, i0, i1, j0, j1, k0, k1);
439  isize = (i1-i0+1);
440  jsize = (j1-j0+1);
441  ksize = (k1-k0+1);
442  dataSize = (i1-i0+1)*(j1-j0+1)*(k1-k0+1);
443 
444  switch(permutation) {
445  case Perm_cX_Y_Z:
447  break;
448  case Perm_Y_Z_cX:
450  break;
451  case Perm_Z_cX_Y:
453  break;
454  default:
455  NAMD_bug("PmeTranspose::PmeTranspose, invalid permutation");
456  break;
457  }
458 
459  // Pos marks the beginning of blocks
460  pos.resize(nblock+1);
461 
462  int x1;
463  for (int iblock=0;iblock < nblock;iblock++) {
464  // Get the dimension of the transpose block
465  // We are transposing nblock of these blocks and storing them into a pencil of size
466  // ny * nz * xsize at location ny*nz*x0
467  int x0, y0dummy, y1dummy, z0dummy, z1dummy;
468  getBlockDim(pmeGrid, permutation, iblock, jblock, kblock, x0, x1, y0dummy, y1dummy, z0dummy, z1dummy);
469 
470  pos[iblock] = x0;
471  }
472  // Last position begins at x1+1
473  pos[nblock] = x1+1;
474  }
int zBlocks
Definition: PmeBase.h:25
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:32
std::vector< int > pos
PmeGrid pmeGrid
int yBlocks
Definition: PmeBase.h:25
void NAMD_bug(const char *err_msg)
Definition: common.C:195
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:89
int xBlocks
Definition: PmeBase.h:25

◆ ~PmeTranspose()

virtual PmeTranspose::~PmeTranspose ( )
inlinevirtual

Definition at line 475 of file PmeSolverUtil.h.

475 {}

Member Function Documentation

◆ transposeXYZtoYZX()

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

Implemented in CudaPmeTranspose.

◆ transposeXYZtoZXY()

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

Implemented in CudaPmeTranspose.

Member Data Documentation

◆ dataSize

int PmeTranspose::dataSize
protected

◆ isize

int PmeTranspose::isize
protected

◆ jblock

const int PmeTranspose::jblock
protected

◆ jsize

int PmeTranspose::jsize
protected

◆ kblock

const int PmeTranspose::kblock
protected

◆ ksize

int PmeTranspose::ksize
protected

◆ nblock

int PmeTranspose::nblock
protected

◆ permutation

const int PmeTranspose::permutation
protected

◆ pmeGrid

PmeGrid PmeTranspose::pmeGrid
protected

◆ pos

std::vector<int> PmeTranspose::pos
protected

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