mirror of https://github.com/CGAL/cgal
Use Parallel_if_available_tag
This commit is contained in:
parent
1287db1138
commit
902183b701
|
|
@ -13,7 +13,7 @@ or the middle depending on the `PolicyTag`.
|
||||||
|
|
||||||
\tparam PolicyTag must be `Hilbert_sort_median_policy` or `Hilbert_sort_middle_policy`.
|
\tparam PolicyTag must be `Hilbert_sort_median_policy` or `Hilbert_sort_middle_policy`.
|
||||||
|
|
||||||
\tparam ConcurrencyTag must be `Sequential_tag` or `Parallel_tag`. With `Parallel_tag`
|
\tparam ConcurrencyTag must be `Sequential_tag`, `Parallel_tag`, or `Parallel_if_available_tag. With parallelism
|
||||||
and TBB enabled, for the median policy up to four threads are used in parallel.
|
and TBB enabled, for the median policy up to four threads are used in parallel.
|
||||||
*/
|
*/
|
||||||
template< typename Traits, typename PolicyTag, typename ConcurrencyTag = Sequential_tag >
|
template< typename Traits, typename PolicyTag, typename ConcurrencyTag = Sequential_tag >
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ or the middle depending on the `PolicyTag`.
|
||||||
|
|
||||||
\tparam PolicyTag must be `Hilbert_sort_median_policy` or `Hilbert_sort_middle_policy`.
|
\tparam PolicyTag must be `Hilbert_sort_median_policy` or `Hilbert_sort_middle_policy`.
|
||||||
|
|
||||||
\tparam ConcurrencyTag must be `Sequential_tag` or `Parallel_tag`. With `Parallel_tag`
|
\tparam ConcurrencyTag must be `Sequential_tag`,`Parallel_tag`, or `Parallel_if_available_tag`. With parallelism
|
||||||
and TBB enabled, for the median policy up to eight threads are used in parallel.
|
and TBB enabled, for the median policy up to eight threads are used in parallel.
|
||||||
*/
|
*/
|
||||||
template< typename Traits, typename PolicyTag, typename ConcurrencyTag = Sequential_tag >
|
template< typename Traits, typename PolicyTag, typename ConcurrencyTag = Sequential_tag >
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,8 @@ along a Hilbert curve.
|
||||||
|
|
||||||
It sorts the range `[begin, end)` in place.
|
It sorts the range `[begin, end)` in place.
|
||||||
|
|
||||||
\tparam ConcurrencyTag must be `Sequential_tag` or `Parallel_tag`.
|
\tparam ConcurrencyTag must be `Sequential_tag`, `Parallel_tag`, or `Parallel_if_available_tag`.
|
||||||
With `Parallel_tag` and TBB enabled, the sorting will be
|
With parallelism and TBB enabled, the sorting will be
|
||||||
done using up to four threads in 2D, and up to eight threads in 3D with the median policy.
|
done using up to four threads in 2D, and up to eight threads in 3D with the median policy.
|
||||||
|
|
||||||
\tparam RandomAccessIterator
|
\tparam RandomAccessIterator
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,8 @@ of being close in the order.
|
||||||
|
|
||||||
It sorts the range `[begin, end)` in place.
|
It sorts the range `[begin, end)` in place.
|
||||||
|
|
||||||
\tparam ConcurrencyTag must be `Sequential_tag` or `Parallel_tag`.
|
\tparam ConcurrencyTag must be `Sequential_tag`, `Parallel_tag`, or `Parallel_if_available_tag`.
|
||||||
With `Parallel_tag` and TBB enabled, the sorting will be
|
With parallelism and TBB enabled, the sorting will be
|
||||||
done using up to four threads in 2D, and up to eight threads in 3D with the median policy.
|
done using up to four threads in 2D, and up to eight threads in 3D with the median policy.
|
||||||
|
|
||||||
\tparam RandomAccessIterator `std::iterator_traits<RandomAccessIterator>::%value_type` must be convertible to
|
\tparam RandomAccessIterator `std::iterator_traits<RandomAccessIterator>::%value_type` must be convertible to
|
||||||
|
|
|
||||||
|
|
@ -214,7 +214,8 @@ The Hilbert sort and spatial sort functions when using the median policy and wit
|
||||||
enabled, are parallized and use up to four/eight threads for 2D/3D.
|
enabled, are parallized and use up to four/eight threads for 2D/3D.
|
||||||
|
|
||||||
By default the sequential version is used. The parallel version is used
|
By default the sequential version is used. The parallel version is used
|
||||||
by adding the template parameter `CGAL::Parallel_tag`.
|
by adding the template parameter `CGAL::Parallel_tag`. In case it is not sure
|
||||||
|
whether TBB is enabled use `CGAL::Parallel_if_available_tag`.
|
||||||
|
|
||||||
\cgalExample{Spatial_sorting/parallel_spatial_sort_2.cpp}
|
\cgalExample{Spatial_sorting/parallel_spatial_sort_2.cpp}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,9 +26,9 @@ int main()
|
||||||
// By default sequential
|
// By default sequential
|
||||||
CGAL::spatial_sort(points.begin(),points.end());
|
CGAL::spatial_sort(points.begin(),points.end());
|
||||||
|
|
||||||
// Add the template argument to switch on parallelism
|
// Add the template argument to switch on parallelism if available
|
||||||
// You will get a compile time warning in case TBB is not enabled
|
// You can also use Parallel_tag if you know that TBB is enabled
|
||||||
CGAL::spatial_sort<CGAL::Parallel_tag>(points.begin(),points.end());
|
CGAL::spatial_sort<CGAL::Parallel_if_available_tag>(points.begin(),points.end());
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue