29#include "system/Leaf.hpp"
53 public std::enable_shared_from_this<GpuParticleData> {
57 static constexpr std::size_t
pos = 0;
58 static constexpr std::size_t
force = 1;
59 static constexpr std::size_t
torque = 2;
60 static constexpr std::size_t
q = 3;
61 static constexpr std::size_t
dip = 4;
74#ifdef ESPRESSO_DIPOLES
77#ifdef ESPRESSO_ELECTROSTATICS
86 std::unique_ptr<Storage> m_data;
87 void deinitialize() noexcept;
93 bool m_communication_enabled = false;
95 bool m_split_particle_struct = false;
97 bool m_need_particles_update = false;
100 bool has_compatible_device_impl() const;
101 void gpu_init_particle_comm();
102 void enable_particle_transfer();
103 void copy_particles_to_device();
109 void particles_scatter_forces(
ParticleRange const &particles,
110 std::span<
float> host_forces,
111 std::span<
float> host_torques) const;
112#ifdef ESPRESSO_DIPOLE_FIELD_TRACKING
113 void particles_scatter_dip_fld(
ParticleRange const &particles,
114 std::span<float> host_dip_fld)
const;
122 if (m_need_particles_update and m_communication_enabled) {
123 copy_particles_to_device();
130#ifdef ESPRESSO_DIPOLE_FIELD_TRACKING
140#ifdef ESPRESSO_DIPOLE_FIELD_TRACKING
143#ifdef ESPRESSO_ROTATION
146#ifdef ESPRESSO_DIPOLES
149#ifdef ESPRESSO_ELECTROSTATICS
std::vector< T, CudaHostAllocator< T > > pinned_vector
Vector implementation and trait types for boost qvm interoperability.
Host and device containers for particle data.
float * get_particle_dip_fld_device() const
float * get_particle_torques_device() const
float * get_particle_charges_device() const
void copy_forces_to_host(ParticleRange const &particles, int this_node)
GpuEnergy * get_energy_device() const
void copy_dip_fld_to_host(ParticleRange const &particles, int this_node)
float * get_particle_dipoles_device() const
float * get_particle_forces_device() const
GpuEnergy copy_energy_to_host() const
void clear_energy_on_device()
void enable_property(std::size_t property)
std::size_t n_particles() const
bool has_compatible_device() const
float * get_particle_positions_device() const
Queue to deallocate resources before normal program termination.
Abstract class that represents a component of the system.
int this_node
The number of this node.
Energies that are retrieved from the GPU.
Subset of Particle which is copied to the GPU.
Particle properties that need to be communicated to the GPU.
static constexpr std::size_t force
static constexpr std::size_t dip_fld
static constexpr std::size_t torque
static constexpr std::size_t pos
static constexpr std::size_t dip
static constexpr std::size_t q