浏览代码

shut up compiler warning

Samuel Thibault 9 年之前
父节点
当前提交
7b2dd52abc
共有 2 个文件被更改,包括 3 次插入2 次删除
  1. 2 2
      src/core/sched_ctx.c
  2. 1 0
      src/sched_policies/work_stealing_policy.c

+ 2 - 2
src/core/sched_ctx.c

@@ -2178,7 +2178,7 @@ void starpu_sched_ctx_list_task_counters_decrement_all(struct starpu_task *task,
 	if (_starpu_get_nsched_ctxs() > 1)
 	{
 		int curr_workerid = starpu_worker_get_id();
-		struct _starpu_worker *curr_worker_str, *worker_str;
+		struct _starpu_worker *curr_worker_str = NULL, *worker_str;
 		if(curr_workerid != -1)
 		{
 			curr_worker_str = _starpu_get_worker_struct(curr_workerid);
@@ -2215,7 +2215,7 @@ void starpu_sched_ctx_list_task_counters_reset_all(struct starpu_task *task, uns
 	if (_starpu_get_nsched_ctxs() > 1)
 	{
 		int curr_workerid = starpu_worker_get_id();
-		struct _starpu_worker *curr_worker_str, *worker_str;
+		struct _starpu_worker *curr_worker_str = NULL, *worker_str;
 		if(curr_workerid != -1)
 		{
 			curr_worker_str = _starpu_get_worker_struct(curr_workerid);

+ 1 - 0
src/sched_policies/work_stealing_policy.c

@@ -116,6 +116,7 @@ static unsigned select_victim_round_robin(unsigned sched_ctx_id)
 {
 	struct _starpu_work_stealing_data *ws = (struct _starpu_work_stealing_data*)starpu_sched_ctx_get_policy_data(sched_ctx_id);
 	unsigned worker = ws->last_pop_worker;
+	/* This is horribly expensive... */
 	unsigned nworkers = starpu_sched_ctx_get_nworkers(sched_ctx_id);
 	int *workerids = NULL;
 	starpu_sched_ctx_get_workers_list(sched_ctx_id, &workerids);