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

Public Member Functions

 GpuParticleData ()
 ~GpuParticleData ()
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)
void copy_dip_fld_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
GpuEnergy * get_energy_device () const
float * get_particle_positions_device () const
float * get_particle_forces_device () const
float * get_particle_dip_fld_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 ()
Protected Attributes inherited from System::Leaf< GpuParticleData >
std::weak_ptr< System > m_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 52 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 314 of file GpuParticleData_cuda.cu.

References cuda_safe_mem.

◆ copy_dip_fld_to_host()

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

Definition at line 298 of file GpuParticleData_cuda.cu.

References this_node.

◆ copy_energy_to_host()

GpuParticleData::GpuEnergy GpuParticleData::copy_energy_to_host ( ) const

Definition at line 323 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 275 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 183 of file GpuParticleData_cuda.cu.

◆ get_particle_charges_device()

float * GpuParticleData::get_particle_charges_device ( ) const

Definition at line 178 of file GpuParticleData_cuda.cu.

◆ get_particle_dip_fld_device()

float * GpuParticleData::get_particle_dip_fld_device ( ) const

Definition at line 160 of file GpuParticleData_cuda.cu.

References raw_data_pointer().

◆ get_particle_dipoles_device()

float * GpuParticleData::get_particle_dipoles_device ( ) const

Definition at line 172 of file GpuParticleData_cuda.cu.

◆ get_particle_forces_device()

float * GpuParticleData::get_particle_forces_device ( ) const

Definition at line 156 of file GpuParticleData_cuda.cu.

References raw_data_pointer().

◆ get_particle_positions_device()

float * GpuParticleData::get_particle_positions_device ( ) const

Definition at line 152 of file GpuParticleData_cuda.cu.

◆ get_particle_torques_device()

float * GpuParticleData::get_particle_torques_device ( ) const

Definition at line 166 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

◆ update()

void GpuParticleData::update ( )
inline

Definition at line 121 of file GpuParticleData.hpp.


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