GrPPI  1.0
Generic and Reusable Parallel Pattern Interface
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
grppi Namespace Reference

Namespaces

 detail_ff
 
 internal
 

Classes

class  context_t
 Representation of a context pattern. Represents a context that uses a given policy to run a transformer. This pattern is intended to switch between execution policies in a pattern composition. More...
 
class  farm_t
 Representation of farm pattern. Represents a farm of n replicas from a transformer. More...
 
class  filter_t
 Representation of filter pattern. Represents a filter that can be used as a stage on a pipeline. More...
 
class  iteration_t
 Representation of iteration pattern. Represents a iteration that can be used as a stage on a pipeline. More...
 
class  mpmc_queue
 
class  pipeline_info
 
class  reduction_info
 
class  farm_info
 
class  filter_info
 
struct  stage_return_type
 Determines the return type after applying a list of transformers (stages) on a input type. More...
 
struct  stage_return_type< Input, Transformer >
 Determines the return type of applying a function on a input type. More...
 
struct  stage_return_type< Input, Transformer, Other ... >
 Determines the return type of consecutively applying a set of transformer functions on a input type. More...
 
class  pipeline_t
 Representation of pipeline pattern. Represents a pipeline with multiple chained transformers. More...
 
class  reduce_t
 Representation of reduce pattern. Represents a reduction that can be used as a stage on a pipeline. More...
 
class  dynamic_execution
 
struct  parallel_execution_ff
 
class  thread_registry
 Thread index table to provide portable natural thread indices. More...
 
class  native_thread_manager
 RAII class to manage registration/deregistration pairs. This class allows to manage automatic deregistration of threads through the common RAII pattern. The current thread is registered into the registry at construction and deregistered a destruction. More...
 
class  parallel_execution_native
 Native parallel execution policy. This policy uses ISO C++ threads as implementation building block allowing usage in any ISO C++ compliant platform. More...
 
class  worker_pool
 Pool of worker threads. This class offers a simple pool of worker threads. More...
 
class  parallel_execution_omp
 OpenMP parallel execution policy. More...
 
class  sequential_execution
 Sequential execution policy. More...
 
class  parallel_execution_tbb
 TBB parallel execution policy. More...
 

Typedefs

template<typename G >
using requires_generator = typename std::enable_if_t< is_generator< G >, int >
 
template<typename F >
using requires_arguments = typename std::enable_if_t< internal::has_arguments< F >(), int >
 
template<typename F , typename I >
using requires_consumer = typename std::enable_if_t< internal::has_void_return< F(I)>(), int >
 
template<typename T >
using requires_context = typename std::enable_if_t< is_context< T >, int >
 
template<typename E >
using requires_execution_supported = std::enable_if_t< is_supported< E >(), int >
 
template<typename E >
using requires_execution_not_supported = std::enable_if_t<!is_supported< E >(), int >
 
template<typename T >
using requires_farm = typename std::enable_if_t< is_farm< T >, int >
 
template<typename T >
using requires_filter = typename std::enable_if_t< is_filter< T >, int >
 
template<typename T >
using requires_iteration = typename std::enable_if_t< is_iteration< T >, int >
 
template<typename T >
using requires_iterator = std::enable_if_t< is_iterator< T >, int >
 
template<typename ... T>
using requires_iterators = std::enable_if_t< are_iterators< T... >, int >
 
template<typename T >
using requires_queue = std::enable_if_t< is_queue< T >, int >
 
template<typename T >
using requires_no_pattern = std::enable_if_t< is_no_pattern< T >, int >
 
template<typename T >
using requires_pattern = std::enable_if_t< is_pattern< T >, int >
 
template<typename Input , typename Transformer >
using result_type = typename std::result_of< Transformer(Input)>::type
 Determines the return type of applying a function on a input type. More...
 
template<typename T >
using requires_pipeline = typename std::enable_if_t< is_pipeline< T >, int >
 
template<typename I , typename T >
using output_value_type = typename internal::output_value_type< I, T >::type
 
template<typename T >
using requires_reduce = std::enable_if_t< is_reduce< T >, int >
 

Enumerations

enum class  queue_mode { lockfree = true , blocking = false }
 

Functions

template<typename E >
constexpr bool is_supported ()
 Determines if an execution policy is supported in the current compilation. More...
 
template<typename E >
constexpr bool supports_map ()
 Determines if an execution policy supports the map pattern. More...
 
template<typename E >
constexpr bool supports_reduce ()
 Determines if an execution policy supports the reduce pattern. More...
 
template<typename E >
constexpr bool supports_map_reduce ()
 Determines if an execution policy supports the map-reduce pattern. More...
 
template<typename E >
constexpr bool supports_stencil ()
 Determines if an execution policy supports the stencil pattern. More...
 
template<typename E >
constexpr bool supports_divide_conquer ()
 Determines if an execution policy supports the divide-conquer pattern. More...
 
template<typename E >
constexpr bool supports_pipeline ()
 Determines if an execution policy supports the pipeline pattern. More...
 
