Skip to content

Commit e840d2e

Browse files
author
fabien servant
committed
replace omp_set_nested with omp_set_max_active_levels
1 parent 5264cff commit e840d2e

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

src/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.25)
1+
cmake_minimum_required(VERSION 3.30)
22
message("CMake version: ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}")
33

44
# ==============================================================================
@@ -253,6 +253,7 @@ endif()
253253
if (ALICEVISION_USE_OPENMP STREQUAL "OFF")
254254
set(ALICEVISION_HAVE_OPENMP 0)
255255
else() # ON OR AUTO
256+
set(OpenMP_RUNTIME_MSVC "llvm")
256257
find_package(OpenMP)
257258

258259
if (OPENMP_FOUND)

src/aliceVision/alicevision_omp.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ inline int omp_get_thread_num() { return 0; }
1717
inline int omp_get_max_threads() { return 1; }
1818
inline void omp_set_num_threads(int num_threads) {}
1919
inline int omp_get_num_procs() { return 1; }
20-
inline void omp_set_nested(int nested) {}
20+
inline void omp_set_max_active_levels(int levels) {}
2121

2222
inline void omp_init_lock(omp_lock_t* lock) {}
2323
inline void omp_destroy_lock(omp_lock_t* lock) {}

src/aliceVision/featureEngine/FeatureExtractor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ void FeatureExtractor::process(const HardwareContext& hContext, const image::EIm
149149
nbThreads = std::min(cpuJobs.size(), nbThreads);
150150

151151
ALICEVISION_LOG_INFO("# threads for extraction: " << nbThreads);
152-
omp_set_nested(1);
152+
omp_set_max_active_levels(2);
153153

154154
#pragma omp parallel for num_threads(nbThreads)
155155
for (int i = 0; i < cpuJobs.size(); ++i)

src/aliceVision/fuseCut/PointCloud.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ void createVerticesWithVisibilities(const StaticVector<int>& cams,
141141
for (auto& lock : locks)
142142
omp_init_lock(&lock);
143143

144-
omp_set_nested(1);
144+
omp_set_max_active_levels(2);
145145
#pragma omp parallel for num_threads(3)
146146
for (int c = 0; c < cams.size(); ++c)
147147
{
@@ -229,7 +229,7 @@ void createVerticesWithVisibilities(const StaticVector<int>& cams,
229229
}
230230
}
231231
}
232-
omp_set_nested(0);
232+
omp_set_max_active_levels(1);
233233

234234
for (auto& lock : locks)
235235
omp_destroy_lock(&lock);
@@ -294,7 +294,7 @@ void PointCloud::fuseFromDepthMaps(const StaticVector<int>& cams, const Point3d
294294

295295
ALICEVISION_LOG_INFO("Load depth maps and add points.");
296296
{
297-
omp_set_nested(1);
297+
omp_set_max_active_levels(2);
298298
#pragma omp parallel for num_threads(3)
299299
for (int c = 0; c < cams.size(); c++)
300300
{
@@ -424,7 +424,7 @@ void PointCloud::fuseFromDepthMaps(const StaticVector<int>& cams, const Point3d
424424
}
425425
}
426426
}
427-
omp_set_nested(0);
427+
omp_set_max_active_levels(1);
428428
}
429429

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

0 commit comments

Comments
 (0)