Browse Source

Skip computations in the tests when running on valgrind.

Cyril Roelandt 13 years ago
parent
commit
3b9c9c7b4c
52 changed files with 410 additions and 0 deletions
  1. 2 0
      configure.ac
  2. 6 0
      tests/core/deprecated_buffer.c
  3. 8 0
      tests/core/deprecated_func.c
  4. 6 0
      tests/core/get_current_task.c
  5. 6 0
      tests/core/insert_task.c
  6. 6 0
      tests/core/starpu_task_bundle.c
  7. 8 0
      tests/datawizard/acquire_cb_insert.c
  8. 6 0
      tests/datawizard/acquire_release.c
  9. 6 0
      tests/datawizard/acquire_release2.c
  10. 6 0
      tests/datawizard/critical_section_with_void_interface.c
  11. 10 0
      tests/datawizard/data_implicit_deps.c
  12. 10 0
      tests/datawizard/data_invalidation.c
  13. 22 0
      tests/datawizard/increment_redux.c
  14. 22 0
      tests/datawizard/increment_redux_v2.c
  15. 6 0
      tests/datawizard/interfaces/bcsr/bcsr_interface.c
  16. 6 0
      tests/datawizard/interfaces/bcsr/bcsr_opencl.c
  17. 6 0
      tests/datawizard/interfaces/block/block_interface.c
  18. 6 0
      tests/datawizard/interfaces/block/block_opencl.c
  19. 6 0
      tests/datawizard/interfaces/csr/csr_interface.c
  20. 6 0
      tests/datawizard/interfaces/csr/csr_opencl.c
  21. 6 0
      tests/datawizard/interfaces/matrix/matrix_interface.c
  22. 6 0
      tests/datawizard/interfaces/matrix/matrix_opencl.c
  23. 18 0
      tests/datawizard/interfaces/multiformat/advanced/generic.c
  24. 8 0
      tests/datawizard/interfaces/multiformat/multiformat_conversion_codelets.c
  25. 6 0
      tests/datawizard/interfaces/multiformat/multiformat_conversion_codelets_opencl.c
  26. 6 0
      tests/datawizard/interfaces/multiformat/multiformat_interface.c
  27. 6 0
      tests/datawizard/interfaces/multiformat/multiformat_opencl.c
  28. 6 0
      tests/datawizard/interfaces/variable/variable_interface.c
  29. 6 0
      tests/datawizard/interfaces/variable/variable_opencl.c
  30. 6 0
      tests/datawizard/interfaces/vector/test_vector_interface.c
  31. 6 0
      tests/datawizard/interfaces/vector/test_vector_opencl.c
  32. 12 0
      tests/datawizard/lazy_allocation.c
  33. 12 0
      tests/datawizard/manual_reduction.c
  34. 6 0
      tests/datawizard/mpi_like.c
  35. 6 0
      tests/datawizard/mpi_like_async.c
  36. 9 0
      tests/datawizard/scal.c
  37. 6 0
      tests/datawizard/scratch.c
  38. 8 0
      tests/datawizard/sync_and_notify_data.c
  39. 8 0
      tests/datawizard/sync_and_notify_data_implicit.c
  40. 9 0
      tests/datawizard/sync_and_notify_data_opencl.c
  41. 12 0
      tests/datawizard/write_only_tmp_buffer.c
  42. 6 0
      tests/errorcheck/invalid_blocking_calls.c
  43. 10 0
      tests/helper.h
  44. 10 0
      tests/opt/datawizard/wt_broadcast.c
  45. 10 0
      tests/opt/datawizard/wt_host.c
  46. 6 0
      tests/overlap/overlap.c
  47. 6 0
      tests/parallel_tasks/explicit_combined_worker.c
  48. 6 0
      tests/parallel_tasks/parallel_kernels.c
  49. 6 0
      tests/parallel_tasks/parallel_kernels_spmd.c
  50. 6 0
      tests/parallel_tasks/spmd_pgreedy.c
  51. 8 0
      tests/perfmodels/non_linear_regression_based.c
  52. 8 0
      tests/perfmodels/regression_based.c

+ 2 - 0
configure.ac

@@ -168,6 +168,8 @@ fi
 
 AC_CHECK_HEADERS([malloc.h], [AC_DEFINE([STARPU_HAVE_MALLOC_H], [1], [Define to 1 if you have the <malloc.h> header file.])])
 
+AC_CHECK_HEADERS([valgrind/valgrind.h], [AC_DEFINE([STARPU_HAVE_VALGRIND_H], [1], [Define to 1 if you have the <valgrind/valgrind.h> header file.])])
+
 # This defines HAVE_SYNC_VAL_COMPARE_AND_SWAP
 STARPU_CHECK_SYNC_VAL_COMPARE_AND_SWAP
 

+ 6 - 0
tests/core/deprecated_buffer.c

@@ -14,11 +14,17 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
+#include <config.h>
+#if STARPU_HAVE_VALGRIND_H
+#include <valgrind/valgrind.h>
+#endif
 #include <starpu.h>
 #include "../helper.h"
 
 void cpu_codelet(void *descr[], __attribute__ ((unused)) void *_args)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	int *valin = (int *)STARPU_VARIABLE_GET_PTR(descr[0]);
 	int *valout = (int *)STARPU_VARIABLE_GET_PTR(descr[1]);
 

+ 8 - 0
tests/core/deprecated_func.c

@@ -14,11 +14,17 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
+#include <config.h>
+#if STARPU_HAVE_VALGRIND_H
+#include <valgrind/valgrind.h>
+#endif
 #include <starpu.h>
 #include "../helper.h"
 
 void cpu_codelet(void *descr[], __attribute__ ((unused)) void *_args)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	int *valin = (int *)STARPU_VARIABLE_GET_PTR(descr[0]);
 	int *valout = (int *)STARPU_VARIABLE_GET_PTR(descr[1]);
 
@@ -27,6 +33,8 @@ void cpu_codelet(void *descr[], __attribute__ ((unused)) void *_args)
 
 void cpu2_codelet(void *descr[], __attribute__ ((unused)) void *_args)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	int *valin = (int *)STARPU_VARIABLE_GET_PTR(descr[0]);
 	int *valout = (int *)STARPU_VARIABLE_GET_PTR(descr[1]);
 

+ 6 - 0
tests/core/get_current_task.c

@@ -15,6 +15,10 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
+#include <config.h>
+#if STARPU_HAVE_VALGRIND_H
+#include <valgrind/valgrind.h>
+#endif
 #include <sys/time.h>
 #include <stdio.h>
 #include <unistd.h>
