insert_task.doxy 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. /*
  2. * This file is part of the StarPU Handbook.
  3. * Copyright (C) 2009--2011 Universit@'e de Bordeaux
  4. * Copyright (C) 2010, 2011, 2012, 2013, 2014 Centre National de la Recherche Scientifique
  5. * Copyright (C) 2011, 2012 Institut National de Recherche en Informatique et Automatique
  6. * See the file version.doxy for copying conditions.
  7. */
  8. /*! \defgroup API_Insert_Task Insert_Task
  9. \fn starpu_insert_task(struct starpu_codelet *cl, ...)
  10. \ingroup API_Insert_Task
  11. This function does the same as the function starpu_task_insert(). It has been kept to avoid breaking old codes.
  12. \fn int starpu_task_insert(struct starpu_codelet *cl, ...)
  13. \ingroup API_Insert_Task
  14. Create and submit a task corresponding to \p cl with the
  15. following arguments. The argument list must be zero-terminated.
  16. The arguments following the codelet can be of the following types:
  17. <ul>
  18. <li> ::STARPU_R, ::STARPU_W, ::STARPU_RW, ::STARPU_SCRATCH,
  19. ::STARPU_REDUX an access mode followed by a data handle;
  20. <li> ::STARPU_DATA_ARRAY followed by an array of data handles and its
  21. number of elements;
  22. <li> ::STARPU_EXECUTE_ON_WORKER, ::STARPU_WORKER_ORDER followed by an integer value
  23. specifying the worker on which to execute the task (as specified by
  24. starpu_task::execute_on_a_specific_worker)
  25. <li> the specific values ::STARPU_VALUE, ::STARPU_CALLBACK,
  26. ::STARPU_CALLBACK_ARG, ::STARPU_CALLBACK_WITH_ARG, ::STARPU_PRIORITY,
  27. ::STARPU_TAG, ::STARPU_TAG_ONLY, ::STARPU_FLOPS, ::STARPU_SCHED_CTX followed by the
  28. appropriated objects as defined elsewhere.
  29. </ul>
  30. When using ::STARPU_DATA_ARRAY, the access mode of the data handles is
  31. not defined.
  32. Parameters to be passed to the codelet implementation are defined
  33. through the type ::STARPU_VALUE. The function
  34. starpu_codelet_unpack_args() must be called within the codelet
  35. implementation to retrieve them.
  36. \def STARPU_VALUE
  37. \ingroup API_Insert_Task
  38. this macro is used when calling starpu_task_insert(), and must
  39. be followed by a pointer to a constant value and the size of the
  40. constant
  41. \def STARPU_CALLBACK
  42. \ingroup API_Insert_Task
  43. this macro is used when calling starpu_task_insert(), and must
  44. be followed by a pointer to a callback function
  45. \def STARPU_CALLBACK_WITH_ARG
  46. \ingroup API_Insert_Task
  47. this macro is used when calling starpu_task_insert(), and must
  48. be followed by two pointers: one to a callback function, and the other
  49. to be given as an argument to the callback function; this is
  50. equivalent to using both ::STARPU_CALLBACK and
  51. ::STARPU_CALLBACK_WITH_ARG.
  52. \def STARPU_CALLBACK_ARG
  53. \ingroup API_Insert_Task
  54. this macro is used when calling starpu_task_insert(), and must
  55. be followed by a pointer to be given as an argument to the callback
  56. function
  57. \def STARPU_PRIORITY
  58. \ingroup API_Insert_Task
  59. this macro is used when calling starpu_task_insert(), and must
  60. be followed by a integer defining a priority level
  61. \def STARPU_DATA_ARRAY
  62. \ingroup API_Insert_Task
  63. TODO
  64. \def STARPU_EXECUTE_ON_WORKER
  65. \ingroup API_Insert_Task
  66. this macro is used when calling starpu_task_insert(), and must be
  67. followed by an integer value specifying the worker on which to execute
  68. the task (as specified by starpu_task::execute_on_a_specific_worker)
  69. \def STARPU_WORKER_ORDER
  70. \ingroup API_Insert_Task
  71. this macro is used when calling starpu_task_insert(), and must be
  72. followed by an integer value specifying the worker order in which to execute
  73. the tasks (as specified by starpu_task::workerorder)
  74. \def STARPU_TAG
  75. \ingroup API_Insert_Task
  76. this macro is used when calling starpu_task_insert(), and must be followed by a tag.
  77. \def STARPU_TAG_ONLY
  78. \ingroup API_Insert_Task
  79. this macro is used when calling starpu_task_insert(), and must be followed by a tag.
  80. It sets ::tag_id, but leaves ::use_tag as 0.
  81. \def STARPU_FLOPS
  82. \ingroup API_Insert_Task
  83. this macro is used when calling starpu_task_insert(), and must
  84. be followed by an amount of floating point operations, as a double.
  85. Users <b>MUST</b> explicitly cast into double, otherwise parameter
  86. passing will not work.
  87. \def STARPU_SCHED_CTX
  88. \ingroup API_Insert_Task
  89. this macro is used when calling starpu_task_insert(), and must
  90. be followed by the id of the scheduling context to which we want to
  91. submit the task.
  92. \fn void starpu_codelet_pack_args(void **arg_buffer, size_t *arg_buffer_size, ...)
  93. \ingroup API_Insert_Task
  94. Pack arguments of type ::STARPU_VALUE into a buffer which can be
  95. given to a codelet and later unpacked with the function
  96. starpu_codelet_unpack_args().
  97. \fn void starpu_codelet_unpack_args(void *cl_arg, ...)
  98. \ingroup API_Insert_Task
  99. Retrieve the arguments of type ::STARPU_VALUE associated to a
  100. task automatically created using the function starpu_task_insert().
  101. \fn struct starpu_task *starpu_task_build(struct starpu_codelet *cl, ...)
  102. \ingroup API_Insert_Task
  103. Create a task corresponding to \p cl with the following arguments.
  104. The argument list must be zero-terminated. The arguments
  105. following the codelet are the same as the ones for the function
  106. starpu_task_insert().
  107. */