starpu_task_list.h 2.5 KB

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