33 #ifndef _GLIBCXX_PARALLEL_OMP_LOOP_STATIC_H
34 #define _GLIBCXX_PARALLEL_OMP_LOOP_STATIC_H 1
60 template<
typename _RAIter,
67 _RAIter __end, _Op __o,
76 _DifferenceType __length = __end - __begin;
78 (__get_max_threads(), __length);
80 _Result *__thread_results;
82 # pragma omp parallel num_threads(__num_threads)
86 __num_threads = omp_get_num_threads();
87 __thread_results =
new _Result[__num_threads];
90 __thread_results[__i] = _Result();
95 #pragma omp for schedule(static, _Settings::get().workstealing_chunk_size)
96 for (_DifferenceType __pos = 0; __pos < __length; ++__pos)
97 __thread_results[__iam] = __r(__thread_results[__iam],
98 __f(__o, __begin+__pos));
102 __output = __r(__output, __thread_results[__i]);
104 delete [] __thread_results;
108 __f.finish_iterator = __begin + __length;
Includes the original header files concerned with iterators except for stream iterators....
Runtime settings and tuning parameters, heuristics to decide whether to use parallelized algorithms.
constexpr _Iterator __base(_Iterator __it)
GNU parallel code for public use.
uint16_t _ThreadIndex
Unsigned integer to index a thread number. The maximum thread number (for each processor) must fit in...
_Op __for_each_template_random_access_omp_loop_static(_RAIter __begin, _RAIter __end, _Op __o, _Fu &__f, _Red __r, _Result __base, _Result &__output, typename std::iterator_traits< _RAIter >::difference_type __bound)
Embarrassingly parallel algorithm for random access iterators, using an OpenMP for loop with static s...
Traits class for iterators.