starpu_task_list.h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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,2018,2019 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. /** @defgroup
  20. *
  21. * @{
  22. */
  23. #include <starpu_task.h>
  24. #include <starpu_util.h>
  25. #ifdef __cplusplus
  26. extern "C"
  27. {
  28. #endif
  29. /* NOTE: this needs to have at least the same size as lists in src/common/list.h */
  30. #ifdef BUILDING_STARPU
  31. #define STARPU_TASK_LIST_INLINE extern inline
  32. #else
  33. struct starpu_task_list
  34. {
  35. struct starpu_task *head;
  36. struct starpu_task *tail;
  37. };
  38. #define STARPU_TASK_LIST_INLINE extern
  39. #endif
  40. STARPU_TASK_LIST_INLINE
  41. void starpu_task_list_init(struct starpu_task_list *list);
  42. STARPU_TASK_LIST_INLINE
  43. void starpu_task_list_push_front(struct starpu_task_list *list, struct starpu_task *task);
  44. STARPU_TASK_LIST_INLINE
  45. void starpu_task_list_push_back(struct starpu_task_list *list, struct starpu_task *task);
  46. STARPU_TASK_LIST_INLINE
  47. struct starpu_task *starpu_task_list_front(const struct starpu_task_list *list);
  48. STARPU_TASK_LIST_INLINE
  49. struct starpu_task *starpu_task_list_back(const struct starpu_task_list *list);
  50. STARPU_TASK_LIST_INLINE
  51. int starpu_task_list_empty(const struct starpu_task_list *list);
  52. STARPU_TASK_LIST_INLINE
  53. void starpu_task_list_erase(struct starpu_task_list *list, struct starpu_task *task);
  54. STARPU_TASK_LIST_INLINE
  55. struct starpu_task *starpu_task_list_pop_front(struct starpu_task_list *list);
  56. STARPU_TASK_LIST_INLINE
  57. struct starpu_task *starpu_task_list_pop_back(struct starpu_task_list *list);
  58. STARPU_TASK_LIST_INLINE
  59. struct starpu_task *starpu_task_list_begin(const struct starpu_task_list *list);
  60. STARPU_TASK_LIST_INLINE
  61. struct starpu_task *starpu_task_list_end(const struct starpu_task_list *list STARPU_ATTRIBUTE_UNUSED);
  62. STARPU_TASK_LIST_INLINE
  63. struct starpu_task *starpu_task_list_next(const struct starpu_task *task);
  64. STARPU_TASK_LIST_INLINE
  65. int starpu_task_list_ismember(const struct starpu_task_list *list, const struct starpu_task *look);
  66. STARPU_TASK_LIST_INLINE
  67. void starpu_task_list_move(struct starpu_task_list *ldst, struct starpu_task_list *lsrc);
  68. #ifdef __cplusplus
  69. }
  70. #endif
  71. /** @} */
  72. #endif /* __STARPU_TASK_LIST_H__ */