starpu_task_list.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2010-2012,2014,2016-2017 Université de Bordeaux
  4. * Copyright (C) 2011-2014,2017 CNRS
  5. *
  6. * StarPU is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU Lesser General Public License as published by
  8. * the Free Software Foundation; either version 2.1 of the License, or (at
  9. * your option) any later version.
  10. *
  11. * StarPU is distributed in the hope that it will be useful, but
  12. * WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  14. *
  15. * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  16. */
  17. #ifndef __STARPU_TASK_LIST_H__
  18. #define __STARPU_TASK_LIST_H__
  19. #include <starpu_task.h>
  20. #include <starpu_util.h>
  21. #ifdef __cplusplus
  22. extern "C"
  23. {
  24. #endif
  25. /* NOTE: this needs to have at least the same size as lists in src/common/list.h */
  26. #ifdef BUILDING_STARPU
  27. #define STARPU_TASK_LIST_INLINE extern inline
  28. #else
  29. struct starpu_task_list
  30. {
  31. struct starpu_task *head;
  32. struct starpu_task *tail;
  33. };
  34. #define STARPU_TASK_LIST_INLINE extern
  35. #endif
  36. STARPU_TASK_LIST_INLINE
  37. void starpu_task_list_init(struct starpu_task_list *list);
  38. STARPU_TASK_LIST_INLINE
  39. void starpu_task_list_push_front(struct starpu_task_list *list, struct starpu_task *task);
  40. STARPU_TASK_LIST_INLINE
  41. void starpu_task_list_push_back(struct starpu_task_list *list, struct starpu_task *task);
  42. STARPU_TASK_LIST_INLINE
  43. struct starpu_task *starpu_task_list_front(const struct starpu_task_list *list);
  44. STARPU_TASK_LIST_INLINE
  45. struct starpu_task *starpu_task_list_back(const struct starpu_task_list *list);
  46. STARPU_TASK_LIST_INLINE
  47. int starpu_task_list_empty(const struct starpu_task_list *list);
  48. STARPU_TASK_LIST_INLINE
  49. void starpu_task_list_erase(struct starpu_task_list *list, struct starpu_task *task);
  50. STARPU_TASK_LIST_INLINE
  51. struct starpu_task *starpu_task_list_pop_front(struct starpu_task_list *list);
  52. STARPU_TASK_LIST_INLINE
  53. struct starpu_task *starpu_task_list_pop_back(struct starpu_task_list *list);
  54. STARPU_TASK_LIST_INLINE
  55. struct starpu_task *starpu_task_list_begin(const struct starpu_task_list *list);
  56. STARPU_TASK_LIST_INLINE
  57. struct starpu_task *starpu_task_list_end(const struct starpu_task_list *list STARPU_ATTRIBUTE_UNUSED);
  58. STARPU_TASK_LIST_INLINE
  59. struct starpu_task *starpu_task_list_next(const struct starpu_task *task);
  60. STARPU_TASK_LIST_INLINE
  61. int starpu_task_list_ismember(const struct starpu_task_list *list, const struct starpu_task *look);
  62. #ifdef __cplusplus
  63. }
  64. #endif
  65. #endif /* __STARPU_TASK_LIST_H__ */