task.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2009, 2010-2011 Université de Bordeaux 1
  4. * Copyright (C) 2010, 2011 Centre National de la Recherche Scientifique
  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 __CORE_TASK_H__
  18. #define __CORE_TASK_H__
  19. #include <starpu.h>
  20. #include <common/config.h>
  21. #include <core/jobs.h>
  22. /* In order to implement starpu_task_wait_for_all, we keep track of the number of
  23. * task currently submitted */
  24. void _starpu_decrement_nsubmitted_tasks(void);
  25. /* In order to implement starpu_task_wait_for_no_ready, we keep track of the number of
  26. * task currently ready */
  27. void _starpu_increment_nready_tasks(void);
  28. void _starpu_decrement_nready_tasks(void);
  29. /* A pthread key is used to store the task currently executed on the thread.
  30. * _starpu_initialize_current_task_key initializes this pthread key and
  31. * _starpu_set_current_task updates its current value. */
  32. void _starpu_initialize_current_task_key(void);
  33. void _starpu_set_current_task(struct starpu_task *task);
  34. /* NB the second argument makes it possible to count regenerable tasks only
  35. * once. */
  36. int _starpu_submit_job(struct _starpu_job *j);
  37. /* Returns the job structure (which is the internal data structure associated
  38. * to a task). */
  39. struct _starpu_job *_starpu_get_job_associated_to_task(struct starpu_task *task);
  40. struct starpu_task *_starpu_create_task_alias(struct starpu_task *task);
  41. int _starpu_handle_needs_conversion_task(starpu_data_handle_t handle,
  42. unsigned int node);
  43. int _starpu_task_uses_multiformat_handles(struct starpu_task *task);
  44. #endif // __CORE_TASK_H__