ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
|
Particle data communication manager for the GPU. More...
#include <GpuParticleData.hpp>
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 |
GpuEnergy * | get_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< System > | m_system |
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.
|
default |
|
default |
void GpuParticleData::clear_energy_on_device | ( | ) |
Definition at line 284 of file GpuParticleData_cuda.cu.
References cuda_safe_mem.
GpuParticleData::GpuEnergy GpuParticleData::copy_energy_to_host | ( | ) | const |
Definition at line 293 of file GpuParticleData_cuda.cu.
References cuda_safe_mem.
void GpuParticleData::copy_forces_to_host | ( | ParticleRange const & | particles, |
int | this_node | ||
) |
Definition at line 261 of file GpuParticleData_cuda.cu.
References this_node.
void GpuParticleData::enable_property | ( | std::size_t | property | ) |
Definition at line 190 of file GpuParticleData_cuda.cu.
References GpuParticleData::prop::force, and GpuParticleData::prop::torque.
GpuParticleData::GpuEnergy * GpuParticleData::get_energy_device | ( | ) | const |
Definition at line 186 of file GpuParticleData_cuda.cu.
float * GpuParticleData::get_particle_charges_device | ( | ) | const |
Definition at line 181 of file GpuParticleData_cuda.cu.
Referenced by p3m_gpu_add_farfield_force().
float * GpuParticleData::get_particle_dipoles_device | ( | ) | const |
Definition at line 175 of file GpuParticleData_cuda.cu.
float * GpuParticleData::get_particle_forces_device | ( | ) | const |
Definition at line 164 of file GpuParticleData_cuda.cu.
References raw_data_pointer().
Referenced by p3m_gpu_add_farfield_force().
float * GpuParticleData::get_particle_positions_device | ( | ) | const |
Definition at line 160 of file GpuParticleData_cuda.cu.
Referenced by p3m_gpu_add_farfield_force().
float * GpuParticleData::get_particle_torques_device | ( | ) | const |
Definition at line 169 of file GpuParticleData_cuda.cu.
References raw_data_pointer().
bool GpuParticleData::has_compatible_device | ( | ) | const |
Definition at line 56 of file GpuParticleData.cpp.
void GpuParticleData::initialize | ( | ) |
Definition at line 152 of file GpuParticleData_cuda.cu.
References System::Leaf< GpuParticleData >::get_system(), and GpuParticleData::Storage::make_shared().
std::size_t GpuParticleData::n_particles | ( | ) | const |
Definition at line 156 of file GpuParticleData_cuda.cu.
Referenced by get_n_part_safe().
|
inline |
Definition at line 109 of file GpuParticleData.hpp.