PmeAtomStorage Class Reference

#include <ComputePmeCUDAMgr.h>

Inheritance diagram for PmeAtomStorage:

CpuPmeAtomStorage CudaPmeAtomStorage List of all members.

Public Member Functions

 PmeAtomStorage (const bool useIndex)
virtual ~PmeAtomStorage ()
int addAtoms (const int natom, const CudaAtom *src)
int addAtomsWithIndex (const int natom, const CudaAtom *src, const int *index)
void finish ()
void clear ()
CudaAtomgetAtoms ()
int * getPatchPos ()
int getNumPatches ()
int getNumAtoms ()
int * getAtomIndex ()

Protected Attributes

CudaAtomatom
int * atomIndex
CudaAtomoverflowAtom
int * overflowAtomIndex

Detailed Description

Definition at line 20 of file ComputePmeCUDAMgr.h.


Constructor & Destructor Documentation

PmeAtomStorage::PmeAtomStorage ( const bool  useIndex  )  [inline]

Definition at line 22 of file ComputePmeCUDAMgr.h.

References atom, atomIndex, overflowAtom, and overflowAtomIndex.

00022                                       : useIndex(useIndex) {
00023     numAtoms = 0;
00024     atomCapacity = 0;
00025     atom = NULL;
00026     atomIndexCapacity = 0;
00027     atomIndex = NULL;
00028     overflowStart = 0;
00029     overflowEnd = 0;
00030     overflowAtomCapacity = 0;
00031     overflowAtom = NULL;
00032     overflowAtomIndexCapacity = 0;
00033     overflowAtomIndex = NULL;
00034     lock_ = CmiCreateLock();
00035   }

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

Definition at line 36 of file ComputePmeCUDAMgr.h.

00036                             {
00037     CmiDestroyLock(lock_);
00038   }


Member Function Documentation

int PmeAtomStorage::addAtoms ( const int  natom,
const CudaAtom src 
) [inline]

Definition at line 40 of file ComputePmeCUDAMgr.h.

00040                                                      {
00041     return addAtoms_(natom, src, NULL);
00042   }

int PmeAtomStorage::addAtomsWithIndex ( const int  natom,
const CudaAtom src,
const int *  index 
) [inline]

Definition at line 44 of file ComputePmeCUDAMgr.h.

00044                                                                                 {
00045     return addAtoms_(natom, src, index);
00046   }

void PmeAtomStorage::clear (  )  [inline]

Definition at line 63 of file ComputePmeCUDAMgr.h.

00063                {
00064     patchPos.clear();
00065     numAtoms = 0;    
00066   }

void PmeAtomStorage::finish (  )  [inline]

Definition at line 50 of file ComputePmeCUDAMgr.h.

References atom, atomIndex, overflowAtom, and overflowAtomIndex.

00050                 {
00051     if (overflowEnd-overflowStart > 0) {
00052       resize_((void **)&atom, numAtoms, atomCapacity, sizeof(CudaAtom));
00053       if (useIndex) resize_((void **)&atomIndex, numAtoms, atomIndexCapacity, sizeof(int));
00054       memcpy_(atom+overflowStart, overflowAtom, (overflowEnd - overflowStart)*sizeof(CudaAtom));
00055       if (useIndex) memcpy_(atomIndex+overflowStart, overflowAtomIndex, (overflowEnd - overflowStart)*sizeof(int));
00056       overflowStart = 0;
00057       overflowEnd = 0;
00058     }
00059   }

int* PmeAtomStorage::getAtomIndex (  )  [inline]

Definition at line 86 of file ComputePmeCUDAMgr.h.

References atomIndex, and NAMD_bug().

00086                       {
00087     if (!useIndex)
00088       NAMD_bug("PmeAtomStorage::getAtomIndex, no indexing enabled");
00089     return atomIndex;
00090   }

CudaAtom* PmeAtomStorage::getAtoms (  )  [inline]

Definition at line 69 of file ComputePmeCUDAMgr.h.

References atom.

00069                        {
00070     return atom;
00071   }

int PmeAtomStorage::getNumAtoms (  )  [inline]

Definition at line 82 of file ComputePmeCUDAMgr.h.

00082                     {
00083     return numAtoms;
00084   }

int PmeAtomStorage::getNumPatches (  )  [inline]

Definition at line 78 of file ComputePmeCUDAMgr.h.

00078                       {
00079     return patchPos.size();
00080   }

int* PmeAtomStorage::getPatchPos (  )  [inline]

Definition at line 74 of file ComputePmeCUDAMgr.h.

00074                      {
00075     return patchPos.data();
00076   }


Member Data Documentation

CudaAtom* PmeAtomStorage::atom [protected]

Definition at line 94 of file ComputePmeCUDAMgr.h.

Referenced by finish(), getAtoms(), PmeAtomStorage(), CpuPmeAtomStorage::~CpuPmeAtomStorage(), and CudaPmeAtomStorage::~CudaPmeAtomStorage().

int* PmeAtomStorage::atomIndex [protected]

Definition at line 96 of file ComputePmeCUDAMgr.h.

Referenced by finish(), getAtomIndex(), PmeAtomStorage(), CpuPmeAtomStorage::~CpuPmeAtomStorage(), and CudaPmeAtomStorage::~CudaPmeAtomStorage().

CudaAtom* PmeAtomStorage::overflowAtom [protected]

Definition at line 98 of file ComputePmeCUDAMgr.h.

Referenced by finish(), PmeAtomStorage(), CpuPmeAtomStorage::~CpuPmeAtomStorage(), and CudaPmeAtomStorage::~CudaPmeAtomStorage().

int* PmeAtomStorage::overflowAtomIndex [protected]

Definition at line 100 of file ComputePmeCUDAMgr.h.

Referenced by finish(), PmeAtomStorage(), CpuPmeAtomStorage::~CpuPmeAtomStorage(), and CudaPmeAtomStorage::~CudaPmeAtomStorage().


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