|
GGEMS
1.1
GPU GEant4-based Monte Carlo Simulations
|
Go to the documentation of this file.
43 GGcout(
"GGEMSBox",
"GGEMSBox", 3) <<
"GGEMSBox creating..." <<
GGendl;
49 GGcout(
"GGEMSBox",
"GGEMSBox", 3) <<
"GGEMSBox created!!!" <<
GGendl;
58 GGcout(
"GGEMSBox",
"~GGEMSBox", 3) <<
"GGEMSBox erasing..." <<
GGendl;
60 GGcout(
"GGEMSBox",
"~GGEMSBox", 3) <<
"GGEMSBox erased!!!" <<
GGendl;
69 GGcout(
"GGEMSBox",
"Initialize", 3) <<
"Initializing GGEMSBox solid volume..." <<
GGendl;
72 std::string
const kOpenCLKernelPath = OPENCL_KERNEL_PATH;
73 std::string
const kFilename = kOpenCLKernelPath +
"/DrawGGEMSBox.cl";
82 std::string
const kDataType =
"-D" + volume_creator_manager.
GetDataType();
92 GGcout(
"GGEMSBox",
"Draw", 3) <<
"Drawing Box..." <<
GGendl;
102 cl::Event*
event = opencl_manager.
GetEvent(0);
106 std::string device_name = opencl_manager.
GetDeviceName(device_index);
107 std::ostringstream oss(std::ostringstream::out);
108 oss <<
"GGEMSBox::Draw on " << device_name <<
", index " << device_index;
113 GGint3 phantom_dimensions;
126 cl::NDRange global_wi(number_of_work_items);
127 cl::NDRange local_wi(work_group_size);
157 return new(std::nothrow)
GGEMSBox(width, height, depth, unit);
GGfloat3 GetElementsSizes() const
size of voxels in the voxelized volume
cl::Kernel ** kernel_draw_volume_
GGsize GetNumberElements(void) const
Return the total number of voxels.
Mother class handle volume.
void set_position_box(GGEMSBox *box, GGfloat const pos_x, GGfloat const pos_y, GGfloat const pos_z, char const *unit)
Set the position of the box.
void set_label_value_box(GGEMSBox *box, GGfloat const label_value)
Set the label value in box.
std::string GetDataType(void) const
get the type of data
static GGEMSVolumeCreatorManager & GetInstance(void)
Create at first time the Singleton.
static GGEMSProfilerManager & GetInstance(void)
Create at first time the Singleton.
~GGEMSBox(void)
GGEMSBox destructor.
void delete_box(GGEMSBox *box)
Delete instance of GGEMSBox.
void CheckOpenCLError(GGint const &error, std::string const &class_name, std::string const &method_name) const
check the OpenCL error
cl::Buffer * GetVoxelizedVolume(void) const
Return the voxelized volume on OpenCL device.
void draw_box(GGEMSBox *box)
Draw analytical volume in voxelized phantom.
Class GGEMSBox inheriting from GGEMSVolume handling Box solid.
Class GGEMSBox inheriting from GGEMSVolume handling Box solid.
GGsize GetBestWorkItem(GGsize const &number_of_elements) const
get the best number of work item
cl::Event * GetEvent(GGsize const &thread_index) const
return an event to activated context
Namespaces for different useful fonctions.
void Draw(void) override
Draw analytical volume in voxelized phantom.
GGEMS class managing profiler data.
GGsize GetWorkGroupSize(void) const
Get the work group size defined in GGEMS on activated OpenCL context.
Singleton class handling convertion from analytical volume to voxelized volume.
void Initialize(void) override
Initialize the solid and store it in Phantom creator manager.
void SetLabelValue(GGfloat const &label_value)
Set the label value.
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.
GGsize3 GetVolumeDimensions() const
dimensions of volume
void set_material_box(GGEMSBox *box, char const *material)
Set the material of the box.
Namespace storing all the usefull physical units.
#define GGendl
overload C++ std::endl
Singleton class storing all informations about OpenCL and managing GPU/CPU devices,...
GGEMSBox * create_box(GGfloat const width, GGfloat const height, GGfloat const depth, char const *unit)
Create instance of GGEMSBox.
std::string GetDeviceName(GGsize const &device_index) const
Get the name of the activated device.
GGEMS class managing profiler data.
void SetPosition(GGfloat const &pos_x, GGfloat const &pos_y, GGfloat const &pos_z, std::string const &unit="mm")
Set the solid phantom position.
void HandleEvent(cl::Event event, std::string const &profile_name)
handle an OpenCL event in profile_name type
GGsize GetIndexOfActivatedDevice(GGsize const &thread_index) const
get the index of activated device
void initialize_box(GGEMSBox *box)
Initialize the solid and store it in Phantom creator manager.
cl::CommandQueue * GetCommandQueue(GGsize const &thread_index) const
Return the command queue to activated context.
GGEMSBox(GGfloat const &width, GGfloat const &height, GGfloat const &depth, std::string const &unit="mm")
GGEMSBox constructor.
T DistanceUnit(T const &value, std::string const &unit)
Choose best distance unit.
static GGEMSOpenCLManager & GetInstance(void)
Create at first time the Singleton.
void SetMaterial(std::string const &material)
set the material, Air by default