* include/parallel/random_shuffle.h
(__parallel_random_shuffle_drs) : Take as many threads as
possible, i. e. favor parallelism over cache efficiency.
Use own PRNG also for the 1 thread case.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@157826
138bc75d-0d04-0410-961f-
82ee72b054a4
+2010-03-30 Johannes Singler <singler@kit.edu>
+
+ * include/parallel/random_shuffle.h
+ (__parallel_random_shuffle_drs) : Take as many threads as
+ possible, i. e. favor parallelism over cache efficiency.
+ Use own PRNG also for the 1 thread case.
+
2010-03-30 Paolo Carlini <paolo.carlini@oracle.com>
* include/debug/unordered_map: Clean-up includes and guards.
}
#endif
- __num_threads = std::min<_BinIndex>(__num_threads, __num_bins);
+ __num_bins = __round_up_to_pow2(
+ std::max<_BinIndex>(__num_threads, __num_bins));
if (__num_threads <= 1)
- return __sequential_random_shuffle(__begin, __end, __rng);
+ {
+ _RandomNumber __derived_rng(
+ __rng(std::numeric_limits<uint32_t>::max()));
+ __sequential_random_shuffle(__begin, __end, __derived_rng);
+ return;
+ }
_DRandomShufflingGlobalData<_RAIter> __sd(__begin);
_DRSSorterPU<_RAIter, _RandomNumber >* __pus;