RISA
risa::cuda::DetectorInterpolation Class Reference

This stage interpolates the defect detectors in the raw data sinogram. More...

#include <DetectorInterpolation.h>

Collaboration diagram for risa::cuda::DetectorInterpolation:

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_typeresults_
 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_
 

Detailed Description

This stage interpolates the defect detectors in the raw data sinogram.

Definition at line 45 of file DetectorInterpolation.h.

Member Typedef Documentation

The input data type that needs to fit the output type of the previous stage.

Definition at line 48 of file DetectorInterpolation.h.

The output data type that needs to fit the input type of the following stage.

Definition at line 50 of file DetectorInterpolation.h.

Constructor & Destructor Documentation

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.

Parameters
[in]configFilepath 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.

Member Function Documentation

auto risa::cuda::DetectorInterpolation::process ( input_type &&  sinogram) -> void

Pushes the sinogram to the processor-threads.

Parameters
[in]sinograminput data that arrived from previous stage

Definition at line 78 of file DetectorInterpolation.cu.

auto risa::cuda::DetectorInterpolation::processor ( int  deviceID) -> void
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.

Parameters
[in]deviceIDspecifies on which CUDA device to execute the device functions

Definition at line 105 of file DetectorInterpolation.cu.

auto risa::cuda::DetectorInterpolation::readConfig ( const std::string &  configFile) -> bool
private

Read configuration values from configuration file.

All values needed for setting up the class are read from the config file in this function.

Parameters
[in]configFilepath to config file
Return values
trueconfiguration options were read successfully
falseconfiguration 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.

Returns
the oldest sinogram in the output queue results_

Definition at line 101 of file DetectorInterpolation.cu.

Member Data Documentation

std::set<int> risa::cuda::DetectorInterpolation::defects_
private

Definition at line 113 of file DetectorInterpolation.h.

std::map<int, unsigned int> risa::cuda::DetectorInterpolation::memoryPoolIdxs_
private

stores the indeces received when regisitering in MemoryPool

Definition at line 91 of file DetectorInterpolation.h.

int risa::cuda::DetectorInterpolation::memPoolSize_
private

specifies, how many elements are allocated by memory pool

Definition at line 111 of file DetectorInterpolation.h.

unsigned int risa::cuda::DetectorInterpolation::numberOfDetectors_
private

the number of detectors in the fan beam sinogram

Definition at line 105 of file DetectorInterpolation.h.

int risa::cuda::DetectorInterpolation::numberOfDevices_
private

the number of available CUDA devices in the system

Definition at line 103 of file DetectorInterpolation.h.

unsigned int risa::cuda::DetectorInterpolation::numberOfProjections_
private

the number of projections in the fan beam sinogram

Definition at line 106 of file DetectorInterpolation.h.

std::map<int, std::thread> risa::cuda::DetectorInterpolation::processorThreads_
private

stores the processor()-threads

Definition at line 89 of file DetectorInterpolation.h.

glados::Queue<output_type> risa::cuda::DetectorInterpolation::results_
private

the output queue in which the processed sinograms are stored

Definition at line 87 of file DetectorInterpolation.h.

std::map<int, glados::Queue<input_type> > risa::cuda::DetectorInterpolation::sinograms_
private

one separate input queue for each available CUDA device

Definition at line 86 of file DetectorInterpolation.h.

std::map<int, cudaStream_t> risa::cuda::DetectorInterpolation::streams_
private

stores the cudaStreams that are created once

Definition at line 90 of file DetectorInterpolation.h.

double risa::cuda::DetectorInterpolation::threshMax_
private

Definition at line 109 of file DetectorInterpolation.h.

double risa::cuda::DetectorInterpolation::threshMin_
private

Definition at line 108 of file DetectorInterpolation.h.


The documentation for this class was generated from the following files: