vspline 1.1.0
Generic C++11 Code for Uniform B-Splines
Public Types | Public Member Functions | List of all members
wielding::wield< dimension, in_type, out_type > Struct Template Reference

reimplementation of wield using the new 'neutral' multithread. The workers now all receive the same task to process one line at a time until all lines are processed. This simplifies the code; the wield object directly calls 'multithread' in it's operator(). And it improves performance, presumably because tail-end idling is reduced: all active threads have data to process until the last line has been picked up by an aggregator. So tail-end idling is in the order of magnitude of a line's worth, in contrast to half a worker's share of the data in the previous implementation. The current implementation does away with specialized partitioning code (at least for the time being); it looks like the performance is decent throughout, even without exploiting locality by partitioning to tiles. More...

#include <wielding.h>

Public Types

typedef vigra::MultiArrayView< dimension, in_type > in_view_type
 
typedef vigra::MultiArrayView< dimension, out_type > out_view_type
 
typedef in_view_type::difference_type_1 index_type
 
typedef in_view_type::difference_type shape_type
 

Public Member Functions

template<size_t vsz, typename ... types>
void operator() (const in_view_type &in_view, out_view_type &out_view, coupled_aggregator< vsz, types ... > func, int axis=0, int njobs=vspline::default_njobs, vspline::atomic< bool > *p_cancel=0, std::ptrdiff_t segment_size=WIELDING_SEGMENT_SIZE)
 
template<size_t vsz, typename ... types>
void operator() (out_view_type &out_view, indexed_aggregator< vsz, types ... > func, int axis=0, int njobs=vspline::default_njobs, vspline::atomic< bool > *p_cancel=0, std::ptrdiff_t segment_size=WIELDING_SEGMENT_SIZE)
 
template<size_t vsz, typename ... types>
void operator() (shape_type in_shape, const indexed_reductor< vsz, types ... > &func, int axis=0, int njobs=vspline::default_njobs, vspline::atomic< bool > *p_cancel=0, std::ptrdiff_t segment_size=WIELDING_SEGMENT_SIZE)
 
template<size_t vsz, typename ... types>
void operator() (const in_view_type &in_view, const yield_reductor< vsz, types ... > &func, int axis=0, int njobs=vspline::default_njobs, vspline::atomic< bool > *p_cancel=0, std::ptrdiff_t segment_size=WIELDING_SEGMENT_SIZE)
 
template<size_t vsz, typename ... types>
void generate (out_view_type &out_view, generate_aggregator< vsz, types ... > func, int axis=0, int njobs=vspline::default_njobs, vspline::atomic< bool > *p_cancel=0)
 

Detailed Description

template<int dimension, class in_type, class out_type = in_type>
struct wielding::wield< dimension, in_type, out_type >

reimplementation of wield using the new 'neutral' multithread. The workers now all receive the same task to process one line at a time until all lines are processed. This simplifies the code; the wield object directly calls 'multithread' in it's operator(). And it improves performance, presumably because tail-end idling is reduced: all active threads have data to process until the last line has been picked up by an aggregator. So tail-end idling is in the order of magnitude of a line's worth, in contrast to half a worker's share of the data in the previous implementation. The current implementation does away with specialized partitioning code (at least for the time being); it looks like the performance is decent throughout, even without exploiting locality by partitioning to tiles.

Definition at line 1154 of file wielding.h.

Member Typedef Documentation

◆ in_view_type

template<int dimension, class in_type , class out_type = in_type>
typedef vigra::MultiArrayView< dimension , in_type > wielding::wield< dimension, in_type, out_type >::in_view_type

Definition at line 1156 of file wielding.h.

◆ index_type

template<int dimension, class in_type , class out_type = in_type>
typedef in_view_type::difference_type_1 wielding::wield< dimension, in_type, out_type >::index_type

Definition at line 1158 of file wielding.h.

◆ out_view_type

template<int dimension, class in_type , class out_type = in_type>
typedef vigra::MultiArrayView< dimension , out_type > wielding::wield< dimension, in_type, out_type >::out_view_type

Definition at line 1157 of file wielding.h.

◆ shape_type

template<int dimension, class in_type , class out_type = in_type>
typedef in_view_type::difference_type wielding::wield< dimension, in_type, out_type >::shape_type

Definition at line 1159 of file wielding.h.

Member Function Documentation

◆ generate()

template<int dimension, class in_type , class out_type = in_type>
template<size_t vsz, typename ... types>
void wielding::wield< dimension, in_type, out_type >::generate ( out_view_type out_view,
generate_aggregator< vsz, types ... >  func,
int  axis = 0,
int  njobs = vspline::default_njobs,
vspline::atomic< bool > *  p_cancel = 0 
)
inline

Definition at line 1662 of file wielding.h.

◆ operator()() [1/4]

template<int dimension, class in_type , class out_type = in_type>
template<size_t vsz, typename ... types>
void wielding::wield< dimension, in_type, out_type >::operator() ( const in_view_type in_view,
const yield_reductor< vsz, types ... > &  func,
int  axis = 0,
int  njobs = vspline::default_njobs,
vspline::atomic< bool > *  p_cancel = 0,
std::ptrdiff_t  segment_size = WIELDING_SEGMENT_SIZE 
)
inline

Definition at line 1562 of file wielding.h.

◆ operator()() [2/4]

template<int dimension, class in_type , class out_type = in_type>
template<size_t vsz, typename ... types>
void wielding::wield< dimension, in_type, out_type >::operator() ( const in_view_type in_view,
out_view_type out_view,
coupled_aggregator< vsz, types ... >  func,
int  axis = 0,
int  njobs = vspline::default_njobs,
vspline::atomic< bool > *  p_cancel = 0,
std::ptrdiff_t  segment_size = WIELDING_SEGMENT_SIZE 
)
inline

Definition at line 1313 of file wielding.h.

◆ operator()() [3/4]

template<int dimension, class in_type , class out_type = in_type>
template<size_t vsz, typename ... types>
void wielding::wield< dimension, in_type, out_type >::operator() ( out_view_type out_view,
indexed_aggregator< vsz, types ... >  func,
int  axis = 0,
int  njobs = vspline::default_njobs,
vspline::atomic< bool > *  p_cancel = 0,
std::ptrdiff_t  segment_size = WIELDING_SEGMENT_SIZE 
)
inline

Definition at line 1416 of file wielding.h.

◆ operator()() [4/4]

template<int dimension, class in_type , class out_type = in_type>
template<size_t vsz, typename ... types>
void wielding::wield< dimension, in_type, out_type >::operator() ( shape_type  in_shape,
const indexed_reductor< vsz, types ... > &  func,
int  axis = 0,
int  njobs = vspline::default_njobs,
vspline::atomic< bool > *  p_cancel = 0,
std::ptrdiff_t  segment_size = WIELDING_SEGMENT_SIZE 
)
inline

Definition at line 1487 of file wielding.h.


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