template<typename F , typename ... Iterators, template< typename ... > class T>
decltype(auto) apply_deref_increment (F &&f, T< Iterators... > &iterators)
 Applies a callable object to the values obtained from the iterators in a tuple-like object. This function takes callable object f and a tuple-like with iterators (e.g. the result of make_tuple(it1, it2, it3)) More...
 
template<typename F , typename ... Iterators, template< typename... > class T>
decltype(auto) apply_increment (F &&f, T< Iterators... > &iterators)
 Applies a callable object to the iterators in a tuple like-object and the increments those iterators. This function takes callable object f and a tuple-like object with iterators (e.g. the result of make_tuple(it1, it2, it3)) More...
 
template<typename F , typename T >
decltype(auto) apply_iterators_indexed (F &&f, T &&t, std::size_t i)
 Applies a callable object to the values obtained from the iterators in a tuple by indexing. This function takes callable object f, a tuple-like with iterators (e.g. the result of make_tuple(it1, it2, it3)) and an integral index i. More...
 
template<typename T >
auto iterators_next (T &&t, int n)
 Computes next n steps from a tuple of iterators. More...
 
template<typename ... InputIt>
void advance_iterators (size_t delta, InputIt &... in)
 
template<typename ... InputIt>
void advance_iterators (InputIt &... in)
 
template<typename ExecutionPolicy , typename Transformer >
auto run_with (ExecutionPolicy &ex, Transformer &&transform_op)
 Define a new Context on a data stream that can be composed in other streaming patterns. More...
 
template<typename Execution , typename Input , typename Divider , typename Solver , typename Combiner >
auto divide_conquer (const Execution &ex, Input &&input, Divider &&divider_op, Solver &&solver_op, Combiner &&combiner_op)
 Invoke md_divide-conquer. \parapm Execution Execution type. More...
 
template<typename Execution , typename Input , typename Divider , typename Predicate , typename Solver , typename Combiner >
auto divide_conquer (const Execution &ex, Input &&input, Divider &&divider_op, Predicate &&predicate_op, Solver &&solver_op, Combiner &&combiner_op)
 Invoke md_divide-conquer. \parapm Execution Execution type. More...
 
template<>
constexpr bool is_supported< dynamic_execution > ()
 Determines if an execution policy is supported in the current compilation. More...
 
template<>
constexpr bool supports_map< dynamic_execution > ()
 Determines if an execution policy supports the map pattern. More...
 
template<>
constexpr bool supports_reduce< dynamic_execution > ()
 Determines if an execution policy supports the reduce pattern. More...
 
template<>
constexpr bool supports_map_reduce< dynamic_execution > ()
 Determines if an execution policy supports the map-reduce pattern. More...
 
template<>
constexpr bool supports_stencil< dynamic_execution > ()
 Determines if an execution policy supports the stencil pattern. More...
 
template<>
constexpr bool supports_divide_conquer< dynamic_execution > ()
 Determines if an execution policy supports the divide/conquer pattern. More...
 
template<>
constexpr bool supports_pipeline< dynamic_execution > ()
 Determines if an execution policy supports the pipeline pattern. More...
 
template<typename Transformer >
auto farm (int ntasks, Transformer &&transform_op)
 Invoke Farm pattern on a data stream that can be composed in other streaming patterns. More...
 
template<typename E >
constexpr bool is_parallel_execution_ff ()
 Metafunction that determines if type E is parallel_execution_ff This metafunction evaluates to false if GRPPI_FF is disabled. More...
 
template<typename Execution , typename ... InputIterators, typename InputIt , typename OutputIt , typename Transformer , requires_iterators< InputIterators... > = 0, requires_iterator< InputIt > = 0, requires_iterator< OutputIt > = 0>
void map (const Execution &ex, std::tuple< InputIterators... > firsts, InputIt last, OutputIt first_out, Transformer transform_op)
 Invoke Map pattern on a data sequence. More...
 
template<typename Execution , typename ... InputIterators, typename OutputIt , typename Transformer , requires_iterators< InputIterators... > = 0, requires_iterator< OutputIt > = 0>
void map (const Execution &ex, std::tuple< InputIterators... > firsts, std::size_t range, OutputIt first_out, Transformer transformer_op)
 Invoke Map pattern on a data sequence. More...
 
template<typename Execution , typename InputIt , typename OutputIt , typename Transformer , requires_iterator< InputIt > = 0, requires_iterator< OutputIt > = 0>
void map (const Execution &ex, InputIt first, InputIt last, OutputIt first_out, Transformer transform_op)
 Invoke Map pattern on a data sequence. More...
 
template<typename Execution , typename InputIt , typename OutputIt , typename Transformer , typename ... OtherInputIts, requires_iterator< InputIt > = 0, requires_iterator< OutputIt > = 0>
void map (const Execution &ex, InputIt first, InputIt last, OutputIt first_out, Transformer transform_op, OtherInputIts ... other_firsts)
 Invoke Map pattern on a data sequence. More...
 
template<typename Execution , typename ... InputIterators, typename Identity , typename Transformer , typename Combiner , requires_iterators< InputIterators... > = 0>
auto map_reduce (const Execution &ex, std::tuple< InputIterators... > firsts, std::size_t size, Identity &&identity, Transformer &&transform_op, Combiner &&combine_op)
 Invoke md_map-reduce on a data sequence. More...
 
