Переглянути джерело

followup to #21133: make sure we look at task::where and not to codelet::where

Nathalie Furmento 8 роки тому
батько
коміт
152f1a7c88
4 змінених файлів з 15 додано та 16 видалено
  1. 1 1
      socl/src/task.c
  2. 2 3
      src/core/dependencies/cg.c
  3. 6 6
      src/core/jobs.h
  4. 6 6
      src/core/sched_policy.c

+ 1 - 1
socl/src/task.c

@@ -105,7 +105,7 @@ cl_int task_submit_ex(starpu_task task, cl_command cmd) {
   gc_entity_release(ev);
 
   /* Submit task */
-  int ret = (task->cl != NULL && task->cl->where == STARPU_OPENCL ?
+  int ret = (task->cl != NULL && task->where == STARPU_OPENCL ?
         starpu_task_submit_to_ctx(task, cmd->event->cq->context->sched_ctx) :
         starpu_task_submit(task));
 

+ 2 - 3
src/core/dependencies/cg.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010-2012, 2014-2017  Université de Bordeaux
- * Copyright (C) 2010, 2011, 2012, 2013, 2015, 2016  CNRS
+ * Copyright (C) 2010, 2011, 2012, 2013, 2015, 2016, 2017  CNRS
  * Copyright (C) 2012 INRIA
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -126,8 +126,7 @@ int _starpu_list_task_scheduled_successors_in_cg_list(struct _starpu_cg_list *su
 		if (n < ndeps)
 		{
 			struct starpu_task *task = cg->succ.job->task;
-			if (task->cl == NULL || task->cl->where == STARPU_NOWHERE
-					|| task->execute_on_a_specific_worker)
+			if (task->cl == NULL || task->where == STARPU_NOWHERE || task->execute_on_a_specific_worker)
 				/* will not be scheduled */
 				continue;
 			task_array[n] = task;

+ 6 - 6
src/core/jobs.h

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009-2016  Université de Bordeaux
- * Copyright (C) 2010, 2011, 2013, 2014, 2015  CNRS
+ * Copyright (C) 2010, 2011, 2013, 2014, 2015, 2017  CNRS
  * Copyright (C) 2011  Télécom-SudParis
  * Copyright (C) 2014  INRIA
  *
@@ -51,11 +51,11 @@ struct _starpu_worker;
 /* codelet function */
 typedef void (*_starpu_cl_func_t)(void **, void *);
 
-#define _STARPU_CPU_MAY_PERFORM(j)	((j)->task->cl->where & STARPU_CPU)
-#define _STARPU_CUDA_MAY_PERFORM(j)      ((j)->task->cl->where & STARPU_CUDA)
-#define _STARPU_OPENCL_MAY_PERFORM(j)	((j)->task->cl->where & STARPU_OPENCL)
-#define _STARPU_MIC_MAY_PERFORM(j)	((j)->task->cl->where & STARPU_MIC)
-#define _STARPU_SCC_MAY_PERFORM(j)	((j)->task->cl->where & STARPU_SCC)
+#define _STARPU_CPU_MAY_PERFORM(j)	((j)->task->where & STARPU_CPU)
+#define _STARPU_CUDA_MAY_PERFORM(j)      ((j)->task->where & STARPU_CUDA)
+#define _STARPU_OPENCL_MAY_PERFORM(j)	((j)->task->where & STARPU_OPENCL)
+#define _STARPU_MIC_MAY_PERFORM(j)	((j)->task->where & STARPU_MIC)
+#define _STARPU_SCC_MAY_PERFORM(j)	((j)->task->where & STARPU_SCC)
 
 struct _starpu_data_descr
 {

+ 6 - 6
src/core/sched_policy.c

@@ -455,7 +455,7 @@ int _starpu_repush_task(struct _starpu_job *j)
 	/* in case there is no codelet associated to the task (that's a control
 	 * task), we directly execute its callback and enforce the
 	 * corresponding dependencies */
-	if (task->cl == NULL || task->cl->where == STARPU_NOWHERE)
+	if (task->cl == NULL || task->where == STARPU_NOWHERE)
 	{
 		if (task->prologue_callback_pop_func)
 			task->prologue_callback_pop_func(task->prologue_callback_pop_arg);
@@ -536,15 +536,15 @@ int _starpu_push_task_to_workers(struct starpu_task *task)
 		 * prefetch before the scheduling decision. */
 		if (starpu_get_prefetch_flag())
 		{
-			if (task->cl->where == STARPU_CPU && config->cpus_nodeid >= 0)
+			if (task->where == STARPU_CPU && config->cpus_nodeid >= 0)
 				starpu_prefetch_task_input_on_node(task, config->cpus_nodeid);
-			else if (task->cl->where == STARPU_CUDA && config->cuda_nodeid >= 0)
+			else if (task->where == STARPU_CUDA && config->cuda_nodeid >= 0)
 				starpu_prefetch_task_input_on_node(task, config->cuda_nodeid);
-			else if (task->cl->where == STARPU_OPENCL && config->opencl_nodeid >= 0)
+			else if (task->where == STARPU_OPENCL && config->opencl_nodeid >= 0)
 				starpu_prefetch_task_input_on_node(task, config->opencl_nodeid);
-			else if (task->cl->where == STARPU_MIC && config->mic_nodeid >= 0)
+			else if (task->where == STARPU_MIC && config->mic_nodeid >= 0)
 				starpu_prefetch_task_input_on_node(task, config->mic_nodeid);
-			else if (task->cl->where == STARPU_SCC && config->scc_nodeid >= 0)
+			else if (task->where == STARPU_SCC && config->scc_nodeid >= 0)
 				starpu_prefetch_task_input_on_node(task, config->scc_nodeid);
 		}