fifo_queues.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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 __FIFO_QUEUES_H__
  17. #define __FIFO_QUEUES_H__
  18. #include <core/mechanisms/queues.h>
  19. struct starpu_fifo_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_fifo(void);
  32. void _starpu_destroy_fifo(struct starpu_jobq_s *jobq);
  33. int _starpu_fifo_push_task(struct starpu_jobq_s *q, starpu_job_t task);
  34. int _starpu_fifo_push_prio_task(struct starpu_jobq_s *q, starpu_job_t task);
  35. starpu_job_t _starpu_fifo_pop_task(struct starpu_jobq_s *q);
  36. struct starpu_job_list_s * _starpu_fifo_pop_every_task(struct starpu_jobq_s *q, uint32_t where);
  37. void _starpu_init_fifo_queues_mechanisms(void);
  38. void _starpu_deinit_fifo_queues_mechanisms(void);
  39. #endif // __FIFO_QUEUES_H__