diff --git a/Spatial_sorting/doc/Spatial_sorting/CGAL/Hilbert_sort_2.h b/Spatial_sorting/doc/Spatial_sorting/CGAL/Hilbert_sort_2.h index 1dc58ed45b3..5f5b006e003 100644 --- a/Spatial_sorting/doc/Spatial_sorting/CGAL/Hilbert_sort_2.h +++ b/Spatial_sorting/doc/Spatial_sorting/CGAL/Hilbert_sort_2.h @@ -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 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. */ template< typename Traits, typename PolicyTag, typename ConcurrencyTag = Sequential_tag > diff --git a/Spatial_sorting/doc/Spatial_sorting/CGAL/Hilbert_sort_3.h b/Spatial_sorting/doc/Spatial_sorting/CGAL/Hilbert_sort_3.h index e08f0b4a39c..bb366239adc 100644 --- a/Spatial_sorting/doc/Spatial_sorting/CGAL/Hilbert_sort_3.h +++ b/Spatial_sorting/doc/Spatial_sorting/CGAL/Hilbert_sort_3.h @@ -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 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. */ template< typename Traits, typename PolicyTag, typename ConcurrencyTag = Sequential_tag > diff --git a/Spatial_sorting/doc/Spatial_sorting/CGAL/hilbert_sort.h b/Spatial_sorting/doc/Spatial_sorting/CGAL/hilbert_sort.h index 89b94118aea..a6d77e5cf80 100644 --- a/Spatial_sorting/doc/Spatial_sorting/CGAL/hilbert_sort.h +++ b/Spatial_sorting/doc/Spatial_sorting/CGAL/hilbert_sort.h @@ -8,8 +8,8 @@ along a Hilbert curve. It sorts the range `[begin, end)` in place. -\tparam ConcurrencyTag must be `Sequential_tag` or `Parallel_tag`. -With `Parallel_tag` and TBB enabled, the sorting will be +\tparam ConcurrencyTag must be `Sequential_tag`, `Parallel_tag`, or `Parallel_if_available_tag`. +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. \tparam RandomAccessIterator diff --git a/Spatial_sorting/doc/Spatial_sorting/CGAL/spatial_sort.h b/Spatial_sorting/doc/Spatial_sorting/CGAL/spatial_sort.h index 7d5d15b83c6..4beac521426 100644 --- a/Spatial_sorting/doc/Spatial_sorting/CGAL/spatial_sort.h +++ b/Spatial_sorting/doc/Spatial_sorting/CGAL/spatial_sort.h @@ -10,8 +10,8 @@ of being close in the order. It sorts the range `[begin, end)` in place. -\tparam ConcurrencyTag must be `Sequential_tag` or `Parallel_tag`. -With `Parallel_tag` and TBB enabled, the sorting will be +\tparam ConcurrencyTag must be `Sequential_tag`, `Parallel_tag`, or `Parallel_if_available_tag`. +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. \tparam RandomAccessIterator `std::iterator_traits::%value_type` must be convertible to diff --git a/Spatial_sorting/doc/Spatial_sorting/Spatial_sorting.txt b/Spatial_sorting/doc/Spatial_sorting/Spatial_sorting.txt index 3d4329c9f6d..ec6924332cb 100644 --- a/Spatial_sorting/doc/Spatial_sorting/Spatial_sorting.txt +++ b/Spatial_sorting/doc/Spatial_sorting/Spatial_sorting.txt @@ -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. 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} diff --git a/Spatial_sorting/examples/Spatial_sorting/parallel_spatial_sort_2.cpp b/Spatial_sorting/examples/Spatial_sorting/parallel_spatial_sort_2.cpp index eb9ffed6303..ee5d788c6ef 100644 --- a/Spatial_sorting/examples/Spatial_sorting/parallel_spatial_sort_2.cpp +++ b/Spatial_sorting/examples/Spatial_sorting/parallel_spatial_sort_2.cpp @@ -26,9 +26,9 @@ int main() // By default sequential CGAL::spatial_sort(points.begin(),points.end()); - // Add the template argument to switch on parallelism - // You will get a compile time warning in case TBB is not enabled - CGAL::spatial_sort(points.begin(),points.end()); + // Add the template argument to switch on parallelism if available + // You can also use Parallel_tag if you know that TBB is enabled + CGAL::spatial_sort(points.begin(),points.end()); return 0; }