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/Classification.h>
#include <CGAL/bounding_box.h>
#include <CGAL/tags.h>
#include <CGAL/IO/read_ply_points.h>
#include <CGAL/Real_timer.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;
typedef CGAL::Simple_cartesian<double> Kernel;
typedef Kernel::Point_3 Point;

View File

@ -18,11 +18,7 @@
#include <CGAL/Shape_detection/Region_growing.h>
#include <CGAL/Real_timer.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;
typedef CGAL::Simple_cartesian<double> Kernel;
typedef Kernel::Point_3 Point;

View File

@ -127,11 +127,7 @@ public:
std::size_t num_trees = 25,
std::size_t max_depth = 20)
{
#ifdef CGAL_LINKED_WITH_TBB
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
train<CGAL::Parallel_if_available_tag>(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).

View File

@ -226,7 +226,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)
@ -242,10 +242,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>
@ -310,7 +308,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)
@ -325,10 +323,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>
@ -396,7 +392,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)
@ -409,10 +405,8 @@ public:
template <typename ClusterRange,
#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>

View File

@ -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 <typename GeomTraits,
typename PointMap,
#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
typename DiagonalizeTraits = CGAL::Default_diagonalize_traits<float,3> >
class Mesh_feature_generator

View File

@ -90,10 +90,8 @@ template <typename GeomTraits,
typename PointMap,
#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>

View File

@ -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

View File

@ -145,8 +145,9 @@ int main()
#ifdef CGAL_LINKED_WITH_TBB
Triangulation_3 T3;
fct3(T3);
fct3(T3);
#endif
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`
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)
-----------

View File

@ -12,8 +12,8 @@ type to be used for the 3D triangulation embedding the mesh.
and defaults to `Kernel_traits<MD>::%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<Gt, MD>`.

View File

@ -65,15 +65,15 @@ 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
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})

View File

@ -18,11 +18,7 @@ typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Mesh_polyhedron_3<K>::type Polyhedron;
typedef CGAL::Polyhedral_mesh_domain_with_features_3<K> 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,

View File

@ -16,11 +16,7 @@ typedef K::Point_3 Point;
typedef FT (Function)(const Point&);
typedef CGAL::Labeled_mesh_domain_3<K> 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,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::Polyhedral_mesh_domain_with_features_3<K> 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,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;
// 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[])
{

View File

@ -17,12 +17,7 @@ typedef Kernel::Vector_3 Vector;
typedef std::pair<Point, Vector> 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[])
{

View File

@ -18,12 +18,7 @@ typedef Kernel::Point_3 Point;
typedef CGAL::Random_points_on_sphere_3<Point> 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<bool(double)>
struct Progress_to_std_cerr_callback

View File

@ -16,12 +16,7 @@ typedef Kernel::Vector_3 Vector;
typedef std::pair<Point, Vector> 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[])
{

View File

@ -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)
{

View File

@ -48,12 +48,7 @@ typedef std::pair<Point, Vector> PointVectorPair;
typedef std::vector<PointVectorPair> 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

View File

@ -18,11 +18,7 @@ typedef Kernel::Vector_3 Vector;
typedef std::pair<Point, Vector> 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[])
{

View File

@ -12,11 +12,7 @@
#include <fstream>
// 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;

View File

@ -12,11 +12,7 @@ typedef CGAL::Simple_cartesian<double> 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)
{

View File

@ -351,9 +351,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`.

View File

@ -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`.

View File

@ -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.

View File

@ -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`.

View File

@ -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`.

View File

@ -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`.

View File

@ -411,9 +411,8 @@ public:
See the <a href="https://www.threadingbuildingblocks.org/documentation">TBB documentation</a>
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.

View File

@ -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

View File

@ -36,12 +36,7 @@ typedef Kernel::Vector_3 Vector;
typedef std::pair<Point, Vector> 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

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;
// 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

View File

@ -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

View File

@ -3,11 +3,7 @@
#include <CGAL/Polygon_mesh_processing/distance.h>
#include <CGAL/Polygon_mesh_processing/remesh.h>
#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;

View File

@ -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`

View File

@ -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.

View File

@ -15,12 +15,7 @@
#include <iostream>
#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
{

View File

@ -16,13 +16,7 @@
#include <iostream>
#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

View File

@ -16,11 +16,7 @@
#include <iostream>
#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
{

View File

@ -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

View File

@ -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

View File

@ -16,11 +16,8 @@
#include <QMainWindow>
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,

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -19,11 +19,7 @@
#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 :

View File

@ -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

View File

@ -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 <typename Triangulation>
class Marching_tets

View File

@ -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<Kernel> ScaleSpace;
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_area_tag>::type Face_area_map;
#ifdef CGAL_LINKED_WITH_TBB
typedef CGAL::Variational_shape_approximation<SMesh, Vertex_point_map,
CGAL::Default, EPICK, CGAL::Parallel_tag> L21_approx;
#else
typedef CGAL::Variational_shape_approximation<SMesh, Vertex_point_map,
CGAL::Default, EPICK> 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<SMesh> L2_metric;
#ifdef CGAL_LINKED_WITH_TBB
typedef CGAL::Variational_shape_approximation<SMesh, Vertex_point_map,
L2_metric, EPICK, CGAL::Parallel_tag> L2_approx;
#else
typedef CGAL::Variational_shape_approximation<SMesh, Vertex_point_map,
L2_metric, EPICK> 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<SMesh, Vertex_point_map,
Compact_metric, EPICK, CGAL::Parallel_tag> Compact_approx;
#else
typedef CGAL::Variational_shape_approximation<SMesh, Vertex_point_map,
Compact_metric, EPICK> Compact_approx;
#endif
Compact_metric, EPICK, CGAL::Parallel_if_available_tag> Compact_approx;
public:
enum Metric { L21, L2, Compact };

View File

@ -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
{

View File

@ -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

View File

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

View File

@ -26,7 +26,7 @@ namespace CGAL {
struct Void {};
// Boolean_tag<bool> 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 <bool b>
struct Boolean_tag {
typedef boost::mpl::integral_c_tag tag;
@ -58,6 +58,12 @@ 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 <class Base>

View File

@ -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 <typename Geom_traits,
#ifdef DOXYGEN_RUNNING
typename ConcurrencyTag>
#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
{

View File

@ -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 Geom_traits,
#ifdef DOXYGEN_RUNNING
typename DiagonalizeTraits, typename ConcurrencyTag>
typename DiagonalizeTraits,
typename ConcurrencyTag>
#else // DOXYGEN_RUNNING
typename DiagonalizeTraits
= CGAL::Default_diagonalize_traits<typename Geom_traits::FT, 3>,
#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 Geom_traits::FT, 3>,
typename ConcurrencyTag = CGAL::Parallel_if_available_tag>
#endif // DOXYGEN_RUNNING
class Weighted_PCA_smoother
{

View File

@ -114,7 +114,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`.
*/