diff options
author | bkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-10-08 15:58:06 +0000 |
---|---|---|
committer | bkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-10-08 15:58:06 +0000 |
commit | 7290a47ca9b91821d0fd943de462e96f1e42e3a5 (patch) | |
tree | 3599b4fee15fd508751cd48092272e0556525d2a | |
parent | 1a35829f3e4fbdf42f67b00ea64b2198d811286e (diff) | |
download | gcc-7290a47ca9b91821d0fd943de462e96f1e42e3a5.tar.gz |
2007-10-08 Benjamin Kosnik <bkoz@redhat.com>
PR libstdc++/33489
* include/parallel/multiseq_selection.h: Remove default constructed
value_type.
* include/parallel/partition.h:
* include/parallel/partial_sum.h: Format.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@129132 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | libstdc++-v3/ChangeLog | 11 | ||||
-rw-r--r-- | libstdc++-v3/include/parallel/partial_sum.h | 18 | ||||
-rw-r--r-- | libstdc++-v3/include/parallel/partition.h | 8 |
3 files changed, 28 insertions, 9 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 29ab6898573..32eeadf139d 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,11 @@ +2007-10-08 Benjamin Kosnik <bkoz@redhat.com> + + PR libstdc++/33489 + * include/parallel/multiseq_selection.h: Remove default constructed + value_type. + * include/parallel/partition.h: + * include/parallel/partial_sum.h: Format. + 2007-10-08 Johannes Singler <singler@ira.uka.de> * include/parallel/multiway_merge.h: Added reference to paper. @@ -61,7 +69,8 @@ * include/bits/stl_algobase.h (_GLIBCXX_MOVE): Add. (swap, __iter_swap): Use it. - * testsuite/25_algorithms/rotate/moveable.cc: Remove dg-require-rvalref. + * testsuite/25_algorithms/rotate/moveable.cc: Remove + dg-require-rvalref. * testsuite/25_algorithms/remove/moveable.cc: Likewise. * testsuite/25_algorithms/partition/moveable.cc: Likewise. * testsuite/25_algorithms/swap_ranges/moveable.cc: Likewise. diff --git a/libstdc++-v3/include/parallel/partial_sum.h b/libstdc++-v3/include/parallel/partial_sum.h index 5a1a43e31a4..31ded50733b 100644 --- a/libstdc++-v3/include/parallel/partial_sum.h +++ b/libstdc++-v3/include/parallel/partial_sum.h @@ -128,26 +128,34 @@ namespace __gnu_parallel if (id == 0) { *result = *begin; - parallel_partial_sum_basecase(begin + 1, begin + borders[1], result + 1, bin_op, *begin); + parallel_partial_sum_basecase(begin + 1, begin + borders[1], + result + 1, bin_op, *begin); sums[0] = *(result + borders[1] - 1); } else { - sums[id] = std::accumulate(begin + borders[id] + 1, begin + borders[id + 1], *(begin + borders[id]), bin_op, __gnu_parallel::sequential_tag()); + sums[id] = std::accumulate(begin + borders[id] + 1, + begin + borders[id + 1], + *(begin + borders[id]), + bin_op, __gnu_parallel::sequential_tag()); } #pragma omp barrier #pragma omp single - parallel_partial_sum_basecase(sums + 1, sums + num_threads, sums + 1, bin_op, sums[0]); + parallel_partial_sum_basecase(sums + 1, sums + num_threads, sums + 1, + bin_op, sums[0]); #pragma omp barrier // Still same team. - parallel_partial_sum_basecase(begin + borders[id + 1], begin + borders[id + 2], result + borders[id + 1], bin_op, sums[id]); + parallel_partial_sum_basecase(begin + borders[id + 1], + begin + borders[id + 2], + result + borders[id + 1], bin_op, + sums[id]); } - delete[] sums; + delete [] sums; return result + n; } diff --git a/libstdc++-v3/include/parallel/partition.h b/libstdc++-v3/include/parallel/partition.h index 790685bf0a5..70bff8e0af0 100644 --- a/libstdc++-v3/include/parallel/partition.h +++ b/libstdc++-v3/include/parallel/partition.h @@ -70,7 +70,9 @@ namespace __gnu_parallel // Shared. _GLIBCXX_VOLATILE difference_type left = 0, right = n - 1; - _GLIBCXX_VOLATILE difference_type leftover_left, leftover_right, leftnew, rightnew; + _GLIBCXX_VOLATILE difference_type leftover_left, leftover_right; + _GLIBCXX_VOLATILE difference_type leftnew, rightnew; + bool* reserved_left, * reserved_right; reserved_left = new bool[max_num_threads]; @@ -299,7 +301,8 @@ namespace __gnu_parallel */ template<typename RandomAccessIterator, typename Comparator> void - parallel_nth_element(RandomAccessIterator begin, RandomAccessIterator nth, RandomAccessIterator end, Comparator comp) + parallel_nth_element(RandomAccessIterator begin, RandomAccessIterator nth, + RandomAccessIterator end, Comparator comp) { typedef std::iterator_traits<RandomAccessIterator> traits_type; typedef typename traits_type::value_type value_type; @@ -308,7 +311,6 @@ namespace __gnu_parallel _GLIBCXX_CALL(end - begin) RandomAccessIterator split; - value_type pivot; random_number rng; difference_type minimum_length = std::max<difference_type>(2, Settings::partition_minimal_n); |