浏览代码

Reduce sched_ctx execution time in valgrind

Samuel Thibault 5 年之前
父节点
当前提交
408e23cf1a
共有 1 个文件被更改,包括 9 次插入0 次删除
  1. 9 0
      examples/sched_ctx/sched_ctx.c

+ 9 - 0
examples/sched_ctx/sched_ctx.c

@@ -17,6 +17,10 @@
 #include <starpu.h>
 #include <stdlib.h>
 
+#ifdef STARPU_HAVE_VALGRIND_H
+#include <valgrind/valgrind.h>
+#endif
+
 #ifdef STARPU_QUICK_CHECK
 #define NTASKS 64
 #else
@@ -88,6 +92,11 @@ int main(void)
 		return 77;
 	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
+#ifdef STARPU_HAVE_VALGRIND_H
+       if (RUNNING_ON_VALGRIND)
+               ntasks = 8;
+#endif
+
 #ifdef STARPU_USE_CPU
 	nprocs1 = starpu_cpu_worker_get_count();
 	starpu_worker_get_ids_by_type(STARPU_CPU_WORKER, procs1, nprocs1);