Merge pull request #4364 from afabri/CGAL-Parallel_if_available_tag

CGAL:: Add Parallel_if_available_tag
This commit is contained in:
Laurent Rineau 2020-02-07 16:25:03 +01:00
commit 0fd7bbc4ff
59 changed files with 108 additions and 284 deletions

View File

@ -11,16 +11,12 @@
#include <CGAL/Simple_cartesian.h> #include <CGAL/Simple_cartesian.h>
#include <CGAL/Classification.h> #include <CGAL/Classification.h>
#include <CGAL/bounding_box.h> #include <CGAL/bounding_box.h>
#include <CGAL/tags.h>
#include <CGAL/IO/read_ply_points.h> #include <CGAL/IO/read_ply_points.h>
#include <CGAL/Real_timer.h> #include <CGAL/Real_timer.h>
#ifdef CGAL_LINKED_WITH_TBB typedef CGAL::Parallel_if_available_tag Concurrency_tag;
typedef CGAL::Parallel_tag Concurrency_tag;
#else
typedef CGAL::Sequential_tag Concurrency_tag;
#endif
typedef CGAL::Simple_cartesian<double> Kernel; typedef CGAL::Simple_cartesian<double> Kernel;
typedef Kernel::Point_3 Point; typedef Kernel::Point_3 Point;

View File

@ -18,11 +18,7 @@
#include <CGAL/Shape_detection/Region_growing.h> #include <CGAL/Shape_detection/Region_growing.h>
#include <CGAL/Real_timer.h> #include <CGAL/Real_timer.h>
#ifdef CGAL_LINKED_WITH_TBB typedef CGAL::Parallel_if_available_tag Concurrency_tag;
typedef CGAL::Parallel_tag Concurrency_tag;
#else
typedef CGAL::Sequential_tag Concurrency_tag;
#endif
typedef CGAL::Simple_cartesian<double> Kernel; typedef CGAL::Simple_cartesian<double> Kernel;
typedef Kernel::Point_3 Point; typedef Kernel::Point_3 Point;

View File

@ -127,11 +127,7 @@ public:
std::size_t num_trees = 25, std::size_t num_trees = 25,
std::size_t max_depth = 20) std::size_t max_depth = 20)
{ {
#ifdef CGAL_LINKED_WITH_TBB train<CGAL::Parallel_if_available_tag>(ground_truth, reset_trees, num_trees, max_depth);
train<CGAL::Parallel_tag>(ground_truth, reset_trees, num_trees, max_depth);
#else
train<CGAL::Sequential_tag>(ground_truth, reset_trees, num_trees, max_depth);
#endif
} }
/// \endcond /// \endcond
@ -146,7 +142,7 @@ public:
label. label.
\tparam ConcurrencyTag enables sequential versus parallel \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 %CGAL is linked with TBB) or `Sequential_tag` (default value
otherwise). otherwise).

View File

@ -226,7 +226,7 @@ public:
is `CGAL::Point_3`. is `CGAL::Point_3`.
\tparam NeighborQuery model of `NeighborQuery` \tparam NeighborQuery model of `NeighborQuery`
\tparam ConcurrencyTag enables sequential versus parallel \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). is linked with TBB) or `Sequential_tag` (default value otherwise).
\tparam DiagonalizeTraits model of `DiagonalizeTraits` used for \tparam DiagonalizeTraits model of `DiagonalizeTraits` used for
matrix diagonalization. It can be omitted if Eigen 3 (or greater) matrix diagonalization. It can be omitted if Eigen 3 (or greater)
@ -242,10 +242,8 @@ public:
typename NeighborQuery, typename NeighborQuery,
#if defined(DOXYGEN_RUNNING) #if defined(DOXYGEN_RUNNING)
typename ConcurrencyTag, typename ConcurrencyTag,
#elif defined(CGAL_LINKED_WITH_TBB)
typename ConcurrencyTag = CGAL::Parallel_tag,
#else #else
typename ConcurrencyTag = CGAL::Sequential_tag, typename ConcurrencyTag = CGAL::Parallel_if_available_tag,
#endif #endif
#if defined(DOXYGEN_RUNNING) #if defined(DOXYGEN_RUNNING)
typename DiagonalizeTraits> typename DiagonalizeTraits>
@ -310,7 +308,7 @@ public:
\tparam FaceListGraph model of `FaceListGraph`. \tparam FaceListGraph model of `FaceListGraph`.
\tparam NeighborQuery model of `NeighborQuery` \tparam NeighborQuery model of `NeighborQuery`
\tparam ConcurrencyTag enables sequential versus parallel \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). is linked with TBB) or `Sequential_tag` (default value otherwise).
\tparam DiagonalizeTraits model of `DiagonalizeTraits` used for \tparam DiagonalizeTraits model of `DiagonalizeTraits` used for
matrix diagonalization. It can be omitted: if Eigen 3 (or greater) matrix diagonalization. It can be omitted: if Eigen 3 (or greater)
@ -325,10 +323,8 @@ public:
typename NeighborQuery, typename NeighborQuery,
#if defined(DOXYGEN_RUNNING) #if defined(DOXYGEN_RUNNING)
typename ConcurrencyTag, typename ConcurrencyTag,
#elif defined(CGAL_LINKED_WITH_TBB)
typename ConcurrencyTag = CGAL::Parallel_tag,
#else #else
typename ConcurrencyTag = CGAL::Sequential_tag, typename ConcurrencyTag = CGAL::Parallel_if_available_tag,
#endif #endif
#if defined(DOXYGEN_RUNNING) #if defined(DOXYGEN_RUNNING)
typename DiagonalizeTraits> typename DiagonalizeTraits>
@ -396,7 +392,7 @@ public:
`RandomAccessIterator` and its value type is the key type of `RandomAccessIterator` and its value type is the key type of
`PointMap`. `PointMap`.
\tparam ConcurrencyTag enables sequential versus parallel \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). is linked with TBB) or `Sequential_tag` (default value otherwise).
\tparam DiagonalizeTraits model of `DiagonalizeTraits` used for \tparam DiagonalizeTraits model of `DiagonalizeTraits` used for
matrix diagonalization. It can be omitted: if Eigen 3 (or greater) matrix diagonalization. It can be omitted: if Eigen 3 (or greater)
@ -409,10 +405,8 @@ public:
template <typename ClusterRange, template <typename ClusterRange,
#if defined(DOXYGEN_RUNNING) #if defined(DOXYGEN_RUNNING)
typename ConcurrencyTag, typename ConcurrencyTag,
#elif defined(CGAL_LINKED_WITH_TBB)
typename ConcurrencyTag = CGAL::Parallel_tag,
#else #else
typename ConcurrencyTag = CGAL::Sequential_tag, typename ConcurrencyTag = CGAL::Parallel_if_available_tag,
#endif #endif
#if defined(DOXYGEN_RUNNING) #if defined(DOXYGEN_RUNNING)
typename DiagonalizeTraits> typename DiagonalizeTraits>

