ソースを参照

interface/complex: Simplify unregistration

Samuel Thibault 4 年 前
コミット
ccabf092d1
共有1 個のファイルを変更した3 個の追加4 個の削除を含む
  1. 3 4
      examples/interface/complex.c

+ 3 - 4
examples/interface/complex.c

@@ -127,6 +127,9 @@ int main(void)
 #endif
 	starpu_complex_data_register(&handle1, STARPU_MAIN_RAM, &real, &imaginary, 1);
 	starpu_complex_data_register(&handle2, STARPU_MAIN_RAM, &copy_real, &copy_imaginary, 1);
+	/* Create a vector of two complexs.  */
+	starpu_complex_data_register(&handle3, -1, 0, 0, 2);
+	starpu_complex_data_register(&handle4, -1, 0, 0, 1);
 
 	ret = starpu_task_insert(&cl_display, STARPU_VALUE, "handle1", strlen("handle1")+1, STARPU_R, handle1, 0);
 	if (ret == -ENODEV) goto end;
@@ -189,9 +192,6 @@ int main(void)
 	copy_imaginary = 77.0;
 	starpu_data_release(handle2);
 
-	/* Create a vector of two complexs.  */
-	starpu_complex_data_register(&handle3, -1, 0, 0, 2);
-
 	/* Split it in two pieces (thus one complex each).  */
 	struct starpu_data_filter f =
 	{
@@ -249,7 +249,6 @@ int main(void)
 	starpu_data_unpartition(handle3, STARPU_MAIN_RAM);
 
 	/* Use helper starpu_data_cpy */
-	starpu_complex_data_register(&handle4, -1, 0, 0, 1);
 	starpu_data_cpy(handle4, handle1, 0, NULL, NULL);
 	ret = starpu_task_insert(&cl_display, STARPU_VALUE, "handle4", strlen("handle4")+1, STARPU_R, handle4, 0);
 	if (ret == -ENODEV) goto end;