Skip to content

Replace omp_set_nested (deprecated) with omp_set_max_active_levels #1887

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/aliceVision/alicevision_omp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ inline int omp_get_thread_num() { return 0; }
inline int omp_get_max_threads() { return 1; }
inline void omp_set_num_threads(int num_threads) {}
inline int omp_get_num_procs() { return 1; }
inline void omp_set_nested(int nested) {}
inline void omp_set_max_active_levels(int levels) {}

inline void omp_init_lock(omp_lock_t* lock) {}
inline void omp_destroy_lock(omp_lock_t* lock) {}
Expand Down
2 changes: 1 addition & 1 deletion src/aliceVision/featureEngine/FeatureExtractor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ void FeatureExtractor::process(const HardwareContext& hContext, const image::EIm
nbThreads = std::min(cpuJobs.size(), nbThreads);

ALICEVISION_LOG_INFO("# threads for extraction: " << nbThreads);
omp_set_nested(1);
omp_set_max_active_levels(2);

#pragma omp parallel for num_threads(nbThreads)
for (int i = 0; i < cpuJobs.size(); ++i)
Expand Down
8 changes: 4 additions & 4 deletions src/aliceVision/fuseCut/PointCloud.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ void createVerticesWithVisibilities(const StaticVector<int>& cams,
for (auto& lock : locks)
omp_init_lock(&lock);

omp_set_nested(1);
omp_set_max_active_levels(2);
#pragma omp parallel for num_threads(3)
for (int c = 0; c < cams.size(); ++c)
{
Expand Down Expand Up @@ -227,7 +227,7 @@ void createVerticesWithVisibilities(const StaticVector<int>& cams,
}
}
}
omp_set_nested(0);
omp_set_max_active_levels(1);

for (auto& lock : locks)
omp_destroy_lock(&lock);
Expand Down Expand Up @@ -292,7 +292,7 @@ void PointCloud::fuseFromDepthMaps(const StaticVector<int>& cams, const Point3d

ALICEVISION_LOG_INFO("Load depth maps and add points.");
{
omp_set_nested(1);
omp_set_max_active_levels(2);
#pragma omp parallel for num_threads(3)
for (int c = 0; c < cams.size(); c++)
{
Expand Down Expand Up @@ -422,7 +422,7 @@ void PointCloud::fuseFromDepthMaps(const StaticVector<int>& cams, const Point3d
}
}
}
omp_set_nested(0);
omp_set_max_active_levels(1);
}

ALICEVISION_LOG_INFO("Filter initial 3D points by pixel size to remove duplicates.");
Expand Down
Loading