NVBIO
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Methods | Public Members | Static Public Members | List of all members
nvbio::priv::PipelineStageThread< StageType > Struct Template Reference

Detailed description

template< typename StageType>
struct nvbio::priv::PipelineStageThread< StageType >

A class implementing a multiple-buffered CPU pipeline thread

Template Parameters
StageTypea class implementing the actual pipeline stage, must define the following interface:
interface Stage
{
typedef ... argument_type;
typedef ... return_type;
bool process(argument_type* src, return_type* dst);
};

Definition at line 172 of file pipeline_inl.h.

#include <pipeline_inl.h>

Inheritance diagram for nvbio::priv::PipelineStageThread< StageType >:
nvbio::priv::PipelineThreadBase nvbio::Thread< PipelineThreadBase > nvbio::ThreadBase

Public Types

typedef StageType::argument_type argument_type
 
typedef StageType::return_type return_type
 

Public Methods

 PipelineStageThread (StageType *stage, const uint32 buffers)
 
void run ()
 
bool fill ()
 
void * fetch (const uint32 i)
 
void release (const uint32 i)
 
- Public Methods inherited from nvbio::priv::PipelineThreadBase
 PipelineThreadBase ()
 
virtual ~PipelineThreadBase ()
 
void add_dependency (PipelineThreadBase *dep)
 
void add_client ()
 
void set_id (const uint32 id)
 
- Public Methods inherited from nvbio::Thread< PipelineThreadBase >
void create ()
 create the thread More...
 
void join ()
 join the thread More...
 
- Public Methods inherited from nvbio::ThreadBase
 ThreadBase ()
 
 ~ThreadBase ()
 
void set_id (const uint32 id)
 
uint32 get_id () const
 
void create (void *(*func)(void *), void *arg)
 create the thread More...
 
void join ()
 join the thread More...
 

Public Members

StageType * m_stage
 
uint32 m_buffers
 
std::vector< return_typem_data
 
return_type *volatile m_data_ptr [64]
 
uint32 volatile m_data_id [64]
 
uint32 volatile m_count [64]
 
volatile uint32 m_counter
 
float m_time
 
- Public Members inherited from nvbio::priv::PipelineThreadBase
std::vector< PipelineThreadBase * > m_deps
 
uint32 m_clients
 
uint32 m_id
 

Static Public Members

static const uint32 EMPTY_SLOT = uint32(-1)
 

Member Typedef Documentation

template<typename StageType>
typedef StageType::argument_type nvbio::priv::PipelineStageThread< StageType >::argument_type

Definition at line 176 of file pipeline_inl.h.

template<typename StageType>
typedef StageType::return_type nvbio::priv::PipelineStageThread< StageType >::return_type

Definition at line 177 of file pipeline_inl.h.

Constructor & Destructor Documentation

template<typename StageType>
nvbio::priv::PipelineStageThread< StageType >::PipelineStageThread ( StageType *  stage,
const uint32  buffers 
)
inline

constructor

Definition at line 181 of file pipeline_inl.h.

Member Function Documentation

template<typename StageType>
void* nvbio::priv::PipelineStageThread< StageType >::fetch ( const uint32  i)
inlinevirtual

a client method to obtain the next loaded batch; once the client has finished using the sequence, it is responsible to call the release() method to signal completion NOTE: this function will poll until the next batch is available, or return NULL if finished

Reimplemented from nvbio::priv::PipelineThreadBase.

Definition at line 291 of file pipeline_inl.h.

template<typename StageType>
bool nvbio::priv::PipelineStageThread< StageType >::fill ( )
inline

fill the next batch

Definition at line 203 of file pipeline_inl.h.

template<typename StageType>
void nvbio::priv::PipelineStageThread< StageType >::release ( const uint32  i)
inlinevirtual

a client method to release a given input

Reimplemented from nvbio::priv::PipelineThreadBase.

Definition at line 312 of file pipeline_inl.h.

template<typename StageType>
void nvbio::priv::PipelineStageThread< StageType >::run ( )
inlinevirtual

run the thread

Reimplemented from nvbio::priv::PipelineThreadBase.

Definition at line 196 of file pipeline_inl.h.

Member Data Documentation

template<typename StageType>
const uint32 nvbio::priv::PipelineStageThread< StageType >::EMPTY_SLOT = uint32(-1)
static

Definition at line 174 of file pipeline_inl.h.

template<typename StageType>
uint32 nvbio::priv::PipelineStageThread< StageType >::m_buffers

Definition at line 330 of file pipeline_inl.h.

template<typename StageType>
uint32 volatile nvbio::priv::PipelineStageThread< StageType >::m_count[64]

Definition at line 334 of file pipeline_inl.h.

template<typename StageType>
volatile uint32 nvbio::priv::PipelineStageThread< StageType >::m_counter

Definition at line 335 of file pipeline_inl.h.

template<typename StageType>
std::vector<return_type> nvbio::priv::PipelineStageThread< StageType >::m_data

Definition at line 331 of file pipeline_inl.h.

template<typename StageType>
uint32 volatile nvbio::priv::PipelineStageThread< StageType >::m_data_id[64]

Definition at line 333 of file pipeline_inl.h.

template<typename StageType>
return_type* volatile nvbio::priv::PipelineStageThread< StageType >::m_data_ptr[64]

Definition at line 332 of file pipeline_inl.h.

template<typename StageType>
StageType* nvbio::priv::PipelineStageThread< StageType >::m_stage

Definition at line 329 of file pipeline_inl.h.

template<typename StageType>
float nvbio::priv::PipelineStageThread< StageType >::m_time

Definition at line 336 of file pipeline_inl.h.


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