template<typename Execution , typename ... InputIterators, typename InputIt , typename Identity , typename Transformer , typename Combiner , requires_iterators< InputIterators... > = 0, requires_iterator< InputIt > = 0>
auto map_reduce (const Execution &ex, std::tuple< InputIterators... > firsts, InputIt last, Identity &&identity, Transformer &&transform_op, Combiner &&combine_op)
 Invoke md_map-reduce on a data sequence. More...
 
template<typename Execution , typename InputIterator , typename Identity , typename Transformer , typename Combiner , requires_iterator< InputIterator > = 0>
auto map_reduce (const Execution &ex, InputIterator first, InputIterator last, Identity &&identity, Transformer &&transform_op, Combiner &&combine_op)
 Invoke md_map-reduce on a data sequence. More...
 
template<typename Execution , typename InputIterator , typename Identity , typename Transformer , typename Combiner , typename ... OtherInputIterators, requires_iterator< InputIterator > = 0>
auto map_reduce (const Execution &ex, InputIterator first, InputIterator last, Identity &&identity, Transformer &&transform_op, Combiner &&combine_op, OtherInputIterators ... other_firsts)
 Invoke md_map-reduce on multiple data sequences. More...
 
template<typename E >
constexpr bool is_parallel_execution_native ()
 Metafunction that determines if type E is parallel_execution_native. More...
 
template<>
constexpr bool is_supported< parallel_execution_native > ()
 Determines if an execution policy is supported in the current compilation. More...
 
template<>
constexpr bool supports_map< parallel_execution_native > ()
 Determines if an execution policy supports the map pattern. More...
 
template<>
constexpr bool supports_reduce< parallel_execution_native > ()
 Determines if an execution policy supports the reduce pattern. More...
 
template<>
constexpr bool supports_map_reduce< parallel_execution_native > ()
 Determines if an execution policy supports the map-reduce pattern. More...
 
template<>
constexpr bool supports_stencil< parallel_execution_native > ()
 Determines if an execution policy supports the stencil pattern. More...
 
template<>
constexpr bool supports_divide_conquer< parallel_execution_native > ()
 Determines if an execution policy supports the divide/conquer pattern. More...
 
template<>
constexpr bool supports_pipeline< parallel_execution_native > ()
 Determines if an execution policy supports the pipeline pattern. More...
 
template<typename E >
constexpr bool is_parallel_execution_omp ()
 Metafunction that determines if type E is parallel_execution_omp. More...
 
template<>
constexpr bool is_supported< parallel_execution_omp > ()
 Determines if an execution policy is supported in the current compilation. More...
 
template<>
constexpr bool supports_map< parallel_execution_omp > ()
 Determines if an execution policy supports the map pattern. More...
 
template<>
constexpr bool supports_reduce< parallel_execution_omp > ()
 Determines if an execution policy supports the reduce pattern. More...
 
template<>
constexpr bool supports_map_reduce< parallel_execution_omp > ()
 Determines if an execution policy supports the map-reduce pattern. More...
 
template<>
constexpr bool supports_stencil< parallel_execution_omp > ()
 Determines if an execution policy supports the stencil pattern. More...
 
template<>
constexpr bool supports_divide_conquer< parallel_execution_omp > ()
 Determines if an execution policy supports the divide/conquer pattern. More...
 
template<>
constexpr bool supports_pipeline< parallel_execution_omp > ()
 Determines if an execution policy supports the pipeline pattern. More...
 
template<typename Execution , typename Generator , typename ... Transformers, requires_execution_supported< std::decay_t< Execution >> = 0>
void pipeline (const Execution &ex, Generator &&generate_op, Transformers &&... transform_ops)
 Invoke Pipeline pattern on a data stream. More...
 
template<typename Transformer , typename ... Transformers, requires_execution_not_supported< std::decay_t< Transformer >> = 0>
auto pipeline (Transformer &&transform_op, Transformers &&... transform_ops)
 Build a composable Pipeline pattern representation that can be composed in other streaming patterns. More...
 
template<typename Execution , typename InputIt , typename Result , typename Combiner , requires_iterator< InputIt > = 0>
auto reduce (const Execution &ex, InputIt first, std::size_t size, Result &&identity, Combiner &&combine_op)
 Invoke Reduce pattern with identity value on a data sequence with sequential execution. More...
 
template<typename Execution , typename InputIt , typename Result , typename Combiner , requires_iterator< InputIt > = 0>
auto reduce (const Execution &ex, InputIt first, InputIt last, Result &&identity, Combiner &&combine_op)
 Invoke Reduce pattern with identity value on a data sequence with sequential execution. More...
 
template<typename E >
constexpr bool is_sequential_execution ()
 Determine if a type is a sequential execution policy. More...
 
template<>
constexpr bool is_supported< sequential_execution > ()
 Determines if an execution policy is supported in the current compilation. More...
 
template<>
constexpr bool supports_map< sequential_execution > ()
 Determines if an execution policy supports the map pattern. More...
 
