Kaynağa Gözat

Fix test on systems without CPU workers

Samuel Thibault 7 yıl önce
ebeveyn
işleme
fb83db6650
1 değiştirilmiş dosya ile 7 ekleme ve 0 silme
  1. 7 0
      tests/datawizard/redux_acquire.c

+ 7 - 0
tests/datawizard/redux_acquire.c

@@ -16,6 +16,7 @@
 
 #include <starpu.h>
 #include <math.h>
+#include "helper.h"
 
 void init_cpu_func(void *descr[], void *cl_arg)
 {
@@ -61,6 +62,12 @@ int main(int argc, char **argv)
 	int ret = starpu_init(NULL);
 	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
+	if (starpu_cpu_worker_get_count() == 0)
+	{
+		starpu_shutdown();
+		return STARPU_TEST_SKIPPED;
+	}
+
 	starpu_variable_data_register(&dot_handle, -1, (uintptr_t)NULL, sizeof(long int));
 	starpu_data_set_reduction_methods(dot_handle, &redux_codelet, &init_codelet);
 	starpu_data_acquire(dot_handle, STARPU_R);