PmeTranspose Class Reference

#include <PmeSolverUtil.h>

Inheritance diagram for PmeTranspose:

CudaPmeTranspose List of all members.

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 
) [inline]

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, pmeGrid, pos, PmeGrid::xBlocks, PmeGrid::yBlocks, and PmeGrid::zBlocks.

00416                                                                                            : 
00417     pmeGrid(pmeGrid), permutation(permutation), jblock(jblock), kblock(kblock) {
00418 
00419     int i0, i1, j0, j1, k0, k1;
00420     getPencilDim(pmeGrid, permutation, jblock, kblock, i0, i1, j0, j1, k0, k1);
00421     isize = (i1-i0+1);
00422     jsize = (j1-j0+1);
00423     ksize = (k1-k0+1);
00424     dataSize = (i1-i0+1)*(j1-j0+1)*(k1-k0+1);
00425 
00426     switch(permutation) {
00427       case Perm_cX_Y_Z:
00428       nblock = pmeGrid.xBlocks;
00429       break;
00430       case Perm_Y_Z_cX:
00431       nblock = pmeGrid.yBlocks;
00432       break;
00433       case Perm_Z_cX_Y:
00434       nblock = pmeGrid.zBlocks;
00435       break;
00436       default:
00437       NAMD_bug("PmeTranspose::PmeTranspose, invalid permutation");
00438       break;
00439     }
00440 
00441     // Pos marks the beginning of blocks
00442     pos.resize(nblock+1);
00443 
00444     int x1;
00445     for (int iblock=0;iblock < nblock;iblock++) {
00446       // Get the dimension of the transpose block
00447       // We are transposing nblock of these blocks and storing them into a pencil of size
00448       // ny * nz * xsize at location ny*nz*x0
00449       int x0, y0dummy, y1dummy, z0dummy, z1dummy;
00450       getBlockDim(pmeGrid, permutation, iblock, jblock, kblock, x0, x1, y0dummy, y1dummy, z0dummy, z1dummy);
00451 
00452       pos[iblock] = x0;
00453     }
00454     // Last position begins at x1+1
00455     pos[nblock] = x1+1;
00456   }

virtual PmeTranspose::~PmeTranspose (  )  [inline, virtual]

Definition at line 457 of file PmeSolverUtil.h.

00457 {}


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 [protected]

Definition at line 412 of file PmeSolverUtil.h.

Referenced by CudaPmeTranspose::copyDataDeviceToHost(), CudaPmeTranspose::CudaPmeTranspose(), and PmeTranspose().

int PmeTranspose::isize [protected]

Definition at line 411 of file PmeSolverUtil.h.

Referenced by CudaPmeTranspose::copyDataDeviceToDevice(), CudaPmeTranspose::copyDataHostToDevice(), PmeTranspose(), CudaPmeTranspose::transposeXYZtoYZX(), and CudaPmeTranspose::transposeXYZtoZXY().

const int PmeTranspose::jblock [protected]

Definition at line 410 of file PmeSolverUtil.h.

Referenced by CudaPmeTranspose::copyDataDeviceToDevice(), CudaPmeTranspose::copyDataHostToDevice(), CudaPmeTranspose::copyDataToPeerDeviceYZX(), CudaPmeTranspose::copyDataToPeerDeviceZXY(), and CudaPmeTranspose::getBuffer().

int PmeTranspose::jsize [protected]

Definition at line 411 of file PmeSolverUtil.h.

Referenced by CudaPmeTranspose::copyDataDeviceToDevice(), CudaPmeTranspose::copyDataDeviceToHost(), CudaPmeTranspose::copyDataHostToDevice(), PmeTranspose(), CudaPmeTranspose::setDataPtrsYZX(), CudaPmeTranspose::setDataPtrsZXY(), CudaPmeTranspose::transposeXYZtoYZX(), and CudaPmeTranspose::transposeXYZtoZXY().

const int PmeTranspose::kblock [protected]

Definition at line 410 of file PmeSolverUtil.h.

Referenced by CudaPmeTranspose::copyDataDeviceToDevice(), CudaPmeTranspose::copyDataHostToDevice(), CudaPmeTranspose::copyDataToPeerDeviceYZX(), CudaPmeTranspose::copyDataToPeerDeviceZXY(), and CudaPmeTranspose::getBuffer().

int PmeTranspose::ksize [protected]

Definition at line 411 of file PmeSolverUtil.h.

Referenced by CudaPmeTranspose::copyDataDeviceToHost(), PmeTranspose(), CudaPmeTranspose::setDataPtrsYZX(), CudaPmeTranspose::setDataPtrsZXY(), CudaPmeTranspose::transposeXYZtoYZX(), and CudaPmeTranspose::transposeXYZtoZXY().

int PmeTranspose::nblock [protected]

Definition at line 413 of file PmeSolverUtil.h.

Referenced by CudaPmeTranspose::copyDataDeviceToDevice(), CudaPmeTranspose::copyDataDeviceToHost(), CudaPmeTranspose::copyDataHostToDevice(), CudaPmeTranspose::CudaPmeTranspose(), CudaPmeTranspose::getBuffer(), PmeTranspose(), CudaPmeTranspose::setDataPtrsYZX(), CudaPmeTranspose::setDataPtrsZXY(), CudaPmeTranspose::transposeXYZtoYZX(), and CudaPmeTranspose::transposeXYZtoZXY().

const int PmeTranspose::permutation [protected]

Definition at line 409 of file PmeSolverUtil.h.

Referenced by CudaPmeTranspose::copyDataDeviceToDevice(), CudaPmeTranspose::copyDataHostToDevice(), CudaPmeTranspose::getBuffer(), CudaPmeTranspose::transposeXYZtoYZX(), and CudaPmeTranspose::transposeXYZtoZXY().

PmeGrid PmeTranspose::pmeGrid [protected]

Definition at line 408 of file PmeSolverUtil.h.

Referenced by CudaPmeTranspose::copyDataDeviceToDevice(), CudaPmeTranspose::copyDataHostToDevice(), CudaPmeTranspose::getBuffer(), PmeTranspose(), CudaPmeTranspose::setDataPtrsYZX(), and CudaPmeTranspose::setDataPtrsZXY().

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

Definition at line 414 of file PmeSolverUtil.h.

Referenced by CudaPmeTranspose::copyDataDeviceToHost(), PmeTranspose(), CudaPmeTranspose::setDataPtrsYZX(), and CudaPmeTranspose::setDataPtrsZXY().


The documentation for this class was generated from the following file:
Generated on Thu Nov 23 01:17:19 2017 for NAMD by  doxygen 1.4.7