浏览代码

make _starpu_worker_may_execute_task take a task instead of a where

Samuel Thibault 14 年之前
父节点
当前提交
60caa1c253
共有 4 个文件被更改,包括 7 次插入7 次删除
  1. 1 1
      src/core/task.c
  2. 2 2
      src/core/workers.c
  3. 1 1
      src/core/workers.h
  4. 3 3
      src/sched_policies/deque_modeling_policy_data_aware.c

+ 1 - 1
src/core/task.c

@@ -221,7 +221,7 @@ int starpu_task_submit(struct starpu_task *task)
 		/* In case we require that a task should be explicitely
 		 * executed on a specific worker, we make sure that the worker
 		 * is able to execute this task.  */
-		if (task->execute_on_a_specific_worker && !_starpu_worker_may_execute_task(task->workerid, where)) {
+		if (task->execute_on_a_specific_worker && !_starpu_worker_may_execute_task(task->workerid, task)) {
                         _STARPU_LOG_OUT_TAG("ENODEV");
 			return -ENODEV;
                 }

+ 2 - 2
src/core/workers.c

@@ -65,9 +65,9 @@ inline uint32_t _starpu_may_submit_opencl_task(void)
 	return (STARPU_OPENCL & config.worker_mask);
 }
 
-inline uint32_t _starpu_worker_may_execute_task(unsigned workerid, uint32_t where)
+int _starpu_worker_may_execute_task(unsigned workerid, struct starpu_task *task)
 {
-	return (where & config.workers[workerid].worker_mask);
+	return !!(task->cl->where & config.workers[workerid].worker_mask);
 }
 
 /*

+ 1 - 1
src/core/workers.h

@@ -140,7 +140,7 @@ uint32_t _starpu_may_submit_cpu_task(void);
 uint32_t _starpu_may_submit_opencl_task(void);
 
 /* Check if the worker specified by workerid can execute the codelet. */
-uint32_t _starpu_worker_may_execute_task(unsigned workerid, uint32_t where);
+int _starpu_worker_may_execute_task(unsigned workerid, struct starpu_task *task);
 
 /* Check whether there is anything that the worker should do instead of
  * sleeping (waiting on something to happen). */

+ 3 - 3
src/sched_policies/deque_modeling_policy_data_aware.c

@@ -313,7 +313,7 @@ static int _dm_push_task(struct starpu_task *task, unsigned prio)
 		fifo->exp_start = STARPU_MAX(fifo->exp_start, _starpu_timing_now());
 		fifo->exp_end = STARPU_MAX(fifo->exp_end, _starpu_timing_now());
 
-		if (!_starpu_worker_may_execute_task(worker, task->cl->where))
+		if (!_starpu_worker_may_execute_task(worker, task))
 		{
 			/* no one on that queue may execute this task */
 			continue;
@@ -378,7 +378,7 @@ static int _dmda_push_task(struct starpu_task *task, unsigned prio)
 		fifo->exp_start = STARPU_MAX(fifo->exp_start, _starpu_timing_now());
 		fifo->exp_end = STARPU_MAX(fifo->exp_end, _starpu_timing_now());
 
-		if (!_starpu_worker_may_execute_task(worker, task->cl->where))
+		if (!_starpu_worker_may_execute_task(worker, task))
 		{
 			/* no one on that queue may execute this task */
 			continue;
@@ -413,7 +413,7 @@ static int _dmda_push_task(struct starpu_task *task, unsigned prio)
 		{
 			fifo = queue_array[worker];
 	
-			if (!_starpu_worker_may_execute_task(worker, task->cl->where))
+			if (!_starpu_worker_may_execute_task(worker, task))
 			{
 				/* no one on that queue may execute this task */
 				continue;