RISA
|
This stage interpolates the defect detectors in the raw data sinogram. More...
#include <DetectorInterpolation.h>
Public Types | |
using | input_type = glados::Image< glados::cuda::DeviceMemoryManager< unsigned short, glados::cuda::async_copy_policy >> |
The input data type that needs to fit the output type of the previous stage. More... | |
using | output_type = glados::Image< glados::cuda::DeviceMemoryManager< unsigned short, glados::cuda::async_copy_policy >> |
The output data type that needs to fit the input type of the following stage. More... | |
using | deviceManagerType = glados::cuda::DeviceMemoryManager< unsigned short, glados::cuda::async_copy_policy > |
Public Member Functions | |
DetectorInterpolation (const std::string &configFile) | |
Initializes everything, that needs to be done only once. More... | |
~DetectorInterpolation () | |
Destroys everything that is not destroyed automatically. More... | |
auto | process (input_type &&sinogram) -> void |
Pushes the sinogram to the processor-threads. More... | |
auto | wait () -> output_type |
Takes one sinogram from the output queue results_ and transfers it to the neighbored stage. More... | |
Private Member Functions | |
auto | processor (int deviceID) -> void |
main data processing routine executed in its own thread for each CUDA device, that performs the data processing of this stage More... | |
auto | readConfig (const std::string &configFile) -> bool |
Read configuration values from configuration file. More... | |
Private Attributes | |
std::map< int, glados::Queue< input_type > > | sinograms_ |
one separate input queue for each available CUDA device More... | |
glados::Queue< output_type > | results_ |
the output queue in which the processed sinograms are stored More... | |
std::map< int, std::thread > | processorThreads_ |
stores the processor()-threads More... | |
std::map< int, cudaStream_t > | streams_ |
stores the cudaStreams that are created once More... | |
std::map< int, unsigned int > | memoryPoolIdxs_ |
stores the indeces received when regisitering in MemoryPool More... | |
int | numberOfDevices_ |
the number of available CUDA devices in the system More... | |
unsigned int | numberOfDetectors_ |
the number of detectors in the fan beam sinogram More... | |
unsigned int | numberOfProjections_ |
the number of projections in the fan beam sinogram More... | |
double | threshMin_ |
double | threshMax_ |
int | memPoolSize_ |
specifies, how many elements are allocated by memory pool More... | |
std::set< int > | defects_ |
This stage interpolates the defect detectors in the raw data sinogram.
Definition at line 45 of file DetectorInterpolation.h.
using risa::cuda::DetectorInterpolation::deviceManagerType = glados::cuda::DeviceMemoryManager<unsigned short, glados::cuda::async_copy_policy> |
Definition at line 51 of file DetectorInterpolation.h.
using risa::cuda::DetectorInterpolation::input_type = glados::Image<glados::cuda::DeviceMemoryManager<unsigned short, glados::cuda::async_copy_policy>> |
The input data type that needs to fit the output type of the previous stage.
Definition at line 48 of file DetectorInterpolation.h.
using risa::cuda::DetectorInterpolation::output_type = glados::Image<glados::cuda::DeviceMemoryManager<unsigned short, glados::cuda::async_copy_policy>> |
The output data type that needs to fit the input type of the following stage.
Definition at line 50 of file DetectorInterpolation.h.
risa::cuda::DetectorInterpolation::DetectorInterpolation | ( | const std::string & | configFile | ) |
Initializes everything, that needs to be done only once.
Runs as many processor-thread as CUDA devices are available in the system. Allocates memory using the MemoryPool for all CUDA devices.
[in] | configFile | path to configuration file |
Definition at line 46 of file DetectorInterpolation.cu.
risa::cuda::DetectorInterpolation::~DetectorInterpolation | ( | ) |
Destroys everything that is not destroyed automatically.
Tells MemoryPool to free the allocated memory. Destroys the cudaStreams.
Definition at line 72 of file DetectorInterpolation.cu.
auto risa::cuda::DetectorInterpolation::process | ( | input_type && | sinogram | ) | -> void |
Pushes the sinogram to the processor-threads.
[in] | sinogram | input data that arrived from previous stage |
Definition at line 78 of file DetectorInterpolation.cu.
|
private |
main data processing routine executed in its own thread for each CUDA device, that performs the data processing of this stage
This method takes one sinogram from the input queue sinograms_. So far, the detector interpolation is performed on the host. Thus, the data is transfered from host to device, the raw data sinogram is interpolated and afterwards, transfered from device to host.
[in] | deviceID | specifies on which CUDA device to execute the device functions |
Definition at line 105 of file DetectorInterpolation.cu.
|
private |
Read configuration values from configuration file.
All values needed for setting up the class are read from the config file in this function.
[in] | configFile | path to config file |
true | configuration options were read successfully |
false | configuration options could not be read successfully |
Definition at line 142 of file DetectorInterpolation.cu.
auto risa::cuda::DetectorInterpolation::wait | ( | ) | -> output_type |
Takes one sinogram from the output queue results_ and transfers it to the neighbored stage.
Definition at line 101 of file DetectorInterpolation.cu.
|
private |
Definition at line 113 of file DetectorInterpolation.h.
|
private |
stores the indeces received when regisitering in MemoryPool
Definition at line 91 of file DetectorInterpolation.h.
|
private |
specifies, how many elements are allocated by memory pool
Definition at line 111 of file DetectorInterpolation.h.
|
private |
the number of detectors in the fan beam sinogram
Definition at line 105 of file DetectorInterpolation.h.
|
private |
the number of available CUDA devices in the system
Definition at line 103 of file DetectorInterpolation.h.
|
private |
the number of projections in the fan beam sinogram
Definition at line 106 of file DetectorInterpolation.h.
|
private |
stores the processor()-threads
Definition at line 89 of file DetectorInterpolation.h.
|
private |
the output queue in which the processed sinograms are stored
Definition at line 87 of file DetectorInterpolation.h.
|
private |
one separate input queue for each available CUDA device
Definition at line 86 of file DetectorInterpolation.h.
|
private |
stores the cudaStreams that are created once
Definition at line 90 of file DetectorInterpolation.h.
|
private |
Definition at line 109 of file DetectorInterpolation.h.
|
private |
Definition at line 108 of file DetectorInterpolation.h.