NVBIO
|
A class implementing a parallel CPU task-pipeline. The pipeline can be composed by any number of user-defined stages connected as a DAG and terminating into a sink (i.e. a task with no output). At run-time, each stage of the pipeline can be executed in parallel by separate threads, and the run-time takes care of managing the dependencies and performing multiple-buffering for each of the stages.
Definition at line 58 of file pipeline.h.
#include <pipeline.h>
Public Methods | |
Pipeline () | |
~Pipeline () | |
template<typename StageType > | |
uint32 | append_stage (StageType *stage, const uint32 buffers=4) |
template<typename SinkType > | |
uint32 | append_sink (SinkType *sink) |
void | add_dependency (const uint32 in, const uint32 out) |
void | run () |
Public Members | |
std::vector < priv::PipelineThreadBase * > | m_stages |
|
inline |
constructor
Definition at line 62 of file pipeline.h.
|
inline |
destructor
Definition at line 343 of file pipeline_inl.h.
add a dependency
in | the id of the producer stage |
out | the id of the consumer stage |
Definition at line 384 of file pipeline_inl.h.
uint32 nvbio::Pipeline::append_sink | ( | SinkType * | sink) |
append the pipeline sink
sink | the sink stage |
Definition at line 369 of file pipeline_inl.h.
uint32 nvbio::Pipeline::append_stage | ( | StageType * | stage, |
const uint32 | buffers = 4 |
||
) |
append a new pipeline stage
stage | the stage to be added |
buffers | the number of output buffers for multiple buffering |
Definition at line 353 of file pipeline_inl.h.
|
inline |
run the pipeline to completion
Definition at line 392 of file pipeline_inl.h.
std::vector<priv::PipelineThreadBase*> nvbio::Pipeline::m_stages |
Definition at line 95 of file pipeline.h.