diff options
author | ROUVREAU Vincent <vincent.rouvreau@inria.fr> | 2020-01-30 18:04:20 +0100 |
---|---|---|
committer | ROUVREAU Vincent <vincent.rouvreau@inria.fr> | 2020-01-30 18:04:20 +0100 |
commit | 0cbf41493cee2b9bd598557b97df9b1211da2b9d (patch) | |
tree | 434c210004518a58be79a76a362c4d0b4a4d1af7 /src | |
parent | 5d5f40493ce60f2a606793645bf713c60fb5284d (diff) |
Use mutex from stl instead of tbb one that is deprecated
Diffstat (limited to 'src')
-rw-r--r-- | src/Nerve_GIC/include/gudhi/GIC.h | 8 | ||||
-rw-r--r-- | src/Tangential_complex/include/gudhi/Tangential_complex.h | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/Nerve_GIC/include/gudhi/GIC.h b/src/Nerve_GIC/include/gudhi/GIC.h index a47d6889..2a6d4788 100644 --- a/src/Nerve_GIC/include/gudhi/GIC.h +++ b/src/Nerve_GIC/include/gudhi/GIC.h @@ -14,7 +14,7 @@ #ifdef GUDHI_USE_TBB #include <tbb/parallel_for.h> -#include <tbb/mutex.h> +#include <mutex> #endif #include <gudhi/Debug_utils.h> @@ -459,7 +459,7 @@ class Cover_complex { // This cannot be parallelized if thread_local is not defined // thread_local is not defined for XCode < v.8 #if defined(GUDHI_USE_TBB) && defined(GUDHI_CAN_USE_CXX11_THREAD_LOCAL) - tbb::mutex deltamutex; + std::mutex deltamutex; tbb::parallel_for(0, N, [&](int i){ std::vector<int> samples(m); SampleWithoutReplacement(n, m, samples); @@ -765,7 +765,7 @@ class Cover_complex { #ifdef GUDHI_USE_TBB if (verbose) std::cout << "Computing connected components (parallelized)..." << std::endl; - tbb::mutex covermutex, idmutex; + std::mutex covermutex, idmutex; tbb::parallel_for(0, res, [&](int i){ // Compute connected components Graph G = one_skeleton.create_subgraph(); @@ -895,7 +895,7 @@ class Cover_complex { // Compute the geodesic distances to subsamples with Dijkstra #ifdef GUDHI_USE_TBB if (verbose) std::cout << "Computing geodesic distances (parallelized)..." << std::endl; - tbb::mutex coverMutex; tbb::mutex mindistMutex; + std::mutex coverMutex; std::mutex mindistMutex; tbb::parallel_for(0, m, [&](int i){ int seed = voronoi_subsamples[i]; std::vector<double> dmap(n); diff --git a/src/Tangential_complex/include/gudhi/Tangential_complex.h b/src/Tangential_complex/include/gudhi/Tangential_complex.h index f058fa9f..f007bdd5 100644 --- a/src/Tangential_complex/include/gudhi/Tangential_complex.h +++ b/src/Tangential_complex/include/gudhi/Tangential_complex.h @@ -60,7 +60,7 @@ #ifdef GUDHI_USE_TBB #include <tbb/parallel_for.h> #include <tbb/combinable.h> -#include <tbb/mutex.h> +#include <mutex> #endif // #define GUDHI_TC_EXPORT_NORMALS // Only for 3D surfaces (k=2, d=3) @@ -147,7 +147,7 @@ class Tangential_complex { typedef typename Tr_traits::Vector_d Tr_vector; #if defined(GUDHI_USE_TBB) - typedef tbb::mutex Mutex_for_perturb; + typedef std::mutex Mutex_for_perturb; typedef Vector Translation_for_perturb; typedef std::vector<Atomic_wrapper<FT> > Weights; #else |