21 #ifndef GRPPI_OMP_MAP_H 22 #define GRPPI_OMP_MAP_H 30 template <
typename InputIt,
typename OutputIt,
typename Transformer,
31 typename ... OtherInputIts>
33 InputIt first, InputIt last,
35 Transformer && transf_op,
37 int elemperthr, OtherInputIts ... more_firsts)
40 auto begin = first + (elemperthr * i);
41 auto end = first + (elemperthr * (i+1));
43 auto out = first_out + (elemperthr * i);
46 *out = transf_op(*begin, *more_firsts ...);
73 template <
typename InputIt,
typename OutputIt,
typename Transformer>
75 InputIt first, InputIt last,
77 Transformer && transf_op)
79 int numElements = last - first;
85 #pragma omp single nowait 91 #pragma omp task firstprivate(i) 93 auto begin = first + (elemperthr * i);
94 auto end = first + (elemperthr * (i+1));
96 auto out = first_out + (elemperthr * i);
98 *out = transf_op(*begin);
106 auto out = first_out;
107 auto end = first+elemperthr;
109 *out = transf_op(*beg);
132 template <
typename InputIt,
typename OutputIt,
typename Transformer,
133 typename ... OtherInputIts>
135 InputIt first, InputIt last,
137 Transformer && transf_op,
138 OtherInputIts ... more_firsts)
141 int numElements = last - first;
147 #pragma omp single nowait 151 #pragma omp task firstprivate(i) 154 std::forward<Transformer>(transf_op) , i, elemperthr,
162 std::forward<Transformer>(transf_op), 0, elemperthr,
Definition: callable_traits.h:24
void internal_map(parallel_execution_omp &ex, InputIt first, InputIt last, OutputIt first_out, Transformer &&transf_op, int i, int elemperthr, OtherInputIts...more_firsts)
Definition: omp/map.h:32
OpenMP parallel execution policy.
Definition: parallel_execution_omp.h:40
void advance_iterators(size_t delta, InputIt &...in)
Definition: iterator.h:29
int concurrency_degree() const noexcept
Get number of grppi trheads.
Definition: parallel_execution_omp.h:85
void map(parallel_execution_native &ex, InputIt first, InputIt last, OutputIt first_out, Transformer &&transf_op)
Invoke Map pattern on a data sequence with native paralell execution.
Definition: native/map.h:50