@@ -25,6 +29,8 @@ static unsigned ntasks = 65536;
 
 static void check_task_func(void *descr[], void *arg)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	/* We check that the returned task is valid from the codelet */
 	struct starpu_task *task = (struct starpu_task *) arg;
 	STARPU_ASSERT(task == starpu_task_get_current());

+ 6 - 0
tests/core/insert_task.c

@@ -14,11 +14,17 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
+#include <config.h>
+#if STARPU_HAVE_VALGRIND_H
+#include <valgrind/valgrind.h>
+#endif
 #include <starpu.h>
 #include "../helper.h"
 
 void func_cpu(void *descr[], void *_args)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	int *x0 = (int *)STARPU_VARIABLE_GET_PTR(descr[0]);
 	float *x1 = (float *)STARPU_VARIABLE_GET_PTR(descr[1]);
 	int ifactor;

+ 6 - 0
tests/core/starpu_task_bundle.c

@@ -14,6 +14,10 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
+#include <config.h>
+#if STARPU_HAVE_VALGRIND_H
+#include <valgrind/valgrind.h>
+#endif
 #include <starpu.h>
 #include "../helper.h"
 
@@ -22,6 +26,8 @@
 
 void func_cpu(void *descr[], void *args)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	float *x = (float *) STARPU_VARIABLE_GET_PTR(descr[0]);
 	float factor;
 

+ 8 - 0
tests/datawizard/acquire_cb_insert.c

@@ -14,6 +14,10 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
+#include <config.h>
+#if STARPU_HAVE_VALGRIND_H
+#include <valgrind/valgrind.h>
+#endif
 #include <starpu.h>
 #include "../helper.h"
 
@@ -23,6 +27,8 @@
 
 void which_index_cpu(void *descr[], void *_args)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	int *x0 = (int *)STARPU_VARIABLE_GET_PTR(descr[0]);
 
 	/* A real case would actually compute something */
@@ -39,6 +45,8 @@ struct starpu_codelet which_index =
 
 void work_cpu(void *descr[], void *_args)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	int i, n = STARPU_VECTOR_GET_NX(descr[0]);
 	float *x0 = (float *)STARPU_VECTOR_GET_PTR(descr[0]);
 

+ 6 - 0
tests/datawizard/acquire_release.c

@@ -15,6 +15,10 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
+#include <config.h>
+#if STARPU_HAVE_VALGRIND_H
+#include <valgrind/valgrind.h>
+#endif
 #include <starpu.h>
 #include "../helper.h"
 
@@ -26,6 +30,8 @@ extern void increment_cuda(void *descr[], __attribute__ ((unused)) void *_args);
 
 void increment_cpu(void *descr[], __attribute__ ((unused)) void *_args)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	unsigned *tokenptr = (unsigned *)STARPU_VARIABLE_GET_PTR(descr[0]);
 	(*tokenptr)++;
 }

+ 6 - 0
tests/datawizard/acquire_release2.c

@@ -14,6 +14,10 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
+#include <config.h>
+#if STARPU_HAVE_VALGRIND_H
+#include <valgrind/valgrind.h>
+#endif
 #include <starpu.h>
 #include "../helper.h"
 
@@ -25,6 +29,8 @@ extern void increment_cuda(void *descr[], __attribute__ ((unused)) void *_args);
 
 void increment_cpu(void *descr[], __attribute__ ((unused)) void *_args)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	unsigned *tokenptr = (unsigned *)STARPU_VARIABLE_GET_PTR(descr[0]);
 	(*tokenptr)++;
 }

+ 6 - 0
tests/datawizard/critical_section_with_void_interface.c

@@ -15,6 +15,10 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
+#include <config.h>
+#if STARPU_HAVE_VALGRIND_H
+#include <valgrind/valgrind.h>
+#endif
 #include <stdio.h>
 #include <unistd.h>
 #include <errno.h>
@@ -28,6 +32,8 @@ int critical_var;
 
 static void critical_section(void *descr[], __attribute__ ((unused)) void *_args)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	/* We do not protect this variable because it is only accessed when the
 	 * "void_handle" piece of data is accessed. */
 	critical_var++;

+ 10 - 0
tests/datawizard/data_implicit_deps.c

@@ -15,6 +15,10 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
+#include <config.h>
+#if STARPU_HAVE_VALGRIND_H
+#include <valgrind/valgrind.h>
+#endif
 #include <stdio.h>
 #include <unistd.h>
 #include <errno.h>
@@ -31,6 +35,8 @@ static unsigned var = 0;
 
 static void f(void *descr[], __attribute__ ((unused)) void *_args)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	usleep(200000);
 }
 
@@ -45,6 +51,8 @@ static struct starpu_codelet cl_f =
 
 static void g(void *descr[], __attribute__ ((unused)) void *_args)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	usleep(100000);
 	var = 42;
 }
@@ -60,6 +68,8 @@ static struct starpu_codelet cl_g =
 
 static void h(void *descr[], __attribute__ ((unused)) void *_args)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	FPRINTF(stderr, "VAR %u (should be 42)\n", var);
 	STARPU_ASSERT(var == 42);
 }

+ 10 - 0
tests/datawizard/data_invalidation.c

@@ -15,6 +15,10 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
+#include <config.h>
+#if STARPU_HAVE_VALGRIND_H
+#include <valgrind/valgrind.h>
+#endif
 #include <stdio.h>
 #include <unistd.h>
 #include <errno.h>
@@ -35,6 +39,8 @@ static starpu_data_handle_t v_handle;
 #ifdef STARPU_USE_CUDA
 static void cuda_memset_codelet(void *descr[], __attribute__ ((unused)) void *_args)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	char *buf = (char *)STARPU_VECTOR_GET_PTR(descr[0]);
 	unsigned length = STARPU_VECTOR_GET_NX(descr[0]);
 
