diff options
author | Benjamin Kosnik <bkoz@gcc.gnu.org> | 2007-10-08 15:58:06 +0000 |
---|---|---|
committer | Benjamin Kosnik <bkoz@gcc.gnu.org> | 2007-10-08 15:58:06 +0000 |
commit | a222efd88a856f71d4e7dcb14d97d5f5a3aadce3 (patch) | |
tree | 3599b4fee15fd508751cd48092272e0556525d2a | |
parent | b4d4a7d4b09fe843af40348786bdaae7dac4281e (diff) | |
download | gcc-a222efd88a856f71d4e7dcb14d97d5f5a3aadce3.zip gcc-a222efd88a856f71d4e7dcb14d97d5f5a3aadce3.tar.gz gcc-a222efd88a856f71d4e7dcb14d97d5f5a3aadce3.tar.bz2 |
re PR libstdc++/33489 (parallel v3: not default constructible issues)
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.
From-SVN: r129132
-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 29ab689..32eeadf1 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 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<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); |