Browse Source

examples/spmv/dw_block_spmv.c: make sure struct starpu_task object is properly initialized

Nathalie Furmento 13 years ago
parent
commit
dc616ee3b5
1 changed files with 2 additions and 1 deletions
  1. 2 1
      examples/spmv/dw_block_spmv.c

+ 2 - 1
examples/spmv/dw_block_spmv.c

@@ -167,7 +167,7 @@ void launch_spmv_codelets(void)
 
 	unsigned taskid = 0;
 
-	task_tab = malloc(totaltasks*sizeof(struct starpu_task));
+	task_tab = calloc(totaltasks, sizeof(struct starpu_task));
 	STARPU_ASSERT(task_tab);
 
 	is_entry_tab = calloc(totaltasks, sizeof(uint8_t));
@@ -199,6 +199,7 @@ void launch_spmv_codelets(void)
 			for (index = rowptr[row]; index < rowptr[row+1]; index++, part++)
 			{
 				struct starpu_task *task = &task_tab[taskid];
+				starpu_task_init(task);
 
 				task->use_tag = 1;
 				task->tag_id = taskid;