From: bkoz Date: Mon, 8 Oct 2007 15:58:06 +0000 (+0000) Subject: 2007-10-08 Benjamin Kosnik X-Git-Tag: upstream/4.9.2~45728 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7290a47ca9b91821d0fd943de462e96f1e42e3a5;p=platform%2Fupstream%2Flinaro-gcc.git 2007-10-08 Benjamin Kosnik 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 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 29ab689..32eeadf 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,11 @@ +2007-10-08 Benjamin Kosnik + + 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 * 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 5a1a43e..31ded50 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 790685b..70bff8e 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 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 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(2, Settings::partition_minimal_n);