33 #ifndef _GLIBCXX_PARALLEL_OMP_LOOP_STATIC_H
34 #define _GLIBCXX_PARALLEL_OMP_LOOP_STATIC_H 1
61 template<
typename RandomAccessIterator,
68 RandomAccessIterator end,
70 Result base, Result& output,
72 <RandomAccessIterator>::
73 difference_type bound)
76 std::iterator_traits<RandomAccessIterator>::difference_type
79 difference_type length = end - begin;
81 std::min<difference_type>(get_max_threads(), length);
83 Result *thread_results;
85 # pragma omp parallel num_threads(num_threads)
89 num_threads = omp_get_num_threads();
90 thread_results =
new Result[num_threads];
93 thread_results[i] = Result();
98 # pragma omp for schedule(static, _Settings::get().workstealing_chunk_size)
99 for (difference_type pos = 0; pos < length; ++pos)
100 thread_results[iam] = r(thread_results[iam], f(o, begin+pos));
104 output = r(output, thread_results[i]);
106 delete [] thread_results;
110 f.finish_iterator = begin + length;
Runtime settings and tuning parameters, heuristics to decide whether to use parallelized algorithms...
GNU parallel code for public use.
uint16 thread_index_t
Unsigned integer to index a thread number. The maximum thread number (for each processor) must fit in...
Includes the original header files concerned with iterators except for stream iterators. This file is a GNU parallel extension to the Standard C++ Library.
Op for_each_template_random_access_omp_loop_static(RandomAccessIterator begin, RandomAccessIterator end, Op o, Fu &f, Red r, Result base, Result &output, typename std::iterator_traits< RandomAccessIterator >::difference_type bound)
Embarrassingly parallel algorithm for random access iterators, using an OpenMP for loop with static s...