浏览代码

add function void starpu_codelet_init(struct starpu_codelet *cl) to initialise a codelet with default values

Nathalie Furmento 13 年之前
父节点
当前提交
5c67ff4e54
共有 2 个文件被更改,包括 26 次插入0 次删除
  1. 2 0
      include/starpu_task.h
  2. 24 0
      src/core/task.c

+ 2 - 0
include/starpu_task.h

@@ -300,6 +300,8 @@ int starpu_task_wait_for_all(void);
 /* This function waits until there is no more ready task. */
 int starpu_task_wait_for_no_ready(void);
 
+void starpu_codelet_init(struct starpu_codelet *cl);
+
 void starpu_display_codelet_stats(struct starpu_codelet *cl);
 
 /* Return the task currently executed by the worker, or NULL if this is called

+ 24 - 0
src/core/task.c

@@ -515,6 +515,30 @@ int _starpu_task_submit_conversion_task(struct starpu_task *task,
 	return 0;
 }
 
+void starpu_codelet_init(struct starpu_codelet *cl)
+{
+	cl->where = 0;
+	cl->can_execute = NULL;
+	cl->type = STARPU_SEQ;
+
+	cl->cuda_func = NULL;
+	cl->cpu_func = NULL;
+	cl->opencl_func = NULL;
+	cl->gordon_func = 0;
+
+	cl->cuda_funcs[0] = NULL;
+	cl->cpu_funcs[0] = NULL;
+	cl->opencl_funcs[0] = NULL;
+	cl->gordon_funcs[0] = 0;
+
+	cl->nbuffers = 0;
+
+	cl->model = NULL;
+	cl->power_model = NULL;
+
+	cl->name = "undefined";
+};
+
 void starpu_display_codelet_stats(struct starpu_codelet *cl)
 {
 	unsigned worker;