RISA
|
This stage transfer a data element from device to host. More...
#include <D2H.h>
Public Types | |
using | hostManagerType = glados::cuda::HostMemoryManager< float, glados::cuda::async_copy_policy > |
The input data type that needs to fit the output type of the previous stage. More... | |
using | input_type = glados::Image< glados::cuda::DeviceMemoryManager< float, glados::cuda::async_copy_policy >> |
The output data type that needs to fit the input type of the following stage. More... | |
using | output_type = glados::Image< glados::cuda::HostMemoryManager< float, glados::cuda::async_copy_policy >> |
Public Member Functions | |
D2H (const std::string &configFile) | |
Initializes everything, that needs to be done only once. More... | |
~D2H () | |
Destroys everything that is not destroyed automatically. More... | |
auto | process (input_type &&img) -> 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 (const 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 > > | imgs_ |
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... | |
unsigned int | memoryPoolIdx_ |
stores the indeces received when regisitering in MemoryPool More... | |
int | memPoolSize_ |
specifies, how many elements are allocated by memory pool More... | |
int | numberOfDevices_ |
the number of available CUDA devices in the system More... | |
int | numberOfPixels_ |
the number of pixels in one direction in the reconstructed image More... | |
std::size_t | count_ {0} |
counts the total number of reconstructed sinograms More... | |
double | reconstructionRate_ |
the average reconstruction rate More... | |
double | counter_ |
used for computing the average reconstruction rate More... | |
Timer | tmr_ |
used to measure the timings More... | |
risa::cuda::D2H::D2H | ( | const std::string & | configFile | ) |
risa::cuda::D2H::~D2H | ( | ) |
auto risa::cuda::D2H::process | ( | input_type && | img | ) | -> 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 image from the input queue imgs_. The image is transfered from device to host using the asynchronous cudaMemcpyAsync()-operation. The resulting host structure is pushed back into the output queue results_.
[in] | deviceID | specifies on which CUDA device to execute the device functions |
|
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 |
auto risa::cuda::D2H::wait | ( | ) | -> output_type |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
stores the processor()-threads
|
private |
|
private |
|
private |
|
private |