CudaPmePencilX Class Reference

#include <CudaPmeSolver.h>

List of all members.

Public Member Functions

CudaPmePencilX_SDAG_CODE CudaPmePencilX ()
 CudaPmePencilX (CkMigrateMessage *m)
 ~CudaPmePencilX ()
void initialize (CudaPmeXInitMsg *msg)
void initializeDevice (InitDeviceMsg *msg)


Detailed Description

Definition at line 112 of file CudaPmeSolver.h.


Constructor & Destructor Documentation

CudaPmePencilX_SDAG_CODE CudaPmePencilX::CudaPmePencilX (  )  [inline]

Definition at line 115 of file CudaPmeSolver.h.

00115 : numGetDeviceBuffer(0), eventCreated(false) {}

CudaPmePencilX::CudaPmePencilX ( CkMigrateMessage *  m  )  [inline]

Definition at line 116 of file CudaPmeSolver.h.

00116 : numGetDeviceBuffer(0), eventCreated(false) {}

CudaPmePencilX::~CudaPmePencilX (  ) 

Definition at line 268 of file CudaPmeSolver.C.

References cudaCheck.

00268                                 {
00269   if (eventCreated) cudaCheck(cudaEventDestroy(event));
00270 }


Member Function Documentation

void CudaPmePencilX::initialize ( CudaPmeXInitMsg msg  ) 

Definition at line 257 of file CudaPmeSolver.C.

References CudaPmeXInitMsg::pmeGrid, CudaPmeXInitMsg::pmePencilY, and CudaPmeXInitMsg::yMap.

00257                                                     {
00258   pmeGrid = msg->pmeGrid;
00259   pmePencilY = msg->pmePencilY;
00260   yMap = msg->yMap;
00261 
00262   delete msg;
00263 
00264   initBlockSizes();
00265 
00266 }

void CudaPmePencilX::initializeDevice ( InitDeviceMsg msg  ) 

Definition at line 275 of file CudaPmeSolver.C.

References cudaCheck, InitDeviceMsg::deviceProxy, and Perm_cX_Y_Z.

00275                                                         {
00276   // Store device proxy
00277   deviceProxy = msg->deviceProxy;
00278   delete msg;
00279   deviceID = deviceProxy.ckLocalBranch()->getDeviceID();
00280   stream = deviceProxy.ckLocalBranch()->getStream();
00281   CProxy_ComputePmeCUDAMgr mgrProxy = deviceProxy.ckLocalBranch()->getMgrProxy();
00282   // Setup fftCompute and pmeKSpaceCompute
00283   fftCompute = new CudaFFTCompute(deviceID, stream);
00284   pmeTranspose = new CudaPmeTranspose(pmeGrid, Perm_cX_Y_Z, thisIndex.y, thisIndex.z, deviceID, stream);  
00285 
00286   // Create event. NOTE: Events are tied to devices, hence the cudaSetDevice() here
00287   cudaCheck(cudaSetDevice(deviceID));
00288   cudaCheck(cudaEventCreateWithFlags(&event, cudaEventDisableTiming));
00289   eventCreated = true;
00290 
00291   deviceBuffers.resize(pmeGrid.xBlocks, DeviceBuffer(-1, false, NULL));
00292   numDeviceBuffers = 0;
00293 
00294   for (int x=0;x < pmeGrid.xBlocks;x++) {
00295     int pe = yMap.ckLocalBranch()->procNum(0, CkArrayIndex3D(x,0,thisIndex.z));
00296     if (CkNodeOf(pe) == CkMyNode()) {
00297       int deviceID0 = mgrProxy.ckLocalBranch()->getDeviceIDPencilY(x, thisIndex.z);
00298       numDeviceBuffers++;
00299       deviceBuffers[x] = DeviceBuffer(deviceID0, false, NULL);
00300       pmePencilY(x,0,thisIndex.z).getDeviceBuffer(thisIndex.y, (deviceID0 == deviceID), thisProxy);
00301     }
00302   }
00303 
00304 }


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