Просмотр исходного кода

Add starpu_task_list_begin/end/next

Samuel Thibault лет назад: 13
Родитель
Сommit
d8f3a379ae
2 измененных файлов с 25 добавлено и 1 удалено
  1. 9 0
      include/starpu_task_list.h
  2. 16 1
      src/util/starpu_task_list.c

+ 9 - 0
include/starpu_task_list.h

@@ -55,6 +55,15 @@ struct starpu_task *starpu_task_list_pop_front(struct starpu_task_list *list);
 /* Remove the element at the back of the list */
 struct starpu_task *starpu_task_list_pop_back(struct starpu_task_list *list);
 
+/* Get the first task of the list */
+struct starpu_task *starpu_task_list_begin(struct starpu_task_list *list);
+
+/* Get the end of the list */
+struct starpu_task *starpu_task_list_end(struct starpu_task_list *list);
+
+/* Get the next task of the list. This is not erase-safe. */
+struct starpu_task *starpu_task_list_next(struct starpu_task *task);
+
 #ifdef __cplusplus
 }
 #endif

+ 16 - 1
src/util/starpu_task_list.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2010  Université de Bordeaux 1
+ * Copyright (C) 2010-2011  Université de Bordeaux 1
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -113,3 +113,18 @@ struct starpu_task *starpu_task_list_pop_back(struct starpu_task_list *list)
 
 	return task;
 }
+
+struct starpu_task *starpu_task_list_begin(struct starpu_task_list *list)
+{
+	return list->head;
+}
+
+struct starpu_task *starpu_task_list_end(struct starpu_task_list *list)
+{
+	return NULL;
+}
+
+struct starpu_task *starpu_task_list_next(struct starpu_task *task)
+{
+	return task->next;
+}