@@ -45,6 +51,8 @@ static void cuda_memset_codelet(void *descr[], __attribute__ ((unused)) void *_a
 
 static void cpu_memset_codelet(void *descr[], __attribute__ ((unused)) void *_args)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	char *buf = (char *)STARPU_VECTOR_GET_PTR(descr[0]);
 	unsigned length = STARPU_VECTOR_GET_NX(descr[0]);
 
@@ -68,6 +76,8 @@ static struct starpu_codelet memset_cl =
 
 static void cpu_check_content_codelet(void *descr[], __attribute__ ((unused)) void *_args)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	char *buf = (char *)STARPU_VECTOR_GET_PTR(descr[0]);
 	unsigned length = STARPU_VECTOR_GET_NX(descr[0]);
 

+ 22 - 0
tests/datawizard/increment_redux.c

@@ -15,6 +15,10 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
+#include <config.h>
+#if STARPU_HAVE_VALGRIND_H
+#include <valgrind/valgrind.h>
+#endif
 #include <starpu.h>
 #include "../helper.h"
 
@@ -36,6 +40,8 @@ static starpu_data_handle_t handle;
 #ifdef STARPU_USE_CUDA
 static void redux_cuda_kernel(void *descr[], void *arg)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	unsigned *dst = (unsigned *)STARPU_VARIABLE_GET_PTR(descr[0]);
 	unsigned *src = (unsigned *)STARPU_VARIABLE_GET_PTR(descr[1]);
 
@@ -54,6 +60,8 @@ static void redux_cuda_kernel(void *descr[], void *arg)
 
 static void neutral_cuda_kernel(void *descr[], void *arg)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	unsigned *dst = (unsigned *)STARPU_VARIABLE_GET_PTR(descr[0]);
 
 	/* This is a dummy technique of course */
@@ -66,6 +74,8 @@ static void neutral_cuda_kernel(void *descr[], void *arg)
 #ifdef STARPU_USE_OPENCL
 static void redux_opencl_kernel(void *descr[], void *arg)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	unsigned h_dst, h_src;
 
 	cl_mem d_dst = (cl_mem)STARPU_VARIABLE_GET_PTR(descr[0]);
@@ -85,6 +95,8 @@ static void redux_opencl_kernel(void *descr[], void *arg)
 
 static void neutral_opencl_kernel(void *descr[], void *arg)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	unsigned h_dst = 0;
 	cl_mem d_dst = (cl_mem)STARPU_VARIABLE_GET_PTR(descr[0]);
 
@@ -99,6 +111,8 @@ static void neutral_opencl_kernel(void *descr[], void *arg)
 
 static void redux_cpu_kernel(void *descr[], void *arg)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	unsigned *dst = (unsigned *)STARPU_VARIABLE_GET_PTR(descr[0]);
 	unsigned *src = (unsigned *)STARPU_VARIABLE_GET_PTR(descr[1]);
 	*dst = *dst + *src;
@@ -106,6 +120,8 @@ static void redux_cpu_kernel(void *descr[], void *arg)
 
 static void neutral_cpu_kernel(void *descr[], void *arg)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	unsigned *dst = (unsigned *)STARPU_VARIABLE_GET_PTR(descr[0]);
 	*dst = 0;
 }
@@ -144,6 +160,8 @@ static struct starpu_codelet neutral_cl =
 /* dummy OpenCL implementation */
 static void increment_opencl_kernel(void *descr[], void *cl_arg __attribute__((unused)))
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	cl_mem d_token = (cl_mem)STARPU_VARIABLE_GET_PTR(descr[0]);
 	unsigned h_token;
 