template<>
constexpr bool supports_reduce< sequential_execution > ()
 Determines if an execution policy supports the reduce pattern. More...
 
template<>
constexpr bool supports_map_reduce< sequential_execution > ()
 Determines if an execution policy supports the map-reduce pattern. More...
 
template<>
constexpr bool supports_stencil< sequential_execution > ()
 Determines if an execution policy supports the stencil pattern. More...
 
template<>
constexpr bool supports_divide_conquer< sequential_execution > ()
 Determines if an execution policy supports the divide/conquer pattern. More...
 
template<>
constexpr bool supports_pipeline< sequential_execution > ()
 Determines if an execution policy supports the pipeline pattern. More...
 
template<typename Execution , typename ... InputIterators, typename OutputIt , typename StencilTransformer , typename Neighbourhood , requires_iterators< InputIterators... > = 0, requires_iterator< OutputIt > = 0>
void stencil (const Execution &ex, std::tuple< InputIterators... > firsts, std::size_t size, OutputIt out, StencilTransformer &&transform_op, Neighbourhood &&neighbour_op)
 Invoke Stencil pattern on a data sequence with sequential execution. More...
 
template<typename Execution , typename ... InputIterators, typename InputIt , typename OutputIt , typename StencilTransformer , typename Neighbourhood , requires_iterators< InputIterators... > = 0, requires_iterator< InputIt > = 0, requires_iterator< OutputIt > = 0>
void stencil (const Execution &ex, std::tuple< InputIterators... > firsts, InputIt last, OutputIt out, StencilTransformer &&transform_op, Neighbourhood &&neighbour_op)
 Invoke Stencil pattern on a data sequence with sequential execution. More...
 
template<typename Execution , typename InputIt , typename OutputIt , typename StencilTransformer , typename Neighbourhood , requires_iterator< InputIt > = 0, requires_iterator< OutputIt > = 0>
void stencil (const Execution &ex, InputIt first, InputIt last, OutputIt out, StencilTransformer &&transform_op, Neighbourhood &&neighbour_op)
 Invoke Stencil pattern on a data sequence with sequential execution. More...
 
template<typename Execution , typename InputIt , typename OutputIt , typename StencilTransformer , typename Neighbourhood , typename ... OtherInputIts, requires_iterator< InputIt > = 0, requires_iterator< OutputIt > = 0>
void stencil (const Execution &ex, InputIt first, InputIt last, OutputIt out, StencilTransformer &&transform_op, Neighbourhood &&neighbour_op, OtherInputIts ... other_firsts)
 Invoke Stencil pattern on multiple data sequences with sequential execution. More...
 
template<typename Predicate >
auto keep (Predicate &&predicate_op)
 Invoke md_stream-filter on a data stream that can be composed in other streaming patterns. This function keeps in the stream only those items that satisfy the predicate. More...
 
template<typename Predicate >
auto discard (Predicate &&predicate_op)
 Invoke md_stream-filter on a data stream that can be composed in other streaming patterns. This function discards from the stream those items that satisfy the predicate. More...
 
template<typename Transformer , typename Predicate >
auto repeat_until (Transformer &&transform_op, Predicate &&predicate_op)
 
template<typename Identity , typename Combiner >
auto reduce (int window_size, int offset, Identity identity, Combiner &&combine_op)
 Invoke md_stream-reduce on a stream that can be composed in other streaming patterns. More...
 
template<typename E >
constexpr bool is_parallel_execution_tbb ()
 Metafunction that determines if type E is parallel_execution_tbb. More...
 
template<>
constexpr bool is_supported< parallel_execution_tbb > ()
 Determines if an execution policy is supported in the current compilation. More...
 
template<>
constexpr bool supports_map< parallel_execution_tbb > ()
 Determines if an execution policy supports the map pattern. More...
 
template<>
constexpr bool supports_reduce< parallel_execution_tbb > ()
 Determines if an execution policy supports the reduce pattern. More...
 
template<>
constexpr bool supports_map_reduce< parallel_execution_tbb > ()
 Determines if an execution policy supports the map-reduce pattern. More...
 
template<>
constexpr bool supports_stencil< parallel_execution_tbb > ()
 Determines if an execution policy supports the stencil pattern. More...
 
template<>
constexpr bool supports_divide_conquer< parallel_execution_tbb > ()
 Determines if an execution policy supports the divide/conquer pattern. More...
 
template<>
constexpr bool supports_pipeline< parallel_execution_tbb > ()
 Determines if an execution policy supports the pipeline pattern. More...
 

Variables

template<typename F , typename I >
constexpr bool is_consumer = internal::has_void_return<F,I>()
 
template<typename G >
constexpr bool is_generator
 
template<typename T >
static constexpr bool is_context = internal::is_context<std::decay_t<T>>()
 
template<typename T >
static constexpr bool is_farm = internal::is_farm<std::decay_t<T>>()
 
template<typename T >
static constexpr bool is_filter = internal::is_filter<std::decay_t<T>>()
 
template<typename T >
static constexpr bool is_iteration = internal::is_iteration<std::decay_t<T>>()
 
