소스 검색

make use of _starpu_worker_may_execute_task instead of hardcoding it

Samuel Thibault 14 년 전
부모
커밋
67bca51106
2개의 변경된 파일3개의 추가작업 그리고 4개의 파일을 삭제
  1. 1 2
      src/sched_policies/deque_queues.c
  2. 2 2
      src/sched_policies/fifo_queues.c

+ 1 - 2
src/sched_policies/deque_queues.c

@@ -83,7 +83,6 @@ struct starpu_task *_starpu_deque_pop_task(struct starpu_deque_jobq_s *deque_que
 struct starpu_job_list_s *_starpu_deque_pop_every_task(struct starpu_deque_jobq_s *deque_queue, pthread_mutex_t *sched_mutex, int workerid)
 {
 	struct starpu_job_list_s *new_list, *old_list;
-	uint32_t where = starpu_worker_get_type(workerid);
 
 	/* block until some task is available in that queue */
 	PTHREAD_MUTEX_LOCK(sched_mutex);
@@ -109,7 +108,7 @@ struct starpu_job_list_s *_starpu_deque_pop_every_task(struct starpu_deque_jobq_
 		{
 			next_job = starpu_job_list_next(i);
 
-			if (i->task->cl->where & where)
+			if (_starpu_worker_may_execute_task(workerid, i->task))
 			{
 				/* this elements can be moved into the new list */
 				new_list_size++;

+ 2 - 2
src/sched_policies/fifo_queues.c

@@ -21,6 +21,7 @@
 #include <errno.h>
 #include <common/utils.h>
 #include <core/task.h>
+#include <core/workers.h>
 
 struct starpu_fifo_taskq_s *_starpu_create_fifo(void)
 {
@@ -101,7 +102,6 @@ struct starpu_task *_starpu_fifo_pop_every_task(struct starpu_fifo_taskq_s *fifo
 {
 	struct starpu_task_list *old_list;
 	unsigned size;
-	uint32_t where = starpu_worker_get_type(workerid);
 
 	struct starpu_task *new_list = NULL;
 	struct starpu_task *new_list_tail = NULL;
@@ -122,7 +122,7 @@ struct starpu_task *_starpu_fifo_pop_every_task(struct starpu_fifo_taskq_s *fifo
 		{
 			next_task = task->next;
 
-			if (task->cl->where & where)
+			if (_starpu_worker_may_execute_task(workerid, task))
 			{
 				/* this elements can be moved into the new list */
 				new_list_size++;