@@ -160,6 +178,8 @@ static void increment_opencl_kernel(void *descr[], void *cl_arg __attribute__((u
 #ifdef STARPU_USE_CUDA
 static void increment_cuda_kernel(void *descr[], void *arg)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	unsigned *tokenptr = (unsigned *)STARPU_VARIABLE_GET_PTR(descr[0]);
 	unsigned host_token;
 
@@ -176,6 +196,8 @@ static void increment_cuda_kernel(void *descr[], void *arg)
 
 static void increment_cpu_kernel(void *descr[], void *arg)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	unsigned *tokenptr = (unsigned *)STARPU_VARIABLE_GET_PTR(descr[0]);
 	*tokenptr = *tokenptr + 1;
 }

+ 22 - 0
tests/datawizard/increment_redux_v2.c

@@ -14,6 +14,10 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
+#include <config.h>
+#if STARPU_HAVE_VALGRIND_H
+#include <valgrind/valgrind.h>
+#endif
 #include <starpu.h>
 #include "../helper.h"
 
@@ -35,6 +39,8 @@ static starpu_data_handle_t handle;
 #ifdef STARPU_USE_CUDA
 static void redux_cuda_kernel(void *descr[], void *arg)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	unsigned *dst = (unsigned *)STARPU_VARIABLE_GET_PTR(descr[0]);
 	unsigned *src = (unsigned *)STARPU_VARIABLE_GET_PTR(descr[1]);
 
@@ -53,6 +59,8 @@ static void redux_cuda_kernel(void *descr[], void *arg)
 
 static void neutral_cuda_kernel(void *descr[], void *arg)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	unsigned *dst = (unsigned *)STARPU_VARIABLE_GET_PTR(descr[0]);
 
 	/* This is a dummy technique of course */
@@ -65,6 +73,8 @@ static void neutral_cuda_kernel(void *descr[], void *arg)
 #ifdef STARPU_USE_OPENCL
 static void redux_opencl_kernel(void *descr[], void *arg)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	unsigned h_dst, h_src;
 
 	cl_mem d_dst = (cl_mem)STARPU_VARIABLE_GET_PTR(descr[0]);
@@ -84,6 +94,8 @@ static void redux_opencl_kernel(void *descr[], void *arg)
 
 static void neutral_opencl_kernel(void *descr[], void *arg)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	unsigned h_dst = 0;
 	cl_mem d_dst = (cl_mem)STARPU_VARIABLE_GET_PTR(descr[0]);
 
@@ -98,6 +110,8 @@ static void neutral_opencl_kernel(void *descr[], void *arg)
 
 static void redux_cpu_kernel(void *descr[], void *arg)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	unsigned *dst = (unsigned *)STARPU_VARIABLE_GET_PTR(descr[0]);
 	unsigned *src = (unsigned *)STARPU_VARIABLE_GET_PTR(descr[1]);
 	*dst = *dst + *src;
@@ -105,6 +119,8 @@ static void redux_cpu_kernel(void *descr[], void *arg)
 
 static void neutral_cpu_kernel(void *descr[], void *arg)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	unsigned *dst = (unsigned *)STARPU_VARIABLE_GET_PTR(descr[0]);
 	*dst = 0;
 }
@@ -143,6 +159,8 @@ static struct starpu_codelet neutral_cl =
 /* dummy OpenCL implementation */
 static void increment_opencl_kernel(void *descr[], void *cl_arg __attribute__((unused)))
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	cl_mem d_token = (cl_mem)STARPU_VARIABLE_GET_PTR(descr[0]);
 	unsigned h_token;
 
@@ -159,6 +177,8 @@ static void increment_opencl_kernel(void *descr[], void *cl_arg __attribute__((u
 #ifdef STARPU_USE_CUDA
 static void increment_cuda_kernel(void *descr[], void *arg)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	unsigned *tokenptr = (unsigned *)STARPU_VARIABLE_GET_PTR(descr[0]);
 	unsigned host_token;
 
@@ -175,6 +195,8 @@ static void increment_cuda_kernel(void *descr[], void *arg)
 
 static void increment_cpu_kernel(void *descr[], void *arg)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	unsigned *tokenptr = (unsigned *)STARPU_VARIABLE_GET_PTR(descr[0]);
 	*tokenptr = *tokenptr + 1;
 }

+ 6 - 0
tests/datawizard/interfaces/bcsr/bcsr_interface.c

@@ -14,6 +14,10 @@
  *
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
+#include <config.h>
+#if STARPU_HAVE_VALGRIND_H
+#include <valgrind/valgrind.h>
+#endif
 #include <starpu.h>
 #include "../test_interfaces.h"
 #include "../../../helper.h"
@@ -133,6 +137,8 @@ unregister_data(void)
 static void
 test_bcsr_cpu_func(void *buffers[], void *args)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	int *val;
 	int factor;
 	int i;

+ 6 - 0
tests/datawizard/interfaces/bcsr/bcsr_opencl.c

@@ -13,6 +13,10 @@
  *
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
+#include <config.h>
+#if STARPU_HAVE_VALGRIND_H
+#include <valgrind/valgrind.h>
+#endif
 #include <starpu.h>
 #include <starpu_opencl.h>
 #include "../test_interfaces.h"
@@ -24,6 +28,8 @@ static struct starpu_opencl_program opencl_program;
 void
 test_bcsr_opencl_func(void *buffers[], void *args)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	int id, devid, ret;
 	int factor = *(int *) args;
 

+ 6 - 0
tests/datawizard/interfaces/block/block_interface.c

@@ -13,6 +13,10 @@
  *
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
+#include <config.h>
+#if STARPU_HAVE_VALGRIND_H
+#include <valgrind/valgrind.h>
+#endif
 #include <starpu.h>
 #include "../test_interfaces.h"
 #include "../../../helper.h"
@@ -95,6 +99,8 @@ unregister_data(void)
 
 static void test_block_cpu_func(void *buffers[], void *args)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	int factor = *(int*)args;
 	int nx = STARPU_BLOCK_GET_NX(buffers[0]);
 	int ny = STARPU_BLOCK_GET_NY(buffers[0]);

+ 6 - 0
tests/datawizard/interfaces/block/block_opencl.c

@@ -13,6 +13,10 @@
  *
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
+#include <config.h>
+#if STARPU_HAVE_VALGRIND_H
+#include <valgrind/valgrind.h>
+#endif
 #include <starpu.h>
 #include <starpu_opencl.h>
 #include "../test_interfaces.h"
@@ -24,6 +28,8 @@ static struct starpu_opencl_program opencl_program;
 void
 test_block_opencl_func(void *buffers[], void *args)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	int id, devid, ret;
 	int factor = *(int *) args;
 

+ 6 - 0
tests/datawizard/interfaces/csr/csr_interface.c

@@ -13,6 +13,10 @@
  *
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
+#include <config.h>
+#if STARPU_HAVE_VALGRIND_H
+#include <valgrind/valgrind.h>
+#endif
 #include <starpu.h>
 #include "../test_interfaces.h"
 #include "../../../helper.h"
@@ -115,6 +119,8 @@ unregister_data(void)
 static void
 test_csr_cpu_func(void *buffers[], void *args)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	int *val;
 	int factor;
 	int i;

+ 6 - 0
tests/datawizard/interfaces/csr/csr_opencl.c

@@ -13,6 +13,10 @@
  *
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
+#include <config.h>
+#if STARPU_HAVE_VALGRIND_H
+#include <valgrind/valgrind.h>
+#endif
 #include <starpu.h>
 #include <starpu_opencl.h>
 #include "../test_interfaces.h"
@@ -24,6 +28,8 @@ static struct starpu_opencl_program opencl_program;
 void
 test_csr_opencl_func(void *buffers[], void *args)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	int id, devid, ret;
 	int factor = *(int *) args;
 

+ 6 - 0
tests/datawizard/interfaces/matrix/matrix_interface.c

@@ -13,6 +13,10 @@
  *
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
+#include <config.h>
+#if STARPU_HAVE_VALGRIND_H
+#include <valgrind/valgrind.h>
+#endif
 #include <starpu.h>
 #include "../test_interfaces.h"
 #include "../../../helper.h"
@@ -88,6 +92,8 @@ unregister_data(void)
 static void
 test_matrix_cpu_func(void *buffers[], void *args)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	int *val;
 	int factor;
 	int i;

+ 6 - 0
tests/datawizard/interfaces/matrix/matrix_opencl.c

@@ -12,6 +12,10 @@
  *
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
+#include <config.h>
+#if STARPU_HAVE_VALGRIND_H
+#include <valgrind/valgrind.h>
+#endif
 #include <starpu.h>
 #include <starpu_opencl.h>
 #include "../test_interfaces.h"
@@ -23,6 +27,8 @@ static struct starpu_opencl_program matrix_program;
 
 void test_matrix_opencl_func(void *buffers[], void *args)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	int id, devid, factor, ret;
 	unsigned int n;
 

+ 18 - 0
tests/datawizard/interfaces/multiformat/advanced/generic.c

@@ -13,6 +13,10 @@
  *
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
+#include <config.h>
+#if STARPU_HAVE_VALGRIND_H
+#include <valgrind/valgrind.h>
+#endif
 #include <starpu_data_interfaces.h>
 #include "generic.h"
 #include "../../../../helper.h"
@@ -22,6 +26,8 @@ struct stats global_stats;
 #ifdef STARPU_USE_CPU
 void cpu_func(void *buffers[], void *args)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	global_stats.cpu++;
 }
 #endif /* !STARPU_USE_CPU */
@@ -29,16 +35,22 @@ void cpu_func(void *buffers[], void *args)
 #ifdef STARPU_USE_CUDA
 void cuda_func(void *buffers[], void *args)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	global_stats.cuda++;
 }
 
 void cpu_to_cuda_func(void *buffers[], void *args)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	global_stats.cpu_to_cuda++;
 }
 
 void cuda_to_cpu_func(void *buffers[], void *args)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	global_stats.cuda_to_cpu++;
 }
 
