task.h 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2009-2013 Université de Bordeaux 1
  4. * Copyright (C) 2010, 2011, 2013 Centre National de la Recherche Scientifique
  5. * Copyright (C) 2011 INRIA
  6. *
  7. * StarPU is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU Lesser General Public License as published by
  9. * the Free Software Foundation; either version 2.1 of the License, or (at
  10. * your option) any later version.
  11. *
  12. * StarPU is distributed in the hope that it will be useful, but
  13. * WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  15. *
  16. * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  17. */
  18. #ifndef __CORE_TASK_H__
  19. #define __CORE_TASK_H__
  20. #include <starpu.h>
  21. #include <common/config.h>
  22. #include <core/jobs.h>
  23. /* Internal version of starpu_task_destroy: don't check task->destroy flag */
  24. void _starpu_task_destroy(struct starpu_task *task);
  25. /* In order to implement starpu_task_wait_for_all, we keep track of the number of
  26. * task currently submitted */
  27. void _starpu_decrement_nsubmitted_tasks(void);
  28. /* In order to implement starpu_task_wait_for_no_ready, we keep track of the number of
  29. * task currently ready */
  30. void _starpu_increment_nready_tasks(void);
  31. void _starpu_decrement_nready_tasks(void);
  32. /* A pthread key is used to store the task currently executed on the thread.
  33. * _starpu_initialize_current_task_key initializes this pthread key and
  34. * _starpu_set_current_task updates its current value. */
  35. void _starpu_initialize_current_task_key(void);
  36. void _starpu_set_current_task(struct starpu_task *task);
  37. /* NB the second argument makes it possible to count regenerable tasks only
  38. * once. */
  39. int _starpu_submit_job(struct _starpu_job *j);
  40. int _starpu_task_submit_nodeps(struct starpu_task *task);
  41. void _starpu_task_declare_deps_array(struct starpu_task *task, unsigned ndeps, struct starpu_task *task_array[], int check);
  42. /* Returns the job structure (which is the internal data structure associated
  43. * to a task). */
  44. struct _starpu_job *_starpu_get_job_associated_to_task(struct starpu_task *task);
  45. struct starpu_task *_starpu_create_task_alias(struct starpu_task *task);
  46. /* Submits starpu internal tasks to the initial context */
  47. int _starpu_task_submit_internally(struct starpu_task *task);
  48. int _starpu_handle_needs_conversion_task(starpu_data_handle_t handle,
  49. unsigned int node);
  50. int
  51. _starpu_handle_needs_conversion_task_for_arch(starpu_data_handle_t handle,
  52. enum starpu_node_kind node_kind);
  53. int _starpu_task_uses_multiformat_handles(struct starpu_task *task);
  54. int _starpu_task_submit_conversion_task(struct starpu_task *task,
  55. unsigned int workerid);
  56. void _starpu_task_check_deprecated_fields(struct starpu_task *task);
  57. void _starpu_codelet_check_deprecated_fields(struct starpu_codelet *cl);
  58. starpu_cpu_func_t _starpu_task_get_cpu_nth_implementation(struct starpu_codelet *cl, unsigned nimpl);
  59. starpu_cuda_func_t _starpu_task_get_cuda_nth_implementation(struct starpu_codelet *cl, unsigned nimpl);
  60. starpu_opencl_func_t _starpu_task_get_opencl_nth_implementation(struct starpu_codelet *cl, unsigned nimpl);
  61. #endif // __CORE_TASK_H__