Lattice Microbes 2.5
This is for whole cell modeling
Loading...
Searching...
No Matches
CudaByteLattice Class Reference

#include <CudaByteLattice.h>

Inheritance diagram for CudaByteLattice:
[legend]
Collaboration diagram for CudaByteLattice:
[legend]

Public Member Functions

 CudaByteLattice (lattice_coord_t size, si_dist_t spacing, uint particlesPerSite)
 CudaByteLattice (lattice_size_t xSize, lattice_size_t ySize, lattice_size_t zSize, si_dist_t spacing, uint particlesPerSite)
virtual ~CudaByteLattice ()
virtual void copyToGPU ()
virtual void copyFromGPU ()
virtual void * getGPUMemorySrc ()
virtual void * getGPUMemoryDest ()
virtual void swapSrcDest ()
virtual void * getGPUMemorySiteTypes ()
virtual size_t getParticleMemorySize () const
virtual void setSiteType (lattice_size_t x, lattice_size_t y, lattice_size_t z, site_t site)
 Set the site type at the specified location.
virtual void setSiteType (lattice_size_t index, site_t site)
 Set the site type at the specified location.
virtual void addParticle (lattice_size_t x, lattice_size_t y, lattice_size_t z, particle_t particle)
 Add a particle to the specified site.
virtual void addParticle (lattice_size_t index, particle_t particle)
 Add a particle to the specified site.
virtual void removeParticles (lattice_size_t x, lattice_size_t y, lattice_size_t z)
 Remove a particle to the specified site.
virtual void removeParticles (lattice_size_t index)
 Remove a particle to the specified site.
virtual void removeAllParticles ()
 Empty all particles from the specified site.
virtual void setFromRowMajorByteData (void *buffer, size_t bufferSize)
virtual void getSiteLatticeView (uint8_t **siteLattice, int *Nz, int *Ny, int *Nx)
virtual void getParticleLatticeView (uint8_t **particleLattice, int *Nw, int *Nz, int *Ny, int *Nx, int *Np)
Public Member Functions inherited from lm::rdme::ByteLattice
virtual site_t getMaxSiteType () const
 Get the maximum number of site types possible in the lattice.
virtual particle_t getMaxParticle () const
 Get the maximum number of particle types possible in the lattice.
virtual site_size_t getMaxOccupancy () const
 Get the maximum number of particles that can live in a site.
 ByteLattice (lattice_coord_t size, si_dist_t spacing, uint particlesPerSite)
 ByteLattice (lattice_size_t xSize, lattice_size_t ySize, lattice_size_t zSize, si_dist_t spacing, uint particlesPerSite)
virtual ~ByteLattice ()
virtual void getNeighboringSites (lattice_size_t index, lattice_size_t *neighboringIndices)
 Get the sites that are neighbor to the indicated site.
virtual site_t getSiteType (lattice_size_t x, lattice_size_t y, lattice_size_t z) const
 Get the site type at the specified location.
virtual site_t getSiteType (lattice_size_t subvolume) const
 Get the site type at the specified location.
void copySites (void *destBuffer, size_t latticeSize)
virtual site_size_t getOccupancy (lattice_size_t x, lattice_size_t y, lattice_size_t z) const
 Get the number of particles in the specified lattice site.
virtual site_size_t getOccupancy (lattice_size_t subvolume) const
 Get the number of particles in the specified lattice site.
virtual particle_t getParticle (lattice_size_t x, lattice_size_t y, lattice_size_t z, site_size_t particleIndex) const
 Get the particle at the specified site with at the specified number in the particle list.
virtual particle_t getParticle (lattice_size_t subvolume, site_size_t particleIndex) const
 Get the particle at the specified site with at the specified number in the particle list.
virtual std::map< particle_t, uintgetParticleCounts ()
 Get the number of each particle type in the lattice.
virtual std::vector< particle_loc_tfindParticles (particle_t minParticleType, particle_t maxParticleType)
 Get the number of the specified particles types in the lattice.
virtual void setSitesFromRowMajorByteData (void *buffer, size_t bufferSize)
virtual size_t getLatticeMemorySize () const
Public Member Functions inherited from lm::rdme::Lattice
 Lattice (lattice_coord_t size, si_dist_t spacing)
 Create a Lattice object.
 Lattice (lattice_size_t xSize, lattice_size_t ySize, lattice_size_t zSize, si_dist_t spacing)
 Create a Lattice object.