@@ -60,16 +72,22 @@ struct starpu_codelet cuda_to_cpu_cl =
 #ifdef STARPU_USE_OPENCL
 void opencl_func(void *buffers[], void *args)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	global_stats.opencl++;
 }
 
 void cpu_to_opencl_func(void *buffers[], void *args)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	global_stats.cpu_to_opencl++;
 }
 
 void opencl_to_cpu_func(void *buffers[], void *args)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	global_stats.opencl_to_cpu++;
 }
 

+ 8 - 0
tests/datawizard/interfaces/multiformat/multiformat_conversion_codelets.c

@@ -13,6 +13,10 @@
  *
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
+#include <config.h>
+#if STARPU_HAVE_VALGRIND_H
+#include <valgrind/valgrind.h>
+#endif
 #include <starpu.h>
 #include "multiformat_types.h"
 #include "../../../helper.h"
@@ -20,6 +24,8 @@
 #ifdef STARPU_USE_CUDA
 void cuda_to_cpu(void *buffers[], void *arg)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	FPRINTF(stderr, "Entering %s\n", __func__);
 	struct struct_of_arrays *src = STARPU_MULTIFORMAT_GET_CUDA_PTR(buffers[0]);
 	struct point *dst = STARPU_MULTIFORMAT_GET_PTR(buffers[0]);
@@ -50,6 +56,8 @@ struct starpu_codelet cuda_to_cpu_cl =
 #ifdef STARPU_USE_OPENCL
 void opencl_to_cpu(void *buffers[], void *arg)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	struct struct_of_arrays *src = STARPU_MULTIFORMAT_GET_OPENCL_PTR(buffers[0]);
 	struct point *dst = STARPU_MULTIFORMAT_GET_PTR(buffers[0]);
 	int n = STARPU_MULTIFORMAT_GET_NX(buffers[0]);

+ 6 - 0
tests/datawizard/interfaces/multiformat/multiformat_conversion_codelets_opencl.c

@@ -15,6 +15,10 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
+#include <config.h>
+#if STARPU_HAVE_VALGRIND_H
+#include <valgrind/valgrind.h>
+#endif
 #include <starpu.h>
 #include <starpu_opencl.h>
 #include "../../../helper.h"
@@ -24,6 +28,8 @@ static struct starpu_opencl_program opencl_conversion_program;
 
 void cpu_to_opencl_opencl_func(void *buffers[], void *args)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	(void) args;
 	int id, devid, ret;
         cl_int err;

+ 6 - 0
tests/datawizard/interfaces/multiformat/multiformat_interface.c

@@ -13,6 +13,10 @@
  *
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
+#include <config.h>
+#if STARPU_HAVE_VALGRIND_H
+#include <valgrind/valgrind.h>
+#endif
 #include <starpu.h>
 #include "multiformat_types.h"
 #include "../test_interfaces.h"
@@ -50,6 +54,8 @@ struct test_config multiformat_config =
 static void
 test_multiformat_cpu_func(void *buffers[], void *args)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	struct point *aos;
 	unsigned int n, i;
 	int factor;

+ 6 - 0
tests/datawizard/interfaces/multiformat/multiformat_opencl.c

@@ -12,6 +12,10 @@
  *
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
+#include <config.h>
+#if STARPU_HAVE_VALGRIND_H
+#include <valgrind/valgrind.h>
+#endif
 #include <starpu.h>
 #include <starpu_opencl.h>
 #include "../test_interfaces.h"
@@ -23,6 +27,8 @@ static struct starpu_opencl_program multiformat_program;
 
 void test_multiformat_opencl_func(void *buffers[], void *args)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	int id, devid, factor, ret;
 	unsigned int n;
 

+ 6 - 0
tests/datawizard/interfaces/variable/variable_interface.c

@@ -13,6 +13,10 @@
  *
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
+#include <config.h>
+#if STARPU_HAVE_VALGRIND_H
+#include <valgrind/valgrind.h>
+#endif
 #include <starpu.h>
 #include "../test_interfaces.h"
 
@@ -52,6 +56,8 @@ struct test_config variable_config =
 static void
 test_variable_cpu_func(void *buffers[], void *args)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	int *val;
 	int factor;
 

+ 6 - 0
tests/datawizard/interfaces/variable/variable_opencl.c

@@ -13,6 +13,10 @@
  *
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
+#include <config.h>
+#if STARPU_HAVE_VALGRIND_H
+#include <valgrind/valgrind.h>
+#endif
 #include <starpu.h>
 #include <starpu_opencl.h>
 #include "../test_interfaces.h"
@@ -24,6 +28,8 @@ static struct starpu_opencl_program opencl_program;
 
 void test_variable_opencl_func(void *buffers[], void *args)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	int id, devid, ret;
 	int factor = *(int *) args;
 

+ 6 - 0
tests/datawizard/interfaces/vector/test_vector_interface.c

@@ -13,6 +13,10 @@
  *
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
+#include <config.h>
+#if STARPU_HAVE_VALGRIND_H
+#include <valgrind/valgrind.h>
+#endif
 #include <starpu.h>
 #include "../test_interfaces.h"
 #include "../../../helper.h"
@@ -81,6 +85,8 @@ unregister_data(void)
 
 static void test_vector_cpu_func(void *buffers[], void *args)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	unsigned n = STARPU_VECTOR_GET_NX(buffers[0]);
 	int *val = (int *) STARPU_VECTOR_GET_PTR(buffers[0]);
 	int factor = *(int*)args;

+ 6 - 0
tests/datawizard/interfaces/vector/test_vector_opencl.c

@@ -13,6 +13,10 @@
  *
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
+#include <config.h>
+#if STARPU_HAVE_VALGRIND_H
+#include <valgrind/valgrind.h>
+#endif
 #include <starpu.h>
 #include <starpu_opencl.h>
 #include "../test_interfaces.h"
@@ -24,6 +28,8 @@ static struct starpu_opencl_program opencl_program;
 void
 test_vector_opencl_func(void *buffers[], void *args)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	int id, devid, ret;
 	int factor = *(int *) args;
 

+ 12 - 0
tests/datawizard/lazy_allocation.c

@@ -14,6 +14,10 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
+#include <config.h>
+#if STARPU_HAVE_VALGRIND_H
+#include <valgrind/valgrind.h>
+#endif
 #include <stdio.h>
 #include <unistd.h>
 #include <errno.h>
@@ -33,6 +37,8 @@ static starpu_data_handle_t v_handle;
 #ifdef STARPU_USE_CUDA
 static void cuda_memset_codelet(void *descr[], __attribute__ ((unused)) void *_args)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	char *buf = (char *)STARPU_VECTOR_GET_PTR(descr[0]);
 	unsigned length = STARPU_VECTOR_GET_NX(descr[0]);
 
