浏览代码

update the vector-scal "basic example"

Cédric Augonnet 15 年之前
父节点
当前提交
d18cb19c6d
共有 1 个文件被更改,包括 9 次插入10 次删除
  1. 9 10
      examples/basic-examples/vector-scal.c

+ 9 - 10
examples/basic-examples/vector-scal.c

@@ -30,21 +30,20 @@
 #define	N	2048
 #define	N	2048
 
 
 /* This kernel takes a buffer and scales it by a constant factor */
 /* This kernel takes a buffer and scales it by a constant factor */
-static void scal_func(void *buffers[], void *arg)
+static void scal_func(void *buffers[], void *cl_arg)
 {
 {
 	unsigned i;
 	unsigned i;
-	float *factor = arg;
+	float *factor = cl_arg;
 
 
-#warning TODO update
 	/* 
 	/* 
-	 * The "buffers" array matches the task->buffers one: for instance
+	 * The "buffers" array matches the task->buffers array: for instance
 	 * task->buffers[0].handle is a handle that corresponds to a data with
 	 * task->buffers[0].handle is a handle that corresponds to a data with
-	 * vector "interface". The starpu_data_interface_t is a union type with
-	 * a field for each defined interface. Here, we manipulate the
-	 * buffers[0].vector field: vector.nx gives the number of elements in
-	 * the array, vector.ptr gives the location of the array (that was
-	 * possibly migrated/replicated), and vector.elemsize gives the size of
-	 * each elements.
+	 * vector "interface", so that the first entry of the array in the
+	 * codelet  is a pointer to a structure describing such a vector (ie.
+	 * struct starpu_vector_interface_s *). Here, we therefore manipulate
+	 * the buffers[0] element as a vector: nx gives the number of elements
+	 * in the array, ptr gives the location of the array (that was possibly
+	 * migrated/replicated), and elemsize gives the size of each elements.
 	 */
 	 */
 
 
 	starpu_vector_interface_t *vector = buffers[0];
 	starpu_vector_interface_t *vector = buffers[0];