Browse Source

- put a short description of the goal of the vector-scal example
- also delete the handle at the end of the program

Cédric Augonnet 16 years ago
parent
commit
1d8b7066e9
1 changed files with 13 additions and 0 deletions
  1. 13 0
      examples/basic-examples/vector-scal.c

+ 13 - 0
examples/basic-examples/vector-scal.c

@@ -14,6 +14,15 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
  */
 
 
+/*
+ * This example demonstrates how to use StarPU to scale an array by a factor.
+ * It shows how to manipulate data with StarPU's data management library.
+ *  1- how to declare a piece of data to StarPU (starpu_register_vector_data)
+ *  2- how to describe which data are accessed by a task (task->buffers[0])
+ *  3- how a kernel can manipulate the data (buffers[0].vector.ptr)
+ */
+
+
 #include <stdio.h>
 #include <stdio.h>
 #include <stdint.h>
 #include <stdint.h>
 #include <starpu.h>
 #include <starpu.h>
@@ -96,6 +105,10 @@ int main(int argc, char **argv)
 	/* execute the task on any eligible computational ressource */
 	/* execute the task on any eligible computational ressource */
 	starpu_submit_task(task);
 	starpu_submit_task(task);
 
 
+	/* StarPU does not need to manipulate the array anymore so we can stop
+ 	 * to monitor it */
+	starpu_delete_data(tab_handle);
+
 	/* terminate StarPU, no task can be submitted after */
 	/* terminate StarPU, no task can be submitted after */
 	starpu_shutdown();
 	starpu_shutdown();