GGEMS  1.1
GPU GEant4-based Monte Carlo Simulations
GGEMSOpenCLManager.hh File Reference

Singleton class storing all informations about OpenCL and managing GPU/CPU devices, contexts, kernels, command queues and events. In GGEMS the strategy is 1 context = 1 device. More...

#include <unordered_map>
#include "GGEMS/tools/GGEMSPrint.hh"
Include dependency graph for GGEMSOpenCLManager.hh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  GGEMSOpenCLManager
 Singleton class storing all informations about OpenCL and managing GPU/CPU devices, contexts, kernels, command queues and events. In GGEMS the strategy is 1 context = 1 device. More...
 

Macros

#define KERNEL_NOT_COMPILED   0x100000000
 

Typedefs

typedef std::unordered_map< std::string, std::string > VendorUMap
 

Functions

GGEMSOpenCLManagerget_instance_ggems_opencl_manager (void)
 Get the GGEMSOpenCLManager pointer for python user. More...
 
void print_infos_opencl_manager (GGEMSOpenCLManager *opencl_manager)
 Print information about OpenCL. More...
 
void set_device_index_ggems_opencl_manager (GGEMSOpenCLManager *opencl_manager, GGsize const device_id)
 Set the device index to activate. More...
 
void set_device_to_activate_opencl_manager (GGEMSOpenCLManager *opencl_manager, char const *device_type, char const *device_vendor="")
 Set the device index to activate. More...
 
void clean_opencl_manager (GGEMSOpenCLManager *opencl_manager)
 Clean OpenCL manager for python user. More...
 
void set_device_balancing_opencl_manager (GGEMSOpenCLManager *opencl_manager, char const *device_balancing)
 change the device balancing, by default device balancing is the same for each device More...
 

Detailed Description

Singleton class storing all informations about OpenCL and managing GPU/CPU devices, contexts, kernels, command queues and events. In GGEMS the strategy is 1 context = 1 device.

Author
Julien BERT julie.nosp@m.n.be.nosp@m.rt@un.nosp@m.iv-b.nosp@m.rest..nosp@m.fr
Didier BENOIT didie.nosp@m.r.be.nosp@m.noit@.nosp@m.inse.nosp@m.rm.fr
LaTIM, INSERM - U1101, Brest, FRANCE
Version
1.0
Date
Tuesday March 23, 2021

Definition in file GGEMSOpenCLManager.hh.

Macro Definition Documentation

◆ KERNEL_NOT_COMPILED

#define KERNEL_NOT_COMPILED   0x100000000

value if OpenCL kernel is not compiled

Definition at line 47 of file GGEMSOpenCLManager.hh.

Typedef Documentation

◆ VendorUMap

typedef std::unordered_map<std::string, std::string> VendorUMap

Alias to OpenCL vendors

Definition at line 45 of file GGEMSOpenCLManager.hh.

Function Documentation

◆ clean_opencl_manager()

void clean_opencl_manager ( GGEMSOpenCLManager opencl_manager)

Clean OpenCL manager for python user.

Parameters
opencl_manager- pointer on the singleton

Definition at line 1475 of file GGEMSOpenCLManager.cc.

◆ get_instance_ggems_opencl_manager()

GGEMSOpenCLManager * get_instance_ggems_opencl_manager ( void  )

Get the GGEMSOpenCLManager pointer for python user.

Returns
the pointer on the singleton

Definition at line 1436 of file GGEMSOpenCLManager.cc.

◆ print_infos_opencl_manager()

void print_infos_opencl_manager ( GGEMSOpenCLManager opencl_manager)

Print information about OpenCL.

Parameters
opencl_manager- pointer on the singleton

Definition at line 1445 of file GGEMSOpenCLManager.cc.

◆ set_device_balancing_opencl_manager()

void set_device_balancing_opencl_manager ( GGEMSOpenCLManager opencl_manager,
char const *  device_balancing 
)

change the device balancing, by default device balancing is the same for each device

Parameters
opencl_manager- pointer on the singleton
device_balancing- device balancing

Definition at line 1484 of file GGEMSOpenCLManager.cc.

◆ set_device_index_ggems_opencl_manager()

void set_device_index_ggems_opencl_manager ( GGEMSOpenCLManager opencl_manager,
GGsize const  device_id 
)

Set the device index to activate.

Parameters
opencl_manager- pointer on the singleton
device_id- index of the device

Definition at line 1457 of file GGEMSOpenCLManager.cc.

◆ set_device_to_activate_opencl_manager()

void set_device_to_activate_opencl_manager ( GGEMSOpenCLManager opencl_manager,
char const *  device_type,
char const *  device_vendor = "" 
)

Set the device index to activate.

Parameters
opencl_manager- pointer on the singleton
device_type- device type (gpu, cpu)
device_vendor- device vendor (intel, amd, nvidia)

Definition at line 1466 of file GGEMSOpenCLManager.cc.