template<typename T >
constexpr bool is_iterator = internal::is_iterator<T>::value
 
template<typename ... T>
constexpr bool are_iterators = internal::are_iterators<T...>::value
 
template<typename T >
constexpr bool is_queue = internal::is_queue<T>()
 
template<typename T >
constexpr bool is_no_pattern
 
template<typename T >
constexpr bool is_pattern = !is_no_pattern<T>
 
template<typename T >
static constexpr bool is_pipeline = internal::is_pipeline<std::decay_t<T>>()
 
template<typename T >
constexpr bool is_reduce = internal::is_reduce<std::decay_t<T>>()
 

Typedef Documentation

◆ output_value_type

template<typename I , typename T >
using grppi::output_value_type = typedef typename internal::output_value_type<I,T>::type

◆ requires_arguments

template<typename F >
using grppi::requires_arguments = typedef typename std::enable_if_t<internal::has_arguments<F>(), int>

◆ requires_consumer

template<typename F , typename I >
using grppi::requires_consumer = typedef typename std::enable_if_t<internal::has_void_return<F(I)>(), int>

◆ requires_context

template<typename T >
using grppi::requires_context = typedef typename std::enable_if_t<is_context<T>, int>

◆ requires_execution_not_supported

template<typename E >
using grppi::requires_execution_not_supported = typedef std::enable_if_t<!is_supported<E>(), int>

◆ requires_execution_supported

template<typename E >
using grppi::requires_execution_supported = typedef std::enable_if_t<is_supported<E>(), int>

◆ requires_farm

template<typename T >
using grppi::requires_farm = typedef typename std::enable_if_t<is_farm<T>, int>

◆ requires_filter

template<typename T >
using grppi::requires_filter = typedef typename std::enable_if_t<is_filter<T>, int>

◆ requires_generator

template<typename G >
using grppi::requires_generator = typedef typename std::enable_if_t<is_generator<G>, int>

◆ requires_iteration

template<typename T >
using grppi::requires_iteration = typedef typename std::enable_if_t<is_iteration<T>, int>

◆ requires_iterator

template<typename T >
using grppi::requires_iterator = typedef std::enable_if_t<is_iterator<T>, int>

◆ requires_iterators

template<typename ... T>
using grppi::requires_iterators = typedef std::enable_if_t<are_iterators<T...>, int>

◆ requires_no_pattern

template<typename T >
using grppi::requires_no_pattern = typedef std::enable_if_t<is_no_pattern<T>,int>

◆ requires_pattern

template<typename T >
using grppi::requires_pattern = typedef std::enable_if_t<is_pattern<T>, int>

◆ requires_pipeline

template<typename T >
using grppi::requires_pipeline = typedef typename std::enable_if_t<is_pipeline<T>, int>

◆ requires_queue

template<typename T >
using grppi::requires_queue = typedef std::enable_if_t<is_queue<T>, int>

◆ requires_reduce

template<typename T >
using grppi::requires_reduce = typedef std::enable_if_t<is_reduce<T>,int>

◆ result_type

template<typename Input , typename Transformer >
using grppi::result_type = typedef typename std::result_of<Transformer(Input)>::type

Determines the return type of applying a function on a input type.

Enumeration Type Documentation

◆ queue_mode

enum grppi::queue_mode
strong
Enumerator
lockfree 
blocking 

Function Documentation

◆ advance_iterators() [1/2]

template<typename ... InputIt>
void grppi::advance_iterators ( InputIt &...  in)

Advance a pack of iterators by one unit. Every iterator in the parameter pack in is increased 1 step.

◆ advance_iterators() [2/2]

template<typename ... InputIt>
void grppi::advance_iterators ( size_t  delta,
InputIt &...  in 
)

Advance a pack of iterators by a delta. Every iterator in the parameter pack in is increased n steps.

◆ apply_deref_increment()

template<typename F , typename ... Iterators, template< typename ... > class T>
decltype(auto) grppi::apply_deref_increment ( F &&  f,
T< Iterators... > &  iterators 
)

Applies a callable object to the values obtained from the iterators in a tuple-like object. This function takes callable object f and a tuple-like with iterators (e.g. the result of make_tuple(it1, it2, it3))

and performs the action

f(*it1++, *it2++, *it3++);
Template Parameters
FType of the callable object.
IteratorsPack of iterator types.
TTuple-like type containing the iterators
Parameters
fCallable object to be invoked.
iteratorsIterators to be used.
Postcondition
All iterators in t have been incremented
Returns
The result of callable invocation.

◆ apply_increment()

template<typename F , typename ... Iterators, template< typename... > class T>
decltype(auto) grppi::apply_increment ( F &&  f,
T< Iterators... > &  iterators 
)

Applies a callable object to the iterators in a tuple like-object and the increments those iterators. This function takes callable object f and a tuple-like object with iterators (e.g. the result of make_tuple(it1, it2, it3))

and performs the action

f(it1++, it2++, it3++);
Template Parameters
Typeof the callable object.
IteratorsPack of iterator types.
TTuple-like type containing the iterators
Parameters
fCallable object to be invoked.
iteratorsIterators to be used.
Postcondition
All iterators in t have been incremented

