GGEMS  1.1
GPU GEant4-based Monte Carlo Simulations
GGEMSParticles Class Reference

Class managing the particles in GGEMS. More...

#include "GGEMSParticles.hh"

Collaboration diagram for GGEMSParticles:
Collaboration graph

Public Member Functions

 GGEMSParticles (void)
 GGEMSParticles constructor. More...
 
 ~GGEMSParticles (void)
 GGEMSParticles destructor. More...
 
 GGEMSParticles (GGEMSParticles const &particle)=delete
 Avoid copy of the class by reference. More...
 
GGEMSParticlesoperator= (GGEMSParticles const &particle)=delete
 Avoid assignement of the class by reference. More...
 
 GGEMSParticles (GGEMSParticles const &&particle)=delete
 Avoid copy of the class by rvalue reference. More...
 
GGEMSParticlesoperator= (GGEMSParticles const &&particle)=delete
 Avoid copy of the class by rvalue reference. More...
 
void Initialize (void)
 Initialize the GGEMSParticles object. More...
 
cl::Buffer * GetPrimaryParticles (GGsize const &thread_index) const
 return the pointer to OpenCL buffer storing particles More...
 
void SetNumberOfParticles (GGsize const &thread_index, GGsize const &number_of_particles)
 Set the number of particles in buffer. More...
 
GGsize GetNumberOfParticles (GGsize const &thread_index) const
 Get the number of particles on activated device. More...
 
bool IsAlive (GGsize const &thread_index) const
 check if some particles are alive in OpenCL particle buffer More...
 
void Dump (std::string const &message) const
 dump particle infos More...
 

Private Member Functions

void AllocatePrimaryParticles (void)
 Allocate memory for primary particles. More...
 
void InitializeKernel (void)
 Initialize kernel for particle in OpenCL. More...
 

Private Attributes

GGsizenumber_of_particles_
 
cl::Buffer ** primary_particles_
 
cl::Buffer ** status_
 
GGsize number_activated_devices_
 
cl::Kernel ** kernel_alive_
 

Detailed Description

Class managing the particles in GGEMS.

Definition at line 47 of file GGEMSParticles.hh.

Constructor & Destructor Documentation

◆ GGEMSParticles() [1/3]

GGEMSParticles::GGEMSParticles ( void  )

GGEMSParticles constructor.

Definition at line 40 of file GGEMSParticles.cc.

◆ ~GGEMSParticles()

GGEMSParticles::~GGEMSParticles ( void  )

GGEMSParticles destructor.

Definition at line 54 of file GGEMSParticles.cc.

◆ GGEMSParticles() [2/3]

GGEMSParticles::GGEMSParticles ( GGEMSParticles const &  particle)
delete

Avoid copy of the class by reference.

Parameters
particle- reference on the particle

◆ GGEMSParticles() [3/3]

GGEMSParticles::GGEMSParticles ( GGEMSParticles const &&  particle)
delete

Avoid copy of the class by rvalue reference.

Parameters
particle- rvalue reference on the particle

Member Function Documentation

◆ AllocatePrimaryParticles()

void GGEMSParticles::AllocatePrimaryParticles ( void  )
private

Allocate memory for primary particles.

Definition at line 200 of file GGEMSParticles.cc.

◆ Dump()

void GGEMSParticles::Dump ( std::string const &  message) const

dump particle infos

Parameters
message- message for dumping

◆ GetNumberOfParticles()

GGsize GGEMSParticles::GetNumberOfParticles ( GGsize const &  thread_index) const
inline

Get the number of particles on activated device.

Parameters
thread_index- index of activated device (thread index)
Returns
number of particles currently activated in OpenCL buffer

Definition at line 116 of file GGEMSParticles.hh.

◆ GetPrimaryParticles()

cl::Buffer * GGEMSParticles::GetPrimaryParticles ( GGsize const &  thread_index) const
inline

return the pointer to OpenCL buffer storing particles

Parameters
thread_index- index of activated device (thread index)
Returns
pointer to OpenCL buffer storing particles

Definition at line 100 of file GGEMSParticles.hh.

◆ Initialize()

void GGEMSParticles::Initialize ( void  )

Initialize the GGEMSParticles object.

Definition at line 120 of file GGEMSParticles.cc.

◆ InitializeKernel()

void GGEMSParticles::InitializeKernel ( void  )
private

Initialize kernel for particle in OpenCL.

Definition at line 97 of file GGEMSParticles.cc.

◆ IsAlive()

bool GGEMSParticles::IsAlive ( GGsize const &  thread_index) const

check if some particles are alive in OpenCL particle buffer

Parameters
thread_index- index of activated device (thread index)
Returns
true if source is still alive, otherwize false

Definition at line 119 of file GGEMSParticles.hh.

◆ operator=() [1/2]

GGEMSParticles & GGEMSParticles::operator= ( GGEMSParticles const &&  particle)
delete

Avoid copy of the class by rvalue reference.

Parameters
particle- rvalue reference on the particle

◆ operator=() [2/2]

GGEMSParticles & GGEMSParticles::operator= ( GGEMSParticles const &  particle)
delete

Avoid assignement of the class by reference.

Parameters
particle- reference on the particle

◆ SetNumberOfParticles()

void GGEMSParticles::SetNumberOfParticles ( GGsize const &  thread_index,
GGsize const &  number_of_particles 
)

Set the number of particles in buffer.

Parameters
thread_index- index of activated device (thread index)
number_of_particles- number of activated particles in buffer

Definition at line 103 of file GGEMSParticles.hh.

Member Data Documentation

◆ kernel_alive_

cl::Kernel** GGEMSParticles::kernel_alive_
private

Kernel checking if particles are alive

Definition at line 151 of file GGEMSParticles.hh.

◆ number_activated_devices_

GGsize GGEMSParticles::number_activated_devices_
private

Number of activated device

Definition at line 150 of file GGEMSParticles.hh.

◆ number_of_particles_

GGsize* GGEMSParticles::number_of_particles_
private

Number of activated particles in buffer

Definition at line 147 of file GGEMSParticles.hh.

◆ primary_particles_

cl::Buffer** GGEMSParticles::primary_particles_
private

Pointer storing info about primary particles in batch on OpenCL device

Definition at line 148 of file GGEMSParticles.hh.

◆ status_

cl::Buffer** GGEMSParticles::status_
private

Buffer storing status of particle

Definition at line 149 of file GGEMSParticles.hh.


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