GrPPI
0.3.1
Generic and Reusable Parallel Pattern Interface
|
Sequential execution policy. More...
#include <sequential_execution.h>
Public Member Functions | |
constexpr | sequential_execution () noexcept=default |
Default constructor. More... | |
constexpr void | set_concurrency_degree (int n) const noexcept |
Set number of grppi threads. More... | |
constexpr int | concurrency_degree () const noexcept |
Get number of grppi trheads. More... | |
constexpr void | enable_ordering () const noexcept |
Enable ordering. More... | |
constexpr void | disable_ordering () const noexcept |
Disable ordering. More... | |
constexpr bool | is_ordered () const noexcept |
Is execution ordered. More... | |
template<typename... InputIterators, typename OutputIterator , typename Transformer > | |
constexpr void | map (std::tuple< InputIterators... > firsts, OutputIterator first_out, std::size_t sequence_size, Transformer &&transform_op) const |
Applies a trasnformation to multiple sequences leaving the result in another sequence. More... | |
template<typename InputIterator , typename Identity , typename Combiner > | |
constexpr auto | reduce (InputIterator first, std::size_t sequence_size, Identity &&identity, Combiner &&combine_op) const |
Applies a reduction to a sequence of data items. More... | |
template<typename... InputIterators, typename Identity , typename Transformer , typename Combiner > | |
constexpr auto | map_reduce (std::tuple< InputIterators... > firsts, std::size_t sequence_size, Identity &&identity, Transformer &&transform_op, Combiner &&combine_op) const |
Applies a map/reduce operation to a sequence of data items. More... | |
template<typename... InputIterators, typename OutputIterator , typename StencilTransformer , typename Neighbourhood > | |
constexpr void | stencil (std::tuple< InputIterators... > firsts, OutputIterator first_out, std::size_t sequence_size, StencilTransformer &&transform_op, Neighbourhood &&neighbour_op) const |
Applies a stencil to multiple sequences leaving the result in another sequence. More... | |
template<typename Input , typename Divider , typename Solver , typename Combiner > | |
auto | divide_conquer (Input &&input, Divider &÷_op, Solver &&solve_op, Combiner &&combine_op) const |
Invoke Divide/conquer pattern. More... | |
template<typename Input , typename Divider , typename Predicate , typename Solver , typename Combiner > | |
auto | divide_conquer (Input &&input, Divider &÷_op, Predicate &&predicate_op, Solver &&solve_op, Combiner &&combine_op) const |
Invoke Divide/conquer pattern. More... | |
template<typename Generator , typename... Transformers> | |
void | pipeline (Generator &&generate_op, Transformers &&...transform_op) const |
Invoke Pipeline pattern. More... | |
template<typename InputType , typename Transformer , typename OutputType > | |
void | pipeline (mpmc_queue< InputType > &input_queue, Transformer &&transform_op, mpmc_queue< OutputType > &output_queue) const |
Invoke Pipeline pattern comming from another context that uses mpmc_queues as communication channels. More... | |
Sequential execution policy.
|
defaultnoexcept |
Default constructor.
|
inlinenoexcept |
Get number of grppi trheads.
|
inlinenoexcept |
Disable ordering.
auto grppi::sequential_execution::divide_conquer | ( | Input && | input, |
Divider && | divide_op, | ||
Solver && | solve_op, | ||
Combiner && | combine_op | ||
) | const |
Invoke Divide/conquer pattern.
Input | Type used for the input problem. |
Divider | Callable type for the divider operation. |
Solver | Callable type for the solver operation. |
Combiner | Callable type for the combiner operation. |
ex | Sequential execution policy object. |
input | Input problem to be solved. |
divider_op | Divider operation. |
solver_op | Solver operation. |
combine_op | Combiner operation. |
auto grppi::sequential_execution::divide_conquer | ( | Input && | input, |
Divider && | divide_op, | ||
Predicate && | predicate_op, | ||
Solver && | solve_op, | ||
Combiner && | combine_op | ||
) | const |
Invoke Divide/conquer pattern.
Input | Type used for the input problem. |
Divider | Callable type for the divider operation. |
Predicate | Callable type for the stop condition predicate. |
Solver | Callable type for the solver operation. |
Combiner | Callable type for the combiner operation. |
ex | Sequential execution policy object. |
input | Input problem to be solved. |
divider_op | Divider operation. |
predicate_op | Predicate operation. |
solver_op | Solver operation. |
combine_op | Combiner operation. |
|
inlinenoexcept |
Enable ordering.
|
inlinenoexcept |
Is execution ordered.
constexpr void grppi::sequential_execution::map | ( | std::tuple< InputIterators... > | firsts, |
OutputIterator | first_out, | ||
std::size_t | sequence_size, | ||
Transformer && | transform_op | ||
) | const |
Applies a trasnformation to multiple sequences leaving the result in another sequence.
InputIterators | Iterator types for input sequences. |
OutputIterator | Iterator type for the output sequence. |
Transformer | Callable object type for the transformation. |
firsts | Tuple of iterators to input sequences. |
first_out | Iterator to the output sequence. |
sequence_size | Size of the input sequences. |
transform_op | Transformation callable object. |
[get<I>(firsts), next(get<I>(firsts),sequence_size))
are valid. [first_out, next(first_out,sequence_size)]
are valid. constexpr auto grppi::sequential_execution::map_reduce | ( | std::tuple< InputIterators... > | firsts, |
std::size_t | sequence_size, | ||
Identity && | identity, | ||
Transformer && | transform_op, | ||
Combiner && | combine_op | ||
) | const |
Applies a map/reduce operation to a sequence of data items.
InputIterator | Iterator type for the input sequence. |
Identity | Type for the identity value. |
Transformer | Callable object type for the transformation. |
Combiner | Callable object type for the combination. |
first | Iterator to the first element of the sequence. |
sequence_size | Size of the input sequence. |
identity | Identity value for the reduction. |
transform_op | Transformation callable object. |
combine_op | Combination callable object. |
[first,last)
are valid. void grppi::sequential_execution::pipeline | ( | Generator && | generate_op, |
Transformers &&... | transform_op | ||
) | const |
Invoke Pipeline pattern.
Generator | Callable type for the generator operation. |
Transformers | Callable types for the transformers in the pipeline. |
generate_op | Generator operation. |
transform_ops | Transformer operations. |
|
inline |
Invoke Pipeline pattern comming from another context that uses mpmc_queues as communication channels.
InputType | Type of the input stream. |
Transformers | Callable types for the transformers in the pipeline. |
InputType | Type of the output stream. |
input_queue | Input stream communicator. |
transform_ops | Transformer operations. |
output_queue | Input stream communicator. |
constexpr auto grppi::sequential_execution::reduce | ( | InputIterator | first, |
std::size_t | sequence_size, | ||
Identity && | identity, | ||
Combiner && | combine_op | ||
) | const |
Applies a reduction to a sequence of data items.
InputIterator | Iterator type for the input sequence. |
Identity | Type for the identity value. |
Combiner | Callable object type for the combination. |
first | Iterator to the first element of the sequence. |
sequence_size | Size of the input sequence. |
last | Iterator to one past the end of the sequence. |
identity | Identity value for the reduction. |
combine_op | Combination callable object. |
[first,last)
are valid.
|
inlinenoexcept |
Set number of grppi threads.
constexpr void grppi::sequential_execution::stencil | ( | std::tuple< InputIterators... > | firsts, |
OutputIterator | first_out, | ||
std::size_t | sequence_size, | ||
StencilTransformer && | transform_op, | ||
Neighbourhood && | neighbour_op | ||
) | const |
Applies a stencil to multiple sequences leaving the result in another sequence.
InputIterators | Iterator types for input sequences. |
OutputIterator | Iterator type for the output sequence. |
StencilTransformer | Callable object type for the stencil transformation. |
Neighbourhood | Callable object for generating neighbourhoods. |
firsts | Tuple of iterators to input sequences. |
first_out | Iterator to the output sequence. |
sequence_size | Size of the input sequences. |
transform_op | Stencil transformation callable object. |
neighbour_op | Neighbourhood callable object. |
[get<I>(firsts), next(get<I>(firsts),sequence_size))
are valid. [first_out, next(first_out,sequence_size)]
are valid.