◆ apply_iterators_indexed()

template<typename F , typename T >
decltype(auto) grppi::apply_iterators_indexed ( F &&  f,
T &&  t,
std::size_t  i 
)

Applies a callable object to the values obtained from the iterators in a tuple by indexing. This function takes callable object f, a tuple-like with iterators (e.g. the result of make_tuple(it1, it2, it3)) and an integral index i.

and performs the action

f(it1[i], it2[i], it3[i]);
Template Parameters
FType of the callable object.
TTuple type containing a tuple of iterators
Parameters
fCallable object to be invoked.
tTuple of iterators.
iIntegral index to apply to each iterator.
Postcondition
All iterators in t have been incremented
f has been invoked with the contents of the iterator in the tuple.

◆ is_parallel_execution_ff()

template<typename E >
constexpr bool grppi::is_parallel_execution_ff ( )
constexpr

Metafunction that determines if type E is parallel_execution_ff This metafunction evaluates to false if GRPPI_FF is disabled.

Template Parameters
Executionpolicy type.

◆ is_parallel_execution_native()

template<typename E >
constexpr bool grppi::is_parallel_execution_native ( )
constexpr

Metafunction that determines if type E is parallel_execution_native.

Template Parameters
Executionpolicy type.

◆ is_parallel_execution_omp()

template<typename E >
constexpr bool grppi::is_parallel_execution_omp ( )
constexpr

Metafunction that determines if type E is parallel_execution_omp.

Template Parameters
Executionpolicy type.

◆ is_parallel_execution_tbb()

template<typename E >
constexpr bool grppi::is_parallel_execution_tbb ( )
constexpr

Metafunction that determines if type E is parallel_execution_tbb.

Template Parameters
Executionpolicy type.

◆ is_sequential_execution()

template<typename E >
constexpr bool grppi::is_sequential_execution ( )
constexpr

Determine if a type is a sequential execution policy.

◆ is_supported()

template<typename E >
constexpr bool grppi::is_supported ( )
constexpr

Determines if an execution policy is supported in the current compilation.

Note
This must be specialized by every execution policy.

◆ is_supported< dynamic_execution >()

template<>
constexpr bool grppi::is_supported< dynamic_execution > ( )
constexpr

Determines if an execution policy is supported in the current compilation.

Note
Specialization for dynamic_execution.

◆ is_supported< parallel_execution_native >()

template<>
constexpr bool grppi::is_supported< parallel_execution_native > ( )
constexpr

Determines if an execution policy is supported in the current compilation.

Note
Specialization for parallel_execution_native.

◆ is_supported< parallel_execution_omp >()

template<>
constexpr bool grppi::is_supported< parallel_execution_omp > ( )
constexpr

Determines if an execution policy is supported in the current compilation.

Note
Specialization for parallel_execution_omp when GRPPI_OMP is enabled.

◆ is_supported< parallel_execution_tbb >()

template<>
constexpr bool grppi::is_supported< parallel_execution_tbb > ( )
constexpr

Determines if an execution policy is supported in the current compilation.

Note
Specialization for parallel_execution_omp when GRPPI_TBB is enabled.

◆ is_supported< sequential_execution >()

template<>
constexpr bool grppi::is_supported< sequential_execution > ( )
constexpr

Determines if an execution policy is supported in the current compilation.

Note
Specialization for sequential_execution.

◆ iterators_next()

template<typename T >
auto grppi::iterators_next ( T &&  t,
int  n 
)

Computes next n steps from a tuple of iterators.

Template Parameters
TTuple type containing a tuple of iterators.
Parameters
tTuple of iterators.
nNumber of steps to advance.
Note
This function is the equivalent to std::next for a tuple of iterators.
Returns
A new tuple with the result iterators.

◆ repeat_until()

template<typename Transformer , typename Predicate >
auto grppi::repeat_until ( Transformer &&  transform_op,
Predicate &&  predicate_op 
)

◆ supports_divide_conquer()

template<typename E >
constexpr bool grppi::supports_divide_conquer ( )
constexpr

Determines if an execution policy supports the divide-conquer pattern.

Note
This must be specialized by every execution policy supporting the pattern.

◆ supports_divide_conquer< dynamic_execution >()

template<>
constexpr bool grppi::supports_divide_conquer< dynamic_execution > ( )
constexpr

Determines if an execution policy supports the divide/conquer pattern.

Note
Specialization for dynamic_execution.

◆ supports_divide_conquer< parallel_execution_native >()

template<>
constexpr bool grppi::supports_divide_conquer< parallel_execution_native > ( )
constexpr

Determines if an execution policy supports the divide/conquer pattern.

Note
Specialization for parallel_execution_native.

◆ supports_divide_conquer< parallel_execution_omp >()

template<>
constexpr bool grppi::supports_divide_conquer< parallel_execution_omp > ( )
constexpr

Determines if an execution policy supports the divide/conquer pattern.

Note
Specialization for parallel_execution_omp when GRPPI_OMP is enabled.