@@ -43,6 +49,8 @@ static void cuda_memset_codelet(void *descr[], __attribute__ ((unused)) void *_a
 
 static void cpu_memset_codelet(void *descr[], __attribute__ ((unused)) void *_args)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	char *buf = (char *)STARPU_VECTOR_GET_PTR(descr[0]);
 	unsigned length = STARPU_VECTOR_GET_NX(descr[0]);
 
@@ -66,6 +74,8 @@ static struct starpu_codelet memset_cl =
 
 static void cpu_check_content_codelet(void *descr[], __attribute__ ((unused)) void *_args)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	char *buf = (char *)STARPU_VECTOR_GET_PTR(descr[0]);
 	unsigned length = STARPU_VECTOR_GET_NX(descr[0]);
 
@@ -83,6 +93,8 @@ static void cpu_check_content_codelet(void *descr[], __attribute__ ((unused)) vo
 #ifdef STARPU_USE_CUDA
 static void cuda_check_content_codelet(void *descr[], __attribute__ ((unused)) void *_args)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	char *buf = (char *)STARPU_VECTOR_GET_PTR(descr[0]);
 	unsigned length = STARPU_VECTOR_GET_NX(descr[0]);
 

+ 12 - 0
tests/datawizard/manual_reduction.c

@@ -15,6 +15,10 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
+#include <config.h>
+#if STARPU_HAVE_VALGRIND_H
+#include <valgrind/valgrind.h>
+#endif
 #include <starpu.h>
 #include "../helper.h"
 
@@ -82,6 +86,8 @@ static void initialize_per_worker_handle(void *arg __attribute__((unused)))
 
 static void cpu_redux_func(void *descr[], void *cl_arg __attribute__((unused)))
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	unsigned *a = (unsigned *)STARPU_VARIABLE_GET_PTR(descr[0]);
 	unsigned *b = (unsigned *)STARPU_VARIABLE_GET_PTR(descr[1]);
 
@@ -106,6 +112,8 @@ static struct starpu_codelet reduction_codelet =
 
 static void cpu_func_incr(void *descr[], void *cl_arg __attribute__((unused)))
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	unsigned *val = (unsigned *)STARPU_VARIABLE_GET_PTR(descr[0]);
 	*val = *val + 1;
 }
@@ -114,6 +122,8 @@ static void cpu_func_incr(void *descr[], void *cl_arg __attribute__((unused)))
 /* dummy CUDA implementation */
 static void cuda_func_incr(void *descr[], void *cl_arg __attribute__((unused)))
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	unsigned *val = (unsigned *)STARPU_VARIABLE_GET_PTR(descr[0]);
 
 	unsigned h_val;
@@ -127,6 +137,8 @@ static void cuda_func_incr(void *descr[], void *cl_arg __attribute__((unused)))
 /* dummy OpenCL implementation */
 static void opencl_func_incr(void *descr[], void *cl_arg __attribute__((unused)))
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	cl_mem d_val = (cl_mem)STARPU_VARIABLE_GET_PTR(descr[0]);
 	unsigned h_val;
 

+ 6 - 0
tests/datawizard/mpi_like.c

@@ -15,6 +15,10 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
+#include <config.h>
+#if STARPU_HAVE_VALGRIND_H
+#include <valgrind/valgrind.h>
+#endif
 #include <starpu.h>
 #include <errno.h>
 #include <pthread.h>
@@ -51,6 +55,8 @@ void cuda_codelet_unsigned_inc(void *descr[], __attribute__ ((unused)) void *cl_
 
 static void increment_handle_cpu_kernel(void *descr[], void *cl_arg __attribute__((unused)))
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	unsigned *val = (unsigned *)STARPU_VARIABLE_GET_PTR(descr[0]);
 	*val += 1;
 }

+ 6 - 0
tests/datawizard/mpi_like_async.c

@@ -15,6 +15,10 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
+#include <config.h>
+#if STARPU_HAVE_VALGRIND_H
+#include <valgrind/valgrind.h>
+#endif
 #include <starpu.h>
 #include <pthread.h>
 #include "../helper.h"
@@ -64,6 +68,8 @@ void cuda_codelet_unsigned_inc(void *descr[], __attribute__ ((unused)) void *cl_
 
 static void increment_handle_cpu_kernel(void *descr[], void *cl_arg __attribute__((unused)))
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	unsigned *val = (unsigned *)STARPU_VARIABLE_GET_PTR(descr[0]);
 	*val += 1;
 

+ 9 - 0
tests/datawizard/scal.c

@@ -14,12 +14,19 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
+#include <config.h>
+#if STARPU_HAVE_VALGRIND_H
+#include <valgrind/valgrind.h>
+#endif
 #include <starpu.h>
 #include <starpu_opencl.h>
 #include "scal.h"
+#include "helper.h"
 
 void scal_func_cpu(void *buffers[], void *cl_arg)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	unsigned i;
 
 	struct starpu_vector_interface *vector = (struct starpu_vector_interface *) buffers[0];
@@ -36,6 +43,8 @@ struct starpu_opencl_program opencl_program;
 
 void scal_func_opencl(void *buffers[], void *_args)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	int id, devid;
         cl_int err;
 	cl_kernel kernel;

+ 6 - 0
tests/datawizard/scratch.c

@@ -15,6 +15,10 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
+#include <config.h>
+#if STARPU_HAVE_VALGRIND_H
+#include <valgrind/valgrind.h>
+#endif
 #include <stdio.h>
 #include <unistd.h>
 #include <errno.h>
@@ -36,6 +40,8 @@ extern void cuda_f(void *descr[], __attribute__ ((unused)) void *_args);
 
 static void cpu_f(void *descr[], __attribute__ ((unused)) void *_args)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	unsigned *v = (unsigned *)STARPU_VECTOR_GET_PTR(descr[0]);
 	unsigned *tmp = (unsigned *)STARPU_VECTOR_GET_PTR(descr[1]);
 

+ 8 - 0
tests/datawizard/sync_and_notify_data.c

@@ -15,6 +15,10 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
+#include <config.h>
+#if STARPU_HAVE_VALGRIND_H
+#include <valgrind/valgrind.h>
+#endif
 #include <stdio.h>
 #include <unistd.h>
 #include <errno.h>
@@ -63,12 +67,16 @@ static unsigned v[VECTORSIZE] __attribute__((aligned(128))) = {0, 0, 0, 0};
 
 void cpu_codelet_incA(void *descr[], __attribute__ ((unused)) void *_args)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	unsigned *val = (unsigned *)STARPU_VECTOR_GET_PTR(descr[0]);
 	val[0]++;
 }
 
 void cpu_codelet_incC(void *descr[], __attribute__ ((unused)) void *_args)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	unsigned *val = (unsigned *)STARPU_VECTOR_GET_PTR(descr[0]);
 	val[2]++;
 }

