deque_queues.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * StarPU
  3. * Copyright (C) INRIA 2008-2009 (see AUTHORS file)
  4. *
  5. * This program 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. * This program 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 __DEQUE_QUEUES_H__
  17. #define __DEQUE_QUEUES_H__
  18. #include <core/mechanisms/queues.h>
  19. struct starpu_deque_jobq_s {
  20. /* the actual list */
  21. starpu_job_list_t jobq;
  22. /* the number of tasks currently in the queue */
  23. unsigned njobs;
  24. /* the number of tasks that were processed */
  25. unsigned nprocessed;
  26. /* only meaningful if the queue is only used by a single worker */
  27. double exp_start;
  28. double exp_end;
  29. double exp_len;
  30. };
  31. struct starpu_jobq_s *_starpu_create_deque(void);
  32. int _starpu_deque_push_task(struct starpu_jobq_s *q, starpu_job_t task);
  33. int _starpu_deque_push_prio_task(struct starpu_jobq_s *q, starpu_job_t task);
  34. starpu_job_t _starpu_deque_pop_task(struct starpu_jobq_s *q);
  35. void _starpu_init_deque_queues_mechanisms(void);
  36. unsigned _starpu_get_total_njobs_deques(void);
  37. unsigned _starpu_get_deque_njobs(struct starpu_jobq_s *q);
  38. unsigned _starpu_get_deque_nprocessed(struct starpu_jobq_s *q);
  39. #endif // __DEQUE_QUEUES_H__