This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[v3] Minor fixes to the include/parallel headers
- From: Paolo Carlini <pcarlini at suse dot de>
- To: Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Cc: libstdc++ <libstdc++ at gcc dot gnu dot org>
- Date: Tue, 15 Jan 2008 03:07:46 +0100
- Subject: [v3] Minor fixes to the include/parallel headers
Hi,
missing from the last patch. Committed to mainline.
Paolo.
///////////////
2008-01-14 Paolo Carlini <pcarlini@suse.de>
* include/parallel/list_partition.h: Formatting fixes, inline tweaks.
* include/parallel/numeric: Likewise.
* include/parallel/balanced_quicksort.h: Likewise.
* include/parallel/unique_copy.h: Likewise.
* include/parallel/algobase.h: Likewise.
* include/parallel/algo.h: Likewise.
Index: include/parallel/list_partition.h
===================================================================
--- include/parallel/list_partition.h (revision 131528)
+++ include/parallel/list_partition.h (working copy)
@@ -109,7 +109,7 @@
{
bool make_twice = false;
- // According to the oversampling factor, the resizing algorithm is chosen.
+ // The resizing algorithm is chosen according to the oversampling factor.
if (oversampling == 0)
{
make_twice = true;
Index: include/parallel/numeric
===================================================================
--- include/parallel/numeric (revision 131528)
+++ include/parallel/numeric (working copy)
@@ -78,7 +78,7 @@
template<typename InputIterator, typename T, typename BinaryOperation,
typename IteratorTag>
- T
+ inline T
accumulate_switch(InputIterator begin, InputIterator end, T init,
BinaryOperation binary_op, IteratorTag)
{ return accumulate(begin, end, init, binary_op,
@@ -345,10 +345,9 @@
OutputIterator result, BinaryOperation bin_op,
random_access_iterator_tag, random_access_iterator_tag)
{
- if (_GLIBCXX_PARALLEL_CONDITION(static_cast<__gnu_parallel::
- sequence_index_t>(end - begin)
- >= __gnu_parallel::Settings::
- partial_sum_minimal_n))
+ if (_GLIBCXX_PARALLEL_CONDITION(
+ static_cast<__gnu_parallel::sequence_index_t>(end - begin)
+ >= __gnu_parallel::Settings::partial_sum_minimal_n))
return __gnu_parallel::parallel_partial_sum(begin, end,
result, bin_op);
else
Index: include/parallel/balanced_quicksort.h
===================================================================
--- include/parallel/balanced_quicksort.h (revision 131528)
+++ include/parallel/balanced_quicksort.h (working copy)
@@ -307,10 +307,10 @@
// Very unequal split, one part smaller than one 128th
// elements not strictly larger than the pivot.
__gnu_parallel::unary_negate<__gnu_parallel::binder1st
- <Comparator, value_type, value_type, bool>, value_type>
- pred(__gnu_parallel::binder1st
- <Comparator, value_type, value_type, bool>(comp,
- *pivot_pos));
+ <Comparator, value_type, value_type, bool>, value_type>
+ pred(__gnu_parallel::binder1st
+ <Comparator, value_type, value_type, bool>(comp,
+ *pivot_pos));
// Find other end of pivot-equal range.
split_pos2 = __gnu_sequential::partition(split_pos1 + 1,
@@ -330,7 +330,8 @@
{
// Right side larger.
if ((split_pos2) != end)
- tl.leftover_parts.push_front(std::make_pair(split_pos2, end));
+ tl.leftover_parts.push_front(std::make_pair(split_pos2,
+ end));
//current.first = begin; //already set anyway
current.second = split_pos1;
Index: include/parallel/unique_copy.h
===================================================================
--- include/parallel/unique_copy.h (revision 131528)
+++ include/parallel/unique_copy.h (working copy)
@@ -187,7 +187,8 @@
parallel_unique_copy(InputIterator first, InputIterator last,
OutputIterator result)
{
- typedef typename std::iterator_traits<InputIterator>::value_type value_type;
+ typedef typename std::iterator_traits<InputIterator>::value_type
+ value_type;
return parallel_unique_copy(first, last, result,
std::equal_to<value_type>());
}
Index: include/parallel/algobase.h
===================================================================
--- include/parallel/algobase.h (revision 131528)
+++ include/parallel/algobase.h (working copy)
@@ -58,7 +58,7 @@
// Sequential fallback
template<typename InputIterator1, typename InputIterator2>
inline pair<InputIterator1, InputIterator2>
- mismatch(InputIterator1 begin1, InputIterator1 end1, InputIterator2 begin2,
+ mismatch(InputIterator1 begin1, InputIterator1 end1, InputIterator2 begin2,
__gnu_parallel::sequential_tag)
{ return _GLIBCXX_STD_P::mismatch(begin1, end1, begin2); }
@@ -66,7 +66,7 @@
template<typename InputIterator1, typename InputIterator2,
typename Predicate>
inline pair<InputIterator1, InputIterator2>
- mismatch(InputIterator1 begin1, InputIterator1 end1, InputIterator2 begin2,
+ mismatch(InputIterator1 begin1, InputIterator1 end1, InputIterator2 begin2,
Predicate pred, __gnu_parallel::sequential_tag)
{ return _GLIBCXX_STD_P::mismatch(begin1, end1, begin2, pred); }
@@ -83,7 +83,7 @@
template<typename RandomAccessIterator1, typename RandomAccessIterator2,
typename Predicate>
pair<RandomAccessIterator1, RandomAccessIterator2>
- mismatch_switch(RandomAccessIterator1 begin1, RandomAccessIterator1 end1,
+ mismatch_switch(RandomAccessIterator1 begin1, RandomAccessIterator1 end1,
RandomAccessIterator2 begin2, Predicate pred,
random_access_iterator_tag, random_access_iterator_tag)
{
Index: include/parallel/algo.h
===================================================================
--- include/parallel/algo.h (revision 131528)
+++ include/parallel/algo.h (working copy)
@@ -1585,7 +1585,7 @@
// Parallel algorithm for random access iterators.
template<typename RandomAccessIterator, typename Size, typename Generator>
- RandomAccessIterator
+ inline RandomAccessIterator
generate_n_switch(RandomAccessIterator begin, Size n, Generator gen,
random_access_iterator_tag,
__gnu_parallel::parallelism parallelism_tag
@@ -1940,10 +1940,10 @@
// Sequential fallback
template<typename RandomAccessIterator>
- void
- partial_sort(RandomAccessIterator begin, RandomAccessIterator middle,
- RandomAccessIterator end, __gnu_parallel::sequential_tag)
- { _GLIBCXX_STD_P::partial_sort(begin, middle, end); }
+ inline void
+ partial_sort(RandomAccessIterator begin, RandomAccessIterator middle,
+ RandomAccessIterator end, __gnu_parallel::sequential_tag)
+ { _GLIBCXX_STD_P::partial_sort(begin, middle, end); }
// Public interface, parallel algorithm for random access iterators
template<typename RandomAccessIterator, typename _Compare>
@@ -2155,4 +2155,3 @@
} // end namespace
#endif /* _GLIBCXX_ALGORITHM_H */
-