+ 8 - 0
tests/datawizard/sync_and_notify_data_implicit.c

@@ -15,6 +15,10 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
+#include <config.h>
+#if STARPU_HAVE_VALGRIND_H
+#include <valgrind/valgrind.h>
+#endif
 #include <stdio.h>
 #include <unistd.h>
 #include <errno.h>
@@ -65,12 +69,16 @@ static unsigned v[VECTORSIZE] __attribute__((aligned(128))) = {0, 0, 0, 0};
 
 void cpu_codelet_incA(void *descr[], __attribute__ ((unused)) void *_args)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	unsigned *val = (unsigned *)STARPU_VECTOR_GET_PTR(descr[0]);
 	val[0]++;
 }
 
 void cpu_codelet_incC(void *descr[], __attribute__ ((unused)) void *_args)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	unsigned *val = (unsigned *)STARPU_VECTOR_GET_PTR(descr[0]);
 	val[2]++;
 }

+ 9 - 0
tests/datawizard/sync_and_notify_data_opencl.c

@@ -15,13 +15,20 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
+#include <config.h>
+#if STARPU_HAVE_VALGRIND_H
+#include <valgrind/valgrind.h>
+#endif
 #include <starpu.h>
 #include <starpu_opencl.h>
+#include "../helper.h"
 
 extern struct starpu_opencl_program opencl_code;
 
 void opencl_codelet_incA(void *descr[], __attribute__ ((unused)) void *_args)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	cl_mem val = (cl_mem)STARPU_VECTOR_GET_DEV_HANDLE(descr[0]);
 	cl_kernel kernel;
 	cl_command_queue queue;
@@ -52,6 +59,8 @@ void opencl_codelet_incA(void *descr[], __attribute__ ((unused)) void *_args)
 
 void opencl_codelet_incC(void *descr[], __attribute__ ((unused)) void *_args)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	cl_mem val = (cl_mem)STARPU_VECTOR_GET_DEV_HANDLE(descr[0]);
 	cl_kernel kernel;
 	cl_command_queue queue;

+ 12 - 0
tests/datawizard/write_only_tmp_buffer.c

@@ -15,6 +15,10 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
+#include <config.h>
+#if STARPU_HAVE_VALGRIND_H
+#include <valgrind/valgrind.h>
+#endif
 #include <stdio.h>
 #include <unistd.h>
 #include <errno.h>
@@ -31,6 +35,8 @@ starpu_data_handle_t v_handle;
 
 static void opencl_codelet_null(void *descr[], __attribute__ ((unused)) void *_args)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	cl_mem buf = (cl_mem)STARPU_VECTOR_GET_DEV_HANDLE(descr[0]);
         char ptr = 42;
         cl_command_queue queue;
