51 lines
1.7 KiB
Diff
51 lines
1.7 KiB
Diff
|
Index: gmic-1.5.8.4/src/CImg.h
|
||
|
===================================================================
|
||
|
--- gmic-1.5.8.4.orig/src/CImg.h
|
||
|
+++ gmic-1.5.8.4/src/CImg.h
|
||
|
@@ -220,8 +220,13 @@
|
||
|
// OpenMP directives may be used in a (very) few CImg functions to get
|
||
|
// advantages of multi-core CPUs.
|
||
|
#ifdef cimg_use_openmp
|
||
|
#include "omp.h"
|
||
|
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
|
||
|
+#define COLLAPSE(x) collapse(x)
|
||
|
+#else
|
||
|
+#define COLLAPSE(x)
|
||
|
+#endif
|
||
|
#endif
|
||
|
|
||
|
// Configure OpenCV support.
|
||
|
// (http://opencv.willowgarage.com/wiki/)
|
||
|
@@ -24304,27 +24309,27 @@ namespace cimg_library_suffixed {
|
||
|
|
||
|
switch (naxis) {
|
||
|
case 'x' : {
|
||
|
#ifdef cimg_use_openmp
|
||
|
-#pragma omp parallel for collapse(3)
|
||
|
+#pragma omp parallel for COLLAPSE(3)
|
||
|
#endif
|
||
|
cimg_forYZC(*this,y,z,c) _cimg_recursive_apply<4>(data(0,y,z,c),filter,_width,1U,order,boundary_conditions);
|
||
|
} break;
|
||
|
case 'y' : {
|
||
|
#ifdef cimg_use_openmp
|
||
|
-#pragma omp parallel for collapse(3)
|
||
|
+#pragma omp parallel for COLLAPSE(3)
|
||
|
#endif
|
||
|
cimg_forXZC(*this,x,z,c) _cimg_recursive_apply<4>(data(x,0,z,c),filter,_height,(unsigned long)_width,order,boundary_conditions);
|
||
|
} break;
|
||
|
case 'z' : {
|
||
|
#ifdef cimg_use_openmp
|
||
|
-#pragma omp parallel for collapse(3)
|
||
|
+#pragma omp parallel for COLLAPSE(3)
|
||
|
#endif
|
||
|
cimg_forXYC(*this,x,y,c) _cimg_recursive_apply<4>(data(x,y,0,c),filter,_depth,(unsigned long)(_width*_height),order,boundary_conditions);
|
||
|
} break;
|
||
|
default : {
|
||
|
#ifdef cimg_use_openmp
|
||
|
-#pragma omp parallel for collapse(3)
|
||
|
+#pragma omp parallel for COLLAPSE(3)
|
||
|
#endif
|
||
|
cimg_forXYZ(*this,x,y,z) _cimg_recursive_apply<4>(data(x,y,z,0),filter,_spectrum,(unsigned long)(_width*_height*_depth),order,boundary_conditions);
|
||
|
}
|
||
|
}
|