task.h 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2009-2012 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. /* Internal version of starpu_task_destroy: don't check task->destroy flag */
  23. void _starpu_task_destroy(struct starpu_task *task);
  24. /* In order to implement starpu_task_wait_for_all, we keep track of the number of
  25. * task currently submitted */
  26. void _starpu_decrement_nsubmitted_tasks(void);
  27. /* In order to implement starpu_task_wait_for_no_ready, we keep track of the number of
  28. * task currently ready */
  29. void _starpu_increment_nready_tasks(void);
  30. void _starpu_decrement_nready_tasks(void);
  31. /* A pthread key is used to store the task currently executed on the thread.
  32. * _starpu_initialize_current_task_key initializes this pthread key and
  33. * _starpu_set_current_task updates its current value. */
  34. void _starpu_initialize_current_task_key(void);
  35. void _starpu_set_current_task(struct starpu_task *task);
  36. /* NB the second argument makes it possible to count regenerable tasks only
  37. * once. */
  38. int _starpu_submit_job(struct _starpu_job *j);
  39. int _starpu_task_submit_nodeps(struct starpu_task *task);
  40. void _starpu_task_declare_deps_array(struct starpu_task *task, unsigned ndeps, struct starpu_task *task_array[], int check);
  41. /* Returns the job structure (which is the internal data structure associated
  42. * to a task). */
  43. struct _starpu_job *_starpu_get_job_associated_to_task(struct starpu_task *task);
  44. struct starpu_task *_starpu_create_task_alias(struct starpu_task *task);
  45. int _starpu_handle_needs_conversion_task(starpu_data_handle_t handle,
  46. unsigned int node);
  47. int _starpu_task_uses_multiformat_handles(struct starpu_task *task);
  48. int _starpu_task_submit_conversion_task(struct starpu_task *task,
  49. unsigned int workerid);
  50. void _starpu_task_check_deprecated_fields(struct starpu_task *task);
  51. void _starpu_codelet_check_deprecated_fields(struct starpu_codelet *cl);
  52. starpu_cpu_func_t _starpu_task_get_cpu_nth_implementation(struct starpu_codelet *cl, unsigned nimpl);
  53. starpu_cuda_func_t _starpu_task_get_cuda_nth_implementation(struct starpu_codelet *cl, unsigned nimpl);
  54. starpu_opencl_func_t _starpu_task_get_opencl_nth_implementation(struct starpu_codelet *cl, unsigned nimpl);
  55. starpu_gordon_func_t _starpu_task_get_gordon_nth_implementation(struct starpu_codelet *cl, unsigned nimpl);
  56. #endif // __CORE_TASK_H__