CudaPmePencilY Class Reference

#include <CudaPmeSolver.h>

List of all members.

Public Member Functions

CudaPmePencilY_SDAG_CODE CudaPmePencilY ()
 CudaPmePencilY (CkMigrateMessage *m)
 ~CudaPmePencilY ()
void initialize (CudaPmeXInitMsg *msg)
void initializeDevice (InitDeviceMsg2 *msg)


Detailed Description

Definition at line 140 of file CudaPmeSolver.h.


Constructor & Destructor Documentation

CudaPmePencilY_SDAG_CODE CudaPmePencilY::CudaPmePencilY (  )  [inline]

Definition at line 143 of file CudaPmeSolver.h.

00143 : numGetDeviceBufferZ(0), numGetDeviceBufferX(0), eventCreated(false) {}

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

Definition at line 144 of file CudaPmeSolver.h.

00144 : numGetDeviceBufferZ(0), numGetDeviceBufferX(0), eventCreated(false) {}

CudaPmePencilY::~CudaPmePencilY (  ) 

Definition at line 447 of file CudaPmeSolver.C.

References cudaCheck.

00447                                 {
00448   if (eventCreated) cudaCheck(cudaEventDestroy(event));
00449 }


Member Function Documentation

void CudaPmePencilY::initialize ( CudaPmeXInitMsg msg  ) 

Definition at line 435 of file CudaPmeSolver.C.

References CudaPmeXInitMsg::pmeGrid, CudaPmeXInitMsg::pmePencilX, CudaPmeXInitMsg::pmePencilZ, CudaPmeXInitMsg::xMap, and CudaPmeXInitMsg::zMap.

00435                                                     {
00436   pmeGrid = msg->pmeGrid;
00437   pmePencilX = msg->pmePencilX;
00438   pmePencilZ = msg->pmePencilZ;
00439   xMap = msg->xMap;
00440   zMap = msg->zMap;
00441 
00442   delete msg;
00443 
00444   initBlockSizes();
00445 }

void CudaPmePencilY::initializeDevice ( InitDeviceMsg2 msg  ) 

Definition at line 454 of file CudaPmeSolver.C.

References cudaCheck, InitDeviceMsg2::deviceID, InitDeviceMsg2::mgrProxy, Perm_Y_Z_cX, InitDeviceMsg2::stream, and y.

00454                                                          {
00455   // Get device proxy
00456   // CProxy_ComputePmeCUDADevice deviceProxy = msg->deviceProxy;
00457   deviceID = msg->deviceID;
00458   stream = msg->stream;
00459   CProxy_ComputePmeCUDAMgr mgrProxy = msg->mgrProxy;
00460   delete msg;
00461   // deviceID = deviceProxy.ckLocalBranch()->getDeviceID();
00462   // cudaStream_t stream = deviceProxy.ckLocalBranch()->getStream();
00463   // CProxy_ComputePmeCUDAMgr mgrProxy = deviceProxy.ckLocalBranch()->getMgrProxy();
00464   // Setup fftCompute and pmeKSpaceCompute
00465   fftCompute = new CudaFFTCompute(deviceID, stream);
00466   pmeTranspose = new CudaPmeTranspose(pmeGrid, Perm_Y_Z_cX, thisIndex.z, thisIndex.x, deviceID, stream);
00467 
00468   // Create event. NOTE: Events are tied to devices, hence the cudaSetDevice() here
00469   cudaCheck(cudaSetDevice(deviceID));
00470   cudaCheck(cudaEventCreateWithFlags(&event, cudaEventDisableTiming));
00471   eventCreated = true;
00472 
00473   deviceBuffersZ.resize(pmeGrid.yBlocks, DeviceBuffer(-1, false, NULL));
00474   deviceBuffersX.resize(pmeGrid.yBlocks, DeviceBuffer(-1, false, NULL));
00475   numDeviceBuffersZ = 0;
00476   numDeviceBuffersX = 0;
00477 
00478   for (int y=0;y < pmeGrid.yBlocks;y++) {
00479     int pe;
00480     pe = zMap.ckLocalBranch()->procNum(0, CkArrayIndex3D(thisIndex.x, y, 0));
00481     if (CkNodeOf(pe) == CkMyNode()) {
00482       int deviceID0 = mgrProxy.ckLocalBranch()->getDeviceIDPencilZ(thisIndex.x, y);
00483       numDeviceBuffersZ++;
00484       deviceBuffersZ[y] = DeviceBuffer(deviceID0, false, NULL);
00485       pmePencilZ(thisIndex.x, y, 0).getDeviceBuffer(thisIndex.z, (deviceID0 == deviceID), thisProxy);
00486     }
00487     pe = xMap.ckLocalBranch()->procNum(0, CkArrayIndex3D(0, y, thisIndex.z));
00488     if (CkNodeOf(pe) == CkMyNode()) {
00489       int deviceID0 = mgrProxy.ckLocalBranch()->getDeviceIDPencilX(y, thisIndex.z);
00490       numDeviceBuffersX++;
00491       deviceBuffersX[y] = DeviceBuffer(deviceID0, false, NULL);
00492       pmePencilX(0, y, thisIndex.z).getDeviceBuffer(thisIndex.x, (deviceID0 == deviceID), thisProxy);
00493     }
00494   }
00495 
00496 }


The documentation for this class was generated from the following files:
Generated on Sat Sep 23 01:17:19 2017 for NAMD by  doxygen 1.4.7