◆ supports_divide_conquer< parallel_execution_tbb >()

template<>
constexpr bool grppi::supports_divide_conquer< parallel_execution_tbb > ( )
constexpr

Determines if an execution policy supports the divide/conquer pattern.

Note
Specialization for parallel_execution_omp when GRPPI_TBB is enabled.

◆ supports_divide_conquer< sequential_execution >()

template<>
constexpr bool grppi::supports_divide_conquer< sequential_execution > ( )
constexpr

Determines if an execution policy supports the divide/conquer pattern.

Note
Specialization for sequential_execution.

◆ supports_map()

template<typename E >
constexpr bool grppi::supports_map ( )
constexpr

Determines if an execution policy supports the map pattern.

Note
This must be specialized by every execution policy supporting the pattern.

◆ supports_map< dynamic_execution >()

template<>
constexpr bool grppi::supports_map< dynamic_execution > ( )
constexpr

Determines if an execution policy supports the map pattern.

Note
Specialization for dynamic_execution.

◆ supports_map< parallel_execution_native >()

template<>
constexpr bool grppi::supports_map< parallel_execution_native > ( )
constexpr

Determines if an execution policy supports the map pattern.

Note
Specialization for parallel_execution_native.

◆ supports_map< parallel_execution_omp >()

template<>
constexpr bool grppi::supports_map< parallel_execution_omp > ( )
constexpr

Determines if an execution policy supports the map pattern.

Note
Specialization for parallel_execution_omp when GRPPI_OMP is enabled.

◆ supports_map< parallel_execution_tbb >()

template<>
constexpr bool grppi::supports_map< parallel_execution_tbb > ( )
constexpr

Determines if an execution policy supports the map pattern.

Note
Specialization for parallel_execution_omp when GRPPI_TBB is enabled.

◆ supports_map< sequential_execution >()

template<>
constexpr bool grppi::supports_map< sequential_execution > ( )
constexpr

Determines if an execution policy supports the map pattern.

Note
Specialization for sequential_execution.

◆ supports_map_reduce()

template<typename E >
constexpr bool grppi::supports_map_reduce ( )
constexpr

Determines if an execution policy supports the map-reduce pattern.

Note
This must be specialized by every execution policy supporting the pattern.

◆ supports_map_reduce< dynamic_execution >()

template<>
constexpr bool grppi::supports_map_reduce< dynamic_execution > ( )
constexpr

Determines if an execution policy supports the map-reduce pattern.

Note
Specialization for dynamic_execution.

◆ supports_map_reduce< parallel_execution_native >()

template<>
constexpr bool grppi::supports_map_reduce< parallel_execution_native > ( )
constexpr

Determines if an execution policy supports the map-reduce pattern.

Note
Specialization for parallel_execution_native.

◆ supports_map_reduce< parallel_execution_omp >()

template<>
constexpr bool grppi::supports_map_reduce< parallel_execution_omp > ( )
constexpr

Determines if an execution policy supports the map-reduce pattern.

Note
Specialization for parallel_execution_omp when GRPPI_OMP is enabled.

◆ supports_map_reduce< parallel_execution_tbb >()

template<>
constexpr bool grppi::supports_map_reduce< parallel_execution_tbb > ( )
constexpr

Determines if an execution policy supports the map-reduce pattern.

Note
Specialization for parallel_execution_omp when GRPPI_TBB is enabled.

◆ supports_map_reduce< sequential_execution >()

template<>
constexpr bool grppi::supports_map_reduce< sequential_execution > ( )
constexpr

Determines if an execution policy supports the map-reduce pattern.

Note
Specialization for sequential_execution.

◆ supports_pipeline()

template<typename E >
constexpr bool grppi::supports_pipeline ( )
constexpr

Determines if an execution policy supports the pipeline pattern.

Note
This must be specialized by every execution policy supporting the pattern.

◆ supports_pipeline< dynamic_execution >()

template<>
constexpr bool grppi::supports_pipeline< dynamic_execution > ( )
constexpr

Determines if an execution policy supports the pipeline pattern.

Note
Specialization for dynamic_execution.

◆ supports_pipeline< parallel_execution_native >()

template<>
constexpr bool grppi::supports_pipeline< parallel_execution_native > ( )
constexpr

Determines if an execution policy supports the pipeline pattern.

Note
Specialization for parallel_execution_native.

◆ supports_pipeline< parallel_execution_omp >()

template<>
constexpr bool grppi::supports_pipeline< parallel_execution_omp > ( )
constexpr

Determines if an execution policy supports the pipeline pattern.

Note
Specialization for parallel_execution_omp when GRPPI_OMP is enabled.

◆ supports_pipeline< parallel_execution_tbb >()

template<>
constexpr bool grppi::supports_pipeline< parallel_execution_tbb > ( )
constexpr

Determines if an execution policy supports the pipeline pattern.

Note
Specialization for parallel_execution_omp when GRPPI_TBB is enabled.

◆ supports_pipeline< sequential_execution >()

template<>
constexpr bool grppi::supports_pipeline< sequential_execution > ( )
constexpr