virtual ~Lattice ()
 Destroy the Lattice object.
virtual lattice_coord_t getSize () const
 Get size of the Lattice.
virtual lattice_size_t getXSize () const
 Get x dimension of the Lattice.
virtual lattice_size_t getYSize () const
 Get y dimension of the Lattice.
virtual lattice_size_t getZSize () const
 Get z dimension of the Lattice.
virtual lattice_size_t getNumberSites () const
 Get total number of sites in the Lattice.
virtual si_dist_t getSpacing () const
 Get spacing between lattice sites.
std::vector< lattice_coord_tgetNearbySites (lattice_size_t xc, lattice_size_t yc, lattice_size_t zc, uint minDistance, uint maxDistance)
 Get a list of sites near the specified site within a certain distance.
virtual void print () const
 Print the lattice to the console.

Protected Member Functions

virtual void allocateCudaMemory ()
virtual void deallocateCudaMemory ()
Protected Member Functions inherited from lm::rdme::ByteLattice
virtual void allocateMemory ()
virtual void deallocateMemory ()
virtual uint32_t * getParticlesMemory ()
virtual uint8_t * getSitesMemory ()

Protected Attributes

uint cudaParticlesCurrent
size_t cudaParticlesSize
void * cudaParticles [2]
size_t cudaSiteTypesSize
void * cudaSiteTypes
bool isGPUMemorySynched
Protected Attributes inherited from lm::rdme::ByteLattice
size_t wordsPerSite
uint32_t * particles
uint8_t * siteTypes
Protected Attributes inherited from lm::rdme::Lattice
lattice_coord_t size
lattice_size_t numberSites
si_dist_t spacing

Additional Inherited Members

Static Public Member Functions inherited from lm::rdme::ByteLattice
static void nativeSerialize (void *destBuffer, void *lattice, size_t latticeSize)
static void nativeSerializeSites (void *destBuffer, void *lattice, size_t latticeSize)
static void copyNativeToRowMajorByte (void *destBuffer, void *sourceBuffer, lattice_size_t xSize, lattice_size_t ySize, lattice_size_t zSize, uint particlesPerSite, size_t bufferSize)
static void copyRowMajorByteToNative (void *destBuffer, void *sourceBuffer, lattice_size_t xSize, lattice_size_t ySize, lattice_size_t zSize, uint particlesPerSite, size_t bufferSize)
static void copySitesRowMajorByteToNative (void *destBuffer, void *sourceBuffer, lattice_size_t xSize, lattice_size_t ySize, lattice_size_t zSize, size_t bufferSize)
static void copySitesNativeToRowMajorByte (void *destBuffer, void *sourceBuffer, lattice_size_t xSize, lattice_size_t ySize, lattice_size_t zSize, size_t bufferSize)
Static Public Member Functions inherited from lm::rdme::Lattice
static void rowMajorByteSerialize (void *destBuffer, void *lattice, size_t bufferSize)
static void rowMajorIntSerialize (void *destBuffer, void *lattice, size_t bufferSize)
static void rowMajorByteSerializeSites (void *destBuffer, void *lattice, size_t bufferSize)

Constructor & Destructor Documentation

◆ CudaByteLattice() [1/2]

lm::rdme::CudaByteLattice::CudaByteLattice ( lattice_coord_t size,
si_dist_t spacing,
uint particlesPerSite )

◆ CudaByteLattice() [2/2]

lm::rdme::CudaByteLattice::CudaByteLattice ( lattice_size_t xSize,
lattice_size_t ySize,
lattice_size_t zSize,
si_dist_t spacing,
uint particlesPerSite )

◆ ~CudaByteLattice()

virtual lm::rdme::CudaByteLattice::~CudaByteLattice ( )
virtual

Member Function Documentation

◆ addParticle() [1/2]

virtual void lm::rdme::CudaByteLattice::addParticle ( lattice_size_t index,
particle_t particle )
virtual

Add a particle to the specified site.

Reimplemented from lm::rdme::ByteLattice.

◆ addParticle() [2/2]

