Files
opencv-mobile/patches/opencv-4.11.0-no-atomic.patch
nihui 589a38adf9 update opencv 4.11.0 (#181)
* save kleidicv
2025-03-21 21:59:44 +08:00

37 lines
1.5 KiB
Diff

diff -Nuarp opencv-4.11.0.orig/modules/core/src/mathfuncs.cpp opencv-4.11.0/modules/core/src/mathfuncs.cpp
--- opencv-4.11.0.orig/modules/core/src/mathfuncs.cpp 2025-01-18 23:31:52.827608643 +0800
+++ opencv-4.11.0/modules/core/src/mathfuncs.cpp 2025-01-18 23:55:21.143734178 +0800
@@ -2170,8 +2170,13 @@ const double* getExpTab64f()
const float* getExpTab32f()
{
static float CV_DECL_ALIGNED(64) expTab_f[EXPTAB_MASK+1];
+#ifndef OPENCV_DISABLE_THREAD_SUPPORT
static std::atomic<bool> expTab_f_initialized(false);
if (!expTab_f_initialized.load())
+#else
+ static bool expTab_f_initialized = false;
+ if (!expTab_f_initialized)
+#endif
{
for( int j = 0; j <= EXPTAB_MASK; j++ )
expTab_f[j] = (float)expTab[j];
diff -Nuarp opencv-4.11.0.orig/modules/core/src/parallel.cpp opencv-4.11.0/modules/core/src/parallel.cpp
--- opencv-4.11.0.orig/modules/core/src/parallel.cpp 2025-01-18 23:43:48.356574419 +0800
+++ opencv-4.11.0/modules/core/src/parallel.cpp 2025-01-18 23:55:21.143734178 +0800
@@ -497,6 +497,7 @@ void parallel_for_(const cv::Range& rang
if (range.empty())
return;
+#ifndef OPENCV_DISABLE_THREAD_SUPPORT
static std::atomic<bool> flagNestedParallelFor(false);
bool isNotNestedRegion = !flagNestedParallelFor.load();
if (isNotNestedRegion)
@@ -509,6 +510,7 @@ void parallel_for_(const cv::Range& rang
}
}
else // nested parallel_for_() calls are not parallelized
+#endif
{
CV_UNUSED(nstripes);
body(range);