Commit 736cc331 by Johannes Singler Committed by Johannes Singler

2010-06-08 Johannes Singler <singler@kit.edu>

        * include/parallel/partial_sum.h
        (__parallel_partial_sum_linear):
        Correctly calculate part lengths for partial_sum_dilation!=1.0f.

From-SVN: r160428
parent a9429e29
2010-06-08 Johannes Singler <singler@kit.edu>
* include/parallel/partial_sum.h
(__parallel_partial_sum_linear):
Correctly calculate part lengths for partial_sum_dilation!=1.
2010-06-07 Paolo Carlini <paolo.carlini@oracle.com> 2010-06-07 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/44417 PR libstdc++/44417
......
...@@ -127,10 +127,13 @@ namespace __gnu_parallel ...@@ -127,10 +127,13 @@ namespace __gnu_parallel
equally_split(__n, __num_threads + 1, __borders); equally_split(__n, __num_threads + 1, __borders);
else else
{ {
_DifferenceType __first_part_length =
std::max<_DifferenceType>(1,
__n / (1.0f + __s.partial_sum_dilation * __num_threads));
_DifferenceType __chunk_length = _DifferenceType __chunk_length =
((double)__n (__n - __first_part_length) / __num_threads;
/ ((double)__num_threads + __s.partial_sum_dilation)), _DifferenceType __borderstart =
__borderstart = __n - __num_threads * __chunk_length; __n - __num_threads * __chunk_length;
__borders[0] = 0; __borders[0] = 0;
for (_ThreadIndex __i = 1; __i < (__num_threads + 1); ++__i) for (_ThreadIndex __i = 1; __i < (__num_threads + 1); ++__i)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment