|
GGEMS
1.1
GPU GEant4-based Monte Carlo Simulations
|
Go to the documentation of this file.
42 GGcout(
"GGEMSSolidBox",
"GGEMSSolidBox", 3) <<
"GGEMSSolidBox creating..." <<
GGendl;
83 if (data_reg_type ==
"HISTOGRAM") {
102 std::ostringstream oss(std::ostringstream::out);
103 oss <<
"False registration type name!!!" << std::endl;
104 oss <<
"Registration type is :" << std::endl;
105 oss <<
" - HISTOGRAM" << std::endl;
111 GGcout(
"GGEMSSolidBox",
"GGEMSSolidBox", 3) <<
"GGEMSSolidBox created!!!" <<
GGendl;
120 GGcout(
"GGEMSSolidBox",
"~GGEMSSolidBox", 3) <<
"GGEMSSolidBox erasing..." <<
GGendl;
145 GGcout(
"GGEMSSolidBox",
"~GGEMSSolidBox", 3) <<
"GGEMSSolidBox erased!!!" <<
GGendl;
154 GGcout(
"GGEMSSolidBox",
"InitializeKernel", 3) <<
"Initializing kernel for solid box..." <<
GGendl;
160 std::string openCL_kernel_path = OPENCL_KERNEL_PATH;
161 std::string particle_solid_distance_filename = openCL_kernel_path +
"/ParticleSolidDistanceGGEMSSolidBox.cl";
162 std::string project_to_filename = openCL_kernel_path +
"/ProjectToGGEMSSolidBox.cl";
163 std::string track_through_filename = openCL_kernel_path +
"/TrackThroughGGEMSSolidBox.cl";
177 GGcout(
"GGEMSSolidBox",
"Initialize", 3) <<
"Initializing voxelized solid..." <<
GGendl;
220 GGcout(
"GGEMSSolidBox",
"PrintInfos", 0) <<
"GGEMSSolidBox Infos:" <<
GGendl;
221 GGcout(
"GGEMSSolidBox",
"PrintInfos", 0) <<
"--------------------------" <<
GGendl;
222 GGcout(
"GGEMSMaterials",
"PrintInfos", 0) <<
"Material on device: " << opencl_manager.
GetDeviceName(device_index) <<
GGendl;
225 GGcout(
"GGEMSVoxelizedSolid",
"PrintInfos", 0) <<
"* Oriented bounding box (OBB) in local position:" <<
GGendl;
229 GGcout(
"GGEMSSolidBox",
"PrintInfos", 0) <<
" - Transformation matrix:" <<
GGendl;
230 GGcout(
"GGEMSSolidBox",
"PrintInfos", 0) <<
" [" <<
GGendl;
235 GGcout(
"GGEMSSolidBox",
"PrintInfos", 0) <<
" ]" <<
GGendl;
236 GGcout(
"GGEMSSolidBox",
"PrintInfos", 0) <<
"* Solid index: " << solid_data_device->
solid_id_ <<
GGendl;
257 for (
GGint i = 0; i < 4; ++i) {
struct GGfloat44_t GGfloat44
cl::Buffer ** solid_data_
GGEMS class handling material(s) for a specific navigator.
GGEMS class for solid informations.
void Initialize(GGEMSMaterials *materials) override
Initialize solid for geometric navigation.
cl::Kernel ** kernel_project_to_solid_
GGEMS class for solid box.
void Deallocate(cl::Buffer *buffer, GGsize size, GGsize const &thread_index, std::string const &class_name="Undefined")
Deallocation of OpenCL memory.
void ReleaseDeviceBuffer(cl::Buffer *const device_ptr, T *host_ptr, GGsize const &thread_index)
Get the device pointer on host to write on it. Mandatory after a GetDeviceBufferWrite ou GetDeviceBuf...
void InitializeKernel(void) override
Initialize kernel for particle solid distance.
cl::Kernel ** kernel_track_through_solid_
~GGEMSSolidBox(void)
GGEMSSolidBox destructor.
void EnableScatter(void) override
Activate scatter registration.
GGfloat44 matrix_transformation_
void SetAxisTransformation(GGfloat33 const &axis)
Set the transformation of the frame, usefull for mirroring or convert 3D to 2D.
GGEMSGeometryTransformation * geometry_transformation_
GGEMSSolidBox(GGsize const &virtual_element_number_x, GGsize const &virtual_element_number_y, GGsize const &virtual_element_number_z, GGfloat const &element_size_x, GGfloat const &element_size_y, GGfloat const &element_size_z, std::string const &data_reg_type)
GGEMSSolidBox constructor.
cl::Kernel ** kernel_particle_solid_distance_
void CleanBuffer(cl::Buffer *buffer, GGsize const &size, GGsize const &thread_index)
Cleaning buffer on OpenCL device.
struct GGEMSSolidBoxData_t GGEMSSolidBoxData
Structure storing the stack of data for solid box.
GGEMSHistogramMode histogram_
cl::Buffer * Allocate(void *host_ptr, GGsize const &size, GGsize const &thread_index, cl_mem_flags flags, std::string const &class_name="Undefined")
Allocation of OpenCL memory.
GGsize virtual_element_number_xyz_[3]
void CompileKernel(std::string const &kernel_filename, std::string const &kernel_name, cl::Kernel **kernel_list, char *const custom_options=nullptr, char *const additional_options=nullptr)
Compile the OpenCL kernel on the activated device.
GGsize number_of_elements_
GGsize number_activated_devices_
cl::Buffer * GetTransformationMatrix(GGsize const &index) const
return the transformation matrix
T * GetDeviceBuffer(cl::Buffer *device_ptr, GGsize const &size, GGsize const &thread_index)
Get the device pointer on host to write on it. ReleaseDeviceBuffer must be used after this method!...
#define GGendl
overload C++ std::endl
Structure storing the data for solid box.
void UpdateTransformationMatrix(GGsize const &thread_index) override
Update transformation matrix for solid box object.
Singleton class storing all informations about OpenCL and managing GPU/CPU devices,...
void PrintInfos(void) const override
printing infos about voxelized solid
std::string GetDeviceName(GGsize const &device_index) const
Get the name of the activated device.
std::string data_reg_type_
Class managing the geometry transformation.
GGsize GetIndexOfActivatedDevice(GGsize const &thread_index) const
get the index of activated device
std::string kernel_option_
Structure storing float 4 x 4 matrix.
void ThrowException(std::string const &class_name, std::string const &method_name, std::string const &message)
Throw a C++ exception.
static GGEMSOpenCLManager & GetInstance(void)
Create at first time the Singleton.