[Bug libstdc++/47437] [4.6 Regression] libstdc++ parallel mode: multiway_merge does not compile

2011-01-24 Thread singler at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47437

--- Comment #3 from singler at gcc dot gnu.org  
2011-01-24 16:44:36 UTC ---
Author: singler
Date: Mon Jan 24 16:44:30 2011
New Revision: 169166

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=169166
Log:
2011-01-24  Johannes Singler  

PR libstdc++/47437
* include/parallel/multiway_merge.h (_UnguardedIterator):
Remove useless "mutable" from reference declaration.

Modified:
trunk/libstdc++-v3/ChangeLog
trunk/libstdc++-v3/include/parallel/multiway_merge.h


[Bug libstdc++/47433] libstdc++ parallel mode calls std::swap explicitely

2011-01-24 Thread singler at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47433

--- Comment #12 from singler at gcc dot gnu.org  
2011-01-24 17:07:40 UTC ---
Author: singler
Date: Mon Jan 24 17:07:35 2011
New Revision: 169171

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=169171
Log:
2011-01-24  Johannes Singler  

PR libstdc++/47433
* include/parallel/losertree.h
(_LoserTree<>::__delete_min_insert):
Do not qualify swap with std:: for value type, 
but include a using directive instead.
(_LoserTreeUnguarded<>::__delete_min_insert): Likewise.
* include/parallel/balanced_quicksort.h (__qsb_divide):
Use std::iter_swap instead of std::swap.
(__qsb_local_sort_with_helping): Likewise.
* include/parallel/partition.h (__parallel_partition): 
Likewise. (__parallel_nth_element): Likewise.

Modified:
trunk/libstdc++-v3/ChangeLog
trunk/libstdc++-v3/include/parallel/balanced_quicksort.h
trunk/libstdc++-v3/include/parallel/losertree.h
trunk/libstdc++-v3/include/parallel/partition.h


[Bug libstdc++/47433] libstdc++ parallel mode calls std::swap explicitely

2011-02-11 Thread singler at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47433

--- Comment #14 from singler at gcc dot gnu.org  
2011-02-11 10:11:46 UTC ---
Author: singler
Date: Fri Feb 11 10:11:41 2011
New Revision: 170047

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=170047
Log:
2011-02-11  Johannes Singler  

PR libstdc++/47433
* include/parallel/losertree.h
(_LoserTreeUnguarded<>::__delete_min_insert):
Add missing "using std::swap;", as for other variants.

Modified:
trunk/libstdc++-v3/ChangeLog
trunk/libstdc++-v3/include/parallel/losertree.h


[Bug libstdc++/47433] libstdc++ parallel mode calls std::swap explicitely

2011-02-25 Thread singler at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47433

--- Comment #15 from singler at gcc dot gnu.org  
2011-02-25 14:04:48 UTC ---
Author: singler
Date: Fri Feb 25 14:04:40 2011
New Revision: 170494

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=170494
Log:
2011-02-25  Johannes Singler  

PR libstdc++/47433
* include/parallel/losertree.h
(_LoserTree<>::__delete_min_insert):
Do not qualify swap with std:: for value type,
but include a using directive instead.
(_LoserTreeUnguarded<>::__delete_min_insert): Likewise.
* include/parallel/balanced_quicksort.h (__qsb_divide):
Use std::iter_swap instead of std::swap.
(__qsb_local_sort_with_helping): Likewise.
* include/parallel/partition.h (__parallel_partition):
Likewise. (__parallel_nth_element): Likewise.

Modified:
branches/gcc-4_5-branch/libstdc++-v3/ChangeLog
branches/gcc-4_5-branch/libstdc++-v3/include/parallel/balanced_quicksort.h
branches/gcc-4_5-branch/libstdc++-v3/include/parallel/losertree.h
branches/gcc-4_5-branch/libstdc++-v3/include/parallel/partition.h


[Bug libstdc++/48559] parallel-mode vs C++0x

2011-04-12 Thread singler at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48559

sing...@gcc.gnu.org  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2011.04.12 19:02:06
 CC||singler at gcc dot gnu.org
 Ever Confirmed|0   |1

--- Comment #2 from singler at gcc dot gnu.org  
2011-04-12 19:02:06 UTC ---
We should try to tweak the algorithms to use just moves.  Since memory
bandwidth often limits parallel performance, it could even be particularly
efficient.

On the other hand, we sometimes need references to elements of the
random-access input sequence(s).  We could always use an iterator, but that
might be inefficient.  And we cannot take the lvalue reference or the address
of a dereferenced random access iterator, can we?  (Although this is
unfortunately done so far in multiseq_selection.h.)  Can we always take the
rvalue reference of a dereferenced random access iterator?

random_shuffle and partition will be the easiest cases, so we should start
there.


[Bug libstdc++/48750] for_each_template_random_access_ed has unbalanced new/delete[]

2011-04-27 Thread singler at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48750

sing...@gcc.gnu.org  changed:

   What|Removed |Added

 CC||singler at gcc dot gnu.org

--- Comment #16 from singler at gcc dot gnu.org  
2011-04-27 19:59:29 UTC ---
I have reviewed the patch, it looks mostly fine.  Thanks!
Only line 606 of losertree.h might not yet be fully consistent with line 597. 
I'm not sure all loser tree members are correctly constructed in the first
place.

We might have to add

for (unsigned int __i = 0; __i < _M_k; ++__i)
  {
::new(&(_M_losers[__i]._M_key)) _Tp(__sentinel);
_M_losers[__i]._M_source = -1;
  }

I will test that...

We have used these ::operator new/placement new construction to avoid calling
the default constructor, which might not be available for the ValueType. 
Interference with the actual parallelism should be minimal.