From 38fc71bd90084b971bbd1065c3ce0967a2e7b7b2 Mon Sep 17 00:00:00 2001 From: "Arend G. Dijkstra" <adijkstra@astron.nl> Date: Thu, 19 Nov 2020 14:26:44 +0100 Subject: [PATCH] openMP try --- meanshift.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/meanshift.cpp b/meanshift.cpp index eef50eb..a3dfda0 100644 --- a/meanshift.cpp +++ b/meanshift.cpp @@ -136,8 +136,13 @@ void Grouper::group(py::list l){ ctype coords_to_check = _coordinates; while (coords_to_check.size() > 0){ - auto idx_cluster = neighbourhood_points(coords_to_check[0], _coordinates, _groupingDistance); - auto idx_cluster_to_remove = neighbourhood_points(coords_to_check[0], coords_to_check, _groupingDistance); + std::vector<unsigned> idx_cluster; + std::vector<unsigned> idx_cluster_to_remove; +#pragma omp parallel +{ + idx_cluster = neighbourhood_points(coords_to_check[0], _coordinates, _groupingDistance); + idx_cluster_to_remove = neighbourhood_points(coords_to_check[0], coords_to_check, _groupingDistance); +} unsigned n = 0; for (auto idx : idx_cluster_to_remove){ coords_to_check.erase(coords_to_check.begin() + idx - n); -- GitLab