@@ -45,6 +51,8 @@ static void opencl_codelet_null(void *descr[], __attribute__ ((unused)) void *_a
 #ifdef STARPU_USE_CUDA
 static void cuda_codelet_null(void *descr[], __attribute__ ((unused)) void *_args)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	char *buf = (char *)STARPU_VECTOR_GET_PTR(descr[0]);
 
 	cudaMemset(buf, 42, 1);
@@ -53,6 +61,8 @@ static void cuda_codelet_null(void *descr[], __attribute__ ((unused)) void *_arg
 
 static void cpu_codelet_null(void *descr[], __attribute__ ((unused)) void *_args)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	char *buf = (char *)STARPU_VECTOR_GET_PTR(descr[0]);
 
 	*buf = 42;
@@ -60,6 +70,8 @@ static void cpu_codelet_null(void *descr[], __attribute__ ((unused)) void *_args
 
 static void display_var(void *descr[], __attribute__ ((unused)) void *_args)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	char *buf = (char *)STARPU_VECTOR_GET_PTR(descr[0]);
 	if (*buf != 42)
 	{

+ 6 - 0
tests/errorcheck/invalid_blocking_calls.c

@@ -15,6 +15,10 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
+#include <config.h>
+#if STARPU_HAVE_VALGRIND_H
+#include <valgrind/valgrind.h>
+#endif
 #include <starpu.h>
 #include "../helper.h"
 
@@ -25,6 +29,8 @@ static unsigned data = 42;
 
 static void wrong_func(void *descr[], void *arg)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	int ret;
 
 	/* try to fetch data in the RAM while we are in a codelet, such a

+ 10 - 0
tests/helper.h

@@ -33,3 +33,13 @@
 //#define STARPU_TEST_OUTPUT
 #define FPRINTF(ofile, fmt, args ...) do { if (!getenv("STARPU_SSILENT")) {fprintf(ofile, fmt, ##args); }} while(0)
 
+#if STARPU_HAVE_VALGRIND_H
+#define STARPU_SKIP_IF_VALGRIND do {                                                               \
+if(RUNNING_ON_VALGRIND) {                                                                          \
+	FPRINTF(stderr, "Running on valgrind, skipping the actual computations in %s\n", __func__);\
+return;                                                                                            \
+}                                                                                                  \
+} while(0)
+#else
+#define STARPU_SKIP_IF_VALGRIND
+#endif 

+ 10 - 0
tests/opt/datawizard/wt_broadcast.c

@@ -14,6 +14,10 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
+#include <config.h>
+#if STARPU_HAVE_VALGRIND_H
+#include <valgrind/valgrind.h>
+#endif
 #include <starpu.h>
 #include "../../helper.h"
 
@@ -34,6 +38,8 @@ static starpu_data_handle_t handle;
 /* dummy OpenCL implementation */
 static void increment_opencl_kernel(void *descr[], void *cl_arg __attribute__((unused)))
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	cl_mem d_token = (cl_mem)STARPU_VARIABLE_GET_PTR(descr[0]);
 	unsigned h_token;
 
@@ -50,6 +56,8 @@ static void increment_opencl_kernel(void *descr[], void *cl_arg __attribute__((u
 #ifdef STARPU_USE_CUDA
 static void increment_cuda_kernel(void *descr[], void *arg)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	unsigned *tokenptr = (unsigned *)STARPU_VARIABLE_GET_PTR(descr[0]);
 	unsigned host_token;
 
@@ -66,6 +74,8 @@ static void increment_cuda_kernel(void *descr[], void *arg)
 
 static void increment_cpu_kernel(void *descr[], void *arg)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	unsigned *tokenptr = (unsigned *)STARPU_VARIABLE_GET_PTR(descr[0]);
 	*tokenptr = *tokenptr + 1;
 }

+ 10 - 0
tests/opt/datawizard/wt_host.c

@@ -14,6 +14,10 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
+#include <config.h>
+#if STARPU_HAVE_VALGRIND_H
+#include <valgrind/valgrind.h>
+#endif
 #include <starpu.h>
 #include "../../helper.h"
 
@@ -35,6 +39,8 @@ static starpu_data_handle_t handle;
 /* dummy OpenCL implementation */
 static void increment_opencl_kernel(void *descr[], void *cl_arg __attribute__((unused)))
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	cl_mem d_token = (cl_mem)STARPU_VARIABLE_GET_PTR(descr[0]);
 	unsigned h_token;
 
@@ -51,6 +57,8 @@ static void increment_opencl_kernel(void *descr[], void *cl_arg __attribute__((u
 #ifdef STARPU_USE_CUDA
 static void increment_cuda_kernel(void *descr[], void *arg)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	unsigned *tokenptr = (unsigned *)STARPU_VARIABLE_GET_PTR(descr[0]);
 	unsigned host_token;
 
@@ -67,6 +75,8 @@ static void increment_cuda_kernel(void *descr[], void *arg)
 
 static void increment_cpu_kernel(void *descr[], void *arg)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	unsigned *tokenptr = (unsigned *)STARPU_VARIABLE_GET_PTR(descr[0]);
 	*tokenptr = *tokenptr + 1;
 }

+ 6 - 0
tests/overlap/overlap.c

@@ -16,6 +16,10 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
+#include <config.h>
+#if STARPU_HAVE_VALGRIND_H
+#include <valgrind/valgrind.h>
+#endif
 #include <stdio.h>
 #include <unistd.h>
 #include <errno.h>
@@ -51,6 +55,8 @@ static void callback(void *arg)
 
 static void codelet_sleep(void *descr[], __attribute__ ((unused)) void *_args)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	usleep(TASKDURATION);
 }
 

+ 6 - 0
tests/parallel_tasks/explicit_combined_worker.c

@@ -15,6 +15,10 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
+#include <config.h>
+#if STARPU_HAVE_VALGRIND_H
+#include <valgrind/valgrind.h>
+#endif
 #include <starpu.h>
 #include <limits.h>
 #include <unistd.h>
@@ -25,6 +29,8 @@
 
 static void codelet_null(void *descr[], __attribute__ ((unused)) void *_args)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	int worker_size = starpu_combined_worker_get_size();
 	STARPU_ASSERT(worker_size > 0);
 	usleep(1000/worker_size);

+ 6 - 0
tests/parallel_tasks/parallel_kernels.c

@@ -15,6 +15,10 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
+#include <config.h>
+#if STARPU_HAVE_VALGRIND_H
+#include <valgrind/valgrind.h>
+#endif
 #include <starpu.h>
 #include <limits.h>
 #include <unistd.h>
@@ -25,6 +29,8 @@
 
 static void codelet_null(void *descr[], __attribute__ ((unused)) void *_args)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	int worker_size = starpu_combined_worker_get_size();
 	STARPU_ASSERT(worker_size > 0);
 	usleep(1000/worker_size);

+ 6 - 0
tests/parallel_tasks/parallel_kernels_spmd.c

@@ -15,6 +15,10 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
+#include <config.h>
+#if STARPU_HAVE_VALGRIND_H
+#include <valgrind/valgrind.h>
+#endif
 #include <starpu.h>
 #include <limits.h>
 #include <unistd.h>
@@ -25,6 +29,8 @@
 
 static void codelet_null(void *descr[], __attribute__ ((unused)) void *_args)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	int worker_size = starpu_combined_worker_get_size();
 	STARPU_ASSERT(worker_size > 0);
 

+ 6 - 0
tests/parallel_tasks/spmd_pgreedy.c

@@ -14,6 +14,10 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
+#include <config.h>
+#if STARPU_HAVE_VALGRIND_H
+#include <valgrind/valgrind.h>
+#endif
 #include <starpu.h>
 #include <limits.h>
 #include <unistd.h>
@@ -27,6 +31,8 @@ static unsigned *v;
 
 static void codelet_null(void *descr[], __attribute__ ((unused)) void *_args)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	int worker_size = starpu_combined_worker_get_size();
 	STARPU_ASSERT(worker_size > 0);
 

+ 8 - 0
tests/perfmodels/non_linear_regression_based.c

@@ -15,12 +15,18 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
+#include <config.h>
+#if STARPU_HAVE_VALGRIND_H
+#include <valgrind/valgrind.h>
+#endif
 #include <starpu.h>
 #include "../helper.h"
 
 #ifdef STARPU_USE_CUDA
 static void memset_cuda(void *descr[], void *arg)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	int *ptr = (int *)STARPU_VECTOR_GET_PTR(descr[0]);
 	unsigned n = STARPU_VECTOR_GET_NX(descr[0]);
 
@@ -31,6 +37,8 @@ static void memset_cuda(void *descr[], void *arg)
 
 static void memset_cpu(void *descr[], void *arg)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	int *ptr = (int *)STARPU_VECTOR_GET_PTR(descr[0]);
 	unsigned n = STARPU_VECTOR_GET_NX(descr[0]);
 

+ 8 - 0
tests/perfmodels/regression_based.c

@@ -15,12 +15,18 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
+#include <config.h>
+#if STARPU_HAVE_VALGRIND_H
+#include <valgrind/valgrind.h>
+#endif
 #include <starpu.h>
 #include "../helper.h"
 
 #ifdef STARPU_USE_CUDA
 static void memset_cuda(void *descr[], void *arg)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	int *ptr = (int *)STARPU_VECTOR_GET_PTR(descr[0]);
 	unsigned n = STARPU_VECTOR_GET_NX(descr[0]);
 
@@ -31,6 +37,8 @@ static void memset_cuda(void *descr[], void *arg)
 
 static void memset_cpu(void *descr[], void *arg)
 {
+	STARPU_SKIP_IF_VALGRIND;
+
 	int *ptr = (int *)STARPU_VECTOR_GET_PTR(descr[0]);
 	unsigned n = STARPU_VECTOR_GET_NX(descr[0]);