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

Add starpu_task_list_ismember.

Samuel Thibault 9 роки тому
батько
коміт
8ae7d9599d
2 змінених файлів з 13 додано та 1 видалено
  1. 1 0
      ChangeLog
  2. 12 1
      include/starpu_task_list.h

+ 1 - 0
ChangeLog

@@ -182,6 +182,7 @@ Small features:
     and opencl_program_source.
   * Add submit_hook and do_schedule scheduler methods.
   * Add starpu_sleep.
+  * Add starpu_task_list_ismember.
 
 Changes:
   * Data interfaces (variable, vector, matrix and block) now define

+ 12 - 1
include/starpu_task_list.h

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2010-2012  Université de Bordeaux
+ * Copyright (C) 2010-2012, 2016  Université de Bordeaux
  *
  * 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
@@ -157,6 +157,17 @@ struct starpu_task *starpu_task_list_next(struct starpu_task *task)
 	return task->next;
 }
 
+static STARPU_INLINE
+int starpu_task_list_ismember(struct starpu_task_list *list, struct starpu_task *look)
+{
+	struct starpu_task *task;
+
+	for (task  = list->head; task != NULL; task  = task->next)
+		if (task == look)
+			return 1;
+	return 0;
+}
+
 #ifdef __cplusplus
 }
 #endif