浏览代码

Fix missing initializations in STARPU_TASK_INITIALIZER

Samuel Thibault 7 年之前
父节点
当前提交
97e3c48032
共有 2 个文件被更改,包括 9 次插入4 次删除
  1. 8 4
      include/starpu_task.h
  2. 1 0
      src/core/task.c

+ 8 - 4
include/starpu_task.h

@@ -222,15 +222,18 @@ struct starpu_task
 #endif
 };
 
+/* Note: remember to update starpu_task_init as well */
 #define STARPU_TASK_INITIALIZER 			\
 {							\
 	.cl = NULL,					\
+	.where = -1,					\
 	.cl_arg = NULL,					\
 	.cl_arg_size = 0,				\
 	.callback_func = NULL,				\
 	.callback_arg = NULL,				\
 	.priority = STARPU_DEFAULT_PRIO,		\
 	.use_tag = 0,					\
+	.sequential_consistency = 1,			\
 	.synchronous = 0,				\
 	.execute_on_a_specific_worker = 0,		\
 	.workerorder = 0,				\
@@ -240,15 +243,16 @@ struct starpu_task
 	.regenerate = 0,				\
 	.status = STARPU_TASK_INVALID,			\
 	.profiling_info = NULL,				\
-	.predicted = -1.0,				\
-	.predicted_transfer = -1.0,			\
+	.predicted = NAN,				\
+	.predicted_transfer = NAN,			\
+	.predicted_start = NAN,				\
 	.starpu_private = NULL,				\
 	.magic = 42,                  			\
-	.sched_ctx = 0,					\
+	.sched_ctx = STARPU_NMAX_SCHED_CTXS,		\
 	.hypervisor_tag = 0,				\
 	.flops = 0.0,					\
 	.scheduled = 0,					\
-	.prefetched = 0,					\
+	.prefetched = 0,				\
 	.dyn_handles = NULL,				\
 	.dyn_interfaces = NULL,				\
 	.dyn_modes = NULL,				\

+ 1 - 0
src/core/task.c

@@ -88,6 +88,7 @@ void starpu_task_init(struct starpu_task *task)
 	task->where = -1;
 
 	/* Now we can initialise fields which recquire custom value */
+	/* Note: remember to update STARPU_TASK_INITIALIZER as well */
 #if STARPU_DEFAULT_PRIO != 0
 	task->priority = STARPU_DEFAULT_PRIO;
 #endif