View File

@ -79,7 +79,7 @@ namespace Classification {
is `GeomTraits::Point_3`. is `GeomTraits::Point_3`.
\tparam ConcurrencyTag enables sequential versus parallel \tparam ConcurrencyTag enables sequential versus parallel
computation of `CGAL::Classification::Local_eigen_analysis` 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). is linked with TBB) or `Sequential_tag` (default value otherwise).
\tparam DiagonalizeTraits model of `DiagonalizeTraits` used for \tparam DiagonalizeTraits model of `DiagonalizeTraits` used for
matrix diagonalization. It can be omitted: if Eigen 3 (or greater) matrix diagonalization. It can be omitted: if Eigen 3 (or greater)
@ -93,10 +93,8 @@ template <typename GeomTraits,
typename PointMap, typename PointMap,
#if defined(DOXYGEN_RUNNING) #if defined(DOXYGEN_RUNNING)
typename ConcurrencyTag, typename ConcurrencyTag,
#elif defined(CGAL_LINKED_WITH_TBB)
typename ConcurrencyTag = CGAL::Parallel_tag,
#else #else
typename ConcurrencyTag = CGAL::Sequential_tag, typename ConcurrencyTag = CGAL::Parallel_if_available_tag,
#endif #endif
typename DiagonalizeTraits = CGAL::Default_diagonalize_traits<float,3> > typename DiagonalizeTraits = CGAL::Default_diagonalize_traits<float,3> >
class Mesh_feature_generator class Mesh_feature_generator

View File

@ -90,10 +90,8 @@ template <typename GeomTraits,
typename PointMap, typename PointMap,
#if defined(DOXYGEN_RUNNING) #if defined(DOXYGEN_RUNNING)
typename ConcurrencyTag, typename ConcurrencyTag,
#elif defined(CGAL_LINKED_WITH_TBB)
typename ConcurrencyTag = CGAL::Parallel_tag,
#else #else
typename ConcurrencyTag = CGAL::Sequential_tag, typename ConcurrencyTag = CGAL::Parallel_if_available_tag,
#endif #endif
#if defined(DOXYGEN_RUNNING) #if defined(DOXYGEN_RUNNING)
typename DiagonalizeTraits> typename DiagonalizeTraits>

View File

