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
This commit is contained in:
Benjamin Kosnik 2007-10-08 15:58:06 +00:00
parent b4d4a7d4b0
commit a222efd88a
3 changed files with 28 additions and 9 deletions

View File

@ -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.

View File

@ -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;
}

View File

@ -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);