summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fd4f8ef)
raw | patch | inline | side by side (parent: fd4f8ef)
author | joncruz <joncruz@users.sourceforge.net> | |
Tue, 25 Nov 2008 03:44:36 +0000 (03:44 +0000) | ||
committer | joncruz <joncruz@users.sourceforge.net> | |
Tue, 25 Nov 2008 03:44:36 +0000 (03:44 +0000) |
configure.ac | patch | blob | history | |
src/display/nr-filter-gaussian.cpp | patch | blob | history |
diff --git a/configure.ac b/configure.ac
index 37c4ddb04f150b397eb388302bac1f9526920b17..d33502000321917be2033bccda7f836301b95e64 100644 (file)
--- a/configure.ac
+++ b/configure.ac
dnl Check for OpenMP
dnl ******************************
-AX_OPENMP(,AC_MSG_ERROR([Inkscape requires OpenMP support to build]))
-dnl We have it, now set up the flags
-CXXFLAGS="$CXXFLAGS $OPENMP_CXXFLAGS"
-AC_CHECK_HEADER(omp.h)
+AX_OPENMP([openmp_ok=yes],[openmp_ok=no])
+AC_MSG_CHECKING([for OpenMP support])
+dnl a bit odd, but AX_OPENMP does its own check message, so we're not wrapping it at the moment
+AC_MSG_RESULT([$openmp_ok])
+if test "x$openmp_ok" = "xyes"; then
+ dnl We have it, now set up the flags
+ CXXFLAGS="$CXXFLAGS $OPENMP_CXXFLAGS"
+ AC_CHECK_HEADER(omp.h)
+fi
+
dnl ******************************
dnl Check for libpng
fi
dnl Shouldn't we test for libpng and libz?
-INKSCAPE_LIBS="$INKSCAPE_LIBS -lpng -lz -lgomp"
+if test "x$openmp_ok" = "xyes"; then
+ INKSCAPE_LIBS="$INKSCAPE_LIBS -lpng -lz -lgomp"
+else
+ INKSCAPE_LIBS="$INKSCAPE_LIBS -lpng -lz"
+fi
AC_CHECK_HEADER(popt.h,
[INKSCAPE_LIBS="$INKSCAPE_LIBS -lpopt"],
index 4cbd7957dce2461e5f8315a3dea942f2d840822b..d92a7f7f39358f9c6d604ee561abca64f87e786c 100644 (file)
#include <cstdlib>
#include <glib.h>
#include <limits>
+#if HAVE_OPENMP
#include <omp.h>
+#endif //HAVE_OPENMP
#include "2geom/isnan.h"
int const n1, int const n2, IIRValue const b[N+1], double const M[N*N],
IIRValue *const tmpdata[], int const num_threads)
{
+#if HAVE_OPENMP
#pragma omp parallel for num_threads(num_threads)
+#endif // HAVE_OPENMP
for ( int c2 = 0 ; c2 < n2 ; c2++ ) {
+#if HAVE_OPENMP
unsigned int tid = omp_get_thread_num();
+#else
+ unsigned int tid = 0;
+#endif // HAVE_OPENMP
// corresponding line in the source and output buffer
PT const * srcimg = src + c2*sstr2;
PT * dstimg = dest + c2*dstr2 + n1*dstr1;
// Past pixels seen (to enable in-place operation)
PT history[scr_len+1][PC];
+#if HAVE_OPENMP
#pragma omp parallel for num_threads(num_threads) private(history)
+#endif // HAVE_OPENMP
for ( int c2 = 0 ; c2 < n2 ; c2++ ) {
// corresponding line in the source buffer
double const deviation_x_org = _deviation_x * NR::expansionX(trans);
double const deviation_y_org = _deviation_y * NR::expansionY(trans);
int const PC = NR_PIXBLOCK_BPP(in);
+#if HAVE_OPENMP
int const NTHREADS = std::max(1,std::min(8,prefs->getInt("/options/threading/numthreads",omp_get_num_procs())));
+#else
+ int const NTHREADS = 1;
+#endif // HAVE_OPENMP
// Subsampling constants
int const quality = prefs->getInt("/options/blurquality/value");