Procházet zdrojové kódy

Complete the fread example with more reads, to show in the task graph that there are no spurious dependencies

Samuel Thibault před 5 roky
rodič
revize
ab63982e47
1 změnil soubory, kde provedl 18 přidání a 0 odebrání
  1. 18 0
      examples/filters/fread.c

+ 18 - 0
examples/filters/fread.c

@@ -109,6 +109,24 @@ int main(void)
 		STARPU_CHECK_RETURN_VALUE(ret, "starpu_task_submit");
 	}
 
+	/* Submit a read on the whole vector */
+	ret = starpu_task_insert(&print_cl,
+				 STARPU_R, handle,
+				 0);
+	if (ret == -ENODEV) goto enodev;
+	STARPU_CHECK_RETURN_VALUE(ret, "starpu_task_submit");
+
+        /* Submit a read on each sub-vector */
+	for (i=0; i<PARTS; i++)
+	{
+		ret = starpu_task_insert(&print_cl,
+					 STARPU_R, subhandles[i],
+					 0);
+		if (ret == -ENODEV) goto enodev;
+		STARPU_CHECK_RETURN_VALUE(ret, "starpu_task_submit");
+	}
+
+	/* Submit a read on the whole vector */
 	ret = starpu_task_insert(&print_cl,
 				 STARPU_R, handle,
 				 0);