Explorar el Código

examples/sched_ctx/sched_ctx_delete.c: skip when no CPU worker

Nathalie Furmento hace 7 años
padre
commit
478a8f2802
Se han modificado 1 ficheros con 7 adiciones y 0 borrados
  1. 7 0
      examples/sched_ctx/sched_ctx_delete.c

+ 7 - 0
examples/sched_ctx/sched_ctx_delete.c

@@ -28,6 +28,13 @@ int main(void)
 	if (ret == -ENODEV) return 77;
 	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
+	if (starpu_worker_get_count_by_type(STARPU_CPU_WORKER) == 0)
+	{
+		// Needs at least 1 CPU worker
+		starpu_shutdown();
+		return 77;
+	}
+
 	nprocs = starpu_worker_get_count_by_type(STARPU_ANY_WORKER);
 	starpu_worker_get_ids_by_type(STARPU_ANY_WORKER, procs, nprocs);