ComputeCUDAMgr Class Reference

#include <ComputeCUDAMgr.h>

List of all members.

Public Member Functions

 ComputeCUDAMgr ()
 ComputeCUDAMgr (CkMigrateMessage *)
 ~ComputeCUDAMgr ()
void initialize (CkQdMsg *msg)
void initialize_devices (CkQdMsg *msg)
CudaComputeNonbondedcreateCudaComputeNonbonded (ComputeID c)
CudaComputeNonbondedgetCudaComputeNonbonded ()

Static Public Member Functions

static ComputeCUDAMgrgetComputeCUDAMgr ()


Detailed Description

Definition at line 13 of file ComputeCUDAMgr.h.


Constructor & Destructor Documentation

ComputeCUDAMgr::ComputeCUDAMgr (  ) 

Definition at line 16 of file ComputeCUDAMgr.C.

00016                                {
00017         // __sdag_init();
00018   numDevices = 0;
00019   // numNodesContributed = 0;
00020   // numDevicesMax = 0;
00021 }

ComputeCUDAMgr::ComputeCUDAMgr ( CkMigrateMessage *   ) 

Definition at line 26 of file ComputeCUDAMgr.C.

References NAMD_bug().

00026                                                  {
00027         // __sdag_init();
00028   NAMD_bug("ComputeCUDAMgr cannot be migrated");
00029   numDevices = 0;
00030   // numNodesContributed = 0;
00031   // numDevicesMax = 0;
00032 }

ComputeCUDAMgr::~ComputeCUDAMgr (  ) 

Definition at line 37 of file ComputeCUDAMgr.C.

00037                                 {
00038   for (int i=0;i < numDevices;i++) {
00039     if (cudaNonbondedTablesList[i] != NULL) delete cudaNonbondedTablesList[i];
00040     if (cudaComputeNonbondedList[i] != NULL) delete cudaComputeNonbondedList[i];
00041 #ifdef BONDED_CUDA
00042     if (computeBondedCUDAList[i] != NULL) delete computeBondedCUDAList[i];
00043 #endif
00044   }
00045 }


Member Function Documentation

CudaComputeNonbonded * ComputeCUDAMgr::createCudaComputeNonbonded ( ComputeID  c  ) 

Definition at line 82 of file ComputeCUDAMgr.C.

References deviceCUDA, doStreaming(), SimParameters::GBISOn, DeviceCUDA::getDeviceID(), DeviceCUDA::getNoStreaming(), NAMD_bug(), Node::Object(), and Node::simParameters.

Referenced by createCudaComputeNonbonded().

00082                                                                             {
00083   int deviceID = deviceCUDA->getDeviceID();
00084   if (cudaComputeNonbondedList.at(deviceID) != NULL)
00085     NAMD_bug("ComputeCUDAMgr::createCudaComputeNonbonded called twice");
00086   if (cudaNonbondedTablesList.at(deviceID) == NULL)
00087     NAMD_bug("ComputeCUDAMgr::createCudaComputeNonbonded, non-bonded CUDA tables not created");
00088   bool doStreaming = !deviceCUDA->getNoStreaming() && !Node::Object()->simParameters->GBISOn;
00089   cudaComputeNonbondedList[deviceID] = new CudaComputeNonbonded(c, deviceID, *cudaNonbondedTablesList[deviceID], doStreaming);
00090   return cudaComputeNonbondedList[deviceID];
00091 }

ComputeCUDAMgr * ComputeCUDAMgr::getComputeCUDAMgr (  )  [static]

Definition at line 70 of file ComputeCUDAMgr.C.

References NAMD_bug().

Referenced by createCudaComputeNonbonded(), and getCudaComputeNonbonded().

00070                                                   {
00071   // Get pointer to ComputeCUDAMgr on this node
00072   CProxy_ComputeCUDAMgr computeCUDAMgrProxy = CkpvAccess(BOCclass_group).computeCUDAMgr;
00073   ComputeCUDAMgr* computeCUDAMgr = computeCUDAMgrProxy.ckLocalBranch();
00074   if (computeCUDAMgr == NULL)
00075     NAMD_bug("getComputeCUDAMgr, unable to locate local branch of BOC entry ComputeCUDAMgr");
00076   return computeCUDAMgr;
00077 }

CudaComputeNonbonded * ComputeCUDAMgr::getCudaComputeNonbonded (  ) 

Definition at line 96 of file ComputeCUDAMgr.C.

References deviceCUDA, DeviceCUDA::getDeviceID(), and NAMD_bug().

Referenced by getCudaComputeNonbonded().

00096                                                               {
00097   // Get device ID for this Pe
00098   int deviceID = deviceCUDA->getDeviceID();
00099   CudaComputeNonbonded* p = cudaComputeNonbondedList[deviceID];
00100   if (p == NULL)
00101     NAMD_bug("ComputeCUDAMgr::getCudaComputeNonbonded(), device not created yet");
00102   return p;
00103 }

void ComputeCUDAMgr::initialize ( CkQdMsg *  msg  ) 

Definition at line 51 of file ComputeCUDAMgr.C.

References deviceCUDA, DeviceCUDA::getDeviceCount(), DeviceCUDA::getDeviceIDbyRank(), and DeviceCUDA::getNumDevice().

00051                                             {
00052         if (msg != NULL) delete msg;
00053 
00054         numDevices = deviceCUDA->getDeviceCount();
00055 
00056   // Create pointers to devices
00057   cudaNonbondedTablesList.resize(numDevices, NULL);
00058   cudaComputeNonbondedList.resize(numDevices, NULL);
00059 #ifdef BONDED_CUDA
00060   computeBondedCUDAList.resize(numDevices, NULL);
00061 #endif
00062 
00063   // Create CUDA non-bonded tables for all devices that are used for computation
00064   for (int i=0;i < deviceCUDA->getNumDevice();i++) {
00065     int deviceID = deviceCUDA->getDeviceIDbyRank(i);
00066     cudaNonbondedTablesList[deviceID] = new CudaNonbondedTables(deviceID);
00067   }
00068 }

void ComputeCUDAMgr::initialize_devices ( CkQdMsg *  msg  ) 


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