ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
GpuParticleData Class Reference

Particle data communication manager for the GPU. More...

#include <GpuParticleData.hpp>

+ Inheritance diagram for GpuParticleData:
+ Collaboration diagram for GpuParticleData:

Classes

struct  GpuEnergy
 Energies that are retrieved from the GPU. More...
 
struct  GpuParticle
 Subset of Particle which is copied to the GPU. More...
 
struct  prop
 Particle properties that need to be communicated to the GPU. More...
 
class  Storage
 Host and device containers for particle data. More...
 

Public Member Functions

 GpuParticleData ()=default
 
 ~GpuParticleData ()=default
 
void update ()
 
void initialize ()
 
void enable_property (std::size_t property)
 
void clear_energy_on_device ()
 
void copy_forces_to_host (ParticleRange const &particles, int this_node)
 
std::size_t n_particles () const
 
bool has_compatible_device () const
 
GpuEnergy copy_energy_to_host () const
 
GpuEnergyget_energy_device () const
 
float * get_particle_positions_device () const
 
float * get_particle_forces_device () const
 
float * get_particle_torques_device () const
 
float * get_particle_dipoles_device () const
 
float * get_particle_charges_device () const
 
- Public Member Functions inherited from System::Leaf< GpuParticleData >
void bind_system (std::shared_ptr< System > const &system)
 
void detach_system (std::shared_ptr< System > const &system)
 

Additional Inherited Members

- Protected Member Functions inherited from System::Leaf< GpuParticleData >
auto & get_system ()
 
auto & get_system () const
 
- Protected Attributes inherited from System::Leaf< GpuParticleData >
std::weak_ptr< Systemm_system
 

Detailed Description

Particle data communication manager for the GPU.

When data is synchronized between host and device memory, a subset of the Particle struct is copied from each particle on the host to the corresponding GpuParticle struct on the device via GpuParticleData::update(). Once the transfer is complete, the particle AoS on the device is copied (or "split") to a SoA automatically.

Note that once a particle member is requested, the corresponding device memory is allocated and populated at every time step, even when the GPU method that originally requested the data is disabled.

Definition at line 51 of file GpuParticleData.hpp.

Constructor & Destructor Documentation

◆ GpuParticleData()

GpuParticleData::GpuParticleData ( )
default

◆ ~GpuParticleData()

GpuParticleData::~GpuParticleData ( )
default

Member Function Documentation

◆ clear_energy_on_device()

void GpuParticleData::clear_energy_on_device ( )

Definition at line 281 of file GpuParticleData_cuda.cu.

References cuda_safe_mem.

◆ copy_energy_to_host()

GpuParticleData::GpuEnergy GpuParticleData::copy_energy_to_host ( ) const

Definition at line 290 of file GpuParticleData_cuda.cu.

References cuda_safe_mem.

◆ copy_forces_to_host()

void GpuParticleData::copy_forces_to_host ( ParticleRange const &  particles,
int  this_node 
)

Definition at line 258 of file GpuParticleData_cuda.cu.

References this_node.

◆ enable_property()

void GpuParticleData::enable_property ( std::size_t  property)

◆ get_energy_device()

GpuParticleData::GpuEnergy * GpuParticleData::get_energy_device ( ) const

Definition at line 185 of file GpuParticleData_cuda.cu.

◆ get_particle_charges_device()

float * GpuParticleData::get_particle_charges_device ( ) const

Definition at line 180 of file GpuParticleData_cuda.cu.

Referenced by p3m_gpu_add_farfield_force().

◆ get_particle_dipoles_device()

float * GpuParticleData::get_particle_dipoles_device ( ) const

Definition at line 174 of file GpuParticleData_cuda.cu.

◆ get_particle_forces_device()

float * GpuParticleData::get_particle_forces_device ( ) const

Definition at line 163 of file GpuParticleData_cuda.cu.

References raw_data_pointer().

Referenced by p3m_gpu_add_farfield_force().

◆ get_particle_positions_device()

float * GpuParticleData::get_particle_positions_device ( ) const

Definition at line 159 of file GpuParticleData_cuda.cu.

Referenced by p3m_gpu_add_farfield_force().

◆ get_particle_torques_device()

float * GpuParticleData::get_particle_torques_device ( ) const

Definition at line 168 of file GpuParticleData_cuda.cu.

References raw_data_pointer().

◆ has_compatible_device()

bool GpuParticleData::has_compatible_device ( ) const

Definition at line 57 of file GpuParticleData.cpp.

References comm_cart, and this_node.

◆ initialize()

void GpuParticleData::initialize ( )

◆ n_particles()

std::size_t GpuParticleData::n_particles ( ) const

Definition at line 155 of file GpuParticleData_cuda.cu.

◆ update()

void GpuParticleData::update ( )
inline

Definition at line 109 of file GpuParticleData.hpp.


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