@ -334,7 +334,7 @@ namespace internal {
suboptimal results. suboptimal results.
\tparam ConcurrencyTag enables sequential versus parallel \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 \tparam ItemRange model of `ConstRange`. Its iterator type is
`RandomAccessIterator`. Its value type depends on the data that is `RandomAccessIterator`. Its value type depends on the data that is
@ -424,7 +424,7 @@ namespace internal {
efficiency and better quality results. efficiency and better quality results.
\tparam ConcurrencyTag enables sequential versus parallel \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 \tparam ItemRange model of `ConstRange`. Its iterator type is
`RandomAccessIterator`. `RandomAccessIterator`.
\tparam ItemMap model of `ReadablePropertyMap` whose key \tparam ItemMap model of `ReadablePropertyMap` whose key
@ -502,7 +502,7 @@ namespace internal {
results. results.
\tparam ConcurrencyTag enables sequential versus parallel \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 \tparam ItemRange model of `ConstRange`. Its iterator type is
`RandomAccessIterator`. `RandomAccessIterator`.
\tparam ItemMap model of `ReadablePropertyMap` whose key \tparam ItemMap model of `ReadablePropertyMap` whose key

View File

@ -147,6 +147,7 @@ int main()
Triangulation_3 T3; Triangulation_3 T3;
fct3(T3); fct3(T3);
#endif #endif
return 0; return 0;
} }

View File

@ -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` - 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. 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) [Release 5.0](https://github.com/CGAL/cgal/releases/tag/releases%2FCGAL-5.0)
----------- -----------

View File

@ -12,8 +12,8 @@ type to be used for the 3D triangulation embedding the mesh.
and defaults to `Kernel_traits<MD>::%Kernel`. and defaults to `Kernel_traits<MD>::%Kernel`.
\tparam Concurrency_tag enables sequential versus parallel meshing and optimization algorithms. \tparam Concurrency_tag enables sequential versus parallel meshing and optimization algorithms.
Possible values are `Sequential_tag` (the default) and Possible values are `Sequential_tag` (the default), `Parallel_tag`,
`Parallel_tag`. and `Parallel_if_available_tag`.
\tparam Vertex_base must be a model of `MeshVertexBase_3` or `Default` \tparam Vertex_base must be a model of `MeshVertexBase_3` or `Default`
and defaults to `Mesh_vertex_base_3<Gt, MD>`. and defaults to `Mesh_vertex_base_3<Gt, MD>`.

View File

@ -65,15 +65,15 @@ if ( CGAL_FOUND )
test_meshing_verbose test_meshing_verbose
test_meshing_polyhedron_with_features test_meshing_polyhedron_with_features
test_meshing_utilities.h test_meshing_utilities.h
test_mesh_implicit_domains
test_meshing_implicit_function test_meshing_implicit_function
test_meshing_3D_image test_meshing_3D_image
test_meshing_3D_gray_image test_meshing_3D_gray_image
test_meshing_unit_tetrahedron test_meshing_unit_tetrahedron
test_backward_compatibility
test_meshing_polyhedron test_meshing_polyhedron
test_meshing_polyhedral_complex test_meshing_polyhedral_complex
test_mesh_capsule_var_distance_bound
test_mesh_3_issue_1554 test_mesh_3_issue_1554
test_mesh_polyhedral_domain_with_features_deprecated
) )
if(TBB_FOUND AND TARGET ${target}) if(TBB_FOUND AND TARGET ${target})
CGAL_target_use_TBB(${target}) CGAL_target_use_TBB(${target})

View File

@ -18,11 +18,7 @@ typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Mesh_polyhedron_3<K>::type Polyhedron; typedef CGAL::Mesh_polyhedron_3<K>::type Polyhedron;
typedef CGAL::Polyhedral_mesh_domain_with_features_3<K> Mesh_domain; typedef CGAL::Polyhedral_mesh_domain_with_features_3<K> Mesh_domain;
#ifdef CGAL_CONCURRENT_MESH_3 typedef CGAL::Parallel_if_available_tag Concurrency_tag;
typedef CGAL::Parallel_tag Concurrency_tag;
#else
typedef CGAL::Sequential_tag Concurrency_tag;
#endif
// Triangulation // Triangulation
typedef CGAL::Mesh_triangulation_3<Mesh_domain, typedef CGAL::Mesh_triangulation_3<Mesh_domain,

View File

@ -16,11 +16,7 @@ typedef K::Point_3 Point;
typedef FT (Function)(const Point&); typedef FT (Function)(const Point&);
typedef CGAL::Labeled_mesh_domain_3<K> Mesh_domain; typedef CGAL::Labeled_mesh_domain_3<K> Mesh_domain;
#ifdef CGAL_CONCURRENT_MESH_3 typedef CGAL::Parallel_if_available_tag Concurrency_tag;
typedef CGAL::Parallel_tag Concurrency_tag;
#else
typedef CGAL::Sequential_tag Concurrency_tag;
#endif
// Triangulation // Triangulation
typedef CGAL::Mesh_triangulation_3<Mesh_domain,K,Concurrency_tag>::type Tr; typedef CGAL::Mesh_triangulation_3<Mesh_domain,K,Concurrency_tag>::type Tr;

View File

@ -14,12 +14,7 @@ typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Mesh_polyhedron_3<K>::type Polyhedron; typedef CGAL::Mesh_polyhedron_3<K>::type Polyhedron;
typedef CGAL::Polyhedral_mesh_domain_with_features_3<K> Mesh_domain; typedef CGAL::Polyhedral_mesh_domain_with_features_3<K> Mesh_domain;
typedef CGAL::Parallel_if_available_tag Concurrency_tag;
#ifdef CGAL_CONCURRENT_MESH_3
typedef CGAL::Parallel_tag Concurrency_tag;
#else
typedef CGAL::Sequential_tag Concurrency_tag;
#endif
// Triangulation // Triangulation
typedef CGAL::Mesh_triangulation_3<Mesh_domain,CGAL::Default,Concurrency_tag>::type Tr; typedef CGAL::Mesh_triangulation_3<Mesh_domain,CGAL::Default,Concurrency_tag>::type Tr;

View File

@ -16,12 +16,7 @@ typedef Kernel::Point_3 Point;
typedef boost::tuple<int, Point, int, int, int> IndexedPointWithColorTuple; typedef boost::tuple<int, Point, int, int, int> IndexedPointWithColorTuple;
// Concurrency // Concurrency
#ifdef CGAL_LINKED_WITH_TBB typedef CGAL::Parallel_if_available_tag Concurrency_tag;
typedef CGAL::Parallel_tag Concurrency_tag;
#else
typedef CGAL::Sequential_tag Concurrency_tag;
#endif
int main(int argc, char*argv[]) int main(int argc, char*argv[])
{ {

View File

@ -17,12 +17,7 @@ typedef Kernel::Vector_3 Vector;
typedef std::pair<Point, Vector> PointVectorPair; typedef std::pair<Point, Vector> PointVectorPair;
// Concurrency // Concurrency
#ifdef CGAL_LINKED_WITH_TBB typedef CGAL::Parallel_if_available_tag Concurrency_tag;
typedef CGAL::Parallel_tag Concurrency_tag;
#else
typedef CGAL::Sequential_tag Concurrency_tag;
#endif
int main(int argc, char*argv[]) int main(int argc, char*argv[])
{ {

View File

@ -18,12 +18,7 @@ typedef Kernel::Point_3 Point;
typedef CGAL::Random_points_on_sphere_3<Point> Generator; typedef CGAL::Random_points_on_sphere_3<Point> Generator;
// Concurrency // Concurrency
#ifdef CGAL_LINKED_WITH_TBB typedef CGAL::Parallel_if_available_tag Concurrency_tag;
typedef CGAL::Parallel_tag Concurrency_tag;
#else
typedef CGAL::Sequential_tag Concurrency_tag;
#endif
// instance of std::function<bool(double)> // instance of std::function<bool(double)>
struct Progress_to_std_cerr_callback struct Progress_to_std_cerr_callback

View File

@ -16,12 +16,7 @@ typedef Kernel::Vector_3 Vector;
typedef std::pair<Point, Vector> PointVectorPair; typedef std::pair<Point, Vector> PointVectorPair;
// Concurrency // Concurrency
#ifdef CGAL_LINKED_WITH_TBB typedef CGAL::Parallel_if_available_tag Concurrency_tag;
typedef CGAL::Parallel_tag Concurrency_tag;
#else
typedef CGAL::Sequential_tag Concurrency_tag;
#endif
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {

View File

@ -8,12 +8,7 @@ typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
typedef Kernel::Point_3 Point; typedef Kernel::Point_3 Point;
// Concurrency // Concurrency
#ifdef CGAL_LINKED_WITH_TBB typedef CGAL::Parallel_if_available_tag Concurrency_tag;
typedef CGAL::Parallel_tag Concurrency_tag;
#else
typedef CGAL::Sequential_tag Concurrency_tag;
#endif
int main(void) int main(void)
{ {

View File

@ -48,12 +48,7 @@ typedef std::pair<Point, Vector> PointVectorPair;
typedef std::vector<PointVectorPair> PointList; typedef std::vector<PointVectorPair> PointList;
// Concurrency // Concurrency
#ifdef CGAL_LINKED_WITH_TBB typedef CGAL::Parallel_if_available_tag Concurrency_tag;
typedef CGAL::Parallel_tag Concurrency_tag;
#else
typedef CGAL::Sequential_tag Concurrency_tag;
#endif
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// Private functions // Private functions

View File

@ -18,11 +18,7 @@ typedef Kernel::Vector_3 Vector;
typedef std::pair<Point, Vector> PointVectorPair; typedef std::pair<Point, Vector> PointVectorPair;
// Concurrency // Concurrency
#ifdef CGAL_LINKED_WITH_TBB typedef CGAL::Parallel_if_available_tag Concurrency_tag;
typedef CGAL::Parallel_tag Concurrency_tag;
#else
typedef CGAL::Sequential_tag Concurrency_tag;
#endif
int main(int argc, char*argv[]) int main(int argc, char*argv[])
{ {

View File

@ -12,11 +12,7 @@
#include <fstream> #include <fstream>
// Concurrency // Concurrency
#ifdef CGAL_LINKED_WITH_TBB typedef CGAL::Parallel_if_available_tag Concurrency_tag;
typedef CGAL::Parallel_tag Concurrency_tag;
#else
typedef CGAL::Sequential_tag Concurrency_tag;
#endif
// Types // Types
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;

View File

@ -12,11 +12,7 @@ typedef CGAL::Simple_cartesian<double> Kernel;
typedef Kernel::Point_3 Point; typedef Kernel::Point_3 Point;
// Concurrency // Concurrency
#ifdef CGAL_LINKED_WITH_TBB typedef CGAL::Parallel_if_available_tag Concurrency_tag;
typedef CGAL::Parallel_tag Concurrency_tag;
#else
typedef CGAL::Sequential_tag Concurrency_tag;
#endif
int main(int argc, char** argv) int main(int argc, char** argv)
{ {

View File

@ -351,9 +351,8 @@ public:
\pre Normals must be unit vectors \pre Normals must be unit vectors
\pre k >= 2 \pre k >= 2
\tparam ConcurrencyTag enables sequential versus parallel algorithm. \tparam ConcurrencyTag enables sequential versus parallel algorithm. Possible values are `Sequential_tag`,
Possible values are `Sequential_tag` `Parallel_tag`, and `Parallel_if_available_tag`.
And `Parallel_tag`.
\tparam PointRange is a model of `Range`. The value type of \tparam PointRange is a model of `Range`. The value type of
its iterator is the key type of the named parameter `point_map`. its iterator is the key type of the named parameter `point_map`.

View File

@ -150,9 +150,8 @@ compute_average_spacing(const typename Kernel::Point_3& query, ///< 3D point who
\pre `k >= 2.` \pre `k >= 2.`
\tparam ConcurrencyTag enables sequential versus parallel algorithm. \tparam ConcurrencyTag enables sequential versus parallel algorithm. Possible values are `Sequential_tag`,
Possible values are `Sequential_tag` `Parallel_tag`, and `Parallel_if_available_tag`.
and `Parallel_tag`.
\tparam PointRange is a model of `ConstRange`. The value type of \tparam PointRange is a model of `ConstRange`. The value type of
its iterator is the key type of the named parameter `point_map`. its iterator is the key type of the named parameter `point_map`.

View File

@ -281,7 +281,7 @@ update_new_point(
\tparam ConcurrencyTag enables sequential versus parallel versions \tparam ConcurrencyTag enables sequential versus parallel versions
of `compute_average_spacing()` (called internally). Possible of `compute_average_spacing()` (called internally). Possible
values are `Sequential_tag` and `Parallel_tag`. values are `Sequential_tag`, `Parallel_tag`, and `Parallel_if_available_tag`.
\tparam PointRange is a model of `ConstRange`. The value type of \tparam PointRange is a model of `ConstRange`. The value type of
its iterator is the key type of the named parameter `point_map`. its iterator is the key type of the named parameter `point_map`.
\tparam OutputIterator Type of the output iterator. \tparam OutputIterator Type of the output iterator.

View File

@ -152,9 +152,8 @@ jet_estimate_normal(const typename Kernel::Point_3& query, ///< point to compute
\pre `k >= 2` \pre `k >= 2`
\tparam ConcurrencyTag enables sequential versus parallel algorithm. \tparam ConcurrencyTag enables sequential versus parallel algorithm. Possible values are `Sequential_tag`,
Possible values are `Sequential_tag` `Parallel_tag`, and `Parallel_if_available_tag`.
and `Parallel_tag`.
\tparam PointRange is a model of `Range`. The value type of \tparam PointRange is a model of `Range`. The value type of
its iterator is the key type of the named parameter `point_map`. its iterator is the key type of the named parameter `point_map`.

View File

@ -156,9 +156,8 @@ jet_smooth_point(
\pre `k >= 2` \pre `k >= 2`
\tparam ConcurrencyTag enables sequential versus parallel algorithm. \tparam ConcurrencyTag enables sequential versus parallel algorithm. Possible values are `Sequential_tag`,
Possible values are `Sequential_tag` `Parallel_tag`, and `Parallel_if_available_tag`.
and `Parallel_tag`.
\tparam PointRange is a model of `Range`. The value type of \tparam PointRange is a model of `Range`. The value type of
its iterator is the key type of the named parameter `point_map`. its iterator is the key type of the named parameter `point_map`.

View File

@ -142,9 +142,8 @@ pca_estimate_normal(const typename Kernel::Point_3& query, ///< point to compute
\pre `k >= 2` \pre `k >= 2`
\tparam ConcurrencyTag enables sequential versus parallel algorithm. \tparam ConcurrencyTag enables sequential versus parallel algorithm. Possible values are `Sequential_tag`,
Possible values are `Sequential_tag` `Parallel_tag`, and `Parallel_if_available_tag`.
and `Parallel_tag`.
\tparam PointRange is a model of `Range`. The value type of \tparam PointRange is a model of `Range`. The value type of
its iterator is the key type of the named parameter `point_map`. its iterator is the key type of the named parameter `point_map`.

View File

@ -411,9 +411,8 @@ public:
See the <a href="https://www.threadingbuildingblocks.org/documentation">TBB documentation</a> See the <a href="https://www.threadingbuildingblocks.org/documentation">TBB documentation</a>
for more details. for more details.
\tparam ConcurrencyTag enables sequential versus parallel algorithm. \tparam ConcurrencyTag enables sequential versus parallel algorithm. Possible values are `Sequential_tag`,
Possible values are `Sequential_tag` `Parallel_tag`, and `Parallel_if_available_tag`.
and `Parallel_tag`.
\tparam PointRange is a model of `Range`. The value type of \tparam PointRange is a model of `Range`. The value type of
its iterator is the key type of the named parameter `point_map`. its iterator is the key type of the named parameter `point_map`.
\tparam OutputIterator Type of the output iterator. \tparam OutputIterator Type of the output iterator.

View File

@ -33,12 +33,7 @@ typedef Kernel::FT FT;
typedef Kernel::Point_3 Point; typedef Kernel::Point_3 Point;
// Concurrency // Concurrency
#ifdef CGAL_LINKED_WITH_TBB typedef CGAL::Parallel_if_available_tag Concurrency_tag;
typedef CGAL::Parallel_tag Concurrency_tag;
#else
typedef CGAL::Sequential_tag Concurrency_tag;
#endif
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// Tests // Tests

View File

@ -36,12 +36,7 @@ typedef Kernel::Vector_3 Vector;
typedef std::pair<Point, Vector> PointVectorPair; typedef std::pair<Point, Vector> PointVectorPair;
// Concurrency // Concurrency
#ifdef CGAL_LINKED_WITH_TBB typedef CGAL::Parallel_if_available_tag Concurrency_tag;
typedef CGAL::Parallel_tag Concurrency_tag;
#else
typedef CGAL::Sequential_tag Concurrency_tag;
#endif
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// Tests // Tests

View File

@ -45,12 +45,7 @@ typedef CGAL::Point_with_normal_3<Kernel> Point_with_normal; // position + norma
typedef std::vector<Point_with_normal> PointList; typedef std::vector<Point_with_normal> PointList;
// Concurrency // Concurrency
#ifdef CGAL_LINKED_WITH_TBB typedef CGAL::Parallel_if_available_tag Concurrency_tag;
typedef CGAL::Parallel_tag Concurrency_tag;
#else
typedef CGAL::Sequential_tag Concurrency_tag;
#endif
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// Tests // Tests

View File

@ -36,11 +36,7 @@ typedef Kernel::Point_3 Point;
typedef Kernel::Vector_3 Vector; typedef Kernel::Vector_3 Vector;
// Concurrency // Concurrency
#ifdef CGAL_LINKED_WITH_TBB typedef CGAL::Parallel_if_available_tag Concurrency_tag;
typedef CGAL::Parallel_tag Concurrency_tag;
#else
typedef CGAL::Sequential_tag Concurrency_tag;
#endif
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// Tests // Tests

View File

@ -3,11 +3,7 @@
#include <CGAL/Polygon_mesh_processing/distance.h> #include <CGAL/Polygon_mesh_processing/distance.h>
#include <CGAL/Polygon_mesh_processing/remesh.h> #include <CGAL/Polygon_mesh_processing/remesh.h>
#if defined(CGAL_LINKED_WITH_TBB) #define TAG CGAL::Parallel_if_available_tag
#define TAG CGAL::Parallel_tag
#else
#define TAG CGAL::Sequential_tag
#endif
typedef CGAL::Exact_predicates_inexact_constructions_kernel K; typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef K::Point_3 Point; typedef K::Point_3 Point;

View File

@ -589,8 +589,7 @@ double approximate_Hausdorff_distance(
* for more details. * for more details.
* *
* @tparam Concurrency_tag enables sequential versus parallel algorithm. * @tparam Concurrency_tag enables sequential versus parallel algorithm.
* Possible values are `Sequential_tag` * Possible values are `Sequential_tag`, `Parallel_tag`, and `Parallel_if_available_tag`.
* and `Parallel_tag`.
* @tparam TriangleMesh a model of the concept `FaceListGraph` * @tparam TriangleMesh a model of the concept `FaceListGraph`
* @tparam NamedParameters1 a sequence of \ref pmp_namedparameters "Named Parameters" for `tm1` * @tparam NamedParameters1 a sequence of \ref pmp_namedparameters "Named Parameters" for `tm1`
* @tparam NamedParameters2 a sequence of \ref pmp_namedparameters "Named Parameters" for `tm2` * @tparam NamedParameters2 a sequence of \ref pmp_namedparameters "Named Parameters" for `tm2`

View File

@ -24,16 +24,9 @@
// Concurrency // Concurrency
#ifdef CGAL_LINKED_WITH_TBB typedef CGAL::Parallel_if_available_tag Concurrency_tag;
typedef CGAL::Parallel_tag Concurrency_tag;
#else
typedef CGAL::Sequential_tag Concurrency_tag;
#endif
namespace CGAL { namespace CGAL {
namespace internal { namespace internal {
/** /**

View File

@ -15,12 +15,7 @@
#include <iostream> #include <iostream>
#ifdef CGAL_LINKED_WITH_TBB typedef CGAL::Parallel_if_available_tag Concurrency_tag;
typedef CGAL::Parallel_tag Concurrency_tag;
#else
typedef CGAL::Sequential_tag Concurrency_tag;
#endif
class Cluster_classification : public Item_classification_base class Cluster_classification : public Item_classification_base
{ {

View File

@ -16,13 +16,7 @@
#include <iostream> #include <iostream>
#ifdef CGAL_LINKED_WITH_TBB typedef CGAL::Parallel_if_available_tag Concurrency_tag;
typedef CGAL::Parallel_tag Concurrency_tag;
#else
typedef CGAL::Sequential_tag Concurrency_tag;
#endif
// This class represents a point set in the OpenGL scene // This class represents a point set in the OpenGL scene
class Point_set_item_classification : public Item_classification_base class Point_set_item_classification : public Item_classification_base

View File

@ -16,11 +16,7 @@
#include <iostream> #include <iostream>
#ifdef CGAL_LINKED_WITH_TBB typedef CGAL::Parallel_if_available_tag Concurrency_tag;
typedef CGAL::Parallel_tag Concurrency_tag;
#else
typedef CGAL::Sequential_tag Concurrency_tag;
#endif
class Surface_mesh_item_classification : public Item_classification_base class Surface_mesh_item_classification : public Item_classification_base
{ {

View File

@ -20,11 +20,7 @@
#include "run_with_qprogressdialog.h" #include "run_with_qprogressdialog.h"
// Concurrency // Concurrency
#ifdef CGAL_LINKED_WITH_TBB typedef CGAL::Parallel_if_available_tag Concurrency_tag;
typedef CGAL::Parallel_tag Concurrency_tag;
#else
typedef CGAL::Sequential_tag Concurrency_tag;
#endif
struct Compute_average_spacing_functor struct Compute_average_spacing_functor
: public Functor_with_signal_callback : public Functor_with_signal_callback

View File

@ -21,11 +21,7 @@
#include "ui_Point_set_bilateral_smoothing_plugin.h" #include "ui_Point_set_bilateral_smoothing_plugin.h"
// Concurrency // Concurrency
#ifdef CGAL_LINKED_WITH_TBB typedef CGAL::Parallel_if_available_tag Concurrency_tag;
typedef CGAL::Parallel_tag Concurrency_tag;
#else
typedef CGAL::Sequential_tag Concurrency_tag;
#endif
struct Bilateral_smoothing_functor struct Bilateral_smoothing_functor
: public Functor_with_signal_callback : public Functor_with_signal_callback

View File

@ -16,11 +16,8 @@
#include <QMainWindow> #include <QMainWindow>
using namespace CGAL::Three; using namespace CGAL::Three;
#ifdef CGAL_LINKED_WITH_TBB
typedef CGAL::Parallel_tag Concurrency_tag; typedef CGAL::Parallel_if_available_tag Concurrency_tag;
#else
typedef CGAL::Sequential_tag Concurrency_tag;
#endif
class Point_set_interference_plugin: class Point_set_interference_plugin:
public QObject, public QObject,

View File

@ -25,11 +25,7 @@
#include "ui_Point_set_normal_estimation_plugin.h" #include "ui_Point_set_normal_estimation_plugin.h"
// Concurrency // Concurrency
#ifdef CGAL_LINKED_WITH_TBB typedef CGAL::Parallel_if_available_tag Concurrency_tag;
typedef CGAL::Parallel_tag Concurrency_tag;
#else
typedef CGAL::Sequential_tag Concurrency_tag;
#endif
struct PCA_estimate_normals_functor struct PCA_estimate_normals_functor
: public Functor_with_signal_callback : public Functor_with_signal_callback

View File

@ -22,11 +22,7 @@
#include "ui_Point_set_simplification_plugin.h" #include "ui_Point_set_simplification_plugin.h"
// Concurrency // Concurrency
#ifdef CGAL_LINKED_WITH_TBB typedef CGAL::Parallel_if_available_tag Concurrency_tag;
typedef CGAL::Parallel_tag Concurrency_tag;
#else
typedef CGAL::Sequential_tag Concurrency_tag;
#endif
struct Compute_average_spacing_functor struct Compute_average_spacing_functor
: public Functor_with_signal_callback : public Functor_with_signal_callback

View File

@ -15,11 +15,7 @@
#include "run_with_qprogressdialog.h" #include "run_with_qprogressdialog.h"
// Concurrency // Concurrency
#ifdef CGAL_LINKED_WITH_TBB typedef CGAL::Parallel_if_available_tag Concurrency_tag;
typedef CGAL::Parallel_tag Concurrency_tag;
#else
typedef CGAL::Sequential_tag Concurrency_tag;
#endif
struct Jet_smoothing_functor struct Jet_smoothing_functor
: public Functor_with_signal_callback : public Functor_with_signal_callback

View File

@ -19,11 +19,7 @@
#include "ui_Point_set_upsampling_plugin.h" #include "ui_Point_set_upsampling_plugin.h"
// Concurrency // Concurrency
#ifdef CGAL_LINKED_WITH_TBB typedef CGAL::Parallel_if_available_tag Concurrency_tag;
typedef CGAL::Parallel_tag Concurrency_tag;
#else
typedef CGAL::Sequential_tag Concurrency_tag;
#endif
using namespace CGAL::Three; using namespace CGAL::Three;
class Polyhedron_demo_point_set_upsampling_plugin : class Polyhedron_demo_point_set_upsampling_plugin :

View File

@ -20,11 +20,7 @@
#include "ui_Point_set_wlop_plugin.h" #include "ui_Point_set_wlop_plugin.h"
// Concurrency // Concurrency
#ifdef CGAL_LINKED_WITH_TBB typedef CGAL::Parallel_if_available_tag Concurrency_tag;
typedef CGAL::Parallel_tag Concurrency_tag;
#else
typedef CGAL::Sequential_tag Concurrency_tag;
#endif
struct Compute_average_spacing_functor struct Compute_average_spacing_functor
: public Functor_with_signal_callback : public Functor_with_signal_callback

View File

@ -25,14 +25,8 @@
#include "SMesh_type.h" #include "SMesh_type.h"
#include "Scene_points_with_normal_item.h" #include "Scene_points_with_normal_item.h"
// Concurrency // Concurrency
#ifdef CGAL_LINKED_WITH_TBB typedef CGAL::Parallel_if_available_tag Concurrency_tag;
typedef CGAL::Parallel_tag Concurrency_tag;
#else
typedef CGAL::Sequential_tag Concurrency_tag;
#endif
template <typename Triangulation> template <typename Triangulation>
class Marching_tets class Marching_tets

View File

@ -13,11 +13,7 @@
// Concurrency // Concurrency
#ifdef CGAL_LINKED_WITH_TBB typedef CGAL::Parallel_if_available_tag Concurrency_tag;
typedef CGAL::Parallel_tag Concurrency_tag;
#else
typedef CGAL::Sequential_tag Concurrency_tag;
#endif
typedef CGAL::Scale_space_surface_reconstruction_3<Kernel> ScaleSpace; typedef CGAL::Scale_space_surface_reconstruction_3<Kernel> ScaleSpace;
typedef CGAL::Scale_space_reconstruction_3::Advancing_front_mesher<Kernel> ScaleSpaceAFM; typedef CGAL::Scale_space_reconstruction_3::Advancing_front_mesher<Kernel> ScaleSpaceAFM;

View File

@ -38,23 +38,13 @@ class VSA_WRAPPER_EXPORT VSA_wrapper {
typedef boost::property_map<SMesh, Face_center_tag>::type Face_center_map; typedef boost::property_map<SMesh, Face_center_tag>::type Face_center_map;
typedef boost::property_map<SMesh, Face_area_tag>::type Face_area_map; typedef boost::property_map<SMesh, Face_area_tag>::type Face_area_map;
#ifdef CGAL_LINKED_WITH_TBB
typedef CGAL::Variational_shape_approximation<SMesh, Vertex_point_map, typedef CGAL::Variational_shape_approximation<SMesh, Vertex_point_map,
CGAL::Default, EPICK, CGAL::Parallel_tag> L21_approx; CGAL::Default, EPICK, CGAL::Parallel_if_available_tag> L21_approx;
#else
typedef CGAL::Variational_shape_approximation<SMesh, Vertex_point_map,
CGAL::Default, EPICK> L21_approx;
#endif
typedef L21_approx::Error_metric L21_metric; typedef L21_approx::Error_metric L21_metric;
typedef VSA::L2_metric_plane_proxy<SMesh> L2_metric; typedef VSA::L2_metric_plane_proxy<SMesh> L2_metric;
#ifdef CGAL_LINKED_WITH_TBB
typedef CGAL::Variational_shape_approximation<SMesh, Vertex_point_map, typedef CGAL::Variational_shape_approximation<SMesh, Vertex_point_map,
L2_metric, EPICK, CGAL::Parallel_tag> L2_approx; L2_metric, EPICK, CGAL::Parallel_if_available_tag> L2_approx;
#else
typedef CGAL::Variational_shape_approximation<SMesh, Vertex_point_map,
L2_metric, EPICK> L2_approx;
#endif
// user defined point-wise compact metric // user defined point-wise compact metric
struct Compact_metric_point_proxy { struct Compact_metric_point_proxy {
@ -89,14 +79,8 @@ class VSA_WRAPPER_EXPORT VSA_wrapper {
}; };
typedef Compact_metric_point_proxy Compact_metric; typedef Compact_metric_point_proxy Compact_metric;
#ifdef CGAL_LINKED_WITH_TBB
typedef CGAL::Variational_shape_approximation<SMesh, Vertex_point_map, typedef CGAL::Variational_shape_approximation<SMesh, Vertex_point_map,
Compact_metric, EPICK, CGAL::Parallel_tag> Compact_approx; Compact_metric, EPICK, CGAL::Parallel_if_available_tag> Compact_approx;
#else
typedef CGAL::Variational_shape_approximation<SMesh, Vertex_point_map,
Compact_metric, EPICK> Compact_approx;
#endif
public: public:
enum Metric { L21, L2, Compact }; enum Metric { L21, L2, Compact };

View File

@ -7,12 +7,7 @@
#include "Callback_signaler.h" #include "Callback_signaler.h"
#ifdef CGAL_LINKED_WITH_TBB typedef CGAL::Parallel_if_available_tag Concurrency_tag;
typedef CGAL::Parallel_tag Concurrency_tag;
#else
typedef CGAL::Sequential_tag Concurrency_tag;
#endif
class Signal_callback class Signal_callback
{ {

View File

@ -69,18 +69,25 @@ struct Null_functor {
/*! /*!
\ingroup PkgSTLExtensionUtilities \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. For example, it may be used by a user to request the sequential version of an algorithm.
*/ */
struct Sequential_tag {}; struct Sequential_tag {};
/*! /*!
\ingroup PkgSTLExtensionUtilities \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. For example, it may be used by a user to request the parallel version of an algorithm.
*/ */
struct Parallel_tag {}; 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 \ingroup PkgSTLExtensionUtilities

View File

@ -106,6 +106,9 @@
- `CGAL::Tag_false` - `CGAL::Tag_false`
- `CGAL::Null_tag` - `CGAL::Null_tag`
- `CGAL::Null_functor` - `CGAL::Null_functor`
- `CGAL::Sequential_tag`
- `CGAL::Parallel_tag`
- `CGAL::Parallel_if_available_tag`
- `CGAL::Uncertain<T>` - `CGAL::Uncertain<T>`
- `CGAL::Default` - `CGAL::Default`
- `CGAL::Fast` - `CGAL::Fast`

View File

@ -58,6 +58,12 @@ struct Null_functor {
struct Sequential_tag {}; struct Sequential_tag {};
struct Parallel_tag : public 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 // A function that asserts a specific compile time tag
// forcing its two arguments to have equal type. // forcing its two arguments to have equal type.
template <class Base> template <class Base>

View File

@ -39,17 +39,15 @@ namespace Scale_space_reconstruction_3
* `RealEmbeddable` field number type. Generally, * `RealEmbeddable` field number type. Generally,
* `Exact_predicates_inexact_constructions_kernel` is preferred. * `Exact_predicates_inexact_constructions_kernel` is preferred.
* \tparam ConcurrencyTag indicates whether to use concurrent * \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 * and `CGAL_LINKED_WITH_TBB` is defined then `Parallel_tag` is
* used. Otherwise, `Sequential_tag` is used. * used. Otherwise, `Sequential_tag` is used.
*/ */
template <typename Geom_traits, template <typename Geom_traits,
#ifdef DOXYGEN_RUNNING #ifdef DOXYGEN_RUNNING
typename ConcurrencyTag> typename ConcurrencyTag>
#elif CGAL_LINKED_WITH_TBB
typename ConcurrencyTag = CGAL::Parallel_tag>
#else #else
typename ConcurrencyTag = CGAL::Sequential_tag> typename ConcurrencyTag = CGAL::Parallel_if_available_tag>
#endif #endif
class Jet_smoother class Jet_smoother
{ {

View File

@ -55,21 +55,17 @@ namespace Scale_space_reconstruction_3
* that case, an overload using `Eigen_diagonalize_traits` is * that case, an overload using `Eigen_diagonalize_traits` is
* provided. * provided.
* \tparam ConcurrencyTag indicates whether to use concurrent * \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 * and `CGAL_LINKED_WITH_TBB` is defined then `Parallel_tag` is
* used. Otherwise, `Sequential_tag` is used. * used. Otherwise, `Sequential_tag` is used.
*/ */
template <typename Geom_traits, template <typename Geom_traits,
#ifdef DOXYGEN_RUNNING #ifdef DOXYGEN_RUNNING
typename DiagonalizeTraits, typename ConcurrencyTag> typename DiagonalizeTraits,
typename ConcurrencyTag>
#else // DOXYGEN_RUNNING #else // DOXYGEN_RUNNING
typename DiagonalizeTraits typename DiagonalizeTraits = CGAL::Default_diagonalize_traits<typename Geom_traits::FT, 3>,
= CGAL::Default_diagonalize_traits<typename Geom_traits::FT, 3>, typename ConcurrencyTag = CGAL::Parallel_if_available_tag>
#ifdef CGAL_LINKED_WITH_TBB
typename ConcurrencyTag = CGAL::Parallel_tag>
#else
typename ConcurrencyTag = CGAL::Sequential_tag>
#endif // CGAL_LINKED_WITH_TBB
#endif // DOXYGEN_RUNNING #endif // DOXYGEN_RUNNING
class Weighted_PCA_smoother class Weighted_PCA_smoother
{ {

View File

@ -114,7 +114,7 @@ typedef unspecified_type Vertex_handle;
typedef unspecified_type Cell_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: `CGAL::Parallel_tag`, the following functions can be called concurrently:
`create_vertex`, `create_cell`, `delete_vertex`, `delete_cell`. `create_vertex`, `create_cell`, `delete_vertex`, `delete_cell`.
*/ */