virtual void lm::rdme::CudaByteLattice::addParticle ( lattice_size_t x,
lattice_size_t y,
lattice_size_t z,
particle_t particle )
virtual

Add a particle to the specified site.

Reimplemented from lm::rdme::ByteLattice.

◆ allocateCudaMemory()

virtual void lm::rdme::CudaByteLattice::allocateCudaMemory ( )
protectedvirtual

◆ copyFromGPU()

virtual void lm::rdme::CudaByteLattice::copyFromGPU ( )
virtual

◆ copyToGPU()

virtual void lm::rdme::CudaByteLattice::copyToGPU ( )
virtual

◆ deallocateCudaMemory()

virtual void lm::rdme::CudaByteLattice::deallocateCudaMemory ( )
protectedvirtual

◆ getGPUMemoryDest()

virtual void * lm::rdme::CudaByteLattice::getGPUMemoryDest ( )
virtual

◆ getGPUMemorySiteTypes()

virtual void * lm::rdme::CudaByteLattice::getGPUMemorySiteTypes ( )
virtual

◆ getGPUMemorySrc()

virtual void * lm::rdme::CudaByteLattice::getGPUMemorySrc ( )
virtual

◆ getParticleLatticeView()

virtual void lm::rdme::CudaByteLattice::getParticleLatticeView ( uint8_t ** particleLattice,
int * Nw,
int * Nz,
int * Ny,
int * Nx,
int * Np )
virtual

Reimplemented from lm::rdme::ByteLattice.

◆ getParticleMemorySize()

virtual size_t lm::rdme::CudaByteLattice::getParticleMemorySize ( ) const
inlinevirtual

◆ getSiteLatticeView()

virtual void lm::rdme::CudaByteLattice::getSiteLatticeView ( uint8_t ** siteLattice,
int * Nz,
int * Ny,
int * Nx )
virtual

Reimplemented from lm::rdme::ByteLattice.

◆ removeAllParticles()

virtual void lm::rdme::CudaByteLattice::removeAllParticles ( )
virtual

Empty all particles from the specified site.

Reimplemented from lm::rdme::ByteLattice.

◆ removeParticles() [1/2]

virtual void lm::rdme::CudaByteLattice::removeParticles ( lattice_size_t index)
virtual

Remove a particle to the specified site.

Reimplemented from lm::rdme::ByteLattice.

◆ removeParticles() [2/2]

virtual void lm::rdme::CudaByteLattice::removeParticles ( lattice_size_t x,
lattice_size_t y,
lattice_size_t z )
virtual

Remove a particle to the specified site.

Reimplemented from lm::rdme::ByteLattice.

◆ setFromRowMajorByteData()

virtual void lm::rdme::CudaByteLattice::setFromRowMajorByteData ( void * buffer,
size_t bufferSize )
virtual

Reimplemented from lm::rdme::ByteLattice.

◆ setSiteType() [1/2]

virtual void lm::rdme::CudaByteLattice::setSiteType ( lattice_size_t index,
site_t site )
virtual

Set the site type at the specified location.

Reimplemented from lm::rdme::ByteLattice.

◆ setSiteType() [2/2]

virtual void lm::rdme::CudaByteLattice::setSiteType ( lattice_size_t x,
lattice_size_t y,
lattice_size_t z,
site_t site )
virtual

Set the site type at the specified location.

Reimplemented from lm::rdme::ByteLattice.

◆ swapSrcDest()

virtual void lm::rdme::CudaByteLattice::swapSrcDest ( )
virtual

Member Data Documentation

◆ cudaParticles

void* lm::rdme::CudaByteLattice::cudaParticles[2]
protected

◆ cudaParticlesCurrent

uint lm::rdme::CudaByteLattice::cudaParticlesCurrent
protected

◆ cudaParticlesSize

size_t lm::rdme::CudaByteLattice::cudaParticlesSize
protected

◆ cudaSiteTypes

void* lm::rdme::CudaByteLattice::cudaSiteTypes
protected

◆ cudaSiteTypesSize

size_t lm::rdme::CudaByteLattice::cudaSiteTypesSize
protected

◆ isGPUMemorySynched

bool lm::rdme::CudaByteLattice::isGPUMemorySynched
protected

The documentation for this class was generated from the following file: