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

GGEMS class handling RAM memory. More...

#include "GGEMSRAMManager.hh"

Collaboration diagram for GGEMSRAMManager:
Collaboration graph

Public Member Functions

 GGEMSRAMManager (GGEMSRAMManager const &ram_manager)=delete
 Avoid copy of the class by reference. More...
 
GGEMSRAMManager & operator= (GGEMSRAMManager const &ram_manager)=delete
 Avoid assignement of the class by reference. More...
 
 GGEMSRAMManager (GGEMSRAMManager const &&ram_manager)=delete
 Avoid copy of the class by rvalue reference. More...
 
GGEMSRAMManager & operator= (GGEMSRAMManager const &&ram_manager)=delete
 Avoid copy of the class by rvalue reference. More...
 
void PrintRAMStatus (void) const
 print the RAM memory status for activated context More...
 
bool IsEnoughAvailableRAMMemory (GGsize const &index, GGsize const &size) const
 Checking available RAM memory on device. More...
 
bool IsBufferSizeCorrect (GGsize const &index, GGsize const &size) const
 Check the size of buffer depending on device limit, false if buffer size if too big. More...
 
void IncrementRAMMemory (std::string const &class_name, GGsize const &index, GGsize const &size)
 increment the size of the global allocated buffer More...
 
void DecrementRAMMemory (std::string const &class_name, GGsize const &index, GGsize const &size)
 decrement the size of the global allocated buffer More...
 
void Clean (void)
 clean OpenCL data if necessary More...
 

Static Public Member Functions

static GGEMSRAMManager & GetInstance (void)
 Create at first time the Singleton. More...
 

Private Member Functions

 GGEMSRAMManager (void)
 Unable the constructor for the user. More...
 
 ~GGEMSRAMManager (void)
 Unable the destructor for the user. More...
 

Private Attributes

GGsize number_detected_devices_
 
GGsize * allocated_ram_
 
GGsize * max_available_ram_
 
GGsize * max_buffer_size_
 
AllocatedMemoryUMap * allocated_memories_
 

Detailed Description

GGEMS class handling RAM memory.

Definition at line 50 of file GGEMSRAMManager.hh.

Constructor & Destructor Documentation

◆ GGEMSRAMManager() [1/3]

GGEMSRAMManager::GGEMSRAMManager ( void  )
private

Unable the constructor for the user.

Definition at line 40 of file GGEMSRAMManager.cc.

◆ ~GGEMSRAMManager()

GGEMSRAMManager::~GGEMSRAMManager ( void  )
private

Unable the destructor for the user.

Definition at line 69 of file GGEMSRAMManager.cc.

◆ GGEMSRAMManager() [2/3]

GGEMSRAMManager::GGEMSRAMManager ( GGEMSRAMManager const &  ram_manager)
delete

Avoid copy of the class by reference.

Parameters
ram_manager- reference on the ram manager

◆ GGEMSRAMManager() [3/3]

GGEMSRAMManager::GGEMSRAMManager ( GGEMSRAMManager const &&  ram_manager)
delete

Avoid copy of the class by rvalue reference.

Parameters
ram_manager- rvalue reference on the ram manager

Member Function Documentation

◆ Clean()

void GGEMSRAMManager::Clean ( void  )

clean OpenCL data if necessary

Definition at line 99 of file GGEMSRAMManager.cc.

◆ DecrementRAMMemory()

void GGEMSRAMManager::DecrementRAMMemory ( std::string const &  class_name,
GGsize const &  index,
GGsize const &  size 
)

decrement the size of the global allocated buffer

Parameters
class_name- name of class deallocating memory
index- index of device
size- size of the allocated buffer in byte

Definition at line 134 of file GGEMSRAMManager.cc.

◆ GetInstance()

static GGEMSRAMManager & GGEMSRAMManager::GetInstance ( void  )
inlinestatic

Create at first time the Singleton.

Returns
Object of type GGEMSRAMManager

Definition at line 69 of file GGEMSRAMManager.hh.

◆ IncrementRAMMemory()

void GGEMSRAMManager::IncrementRAMMemory ( std::string const &  class_name,
GGsize const &  index,
GGsize const &  size 
)

increment the size of the global allocated buffer

Parameters
class_name- name of class allocating memory
index- index of device
size- size of the allocated buffer in byte

Definition at line 110 of file GGEMSRAMManager.cc.

◆ IsBufferSizeCorrect()

bool GGEMSRAMManager::IsBufferSizeCorrect ( GGsize const &  index,
GGsize const &  size 
) const
inline

Check the size of buffer depending on device limit, false if buffer size if too big.

Parameters
index- index of device
size- size in bytes of buffer
Returns
true if buffer size is correct

Definition at line 129 of file GGEMSRAMManager.hh.

◆ IsEnoughAvailableRAMMemory()

bool GGEMSRAMManager::IsEnoughAvailableRAMMemory ( GGsize const &  index,
GGsize const &  size 
) const
inline

Checking available RAM memory on device.

Parameters
index- index of device
size- size in bytes to allocate
Returns
true if enough available RAM memory

Definition at line 116 of file GGEMSRAMManager.hh.

◆ operator=() [1/2]

GGEMSRAMManager & GGEMSRAMManager::operator= ( GGEMSRAMManager const &&  ram_manager)
delete

Avoid copy of the class by rvalue reference.

Parameters
ram_manager- rvalue reference on the ram manager

◆ operator=() [2/2]

GGEMSRAMManager & GGEMSRAMManager::operator= ( GGEMSRAMManager const &  ram_manager)
delete

Avoid assignement of the class by reference.

Parameters
ram_manager- reference on the ram manager

◆ PrintRAMStatus()

void GGEMSRAMManager::PrintRAMStatus ( void  ) const

print the RAM memory status for activated context

Definition at line 151 of file GGEMSRAMManager.cc.

Member Data Documentation

◆ allocated_memories_

AllocatedMemoryUMap* GGEMSRAMManager::allocated_memories_
private

Allocated memory on OpenCL device by GGEMS class

Definition at line 164 of file GGEMSRAMManager.hh.

◆ allocated_ram_

GGsize* GGEMSRAMManager::allocated_ram_
private

Allocated RAM on OpenCL device

Definition at line 161 of file GGEMSRAMManager.hh.

◆ max_available_ram_

GGsize* GGEMSRAMManager::max_available_ram_
private

Max available RAM on OpenCL device

Definition at line 162 of file GGEMSRAMManager.hh.

◆ max_buffer_size_

GGsize* GGEMSRAMManager::max_buffer_size_
private

Max of buffer size of OpenCL device

Definition at line 163 of file GGEMSRAMManager.hh.

◆ number_detected_devices_

GGsize GGEMSRAMManager::number_detected_devices_
private

Number of detected device

Definition at line 160 of file GGEMSRAMManager.hh.


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