Difference for src/ComputeCUDAMgr.C from version 1.1 to 1.2

version 1.1version 1.2
Line 36
Line 36
 // //
 ComputeCUDAMgr::~ComputeCUDAMgr() { ComputeCUDAMgr::~ComputeCUDAMgr() {
   for (int i=0;i < numDevices;i++) {   for (int i=0;i < numDevices;i++) {
      if (cudaNonbondedTablesList[i] != NULL) delete cudaNonbondedTablesList[i];
     if (cudaComputeNonbondedList[i] != NULL) delete cudaComputeNonbondedList[i];     if (cudaComputeNonbondedList[i] != NULL) delete cudaComputeNonbondedList[i];
  #ifdef BONDED_CUDA
      if (computeBondedCUDAList[i] != NULL) delete computeBondedCUDAList[i];
  #endif
   }   }
 } }
  
Line 50
Line 54
  numDevices = deviceCUDA->getDeviceCount();  numDevices = deviceCUDA->getDeviceCount();
  
   // Create pointers to devices   // Create pointers to devices
    cudaNonbondedTablesList.resize(numDevices, NULL);
   cudaComputeNonbondedList.resize(numDevices, NULL);   cudaComputeNonbondedList.resize(numDevices, NULL);
  #ifdef BONDED_CUDA
    computeBondedCUDAList.resize(numDevices, NULL);
  #endif
  
    // Create CUDA non-bonded tables for all devices that are used for computation
    for (int i=0;i < deviceCUDA->getNumDevice();i++) {
      int deviceID = deviceCUDA->getDeviceIDbyRank(i);
      cudaNonbondedTablesList[deviceID] = new CudaNonbondedTables(deviceID);
    }
 } }
  
 ComputeCUDAMgr* ComputeCUDAMgr::getComputeCUDAMgr() { ComputeCUDAMgr* ComputeCUDAMgr::getComputeCUDAMgr() {
Line 69
Line 83
   int deviceID = deviceCUDA->getDeviceID();   int deviceID = deviceCUDA->getDeviceID();
   if (cudaComputeNonbondedList.at(deviceID) != NULL)   if (cudaComputeNonbondedList.at(deviceID) != NULL)
     NAMD_bug("ComputeCUDAMgr::createCudaComputeNonbonded called twice");     NAMD_bug("ComputeCUDAMgr::createCudaComputeNonbonded called twice");
    if (cudaNonbondedTablesList.at(deviceID) == NULL)
      NAMD_bug("ComputeCUDAMgr::createCudaComputeNonbonded, non-bonded CUDA tables not created");
   bool doStreaming = !deviceCUDA->getNoStreaming() && !Node::Object()->simParameters->GBISOn;   bool doStreaming = !deviceCUDA->getNoStreaming() && !Node::Object()->simParameters->GBISOn;
   cudaComputeNonbondedList[deviceID] = new CudaComputeNonbonded(c, deviceID, doStreaming);   cudaComputeNonbondedList[deviceID] = new CudaComputeNonbonded(c, deviceID, *cudaNonbondedTablesList[deviceID], doStreaming);
   cudaComputeNonbondedList[deviceID]->buildTables(); 
   return cudaComputeNonbondedList[deviceID];   return cudaComputeNonbondedList[deviceID];
 } }
  
Line 86
Line 101
     NAMD_bug("ComputeCUDAMgr::getCudaComputeNonbonded(), device not created yet");     NAMD_bug("ComputeCUDAMgr::getCudaComputeNonbonded(), device not created yet");
   return p;   return p;
 } }
  
  #ifdef BONDED_CUDA
  //
  // Creates ComputeBondedCUDA object
  //
  ComputeBondedCUDA* ComputeCUDAMgr::createComputeBondedCUDA(ComputeID c, ComputeMgr* computeMgr) {
    int deviceID = deviceCUDA->getDeviceID();
    if (computeBondedCUDAList.at(deviceID) != NULL)
      NAMD_bug("ComputeCUDAMgr::createComputeBondedCUDA called twice");
    if (cudaNonbondedTablesList.at(deviceID) == NULL)
      NAMD_bug("ComputeCUDAMgr::createCudaComputeNonbonded, non-bonded CUDA tables not created");
    computeBondedCUDAList[deviceID] = new ComputeBondedCUDA(c, computeMgr, deviceID, *cudaNonbondedTablesList[deviceID]);
    return computeBondedCUDAList[deviceID];
  }
  
  //
  // Returns ComputeBondedCUDA for this Pe
  //
  ComputeBondedCUDA* ComputeCUDAMgr::getComputeBondedCUDA() {
    // Get device ID for this Pe
    int deviceID = deviceCUDA->getDeviceID();
    ComputeBondedCUDA* p = computeBondedCUDAList[deviceID];
    if (p == NULL)
      NAMD_bug("ComputeCUDAMgr::getComputeBondedCUDA(), device not created yet");
    return p;
  }
  #endif // BONDED_CUDA
  
 #endif // NAMD_CUDA #endif // NAMD_CUDA
  
 #include "ComputeCUDAMgr.def.h" #include "ComputeCUDAMgr.def.h"


Legend:
Removed in v.1.1 
changed lines
 Added in v.1.2



Made by using version 1.53 of cvs2html