Some of the tests are quite heavy CPU users and may benefit from
using multiple CPU cores, so the programs from 'test' directory
are now built with OpenMP support. OpenMP is easy to use, portable
and also takes care of making a decision about how many threads
to spawn.
AC_C_BIGENDIAN
AC_C_INLINE
+# Check for OpenMP support (only supported by autoconf >=2.62)
+OPENMP_CFLAGS=
+m4_ifdef([AC_OPENMP], [AC_OPENMP], [AC_SUBST(OPENMP_CFLAGS)])
+
AC_CHECK_SIZEOF(long)
# Checks for Sun Studio compilers
+AM_CFLAGS = @OPENMP_CFLAGS@
+AM_LDFLAGS = @OPENMP_CFLAGS@
+
TEST_LDADD = $(top_builddir)/pixman/libpixman-1.la
INCLUDES = -I$(top_srcdir)/pixman -I$(top_builddir)/pixman
n2 = default_number_of_iterations;
}
+ #pragma omp parallel for reduction(+:checksum) default(none) \
+ shared(n1, n2, test_function, verbose)
for (i = n1; i <= n2; i++)
{
uint32_t crc = test_function (i, 0);
*/
extern uint32_t lcg_seed;
+#pragma omp threadprivate(lcg_seed)
static inline uint32_t
lcg_rand (void)