|
GGEMS
1.1
GPU GEant4-based Monte Carlo Simulations
|
Go to the documentation of this file. 1 #ifndef GUARD_GGEMS_TOOLS_GGEMSRAMMANAGER_HH
2 #define GUARD_GGEMS_TOOLS_GGEMSRAMMANAGER_HH
35 #pragma warning(disable: 4251) // Deleting warning exporting STL members!!!
39 #include <unordered_map>
42 #include "GGEMS/global/GGEMSExport.hh"
107 void PrintRAMStatus(
void)
const;
118 if (size + allocated_ram_[index] < max_available_ram_[index])
return true;
131 if (size < max_buffer_size_[index])
return true;
142 void IncrementRAMMemory(std::string
const& class_name,
GGsize const& index,
GGsize const& size);
151 void DecrementRAMMemory(std::string
const& class_name,
GGsize const& index,
GGsize const& size);
181 #endif // End of GUARD_GGEMS_TOOLS_GGEMSRAMMANAGER_HH
void print_infos_ram_manager(GGEMSRAMManager *ram_manager)
Print information about RAM memory.
GGEMS class handling RAM memory.
GGsize number_detected_devices_
static GGEMSRAMManager & GetInstance(void)
Create at first time the Singleton.
GGEMSRAMManager & operator=(GGEMSRAMManager const &&ram_manager)=delete
Avoid copy of the class by rvalue reference.
GGEMSRAMManager(GGEMSRAMManager const &&ram_manager)=delete
Avoid copy of the class by rvalue reference.
GGEMSRAMManager * get_instance_ggems_ram_manager(void)
Get the GGEMSRAMManager pointer for python user.
Redefining types for OpenCL device and host.
bool IsEnoughAvailableRAMMemory(GGsize const &index, GGsize const &size) const
Checking available RAM memory on device.
AllocatedMemoryUMap * allocated_memories_
GGEMSRAMManager & operator=(GGEMSRAMManager const &ram_manager)=delete
Avoid assignement of the class by reference.
GGEMSRAMManager(GGEMSRAMManager const &ram_manager)=delete
Avoid copy of the class by reference.
GGsize * max_available_ram_
GGsize * max_buffer_size_
std::unordered_map< std::string, GGsize > AllocatedMemoryUMap
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.