-
-
Notifications
You must be signed in to change notification settings - Fork 850
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
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -141,7 +141,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); | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [nitpick] Consider extracting the magic number
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||||
#pragma omp parallel for num_threads(3) | ||||||||
for (int c = 0; c < cams.size(); ++c) | ||||||||
{ | ||||||||
|
@@ -229,7 +229,7 @@ void createVerticesWithVisibilities(const StaticVector<int>& cams, | |||||||
} | ||||||||
} | ||||||||
} | ||||||||
omp_set_nested(0); | ||||||||
omp_set_max_active_levels(1); | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [nitpick] Similarly, you may want to define
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||||
|
||||||||
for (auto& lock : locks) | ||||||||
omp_destroy_lock(&lock); | ||||||||
|
@@ -294,7 +294,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); | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [nitpick] This duplicated literal could also be replaced by a shared constant or inline comment, so readers understand it matches the upper-level parallel region's configuration.
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||||
#pragma omp parallel for num_threads(3) | ||||||||
for (int c = 0; c < cams.size(); c++) | ||||||||
{ | ||||||||
|
@@ -424,7 +424,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."); | ||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Again, consider using a named constant or comment for
2
to make its intent clear in this context of nested parallel extraction.Copilot uses AI. Check for mistakes.