From: singler Date: Thu, 5 Jun 2008 15:47:17 +0000 (+0000) Subject: 2008-06-05 Johannes Singler X-Git-Tag: upstream/4.9.2~41668 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=707843a2bae5fbb253ea60bea451866bcc8d9b23;p=platform%2Fupstream%2Flinaro-gcc.git 2008-06-05 Johannes Singler * include/parallel/random_shuffle.h: (parallel_random_shuffle_drs) Get the actual number of threads after entering the parallel region. Indentation. * include/parallel/algo.h: (random_shuffle(begin, end)) Add namespace qualification to avoid ambiguity. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@136406 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index d06e303..0f2e56c 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,11 @@ +2008-06-05 Johannes Singler + + * include/parallel/random_shuffle.h: + (parallel_random_shuffle_drs) Get the actual number of + threads after entering the parallel region. Indentation. + * include/parallel/algo.h: (random_shuffle(begin, end)) + Add namespace qualification to avoid ambiguity. + 2008-06-04 Benjamin Kosnik * include/ext/pb_ds/assoc_container.hpp: Change allocator typedef diff --git a/libstdc++-v3/include/parallel/algo.h b/libstdc++-v3/include/parallel/algo.h index 397d7cb..4aa4d8a 100644 --- a/libstdc++-v3/include/parallel/algo.h +++ b/libstdc++-v3/include/parallel/algo.h @@ -1649,7 +1649,7 @@ namespace __parallel { c_rand_number<> r; // Parallelization still possible. - random_shuffle(begin, end, r); + __gnu_parallel::random_shuffle(begin, end, r); } // Parallel algorithm for random access iterators. diff --git a/libstdc++-v3/include/parallel/random_shuffle.h b/libstdc++-v3/include/parallel/random_shuffle.h index 75d9e18..1f7cc10 100644 --- a/libstdc++-v3/include/parallel/random_shuffle.h +++ b/libstdc++-v3/include/parallel/random_shuffle.h @@ -333,6 +333,7 @@ template # pragma omp parallel num_threads(num_threads) { + thread_index_t num_threads = omp_get_num_threads(); # pragma omp single { pus = new DRSSorterPU @@ -375,9 +376,9 @@ template } starts[num_threads] = start; } //single - // Now shuffle in parallel. - parallel_random_shuffle_drs_pu(pus); - } + // Now shuffle in parallel. + parallel_random_shuffle_drs_pu(pus); + } // parallel delete[] starts; delete[] sd.bin_proc;