NVBIO
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Methods | Public Members | List of all members
nvbio::Pipeline Struct Reference

Detailed description

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
 

Constructor & Destructor Documentation

nvbio::Pipeline::Pipeline ( )
inline

constructor

Definition at line 62 of file pipeline.h.

nvbio::Pipeline::~Pipeline ( )
inline

destructor

Definition at line 343 of file pipeline_inl.h.

Member Function Documentation

void nvbio::Pipeline::add_dependency ( const uint32  in,
const uint32  out 
)
inline

add a dependency

Parameters
inthe id of the producer stage
outthe id of the consumer stage

Definition at line 384 of file pipeline_inl.h.

template<typename SinkType >
uint32 nvbio::Pipeline::append_sink ( SinkType *  sink)

append the pipeline sink

Parameters
sinkthe sink stage

Definition at line 369 of file pipeline_inl.h.

template<typename StageType >
uint32 nvbio::Pipeline::append_stage ( StageType *  stage,
const uint32  buffers = 4 
)

append a new pipeline stage

Parameters
stagethe stage to be added
buffersthe number of output buffers for multiple buffering
Returns
the stage id

Definition at line 353 of file pipeline_inl.h.

void nvbio::Pipeline::run ( )
inline

run the pipeline to completion

Definition at line 392 of file pipeline_inl.h.

Member Data Documentation

std::vector<priv::PipelineThreadBase*> nvbio::Pipeline::m_stages

Definition at line 95 of file pipeline.h.


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