From cbe11f6e5bb46ca0e8fb8330c8a7da6131bd828c Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 15 Nov 2019 12:48:16 +0100 Subject: [PATCH 1/6] CGAL:: Add Parallel_if_available_tag --- STL_Extension/include/CGAL/tags.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/STL_Extension/include/CGAL/tags.h b/STL_Extension/include/CGAL/tags.h index 4b033abaf32..2b88992794b 100644 --- a/STL_Extension/include/CGAL/tags.h +++ b/STL_Extension/include/CGAL/tags.h @@ -26,7 +26,7 @@ namespace CGAL { struct Void {}; // Boolean_tag is a model of the Boost Integral Constant concept. -// https://www.boost.org/libs/mpl/doc/refmanual/integral-constant.html +// https://www.boost.org/libs/mpl/doc/refmanual/integral-constant.html template struct Boolean_tag { typedef boost::mpl::integral_c_tag tag; @@ -58,6 +58,13 @@ struct Null_functor { struct Sequential_tag {}; struct Parallel_tag : public Sequential_tag {}; +#ifdef CGAL_LINKED_WITH_TBB +typedef CGAL::Parallel_tag Parallel_if_available_tag; +#else +typedef CGAL::Sequential_tag Parallel_if_available_tag; +#endif + + // A function that asserts a specific compile time tag // forcing its two arguments to have equal type. template From cb74e536f1e7c190e84de117280dc42290f2f7cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Wed, 20 Nov 2019 11:42:47 +0100 Subject: [PATCH 2/6] Document the new type --- STL_Extension/doc/STL_Extension/CGAL/tags.h | 11 +++++++++-- .../doc/STL_Extension/PackageDescription.txt | 3 +++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/STL_Extension/doc/STL_Extension/CGAL/tags.h b/STL_Extension/doc/STL_Extension/CGAL/tags.h index 5e102c1d8ca..9a54c36a4fe 100644 --- a/STL_Extension/doc/STL_Extension/CGAL/tags.h +++ b/STL_Extension/doc/STL_Extension/CGAL/tags.h @@ -69,18 +69,25 @@ struct Null_functor { /*! \ingroup PkgSTLExtensionUtilities -Tag used to enable/disable concurrency. +Tag used to disable concurrency. For example, it may be used by a user to request the sequential version of an algorithm. */ struct Sequential_tag {}; /*! \ingroup PkgSTLExtensionUtilities -Tag used to enable/disable concurrency. +Tag used to enable concurrency. For example, it may be used by a user to request the parallel version of an algorithm. */ struct Parallel_tag {}; +/*! +\ingroup PkgSTLExtensionUtilities +This tag is a convenience typedef to `Parallel_tag` if the third party library \ref thirdpartyTBB +has been found and linked, and to `Sequential_tag` otherwise. +*/ +struct Parallel_if_available_tag {}; + /*! \ingroup PkgSTLExtensionUtilities diff --git a/STL_Extension/doc/STL_Extension/PackageDescription.txt b/STL_Extension/doc/STL_Extension/PackageDescription.txt index df921c5c6e0..4372a8f37d3 100644 --- a/STL_Extension/doc/STL_Extension/PackageDescription.txt +++ b/STL_Extension/doc/STL_Extension/PackageDescription.txt @@ -109,6 +109,9 @@ - `CGAL::Tag_false` - `CGAL::Null_tag` - `CGAL::Null_functor` +- `CGAL::Sequential_tag` +- `CGAL::Parallel_tag` +- `CGAL::Parallel_if_available_tag` - `CGAL::Uncertain` - `CGAL::Default` - `CGAL::Fast` From e73b973b62d52a34a20428d6db1420d45cdbb22c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Wed, 20 Nov 2019 12:24:54 +0100 Subject: [PATCH 3/6] Use Parallel_if_available_tag to simplify code that used CGAL_LINKED_WITH_TBB --- .../Classification/example_classification.cpp | 8 ++----- .../example_cluster_classification.cpp | 6 +---- .../ETHZ/Random_forest_classifier.h | 8 ++----- .../Classification/Local_eigen_analysis.h | 18 +++++---------- .../Classification/Mesh_feature_generator.h | 6 ++--- .../Point_set_feature_generator.h | 4 +--- .../include/CGAL/Classification/classify.h | 6 ++--- Hash_map/test/Hash_map/Hash.cpp | 3 ++- Mesh_3/doc/Mesh_3/CGAL/Mesh_triangulation_3.h | 4 ++-- .../average_spacing_example.cpp | 7 +----- .../bilateral_smooth_point_set_example.cpp | 7 +----- .../callback_example.cpp | 7 +----- .../edge_aware_upsample_point_set_example.cpp | 7 +----- .../jet_smoothing_example.cpp | 7 +----- .../normal_estimation.cpp | 7 +----- .../normals_example.cpp | 6 +---- .../scale_estimation_example.cpp | 6 +---- ...plify_and_regularize_point_set_example.cpp | 6 +---- .../include/CGAL/bilateral_smooth_point_set.h | 5 ++--- .../include/CGAL/compute_average_spacing.h | 5 ++--- .../CGAL/edge_aware_upsample_point_set.h | 4 ++-- .../include/CGAL/jet_estimate_normals.h | 5 ++--- .../include/CGAL/jet_smooth_point_set.h | 5 ++--- .../include/CGAL/pca_estimate_normals.h | 5 ++--- .../wlop_simplify_and_regularize_point_set.h | 5 ++--- .../Point_set_processing_3/analysis_test.cpp | 7 +----- .../edge_aware_upsample_test.cpp | 7 +----- .../normal_estimation_test.cpp | 7 +----- .../Point_set_processing_3/smoothing_test.cpp | 6 +---- .../hausdorff_distance_remeshing_example.cpp | 6 +---- .../CGAL/Polygon_mesh_processing/distance.h | 3 +-- .../CGAL/internal/compute_confidences.h | 11 ++-------- .../Classification/Cluster_classification.h | 7 +----- .../Point_set_item_classification.h | 8 +------ .../Surface_mesh_item_classification.h | 6 +---- .../Point_set_average_spacing_plugin.cpp | 6 +---- .../Point_set_bilateral_smoothing_plugin.cpp | 6 +---- .../Point_set_interference_plugin.cpp | 7 ++---- .../Point_set_normal_estimation_plugin.cpp | 6 +---- .../Point_set_simplification_plugin.cpp | 6 +---- .../Point_set/Point_set_smoothing_plugin.cpp | 6 +---- .../Point_set/Point_set_upsampling_plugin.cpp | 8 ++----- .../Point_set/Point_set_wlop_plugin.cpp | 6 +---- .../Surface_reconstruction_poisson_impl.cpp | 8 +------ ...urface_reconstruction_scale_space_impl.cpp | 6 +---- .../Plugins/Surface_mesh/VSA_wrapper.h | 22 +++---------------- .../include/run_with_qprogressdialog.h | 7 +----- STL_Extension/include/CGAL/tags.h | 1 - .../Jet_smoother.h | 6 ++--- .../Weighted_PCA_smoother.h | 14 +++++------- .../CGAL/Triangulation_data_structure_3.h | 2 +- .../Concepts/TriangulationDataStructure_3.h | 2 +- 52 files changed, 80 insertions(+), 264 deletions(-) diff --git a/Classification/examples/Classification/example_classification.cpp b/Classification/examples/Classification/example_classification.cpp index 665fb17f064..0475fdfcfb3 100644 --- a/Classification/examples/Classification/example_classification.cpp +++ b/Classification/examples/Classification/example_classification.cpp @@ -11,16 +11,12 @@ #include #include #include - +#include #include #include -#ifdef CGAL_LINKED_WITH_TBB -typedef CGAL::Parallel_tag Concurrency_tag; -#else -typedef CGAL::Sequential_tag Concurrency_tag; -#endif +typedef CGAL::Parallel_if_available_tag Concurrency_tag; typedef CGAL::Simple_cartesian Kernel; typedef Kernel::Point_3 Point; diff --git a/Classification/examples/Classification/example_cluster_classification.cpp b/Classification/examples/Classification/example_cluster_classification.cpp index e4ff944803a..78f48b8ddde 100644 --- a/Classification/examples/Classification/example_cluster_classification.cpp +++ b/Classification/examples/Classification/example_cluster_classification.cpp @@ -18,11 +18,7 @@ #include #include -#ifdef CGAL_LINKED_WITH_TBB -typedef CGAL::Parallel_tag Concurrency_tag; -#else -typedef CGAL::Sequential_tag Concurrency_tag; -#endif +typedef CGAL::Parallel_if_available_tag Concurrency_tag; typedef CGAL::Simple_cartesian Kernel; typedef Kernel::Point_3 Point; diff --git a/Classification/include/CGAL/Classification/ETHZ/Random_forest_classifier.h b/Classification/include/CGAL/Classification/ETHZ/Random_forest_classifier.h index 513c939bb8e..62b6dc57d26 100644 --- a/Classification/include/CGAL/Classification/ETHZ/Random_forest_classifier.h +++ b/Classification/include/CGAL/Classification/ETHZ/Random_forest_classifier.h @@ -127,11 +127,7 @@ public: std::size_t num_trees = 25, std::size_t max_depth = 20) { -#ifdef CGAL_LINKED_WITH_TBB - train(ground_truth, reset_trees, num_trees, max_depth); -#else - train(ground_truth, reset_trees, num_trees, max_depth); -#endif + train(ground_truth, reset_trees, num_trees, max_depth); } /// \endcond @@ -146,7 +142,7 @@ public: label. \tparam ConcurrencyTag enables sequential versus parallel - algorithm. Possible values are `Parallel_tag` (default value is + algorithm. Possible values are `Parallel_tag` (default value if %CGAL is linked with TBB) or `Sequential_tag` (default value otherwise). diff --git a/Classification/include/CGAL/Classification/Local_eigen_analysis.h b/Classification/include/CGAL/Classification/Local_eigen_analysis.h index b3849220d54..4ba3ca0661b 100644 --- a/Classification/include/CGAL/Classification/Local_eigen_analysis.h +++ b/Classification/include/CGAL/Classification/Local_eigen_analysis.h @@ -225,7 +225,7 @@ public: is `CGAL::Point_3`. \tparam NeighborQuery model of `NeighborQuery` \tparam ConcurrencyTag enables sequential versus parallel - algorithm. Possible values are `Parallel_tag` (default value is %CGAL + algorithm. Possible values are `Parallel_tag` (default value if %CGAL is linked with TBB) or `Sequential_tag` (default value otherwise). \tparam DiagonalizeTraits model of `DiagonalizeTraits` used for matrix diagonalization. It can be omitted if Eigen 3 (or greater) @@ -241,10 +241,8 @@ public: typename NeighborQuery, #if defined(DOXYGEN_RUNNING) typename ConcurrencyTag, -#elif defined(CGAL_LINKED_WITH_TBB) - typename ConcurrencyTag = CGAL::Parallel_tag, #else - typename ConcurrencyTag = CGAL::Sequential_tag, + typename ConcurrencyTag = CGAL::Parallel_if_available_tag, #endif #if defined(DOXYGEN_RUNNING) typename DiagonalizeTraits> @@ -309,7 +307,7 @@ public: \tparam FaceListGraph model of `FaceListGraph`. \tparam NeighborQuery model of `NeighborQuery` \tparam ConcurrencyTag enables sequential versus parallel - algorithm. Possible values are `Parallel_tag` (default value is %CGAL + algorithm. Possible values are `Parallel_tag` (default value if %CGAL is linked with TBB) or `Sequential_tag` (default value otherwise). \tparam DiagonalizeTraits model of `DiagonalizeTraits` used for matrix diagonalization. It can be omitted: if Eigen 3 (or greater) @@ -324,10 +322,8 @@ public: typename NeighborQuery, #if defined(DOXYGEN_RUNNING) typename ConcurrencyTag, -#elif defined(CGAL_LINKED_WITH_TBB) - typename ConcurrencyTag = CGAL::Parallel_tag, #else - typename ConcurrencyTag = CGAL::Sequential_tag, + typename ConcurrencyTag = CGAL::Parallel_if_available_tag, #endif #if defined(DOXYGEN_RUNNING) typename DiagonalizeTraits> @@ -395,7 +391,7 @@ public: `RandomAccessIterator` and its value type is the key type of `PointMap`. \tparam ConcurrencyTag enables sequential versus parallel - algorithm. Possible values are `Parallel_tag` (default value is %CGAL + algorithm. Possible values are `Parallel_tag` (default value if %CGAL is linked with TBB) or `Sequential_tag` (default value otherwise). \tparam DiagonalizeTraits model of `DiagonalizeTraits` used for matrix diagonalization. It can be omitted: if Eigen 3 (or greater) @@ -408,10 +404,8 @@ public: template diff --git a/Classification/include/CGAL/Classification/Mesh_feature_generator.h b/Classification/include/CGAL/Classification/Mesh_feature_generator.h index 5b90b74b379..ba7832587bd 100644 --- a/Classification/include/CGAL/Classification/Mesh_feature_generator.h +++ b/Classification/include/CGAL/Classification/Mesh_feature_generator.h @@ -79,7 +79,7 @@ namespace Classification { is `GeomTraits::Point_3`. \tparam ConcurrencyTag enables sequential versus parallel computation of `CGAL::Classification::Local_eigen_analysis` - objects. Possible values are `Parallel_tag` (default value is %CGAL + objects. Possible values are `Parallel_tag` (default value if %CGAL is linked with TBB) or `Sequential_tag` (default value otherwise). \tparam DiagonalizeTraits model of `DiagonalizeTraits` used for matrix diagonalization. It can be omitted: if Eigen 3 (or greater) @@ -93,10 +93,8 @@ template > class Mesh_feature_generator diff --git a/Classification/include/CGAL/Classification/Point_set_feature_generator.h b/Classification/include/CGAL/Classification/Point_set_feature_generator.h index 8169e4acec4..58e58bb54dc 100644 --- a/Classification/include/CGAL/Classification/Point_set_feature_generator.h +++ b/Classification/include/CGAL/Classification/Point_set_feature_generator.h @@ -90,10 +90,8 @@ template diff --git a/Classification/include/CGAL/Classification/classify.h b/Classification/include/CGAL/Classification/classify.h index 6fb787a43df..ccd4f585e1a 100644 --- a/Classification/include/CGAL/Classification/classify.h +++ b/Classification/include/CGAL/Classification/classify.h @@ -334,7 +334,7 @@ namespace internal { suboptimal results. \tparam ConcurrencyTag enables sequential versus parallel - algorithm. Possible values are `Parallel_tag` or `Sequential_tag`. + algorithm. Possible values are `Parallel_if_available_tag`, `Parallel_tag` or `Sequential_tag`. \tparam ItemRange model of `ConstRange`. Its iterator type is `RandomAccessIterator`. Its value type depends on the data that is @@ -424,7 +424,7 @@ namespace internal { efficiency and better quality results. \tparam ConcurrencyTag enables sequential versus parallel - algorithm. Possible values are `Parallel_tag` or `Sequential_tag`. + algorithm. Possible values are `Parallel_if_available_tag`, `Parallel_tag` or `Sequential_tag`. \tparam ItemRange model of `ConstRange`. Its iterator type is `RandomAccessIterator`. \tparam ItemMap model of `ReadablePropertyMap` whose key @@ -502,7 +502,7 @@ namespace internal { results. \tparam ConcurrencyTag enables sequential versus parallel - algorithm. Possible values are `Parallel_tag` or `Sequential_tag`. + algorithm. Possible values are `Parallel_if_available_tag`, `Parallel_tag` or `Sequential_tag`. \tparam ItemRange model of `ConstRange`. Its iterator type is `RandomAccessIterator`. \tparam ItemMap model of `ReadablePropertyMap` whose key diff --git a/Hash_map/test/Hash_map/Hash.cpp b/Hash_map/test/Hash_map/Hash.cpp index fc46d118a25..beb15ce87f0 100644 --- a/Hash_map/test/Hash_map/Hash.cpp +++ b/Hash_map/test/Hash_map/Hash.cpp @@ -145,8 +145,9 @@ int main() #ifdef CGAL_LINKED_WITH_TBB Triangulation_3 T3; -fct3(T3); + fct3(T3); #endif + return 0; } diff --git a/Mesh_3/doc/Mesh_3/CGAL/Mesh_triangulation_3.h b/Mesh_3/doc/Mesh_3/CGAL/Mesh_triangulation_3.h index 768c00b1acd..cb8834e9040 100644 --- a/Mesh_3/doc/Mesh_3/CGAL/Mesh_triangulation_3.h +++ b/Mesh_3/doc/Mesh_3/CGAL/Mesh_triangulation_3.h @@ -12,8 +12,8 @@ type to be used for the 3D triangulation embedding the mesh. and defaults to `Kernel_traits::%Kernel`. \tparam Concurrency_tag enables sequential versus parallel meshing and optimization algorithms. - Possible values are `Sequential_tag` (the default) and - `Parallel_tag`. + Possible values are `Sequential_tag` (the default), `Parallel_tag`, + and `Parallel_if_available_tag`. \tparam Vertex_base must be a model of `MeshVertexBase_3` or `Default` and defaults to `Mesh_vertex_base_3`. diff --git a/Point_set_processing_3/examples/Point_set_processing_3/average_spacing_example.cpp b/Point_set_processing_3/examples/Point_set_processing_3/average_spacing_example.cpp index e97432aa79b..776f640c83c 100644 --- a/Point_set_processing_3/examples/Point_set_processing_3/average_spacing_example.cpp +++ b/Point_set_processing_3/examples/Point_set_processing_3/average_spacing_example.cpp @@ -16,12 +16,7 @@ typedef Kernel::Point_3 Point; typedef boost::tuple IndexedPointWithColorTuple; // Concurrency -#ifdef CGAL_LINKED_WITH_TBB -typedef CGAL::Parallel_tag Concurrency_tag; -#else -typedef CGAL::Sequential_tag Concurrency_tag; -#endif - +typedef CGAL::Parallel_if_available_tag Concurrency_tag; int main(int argc, char*argv[]) { diff --git a/Point_set_processing_3/examples/Point_set_processing_3/bilateral_smooth_point_set_example.cpp b/Point_set_processing_3/examples/Point_set_processing_3/bilateral_smooth_point_set_example.cpp index 956f89cfe80..0f87a437e4a 100644 --- a/Point_set_processing_3/examples/Point_set_processing_3/bilateral_smooth_point_set_example.cpp +++ b/Point_set_processing_3/examples/Point_set_processing_3/bilateral_smooth_point_set_example.cpp @@ -17,12 +17,7 @@ typedef Kernel::Vector_3 Vector; typedef std::pair PointVectorPair; // Concurrency -#ifdef CGAL_LINKED_WITH_TBB -typedef CGAL::Parallel_tag Concurrency_tag; -#else -typedef CGAL::Sequential_tag Concurrency_tag; -#endif - +typedef CGAL::Parallel_if_available_tag Concurrency_tag; int main(int argc, char*argv[]) { diff --git a/Point_set_processing_3/examples/Point_set_processing_3/callback_example.cpp b/Point_set_processing_3/examples/Point_set_processing_3/callback_example.cpp index 4004c7e832c..addaaeefaa3 100644 --- a/Point_set_processing_3/examples/Point_set_processing_3/callback_example.cpp +++ b/Point_set_processing_3/examples/Point_set_processing_3/callback_example.cpp @@ -18,12 +18,7 @@ typedef Kernel::Point_3 Point; typedef CGAL::Random_points_on_sphere_3 Generator; // Concurrency -#ifdef CGAL_LINKED_WITH_TBB -typedef CGAL::Parallel_tag Concurrency_tag; -#else -typedef CGAL::Sequential_tag Concurrency_tag; -#endif - +typedef CGAL::Parallel_if_available_tag Concurrency_tag; // instance of std::function struct Progress_to_std_cerr_callback diff --git a/Point_set_processing_3/examples/Point_set_processing_3/edge_aware_upsample_point_set_example.cpp b/Point_set_processing_3/examples/Point_set_processing_3/edge_aware_upsample_point_set_example.cpp index 7ca76b9a055..173c07e9f1c 100644 --- a/Point_set_processing_3/examples/Point_set_processing_3/edge_aware_upsample_point_set_example.cpp +++ b/Point_set_processing_3/examples/Point_set_processing_3/edge_aware_upsample_point_set_example.cpp @@ -16,12 +16,7 @@ typedef Kernel::Vector_3 Vector; typedef std::pair PointVectorPair; // Concurrency -#ifdef CGAL_LINKED_WITH_TBB -typedef CGAL::Parallel_tag Concurrency_tag; -#else -typedef CGAL::Sequential_tag Concurrency_tag; -#endif - +typedef CGAL::Parallel_if_available_tag Concurrency_tag; int main(int argc, char* argv[]) { diff --git a/Point_set_processing_3/examples/Point_set_processing_3/jet_smoothing_example.cpp b/Point_set_processing_3/examples/Point_set_processing_3/jet_smoothing_example.cpp index f228c8d69f6..85be76af70d 100644 --- a/Point_set_processing_3/examples/Point_set_processing_3/jet_smoothing_example.cpp +++ b/Point_set_processing_3/examples/Point_set_processing_3/jet_smoothing_example.cpp @@ -8,12 +8,7 @@ typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; typedef Kernel::Point_3 Point; // Concurrency -#ifdef CGAL_LINKED_WITH_TBB -typedef CGAL::Parallel_tag Concurrency_tag; -#else -typedef CGAL::Sequential_tag Concurrency_tag; -#endif - +typedef CGAL::Parallel_if_available_tag Concurrency_tag; int main(void) { diff --git a/Point_set_processing_3/examples/Point_set_processing_3/normal_estimation.cpp b/Point_set_processing_3/examples/Point_set_processing_3/normal_estimation.cpp index befba2133f5..5f881c12647 100644 --- a/Point_set_processing_3/examples/Point_set_processing_3/normal_estimation.cpp +++ b/Point_set_processing_3/examples/Point_set_processing_3/normal_estimation.cpp @@ -48,12 +48,7 @@ typedef std::pair PointVectorPair; typedef std::vector PointList; // Concurrency -#ifdef CGAL_LINKED_WITH_TBB -typedef CGAL::Parallel_tag Concurrency_tag; -#else -typedef CGAL::Sequential_tag Concurrency_tag; -#endif - +typedef CGAL::Parallel_if_available_tag Concurrency_tag; // ---------------------------------------------------------------------------- // Private functions diff --git a/Point_set_processing_3/examples/Point_set_processing_3/normals_example.cpp b/Point_set_processing_3/examples/Point_set_processing_3/normals_example.cpp index 25a28429661..629b836555d 100644 --- a/Point_set_processing_3/examples/Point_set_processing_3/normals_example.cpp +++ b/Point_set_processing_3/examples/Point_set_processing_3/normals_example.cpp @@ -18,11 +18,7 @@ typedef Kernel::Vector_3 Vector; typedef std::pair PointVectorPair; // Concurrency -#ifdef CGAL_LINKED_WITH_TBB -typedef CGAL::Parallel_tag Concurrency_tag; -#else -typedef CGAL::Sequential_tag Concurrency_tag; -#endif +typedef CGAL::Parallel_if_available_tag Concurrency_tag; int main(int argc, char*argv[]) { diff --git a/Point_set_processing_3/examples/Point_set_processing_3/scale_estimation_example.cpp b/Point_set_processing_3/examples/Point_set_processing_3/scale_estimation_example.cpp index bdd2ebb5730..a85f56bea45 100644 --- a/Point_set_processing_3/examples/Point_set_processing_3/scale_estimation_example.cpp +++ b/Point_set_processing_3/examples/Point_set_processing_3/scale_estimation_example.cpp @@ -12,11 +12,7 @@ #include // Concurrency -#ifdef CGAL_LINKED_WITH_TBB -typedef CGAL::Parallel_tag Concurrency_tag; -#else -typedef CGAL::Sequential_tag Concurrency_tag; -#endif +typedef CGAL::Parallel_if_available_tag Concurrency_tag; // Types typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; diff --git a/Point_set_processing_3/examples/Point_set_processing_3/wlop_simplify_and_regularize_point_set_example.cpp b/Point_set_processing_3/examples/Point_set_processing_3/wlop_simplify_and_regularize_point_set_example.cpp index e8485c3e5f8..d6ef47246fe 100644 --- a/Point_set_processing_3/examples/Point_set_processing_3/wlop_simplify_and_regularize_point_set_example.cpp +++ b/Point_set_processing_3/examples/Point_set_processing_3/wlop_simplify_and_regularize_point_set_example.cpp @@ -12,11 +12,7 @@ typedef CGAL::Simple_cartesian Kernel; typedef Kernel::Point_3 Point; // Concurrency -#ifdef CGAL_LINKED_WITH_TBB -typedef CGAL::Parallel_tag Concurrency_tag; -#else -typedef CGAL::Sequential_tag Concurrency_tag; -#endif +typedef CGAL::Parallel_if_available_tag Concurrency_tag; int main(int argc, char** argv) { diff --git a/Point_set_processing_3/include/CGAL/bilateral_smooth_point_set.h b/Point_set_processing_3/include/CGAL/bilateral_smooth_point_set.h index e80d6a9be52..2e287518fb2 100644 --- a/Point_set_processing_3/include/CGAL/bilateral_smooth_point_set.h +++ b/Point_set_processing_3/include/CGAL/bilateral_smooth_point_set.h @@ -349,9 +349,8 @@ public: \pre Normals must be unit vectors \pre k >= 2 - \tparam ConcurrencyTag enables sequential versus parallel algorithm. - Possible values are `Sequential_tag` - And `Parallel_tag`. + \tparam ConcurrencyTag enables sequential versus parallel algorithm. Possible values are `Sequential_tag`, + `Parallel_tag`, and `Parallel_if_available_tag`. \tparam PointRange is a model of `Range`. The value type of its iterator is the key type of the named parameter `point_map`. diff --git a/Point_set_processing_3/include/CGAL/compute_average_spacing.h b/Point_set_processing_3/include/CGAL/compute_average_spacing.h index 01071c3b849..375a8932a03 100644 --- a/Point_set_processing_3/include/CGAL/compute_average_spacing.h +++ b/Point_set_processing_3/include/CGAL/compute_average_spacing.h @@ -150,9 +150,8 @@ compute_average_spacing(const typename Kernel::Point_3& query, ///< 3D point who \pre `k >= 2.` - \tparam ConcurrencyTag enables sequential versus parallel algorithm. - Possible values are `Sequential_tag` - and `Parallel_tag`. + \tparam ConcurrencyTag enables sequential versus parallel algorithm. Possible values are `Sequential_tag`, + `Parallel_tag`, and `Parallel_if_available_tag`. \tparam PointRange is a model of `ConstRange`. The value type of its iterator is the key type of the named parameter `point_map`. diff --git a/Point_set_processing_3/include/CGAL/edge_aware_upsample_point_set.h b/Point_set_processing_3/include/CGAL/edge_aware_upsample_point_set.h index 7097c2daf63..073e7418622 100644 --- a/Point_set_processing_3/include/CGAL/edge_aware_upsample_point_set.h +++ b/Point_set_processing_3/include/CGAL/edge_aware_upsample_point_set.h @@ -280,8 +280,8 @@ update_new_point( Normals of points are required as input. For more details, please refer to \cgalCite{ear-2013}. \tparam ConcurrencyTag enables sequential versus parallel versions - of `compute_average_spacing()` (called internally). Possible - values are `Sequential_tag` and `Parallel_tag`. + of `compute_average_spacing()` (called internally). Possible + values are `Sequential_tag`, `Parallel_tag`, and `Parallel_if_available_tag`. \tparam PointRange is a model of `ConstRange`. The value type of its iterator is the key type of the named parameter `point_map`. \tparam OutputIterator Type of the output iterator. diff --git a/Point_set_processing_3/include/CGAL/jet_estimate_normals.h b/Point_set_processing_3/include/CGAL/jet_estimate_normals.h index 746710d9240..9b6fb4a1869 100644 --- a/Point_set_processing_3/include/CGAL/jet_estimate_normals.h +++ b/Point_set_processing_3/include/CGAL/jet_estimate_normals.h @@ -152,9 +152,8 @@ jet_estimate_normal(const typename Kernel::Point_3& query, ///< point to compute \pre `k >= 2` - \tparam ConcurrencyTag enables sequential versus parallel algorithm. - Possible values are `Sequential_tag` - and `Parallel_tag`. + \tparam ConcurrencyTag enables sequential versus parallel algorithm. Possible values are `Sequential_tag`, + `Parallel_tag`, and `Parallel_if_available_tag`. \tparam PointRange is a model of `Range`. The value type of its iterator is the key type of the named parameter `point_map`. diff --git a/Point_set_processing_3/include/CGAL/jet_smooth_point_set.h b/Point_set_processing_3/include/CGAL/jet_smooth_point_set.h index fbe89bcd072..bde1da19f37 100644 --- a/Point_set_processing_3/include/CGAL/jet_smooth_point_set.h +++ b/Point_set_processing_3/include/CGAL/jet_smooth_point_set.h @@ -156,9 +156,8 @@ jet_smooth_point( \pre `k >= 2` - \tparam ConcurrencyTag enables sequential versus parallel algorithm. - Possible values are `Sequential_tag` - and `Parallel_tag`. + \tparam ConcurrencyTag enables sequential versus parallel algorithm. Possible values are `Sequential_tag`, + `Parallel_tag`, and `Parallel_if_available_tag`. \tparam PointRange is a model of `Range`. The value type of its iterator is the key type of the named parameter `point_map`. diff --git a/Point_set_processing_3/include/CGAL/pca_estimate_normals.h b/Point_set_processing_3/include/CGAL/pca_estimate_normals.h index 6d1fb05eca7..3a6ead3d5fd 100644 --- a/Point_set_processing_3/include/CGAL/pca_estimate_normals.h +++ b/Point_set_processing_3/include/CGAL/pca_estimate_normals.h @@ -142,9 +142,8 @@ pca_estimate_normal(const typename Kernel::Point_3& query, ///< point to compute \pre `k >= 2` - \tparam ConcurrencyTag enables sequential versus parallel algorithm. - Possible values are `Sequential_tag` - and `Parallel_tag`. + \tparam ConcurrencyTag enables sequential versus parallel algorithm. Possible values are `Sequential_tag`, + `Parallel_tag`, and `Parallel_if_available_tag`. \tparam PointRange is a model of `Range`. The value type of its iterator is the key type of the named parameter `point_map`. diff --git a/Point_set_processing_3/include/CGAL/wlop_simplify_and_regularize_point_set.h b/Point_set_processing_3/include/CGAL/wlop_simplify_and_regularize_point_set.h index 3055edc1b9b..cbe5b1ca5fb 100644 --- a/Point_set_processing_3/include/CGAL/wlop_simplify_and_regularize_point_set.h +++ b/Point_set_processing_3/include/CGAL/wlop_simplify_and_regularize_point_set.h @@ -411,9 +411,8 @@ public: See the TBB documentation for more details. - \tparam ConcurrencyTag enables sequential versus parallel algorithm. - Possible values are `Sequential_tag` - and `Parallel_tag`. + \tparam ConcurrencyTag enables sequential versus parallel algorithm. Possible values are `Sequential_tag`, + `Parallel_tag`, and `Parallel_if_available_tag`. \tparam PointRange is a model of `Range`. The value type of its iterator is the key type of the named parameter `point_map`. \tparam OutputIterator Type of the output iterator. diff --git a/Point_set_processing_3/test/Point_set_processing_3/analysis_test.cpp b/Point_set_processing_3/test/Point_set_processing_3/analysis_test.cpp index 63a68155087..df1603f8efc 100644 --- a/Point_set_processing_3/test/Point_set_processing_3/analysis_test.cpp +++ b/Point_set_processing_3/test/Point_set_processing_3/analysis_test.cpp @@ -33,12 +33,7 @@ typedef Kernel::FT FT; typedef Kernel::Point_3 Point; // Concurrency -#ifdef CGAL_LINKED_WITH_TBB -typedef CGAL::Parallel_tag Concurrency_tag; -#else -typedef CGAL::Sequential_tag Concurrency_tag; -#endif - +typedef CGAL::Parallel_if_available_tag Concurrency_tag; // ---------------------------------------------------------------------------- // Tests diff --git a/Point_set_processing_3/test/Point_set_processing_3/edge_aware_upsample_test.cpp b/Point_set_processing_3/test/Point_set_processing_3/edge_aware_upsample_test.cpp index df0e92efc37..613bf126a06 100644 --- a/Point_set_processing_3/test/Point_set_processing_3/edge_aware_upsample_test.cpp +++ b/Point_set_processing_3/test/Point_set_processing_3/edge_aware_upsample_test.cpp @@ -36,12 +36,7 @@ typedef Kernel::Vector_3 Vector; typedef std::pair PointVectorPair; // Concurrency -#ifdef CGAL_LINKED_WITH_TBB -typedef CGAL::Parallel_tag Concurrency_tag; -#else -typedef CGAL::Sequential_tag Concurrency_tag; -#endif - +typedef CGAL::Parallel_if_available_tag Concurrency_tag; // ---------------------------------------------------------------------------- // Tests diff --git a/Point_set_processing_3/test/Point_set_processing_3/normal_estimation_test.cpp b/Point_set_processing_3/test/Point_set_processing_3/normal_estimation_test.cpp index 1c640709039..36e0adf0320 100644 --- a/Point_set_processing_3/test/Point_set_processing_3/normal_estimation_test.cpp +++ b/Point_set_processing_3/test/Point_set_processing_3/normal_estimation_test.cpp @@ -45,12 +45,7 @@ typedef CGAL::Point_with_normal_3 Point_with_normal; // position + norma typedef std::vector PointList; // Concurrency -#ifdef CGAL_LINKED_WITH_TBB -typedef CGAL::Parallel_tag Concurrency_tag; -#else -typedef CGAL::Sequential_tag Concurrency_tag; -#endif - +typedef CGAL::Parallel_if_available_tag Concurrency_tag; // ---------------------------------------------------------------------------- // Tests diff --git a/Point_set_processing_3/test/Point_set_processing_3/smoothing_test.cpp b/Point_set_processing_3/test/Point_set_processing_3/smoothing_test.cpp index 5dad79528f7..e5333343624 100644 --- a/Point_set_processing_3/test/Point_set_processing_3/smoothing_test.cpp +++ b/Point_set_processing_3/test/Point_set_processing_3/smoothing_test.cpp @@ -36,11 +36,7 @@ typedef Kernel::Point_3 Point; typedef Kernel::Vector_3 Vector; // Concurrency -#ifdef CGAL_LINKED_WITH_TBB -typedef CGAL::Parallel_tag Concurrency_tag; -#else -typedef CGAL::Sequential_tag Concurrency_tag; -#endif +typedef CGAL::Parallel_if_available_tag Concurrency_tag; // ---------------------------------------------------------------------------- // Tests diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/hausdorff_distance_remeshing_example.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/hausdorff_distance_remeshing_example.cpp index 2830dc77768..1b032454d43 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/hausdorff_distance_remeshing_example.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/hausdorff_distance_remeshing_example.cpp @@ -3,11 +3,7 @@ #include #include -#if defined(CGAL_LINKED_WITH_TBB) -#define TAG CGAL::Parallel_tag -#else -#define TAG CGAL::Sequential_tag -#endif +#define TAG CGAL::Parallel_if_available_tag typedef CGAL::Exact_predicates_inexact_constructions_kernel K; typedef K::Point_3 Point; diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/distance.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/distance.h index de52cfac3f2..f6500ea69f0 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/distance.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/distance.h @@ -589,8 +589,7 @@ double approximate_Hausdorff_distance( * for more details. * * @tparam Concurrency_tag enables sequential versus parallel algorithm. - * Possible values are `Sequential_tag` - * and `Parallel_tag`. + * Possible values are `Sequential_tag`, `Parallel_tag`, and `Parallel_if_available_tag`. * @tparam TriangleMesh a model of the concept `FaceListGraph` * @tparam NamedParameters1 a sequence of \ref pmp_namedparameters "Named Parameters" for `tm1` * @tparam NamedParameters2 a sequence of \ref pmp_namedparameters "Named Parameters" for `tm2` diff --git a/Polygonal_surface_reconstruction/include/CGAL/internal/compute_confidences.h b/Polygonal_surface_reconstruction/include/CGAL/internal/compute_confidences.h index 0c2ceafce8d..51eadd3ce7c 100644 --- a/Polygonal_surface_reconstruction/include/CGAL/internal/compute_confidences.h +++ b/Polygonal_surface_reconstruction/include/CGAL/internal/compute_confidences.h @@ -24,17 +24,10 @@ // Concurrency -#ifdef CGAL_LINKED_WITH_TBB -typedef CGAL::Parallel_tag Concurrency_tag; -#else -typedef CGAL::Sequential_tag Concurrency_tag; -#endif - +typedef CGAL::Parallel_if_available_tag Concurrency_tag; namespace CGAL { - - - namespace internal { +namespace internal { /** * Computes the confidences of the candidate faces. diff --git a/Polyhedron/demo/Polyhedron/Plugins/Classification/Cluster_classification.h b/Polyhedron/demo/Polyhedron/Plugins/Classification/Cluster_classification.h index fd88c9e7507..090827a4c89 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Classification/Cluster_classification.h +++ b/Polyhedron/demo/Polyhedron/Plugins/Classification/Cluster_classification.h @@ -15,12 +15,7 @@ #include -#ifdef CGAL_LINKED_WITH_TBB -typedef CGAL::Parallel_tag Concurrency_tag; -#else -typedef CGAL::Sequential_tag Concurrency_tag; -#endif - +typedef CGAL::Parallel_if_available_tag Concurrency_tag; class Cluster_classification : public Item_classification_base { diff --git a/Polyhedron/demo/Polyhedron/Plugins/Classification/Point_set_item_classification.h b/Polyhedron/demo/Polyhedron/Plugins/Classification/Point_set_item_classification.h index 3ddee5310c3..3eb2b503a4c 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Classification/Point_set_item_classification.h +++ b/Polyhedron/demo/Polyhedron/Plugins/Classification/Point_set_item_classification.h @@ -16,13 +16,7 @@ #include -#ifdef CGAL_LINKED_WITH_TBB -typedef CGAL::Parallel_tag Concurrency_tag; -#else -typedef CGAL::Sequential_tag Concurrency_tag; -#endif - - +typedef CGAL::Parallel_if_available_tag Concurrency_tag; // This class represents a point set in the OpenGL scene class Point_set_item_classification : public Item_classification_base diff --git a/Polyhedron/demo/Polyhedron/Plugins/Classification/Surface_mesh_item_classification.h b/Polyhedron/demo/Polyhedron/Plugins/Classification/Surface_mesh_item_classification.h index e690a208951..0fcc827b04a 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Classification/Surface_mesh_item_classification.h +++ b/Polyhedron/demo/Polyhedron/Plugins/Classification/Surface_mesh_item_classification.h @@ -16,11 +16,7 @@ #include -#ifdef CGAL_LINKED_WITH_TBB -typedef CGAL::Parallel_tag Concurrency_tag; -#else -typedef CGAL::Sequential_tag Concurrency_tag; -#endif +typedef CGAL::Parallel_if_available_tag Concurrency_tag; class Surface_mesh_item_classification : public Item_classification_base { diff --git a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_average_spacing_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_average_spacing_plugin.cpp index 13e9e0fa7db..037c7b5123d 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_average_spacing_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_average_spacing_plugin.cpp @@ -20,11 +20,7 @@ #include "run_with_qprogressdialog.h" // Concurrency -#ifdef CGAL_LINKED_WITH_TBB -typedef CGAL::Parallel_tag Concurrency_tag; -#else -typedef CGAL::Sequential_tag Concurrency_tag; -#endif +typedef CGAL::Parallel_if_available_tag Concurrency_tag; struct Compute_average_spacing_functor : public Functor_with_signal_callback diff --git a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_bilateral_smoothing_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_bilateral_smoothing_plugin.cpp index 14c45d7391b..2da04eef9d3 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_bilateral_smoothing_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_bilateral_smoothing_plugin.cpp @@ -21,11 +21,7 @@ #include "ui_Point_set_bilateral_smoothing_plugin.h" // Concurrency -#ifdef CGAL_LINKED_WITH_TBB -typedef CGAL::Parallel_tag Concurrency_tag; -#else -typedef CGAL::Sequential_tag Concurrency_tag; -#endif +typedef CGAL::Parallel_if_available_tag Concurrency_tag; struct Bilateral_smoothing_functor : public Functor_with_signal_callback diff --git a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_interference_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_interference_plugin.cpp index c20a2096421..5860a4c7239 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_interference_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_interference_plugin.cpp @@ -16,11 +16,8 @@ #include using namespace CGAL::Three; -#ifdef CGAL_LINKED_WITH_TBB -typedef CGAL::Parallel_tag Concurrency_tag; -#else -typedef CGAL::Sequential_tag Concurrency_tag; -#endif + +typedef CGAL::Parallel_if_available_tag Concurrency_tag; class Point_set_interference_plugin: public QObject, diff --git a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_normal_estimation_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_normal_estimation_plugin.cpp index 89ef88a006a..c8cea0f5343 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_normal_estimation_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_normal_estimation_plugin.cpp @@ -25,11 +25,7 @@ #include "ui_Point_set_normal_estimation_plugin.h" // Concurrency -#ifdef CGAL_LINKED_WITH_TBB -typedef CGAL::Parallel_tag Concurrency_tag; -#else -typedef CGAL::Sequential_tag Concurrency_tag; -#endif +typedef CGAL::Parallel_if_available_tag Concurrency_tag; struct PCA_estimate_normals_functor : public Functor_with_signal_callback diff --git a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_simplification_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_simplification_plugin.cpp index 9d838794b69..b08cbb27860 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_simplification_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_simplification_plugin.cpp @@ -22,11 +22,7 @@ #include "ui_Point_set_simplification_plugin.h" // Concurrency -#ifdef CGAL_LINKED_WITH_TBB -typedef CGAL::Parallel_tag Concurrency_tag; -#else -typedef CGAL::Sequential_tag Concurrency_tag; -#endif +typedef CGAL::Parallel_if_available_tag Concurrency_tag; struct Compute_average_spacing_functor : public Functor_with_signal_callback diff --git a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_smoothing_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_smoothing_plugin.cpp index 1436a2b4ae5..ac883acf29f 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_smoothing_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_smoothing_plugin.cpp @@ -15,11 +15,7 @@ #include "run_with_qprogressdialog.h" // Concurrency -#ifdef CGAL_LINKED_WITH_TBB -typedef CGAL::Parallel_tag Concurrency_tag; -#else -typedef CGAL::Sequential_tag Concurrency_tag; -#endif +typedef CGAL::Parallel_if_available_tag Concurrency_tag; struct Jet_smoothing_functor : public Functor_with_signal_callback diff --git a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_upsampling_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_upsampling_plugin.cpp index 2fba3abfcb8..ca4042b9949 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_upsampling_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_upsampling_plugin.cpp @@ -19,12 +19,8 @@ #include "ui_Point_set_upsampling_plugin.h" // Concurrency -#ifdef CGAL_LINKED_WITH_TBB -typedef CGAL::Parallel_tag Concurrency_tag; -#else -typedef CGAL::Sequential_tag Concurrency_tag; -#endif - +typedef CGAL::Parallel_if_available_tag Concurrency_tag; + using namespace CGAL::Three; class Polyhedron_demo_point_set_upsampling_plugin : public QObject, diff --git a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_wlop_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_wlop_plugin.cpp index 561b849c4f0..f9ab5c60215 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_wlop_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_wlop_plugin.cpp @@ -20,11 +20,7 @@ #include "ui_Point_set_wlop_plugin.h" // Concurrency -#ifdef CGAL_LINKED_WITH_TBB -typedef CGAL::Parallel_tag Concurrency_tag; -#else -typedef CGAL::Sequential_tag Concurrency_tag; -#endif +typedef CGAL::Parallel_if_available_tag Concurrency_tag; struct Compute_average_spacing_functor : public Functor_with_signal_callback diff --git a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Surface_reconstruction_poisson_impl.cpp b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Surface_reconstruction_poisson_impl.cpp index 77511d670f4..8b089d385b6 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Surface_reconstruction_poisson_impl.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Surface_reconstruction_poisson_impl.cpp @@ -25,14 +25,8 @@ #include "SMesh_type.h" #include "Scene_points_with_normal_item.h" - - // Concurrency -#ifdef CGAL_LINKED_WITH_TBB -typedef CGAL::Parallel_tag Concurrency_tag; -#else -typedef CGAL::Sequential_tag Concurrency_tag; -#endif +typedef CGAL::Parallel_if_available_tag Concurrency_tag; template class Marching_tets diff --git a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Surface_reconstruction_scale_space_impl.cpp b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Surface_reconstruction_scale_space_impl.cpp index 582bad37820..7f15fb61174 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Surface_reconstruction_scale_space_impl.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Surface_reconstruction_scale_space_impl.cpp @@ -13,11 +13,7 @@ // Concurrency -#ifdef CGAL_LINKED_WITH_TBB -typedef CGAL::Parallel_tag Concurrency_tag; -#else -typedef CGAL::Sequential_tag Concurrency_tag; -#endif +typedef CGAL::Parallel_if_available_tag Concurrency_tag; typedef CGAL::Scale_space_surface_reconstruction_3 ScaleSpace; typedef CGAL::Scale_space_reconstruction_3::Advancing_front_mesher ScaleSpaceAFM; diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/VSA_wrapper.h b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/VSA_wrapper.h index f43b6c94d48..c876ba84680 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/VSA_wrapper.h +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/VSA_wrapper.h @@ -38,23 +38,13 @@ class VSA_WRAPPER_EXPORT VSA_wrapper { typedef boost::property_map::type Face_center_map; typedef boost::property_map::type Face_area_map; -#ifdef CGAL_LINKED_WITH_TBB typedef CGAL::Variational_shape_approximation L21_approx; -#else - typedef CGAL::Variational_shape_approximation L21_approx; -#endif + CGAL::Default, EPICK, CGAL::Parallel_if_available_tag> L21_approx; typedef L21_approx::Error_metric L21_metric; typedef VSA::L2_metric_plane_proxy L2_metric; -#ifdef CGAL_LINKED_WITH_TBB typedef CGAL::Variational_shape_approximation L2_approx; -#else - typedef CGAL::Variational_shape_approximation L2_approx; -#endif + L2_metric, EPICK, CGAL::Parallel_if_available_tag> L2_approx; // user defined point-wise compact metric struct Compact_metric_point_proxy { @@ -89,14 +79,8 @@ class VSA_WRAPPER_EXPORT VSA_wrapper { }; typedef Compact_metric_point_proxy Compact_metric; -#ifdef CGAL_LINKED_WITH_TBB typedef CGAL::Variational_shape_approximation Compact_approx; -#else - typedef CGAL::Variational_shape_approximation Compact_approx; -#endif - + Compact_metric, EPICK, CGAL::Parallel_if_available_tag> Compact_approx; public: enum Metric { L21, L2, Compact }; diff --git a/Polyhedron/demo/Polyhedron/include/run_with_qprogressdialog.h b/Polyhedron/demo/Polyhedron/include/run_with_qprogressdialog.h index f1bef8fb5fd..3faa3173db4 100644 --- a/Polyhedron/demo/Polyhedron/include/run_with_qprogressdialog.h +++ b/Polyhedron/demo/Polyhedron/include/run_with_qprogressdialog.h @@ -7,12 +7,7 @@ #include "Callback_signaler.h" -#ifdef CGAL_LINKED_WITH_TBB -typedef CGAL::Parallel_tag Concurrency_tag; -#else -typedef CGAL::Sequential_tag Concurrency_tag; -#endif - +typedef CGAL::Parallel_if_available_tag Concurrency_tag; class Signal_callback { diff --git a/STL_Extension/include/CGAL/tags.h b/STL_Extension/include/CGAL/tags.h index 2b88992794b..8feef206784 100644 --- a/STL_Extension/include/CGAL/tags.h +++ b/STL_Extension/include/CGAL/tags.h @@ -63,7 +63,6 @@ typedef CGAL::Parallel_tag Parallel_if_available_tag; #else typedef CGAL::Sequential_tag Parallel_if_available_tag; #endif - // A function that asserts a specific compile time tag // forcing its two arguments to have equal type. diff --git a/Scale_space_reconstruction_3/include/CGAL/Scale_space_reconstruction_3/Jet_smoother.h b/Scale_space_reconstruction_3/include/CGAL/Scale_space_reconstruction_3/Jet_smoother.h index 49d00554dca..f881e8f23e4 100644 --- a/Scale_space_reconstruction_3/include/CGAL/Scale_space_reconstruction_3/Jet_smoother.h +++ b/Scale_space_reconstruction_3/include/CGAL/Scale_space_reconstruction_3/Jet_smoother.h @@ -39,17 +39,15 @@ namespace Scale_space_reconstruction_3 * `RealEmbeddable` field number type. Generally, * `Exact_predicates_inexact_constructions_kernel` is preferred. * \tparam ConcurrencyTag indicates whether to use concurrent - * processing. It can be omitted: if TBB (or greater) is available + * processing. It can be omitted: if \ref thirdpartyTBB is available * and `CGAL_LINKED_WITH_TBB` is defined then `Parallel_tag` is * used. Otherwise, `Sequential_tag` is used. */ template -#elif CGAL_LINKED_WITH_TBB - typename ConcurrencyTag = CGAL::Parallel_tag> #else - typename ConcurrencyTag = CGAL::Sequential_tag> + typename ConcurrencyTag = CGAL::Parallel_if_available_tag> #endif class Jet_smoother { diff --git a/Scale_space_reconstruction_3/include/CGAL/Scale_space_reconstruction_3/Weighted_PCA_smoother.h b/Scale_space_reconstruction_3/include/CGAL/Scale_space_reconstruction_3/Weighted_PCA_smoother.h index 2b21cae546f..50cc72b4c9c 100644 --- a/Scale_space_reconstruction_3/include/CGAL/Scale_space_reconstruction_3/Weighted_PCA_smoother.h +++ b/Scale_space_reconstruction_3/include/CGAL/Scale_space_reconstruction_3/Weighted_PCA_smoother.h @@ -55,21 +55,17 @@ namespace Scale_space_reconstruction_3 * that case, an overload using `Eigen_diagonalize_traits` is * provided. * \tparam ConcurrencyTag indicates whether to use concurrent - * processing. It can be omitted: if TBB (or greater) is available + * processing. It can be omitted: if \ref thirdpartyTBB is available * and `CGAL_LINKED_WITH_TBB` is defined then `Parallel_tag` is * used. Otherwise, `Sequential_tag` is used. */ template + typename DiagonalizeTraits, + typename ConcurrencyTag> #else // DOXYGEN_RUNNING - typename DiagonalizeTraits - = CGAL::Default_diagonalize_traits, -#ifdef CGAL_LINKED_WITH_TBB - typename ConcurrencyTag = CGAL::Parallel_tag> -#else - typename ConcurrencyTag = CGAL::Sequential_tag> -#endif // CGAL_LINKED_WITH_TBB + typename DiagonalizeTraits = CGAL::Default_diagonalize_traits, + typename ConcurrencyTag = CGAL::Parallel_if_available_tag> #endif // DOXYGEN_RUNNING class Weighted_PCA_smoother { diff --git a/TDS_3/doc/TDS_3/CGAL/Triangulation_data_structure_3.h b/TDS_3/doc/TDS_3/CGAL/Triangulation_data_structure_3.h index 742ea25c03c..a53e0ddb411 100644 --- a/TDS_3/doc/TDS_3/CGAL/Triangulation_data_structure_3.h +++ b/TDS_3/doc/TDS_3/CGAL/Triangulation_data_structure_3.h @@ -26,7 +26,7 @@ They have the default values `Triangulation_ds_vertex_base_3` and The `Concurrency_tag` parameter allows to enable the use of a concurrent container to store vertices and cells. It can be `Sequential_tag` (use of a -`Compact_container` to store vertices and cells) or `Parallel_tag` +`Compact_container` to store vertices and cells) or `Parallel_tag` (use of a `Concurrent_compact_container`). If it is `Parallel_tag`, the following functions can be called concurrently: `create_vertex`, `create_cell`, `delete_vertex`, `delete_cell`. diff --git a/TDS_3/doc/TDS_3/Concepts/TriangulationDataStructure_3.h b/TDS_3/doc/TDS_3/Concepts/TriangulationDataStructure_3.h index 175a64c4e20..7fd2a1a10bc 100644 --- a/TDS_3/doc/TDS_3/Concepts/TriangulationDataStructure_3.h +++ b/TDS_3/doc/TDS_3/Concepts/TriangulationDataStructure_3.h @@ -111,7 +111,7 @@ typedef unspecified_type Vertex_handle; typedef unspecified_type Cell_handle; /*! -Can be `CGAL::Sequential_tag` or `CGAL::Parallel_tag`. If it is +Can be `CGAL::Sequential_tag`, `CGAL::Parallel_tag`, or `Parallel_if_available_tag`. If it is `CGAL::Parallel_tag`, the following functions can be called concurrently: `create_vertex`, `create_cell`, `delete_vertex`, `delete_cell`. */ From 9b598c4ee6f68482a36cf43b9324dc1829d18b16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Wed, 20 Nov 2019 12:36:05 +0100 Subject: [PATCH 4/6] Remove mentions of targets that do not exist in CmakeLists of Mesh_3/test --- Mesh_3/test/Mesh_3/CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/Mesh_3/test/Mesh_3/CMakeLists.txt b/Mesh_3/test/Mesh_3/CMakeLists.txt index 03f021a7172..731686b660b 100644 --- a/Mesh_3/test/Mesh_3/CMakeLists.txt +++ b/Mesh_3/test/Mesh_3/CMakeLists.txt @@ -65,12 +65,10 @@ if ( CGAL_FOUND ) test_meshing_verbose test_meshing_polyhedron_with_features test_meshing_utilities.h - test_mesh_implicit_domains test_meshing_implicit_function test_meshing_3D_image test_meshing_3D_gray_image test_meshing_unit_tetrahedron - test_backward_compatibility test_meshing_polyhedron test_meshing_polyhedral_complex ) From 6f0bbc90df6b3668f7bc2c3cd5618375f295cad8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Wed, 20 Nov 2019 12:38:56 +0100 Subject: [PATCH 5/6] Enable parallel for three tests in Mesh_3/test that relied on CONCURRENT_MESH_3 The macro was never defined and if it had been, the targets would not have been linked properly anyway. --- Mesh_3/test/Mesh_3/CMakeLists.txt | 3 +++ Mesh_3/test/Mesh_3/test_mesh_3_issue_1554.cpp | 6 +----- .../test/Mesh_3/test_mesh_capsule_var_distance_bound.cpp | 6 +----- ...est_mesh_polyhedral_domain_with_features_deprecated.cpp | 7 +------ 4 files changed, 6 insertions(+), 16 deletions(-) diff --git a/Mesh_3/test/Mesh_3/CMakeLists.txt b/Mesh_3/test/Mesh_3/CMakeLists.txt index 731686b660b..525573cbeb4 100644 --- a/Mesh_3/test/Mesh_3/CMakeLists.txt +++ b/Mesh_3/test/Mesh_3/CMakeLists.txt @@ -71,6 +71,9 @@ if ( CGAL_FOUND ) test_meshing_unit_tetrahedron test_meshing_polyhedron test_meshing_polyhedral_complex + test_mesh_capsule_var_distance_bound + test_mesh_3_issue_1554 + test_mesh_polyhedral_domain_with_features_deprecated ) if(TBB_FOUND AND TARGET ${target}) CGAL_target_use_TBB(${target}) diff --git a/Mesh_3/test/Mesh_3/test_mesh_3_issue_1554.cpp b/Mesh_3/test/Mesh_3/test_mesh_3_issue_1554.cpp index 24c7bb6f445..c64f5455ffb 100644 --- a/Mesh_3/test/Mesh_3/test_mesh_3_issue_1554.cpp +++ b/Mesh_3/test/Mesh_3/test_mesh_3_issue_1554.cpp @@ -18,11 +18,7 @@ typedef CGAL::Exact_predicates_inexact_constructions_kernel K; typedef CGAL::Mesh_polyhedron_3::type Polyhedron; typedef CGAL::Polyhedral_mesh_domain_with_features_3 Mesh_domain; -#ifdef CGAL_CONCURRENT_MESH_3 -typedef CGAL::Parallel_tag Concurrency_tag; -#else -typedef CGAL::Sequential_tag Concurrency_tag; -#endif +typedef CGAL::Parallel_if_available_tag Concurrency_tag; // Triangulation typedef CGAL::Mesh_triangulation_3 Mesh_domain; -#ifdef CGAL_CONCURRENT_MESH_3 -typedef CGAL::Parallel_tag Concurrency_tag; -#else -typedef CGAL::Sequential_tag Concurrency_tag; -#endif +typedef CGAL::Parallel_if_available_tag Concurrency_tag; // Triangulation typedef CGAL::Mesh_triangulation_3::type Tr; diff --git a/Mesh_3/test/Mesh_3/test_mesh_polyhedral_domain_with_features_deprecated.cpp b/Mesh_3/test/Mesh_3/test_mesh_polyhedral_domain_with_features_deprecated.cpp index 26e7093cb91..5fd13080c01 100644 --- a/Mesh_3/test/Mesh_3/test_mesh_polyhedral_domain_with_features_deprecated.cpp +++ b/Mesh_3/test/Mesh_3/test_mesh_polyhedral_domain_with_features_deprecated.cpp @@ -14,12 +14,7 @@ typedef CGAL::Exact_predicates_inexact_constructions_kernel K; typedef CGAL::Mesh_polyhedron_3::type Polyhedron; typedef CGAL::Polyhedral_mesh_domain_with_features_3 Mesh_domain; - -#ifdef CGAL_CONCURRENT_MESH_3 -typedef CGAL::Parallel_tag Concurrency_tag; -#else -typedef CGAL::Sequential_tag Concurrency_tag; -#endif +typedef CGAL::Parallel_if_available_tag Concurrency_tag; // Triangulation typedef CGAL::Mesh_triangulation_3::type Tr; From 6cd0be27072ec1e693528521e4f61d7f86a331fb Mon Sep 17 00:00:00 2001 From: Mael Date: Wed, 29 Jan 2020 16:49:52 +0100 Subject: [PATCH 6/6] Update changes.md --- Installation/CHANGES.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Installation/CHANGES.md b/Installation/CHANGES.md index 736a64839c6..c13c8649420 100644 --- a/Installation/CHANGES.md +++ b/Installation/CHANGES.md @@ -75,6 +75,10 @@ Release date: June 2020 - The concept "EdgeProfile" has been removed. This concept was not actually in use as the CGAL-provided model `CGAL::Edge_profile` was imposed to the user. Other concepts have been clarified to reflect the fact that the API uses this particular class. +### STL Extensions for CGAL + - Added a new concurrency tag: `CGAL::Parallel_if_available_tag`. This tag is a convenience typedef to `CGAL::Parallel_tag` + if the third party library TBB has been found and linked with, and to `CGAL::Sequential_tag` otherwise. + [Release 5.0](https://github.com/CGAL/cgal/releases/tag/releases%2FCGAL-5.0) -----------