Determines if an execution policy supports the pipeline pattern.

Note
Specialization for sequential_execution.

◆ supports_reduce()

template<typename E >
constexpr bool grppi::supports_reduce ( )
constexpr

Determines if an execution policy supports the reduce pattern.

Note
This must be specialized by every execution policy supporting the pattern.

◆ supports_reduce< dynamic_execution >()

template<>
constexpr bool grppi::supports_reduce< dynamic_execution > ( )
constexpr

Determines if an execution policy supports the reduce pattern.

Note
Specialization for dynamic_execution.

◆ supports_reduce< parallel_execution_native >()

template<>
constexpr bool grppi::supports_reduce< parallel_execution_native > ( )
constexpr

Determines if an execution policy supports the reduce pattern.

Note
Specialization for parallel_execution_native.

◆ supports_reduce< parallel_execution_omp >()

template<>
constexpr bool grppi::supports_reduce< parallel_execution_omp > ( )
constexpr

Determines if an execution policy supports the reduce pattern.

Note
Specialization for parallel_execution_omp when GRPPI_OMP is enabled.

◆ supports_reduce< parallel_execution_tbb >()

template<>
constexpr bool grppi::supports_reduce< parallel_execution_tbb > ( )
constexpr

Determines if an execution policy supports the reduce pattern.

Note
Specialization for parallel_execution_omp when GRPPI_TBB is enabled.

◆ supports_reduce< sequential_execution >()

template<>
constexpr bool grppi::supports_reduce< sequential_execution > ( )
constexpr

Determines if an execution policy supports the reduce pattern.

Note
Specialization for sequential_execution.

◆ supports_stencil()

template<typename E >
constexpr bool grppi::supports_stencil ( )
constexpr

Determines if an execution policy supports the stencil pattern.

Note
This must be specialized by every execution policy supporting the pattern.

◆ supports_stencil< dynamic_execution >()

template<>
constexpr bool grppi::supports_stencil< dynamic_execution > ( )
constexpr

Determines if an execution policy supports the stencil pattern.

Note
Specialization for dynamic_execution.

◆ supports_stencil< parallel_execution_native >()

template<>
constexpr bool grppi::supports_stencil< parallel_execution_native > ( )
constexpr

Determines if an execution policy supports the stencil pattern.

Note
Specialization for parallel_execution_native.

◆ supports_stencil< parallel_execution_omp >()

template<>
constexpr bool grppi::supports_stencil< parallel_execution_omp > ( )
constexpr

Determines if an execution policy supports the stencil pattern.

Note
Specialization for parallel_execution_omp when GRPPI_OMP is enabled.

◆ supports_stencil< parallel_execution_tbb >()

template<>
constexpr bool grppi::supports_stencil< parallel_execution_tbb > ( )
constexpr

Determines if an execution policy supports the stencil pattern.

Note
Specialization for parallel_execution_omp when GRPPI_TBB is enabled.

◆ supports_stencil< sequential_execution >()

template<>
constexpr bool grppi::supports_stencil< sequential_execution > ( )
constexpr

Determines if an execution policy supports the stencil pattern.

Note
Specialization for sequential_execution.

Variable Documentation

◆ are_iterators

template<typename ... T>
constexpr bool grppi::are_iterators = internal::are_iterators<T...>::value
constexpr

◆ is_consumer

template<typename F , typename I >
constexpr bool grppi::is_consumer = internal::has_void_return<F,I>()
constexpr

◆ is_context

template<typename T >
constexpr bool grppi::is_context = internal::is_context<std::decay_t<T>>()
staticconstexpr

◆ is_farm

template<typename T >
constexpr bool grppi::is_farm = internal::is_farm<std::decay_t<T>>()
staticconstexpr

◆ is_filter

template<typename T >
constexpr bool grppi::is_filter = internal::is_filter<std::decay_t<T>>()
staticconstexpr

◆ is_generator

template<typename G >
constexpr bool grppi::is_generator
constexpr
Initial value:
=
!internal::has_void_return<G>()

◆ is_iteration

template<typename T >
constexpr bool grppi::is_iteration = internal::is_iteration<std::decay_t<T>>()
staticconstexpr

◆ is_iterator

template<typename T >
constexpr bool grppi::is_iterator = internal::is_iterator<T>::value
constexpr

◆ is_no_pattern

template<typename T >
constexpr bool grppi::is_no_pattern
constexpr
Initial value:
=
!is_farm<T> &&
!is_filter<T> &&
!is_pipeline<T> &&
!is_reduce<T> &&
!is_iteration<T>&&
!is_context<T>

◆ is_pattern

template<typename T >
constexpr bool grppi::is_pattern = !is_no_pattern<T>
constexpr

◆ is_pipeline

template<typename T >
constexpr bool grppi::is_pipeline = internal::is_pipeline<std::decay_t<T>>()
staticconstexpr

◆ is_queue

template<typename T >
constexpr bool grppi::is_queue = internal::is_queue<T>()
constexpr

◆ is_reduce

template<typename T >
constexpr bool grppi::is_reduce = internal::is_reduce<std::decay_t<T>>()
constexpr