Ver código fonte

tests/helper.h: new macro STARPU_SKIP_IF_VALGRIND_RETURN_0 which return 0 when running on valgrind

Nathalie Furmento 9 anos atrás
pai
commit
bc6433c2ba
1 arquivos alterados com 16 adições e 1 exclusões
  1. 16 1
      tests/helper.h

+ 16 - 1
tests/helper.h

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2011, 2012, 2013  CNRS
+ * Copyright (C) 2011, 2012, 2013, 2016  CNRS
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -61,6 +61,21 @@ static int _starpu_valgrind_print_once STARPU_ATTRIBUTE_UNUSED = 0;
 		}							\
 	} while(0)
 
+#  define STARPU_SKIP_IF_VALGRIND_RETURN_0 \
+	do \
+	{								\
+		if(STARPU_RUNNING_ON_VALGRIND)					\
+		{							\
+			STARPU_HG_DISABLE_CHECKING(_starpu_valgrind_print_once);	\
+			if (!_starpu_valgrind_print_once)		\
+			{						\
+				FPRINTF(stderr, "Running on valgrind, skipping the actual computations\n"); \
+				_starpu_valgrind_print_once = 1;	\
+			}						\
+			return 0;					\
+		}							\
+	} while(0)
+
 #  define STARPU_RETURN(ret) \
 	do								\
 	{								\