codelet_and_tasks.doxy 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554
  1. /*
  2. * This file is part of the StarPU Handbook.
  3. * Copyright (C) 2009--2011 Universit@'e de Bordeaux 1
  4. * Copyright (C) 2010, 2011, 2012, 2013 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 Codelet_And_Tasks Codelet And Tasks
  9. \brief This section describes the interface to manipulate codelets and tasks.
  10. \def STARPU_CPU
  11. \ingroup Codelet_And_Tasks
  12. \brief This macro is used when setting the field starpu_codelet::where
  13. to specify the codelet may be executed on a CPU processing unit.
  14. \def STARPU_CUDA
  15. \ingroup Codelet_And_Tasks
  16. \brief This macro is used when setting the field starpu_codelet::where
  17. to specify the codelet may be executed on a CUDA processing unit.
  18. \def STARPU_OPENCL
  19. \ingroup Codelet_And_Tasks
  20. \brief This macro is used when setting the field starpu_codelet::where to
  21. specify the codelet may be executed on a OpenCL processing unit.
  22. \def STARPU_MULTIPLE_CPU_IMPLEMENTATIONS
  23. \deprecated
  24. \ingroup Codelet_And_Tasks
  25. \brief Setting the field starpu_codelet::cpu_func with this macro
  26. indicates the codelet will have several implementations. The use of
  27. this macro is deprecated. One should always only define the field
  28. starpu_codelet::cpu_funcs.
  29. \def STARPU_MULTIPLE_CUDA_IMPLEMENTATIONS
  30. \deprecated
  31. \ingroup Codelet_And_Tasks
  32. \brief Setting the field starpu_codelet::cuda_func with this macro
  33. indicates the codelet will have several implementations. The use of
  34. this macro is deprecated. One should always only define the field
  35. starpu_codelet::cuda_funcs.
  36. \def STARPU_MULTIPLE_OPENCL_IMPLEMENTATIONS
  37. \deprecated
  38. \ingroup Codelet_And_Tasks
  39. \brief Setting the field starpu_codelet::opencl_func with
  40. this macro indicates the codelet will have several implementations.
  41. The use of this macro is deprecated. One should always only define the
  42. field starpu_codelet::opencl_funcs.
  43. \struct starpu_codelet
  44. \brief The codelet structure describes a kernel that is possibly
  45. implemented on various targets. For compatibility, make sure to
  46. initialize the whole structure to zero, either by using explicit
  47. memset, or the function starpu_codelet_init(), or by letting the
  48. compiler implicitly do it in e.g. static storage case.
  49. \ingroup Codelet_And_Tasks
  50. \var starpu_codelet::where.
  51. Optional field to indicate which types of processing units are able to
  52. execute the codelet. The different values ::STARPU_CPU, ::STARPU_CUDA,
  53. ::STARPU_OPENCL can be combined to specify on which types of processing
  54. units the codelet can be executed. ::STARPU_CPU|::STARPU_CUDA for instance
  55. indicates that the codelet is implemented for both CPU cores and CUDA
  56. devices while ::STARPU_OPENCL indicates that it is only available on
  57. OpenCL devices. If the field is unset, its value will be automatically
  58. set based on the availability of the XXX_funcs fields defined below.
  59. \var starpu_codelet::can_execute
  60. Define a function which should return 1 if the worker designated by
  61. workerid can execute the <c>nimpl</c>th implementation of the given
  62. task, 0 otherwise.
  63. \var starpu_codelet::type
  64. Optional field to specify the type of the codelet. The default is
  65. ::STARPU_SEQ, i.e. usual sequential implementation. Other values
  66. (::STARPU_SPMD or ::STARPU_FORKJOIN declare that a parallel implementation
  67. is also available. See \ref Parallel_Tasks for details.
  68. \var starpu_codelet::max_parallelism
  69. Optional field. If a parallel implementation is available, this
  70. denotes the maximum combined worker size that StarPU will use to
  71. execute parallel tasks for this codelet.
  72. \var starpu_codelet::cpu_func
  73. \deprecated
  74. Optional field which has been made deprecated. One should use instead
  75. the field starpu_codelet::cpu_funcs.
  76. \var starpu_codelet::cuda_func
  77. \deprecated
  78. Optional field which has been made deprecated. One should use instead
  79. the starpu_codelet::cuda_funcs field.
  80. \var starpu_codelet::opencl_func
  81. \deprecated
  82. Optional field which has been made deprecated. One should use instead
  83. the starpu_codelet::opencl_funcs field.
  84. \var starpu_codelet::cpu_funcs
  85. Optional array of function pointers to the CPU implementations of the
  86. codelet. It must be terminated by a NULL value. The functions
  87. prototype must be:
  88. \code{.c}
  89. void cpu_func(void *buffers[], void *cl_arg)
  90. \endcode
  91. The first argument being the array of data managed by the data
  92. management library, and the second argument is a pointer to the
  93. argument passed from the field starpu_task::cl_arg. If the field
  94. starpu_codelet::where is set, then the field starpu_codelet::cpu_funcs
  95. is ignored if ::STARPU_CPU does not appear in the field
  96. starpu_codelet::where, it must be non-null otherwise.
  97. \var starpu_codelet::cuda_funcs
  98. Optional array of function pointers to the CUDA implementations of the
  99. codelet. It must be terminated by a NULL value. The functions must be
  100. host-functions written in the CUDA runtime API. Their prototype must
  101. be:
  102. \code{.c}
  103. void cuda_func(void *buffers[], void *cl_arg)
  104. \endcode
  105. If the field starpu_codelet::where is set, then the field
  106. starpu_codelet::cuda_funcs is ignored if ::STARPU_CUDA does not appear
  107. in the field starpu_codelet::where, it must be non-null otherwise.
  108. \var starpu_codelet::opencl_funcs
  109. Optional array of function pointers to the OpenCL implementations of
  110. the codelet. It must be terminated by a NULL value. The functions
  111. prototype must be:
  112. \code{.c}
  113. void opencl_func(void *buffers[], void *cl_arg)
  114. \endcode
  115. If the field starpu_codelet::where field is set, then the field
  116. starpu_codelet::opencl_funcs is ignored if ::STARPU_OPENCL does not
  117. appear in the field starpu_codelet::where, it must be non-null
  118. otherwise.
  119. \var starpu_codelet::nbuffers
  120. Specify the number of arguments taken by the codelet. These arguments
  121. are managed by the DSM and are accessed from the <c>void *buffers[]</c>
  122. array. The constant argument passed with the field starpu_task::cl_arg
  123. is not counted in this number. This value should not be above
  124. STARPU_NMAXBUFS.
  125. \var starpu_codelet::modes
  126. Is an array of ::starpu_data_access_mode. It describes the required
  127. access modes to the data neeeded by the codelet (e.g. ::STARPU_RW). The
  128. number of entries in this array must be specified in the field
  129. starpu_codelet::nbuffers, and should not exceed STARPU_NMAXBUFS. If
  130. unsufficient, this value can be set with the <c>--enable-maxbuffers</c>
  131. option when configuring StarPU.
  132. \var starpu_codelet::dyn_modes
  133. Is an array of ::starpu_data_access_mode. It describes the required
  134. access modes to the data neeeded by the codelet (e.g. ::STARPU_RW).
  135. The number of entries in this array must be specified in the field
  136. starpu_codelet::nbuffers. This field should be used for codelets having a
  137. number of datas greater than STARPU_NMAXBUFS (see \ref
  138. Setting_the_Data_Handles_for_a_Task). When defining a codelet, one
  139. should either define this field or the field starpu_codelet::modes defined above.
  140. \var starpu_codelet::model
  141. Optional pointer to the task duration performance model associated to
  142. this codelet. This optional field is ignored when set to <c>NULL</c> or when
  143. its field starpu_perfmodel::symbol is not set.
  144. \var starpu_codelet::power_model
  145. Optional pointer to the task power consumption performance model
  146. associated to this codelet. This optional field is ignored when set to
  147. <c>NULL or when its field starpu_perfmodel::field is not set. In the
  148. case of parallel codelets, this has to account for all processing
  149. units involved in the parallel execution.
  150. \var starpu_codelet::per_worker_stats
  151. Optional array for statistics collected at runtime: this is filled by
  152. StarPU and should not be accessed directly, but for example by calling
  153. the function starpu_codelet_display_stats() (See
  154. starpu_codelet_display_stats() for details).
  155. \var starpu_codelet::name
  156. Optional name of the codelet. This can be useful for debugging
  157. purposes.
  158. \fn void starpu_codelet_init(struct starpu_codelet *cl)
  159. \ingroup Codelet_And_Tasks
  160. \brief Initialize \p cl with default values. Codelets should
  161. preferably be initialized statically as shown in \ref
  162. Defining_a_Codelet. However such a initialisation is not always
  163. possible, e.g. when using C++.
  164. \struct starpu_data_descr
  165. \ingroup Codelet_And_Tasks
  166. \brief This type is used to describe a data handle along with an
  167. access mode.
  168. \var starpu_data_descr::handle
  169. describes a data
  170. \var starpu_data_descr::mode
  171. describes its access mode
  172. \struct starpu_task
  173. \ingroup Codelet_And_Tasks
  174. \brief The structure describes a task that can be offloaded on the
  175. various processing units managed by StarPU. It instantiates a codelet.
  176. It can either be allocated dynamically with the function
  177. starpu_task_create(), or declared statically. In the latter case, the
  178. programmer has to zero the structure starpu_task and to fill the
  179. different fields properly. The indicated default values correspond to
  180. the configuration of a task allocated with starpu_task_create().
  181. \var starpu_task::cl
  182. Is a pointer to the corresponding structure starpu_codelet. This
  183. describes where the kernel should be executed, and supplies the
  184. appropriate implementations. When set to NULL, no code is executed
  185. during the tasks, such empty tasks can be useful for synchronization
  186. purposes.
  187. \var starpu_task::buffers
  188. \deprecated
  189. This field has been made deprecated. One should use instead the
  190. field starpu_task::handles to specify the data handles accessed
  191. by the task. The access modes are now defined in the field
  192. starpu_codelet::mode.
  193. \var starpu_task::handles
  194. Is an array of starpu_data_handle_t. It specifies the handles to the
  195. different pieces of data accessed by the task. The number of entries
  196. in this array must be specified in the field starpu_codelet::nbuffers,
  197. and should not exceed STARPU_NMAXBUFS. If unsufficient, this value can
  198. be set with the option <c>--enable-maxbuffers</c> when configuring
  199. StarPU.
  200. \var starpu_task::dyn_handles
  201. Is an array of starpu_data_handle_t. It specifies the handles to the
  202. different pieces of data accessed by the task. The number of entries
  203. in this array must be specified in the field starpu_codelet::nbuffers.
  204. This field should be used for tasks having a number of datas greater
  205. than STARPU_NMAXBUFS (see \ref Setting_the_Data_Handles_for_a_Task).
  206. When defining a task, one should either define this field or the field
  207. starpu_task::handles defined above.
  208. \var starpu_task::interfaces
  209. The actual data pointers to the memory node where execution will
  210. happen, managed by the DSM.
  211. \var starpu_task::dyn_interfaces
  212. The actual data pointers to the memory node where execution will
  213. happen, managed by the DSM. Is used when the field
  214. starpu_task::dyn_handles is defined.
  215. \var starpu_task::cl_arg
  216. Optional pointer which is passed to the codelet through the second
  217. argument of the codelet implementation (e.g. starpu_codelet::cpu_func
  218. or starpu_codelet::cuda_func). The default value is <c>NULL</c>.
  219. \var starpu_task::cl_arg_size
  220. Optional field. For some specific drivers, the pointer
  221. starpu_task::cl_arg cannot not be directly given to the driver
  222. function. A buffer of size starpu_task::cl_arg_size needs to be
  223. allocated on the driver. This buffer is then filled with the
  224. starpu_task::cl_arg_size bytes starting at address
  225. starpu_task::cl_arg. In this case, the argument given to the codelet
  226. is therefore not the starpu_task::cl_arg pointer, but the address of
  227. the buffer in local store (LS) instead. This field is ignored for CPU,
  228. CUDA and OpenCL codelets, where the starpu_task::cl_arg pointer is
  229. given as such.
  230. \var starpu_task::callback_func
  231. Optional field, the default value is <c>NULL</c>. This is a function
  232. pointer of prototype <c>void (*f)(void *)</c> which specifies a
  233. possible callback. If this pointer is non-null, the callback function
  234. is executed on the host after the execution of the task. Tasks which
  235. depend on it might already be executing. The callback is passed the
  236. value contained in the starpu_task::callback_arg field. No callback is
  237. executed if the field is set to NULL.
  238. \var starpu_task::callback_arg (optional) (default: NULL)
  239. Optional field, the default value is <c>NULL</c>. This is the pointer
  240. passed to the callback function. This field is ignored if the
  241. callback_func is set to <c>NULL</c>.
  242. \var starpu_task::use_tag
  243. Optional field, the default value is 0. If set, this flag indicates
  244. that the task should be associated with the tag contained in the
  245. starpu_task::tag_id field. Tag allow the application to synchronize
  246. with the task and to express task dependencies easily.
  247. \var starpu_task::tag_id
  248. This optional field contains the tag associated to the task if the
  249. field starpu_task::use_tag is set, it is ignored otherwise.
  250. \var starpu_task::sequential_consistency
  251. If this flag is set (which is the default), sequential consistency is
  252. enforced for the data parameters of this task for which sequential
  253. consistency is enabled. Clearing this flag permits to disable
  254. sequential consistency for this task, even if data have it enabled.
  255. \var starpu_task::synchronous
  256. If this flag is set, the function starpu_task_submit() is blocking and
  257. returns only when the task has been executed (or if no worker is able
  258. to process the task). Otherwise, starpu_task_submit() returns
  259. immediately.
  260. \var starpu_task::priority
  261. Optional field, the default value is STARPU_DEFAULT_PRIO. This field
  262. indicates a level of priority for the task. This is an integer value
  263. that must be set between the return values of the function
  264. starpu_sched_get_min_priority() for the least important tasks, and
  265. that of the function starpu_sched_get_max_priority() for the most
  266. important tasks (included). The STARPU_MIN_PRIO and STARPU_MAX_PRIO
  267. macros are provided for convenience and respectively returns the value
  268. of starpu_sched_get_min_priority() and
  269. starpu_sched_get_max_priority(). Default priority is
  270. STARPU_DEFAULT_PRIO, which is always defined as 0 in order to allow
  271. static task initialization. Scheduling strategies that take priorities
  272. into account can use this parameter to take better scheduling
  273. decisions, but the scheduling policy may also ignore it.
  274. \var starpu_task::execute_on_a_specific_worker
  275. Default value is 0. If this flag is set, StarPU will bypass the
  276. scheduler and directly affect this task to the worker specified by the
  277. field starpu_task::workerid.
  278. \var starpu_task::workerid
  279. Optional field. If the field starpu_task::execute_on_a_specific_worker
  280. is set, this field indicates the identifier of the worker that should
  281. process this task (as returned by starpu_worker_get_id()). This field
  282. is ignored if the field starpu_task::execute_on_a_specific_worker is
  283. set to 0.
  284. \var starpu_task::bundle
  285. Optional field. The bundle that includes this task. If no bundle is
  286. used, this should be NULL.
  287. \var starpu_task::detach
  288. Optional field, default value is 1. If this flag is set, it is not
  289. possible to synchronize with the task by the means of starpu_task_wait()
  290. later on. Internal data structures are only guaranteed to be freed
  291. once starpu_task_wait() is called if the flag is not set.
  292. \var starpu_task::destroy
  293. Optional value. Default value is 0 for starpu_task_init(), and 1 for
  294. starpu_task_create(). If this flag is set, the task structure will
  295. automatically be freed, either after the execution of the callback if
  296. the task is detached, or during starpu_task_wait() otherwise. If this
  297. flag is not set, dynamically allocated data structures will not be
  298. freed until starpu_task_destroy() is called explicitly. Setting this
  299. flag for a statically allocated task structure will result in
  300. undefined behaviour. The flag is set to 1 when the task is created by
  301. calling starpu_task_create(). Note that starpu_task_wait_for_all()
  302. will not free any task.
  303. \var starpu_task::regenerate
  304. Optional field. If this flag is set, the task will be re-submitted to
  305. StarPU once it has been executed. This flag must not be set if the
  306. destroy flag is set.
  307. \var starpu_task::status
  308. Optional field. Current state of the task.
  309. \var starpu_task::profiling_info
  310. Optional field. Profiling information for the task.
  311. \var starpu_task::predicted
  312. Output field. Predicted duration of the task. This field is only set
  313. if the scheduling strategy used performance models.
  314. \var starpu_task::predicted_transfer
  315. Optional field. Predicted data transfer duration for the task in
  316. microseconds. This field is only valid if the scheduling strategy uses
  317. performance models.
  318. \var starpu_task::prev
  319. \private
  320. A pointer to the previous task. This should only be used by StarPU.
  321. \var starpu_task::next
  322. \private
  323. A pointer to the next task. This should only be used by StarPU.
  324. \var starpu_task::mf_skip
  325. \private
  326. This is only used for tasks that use multiformat handle. This should
  327. only be used by StarPU.
  328. \var starpu_task::flops
  329. This can be set to the number of floating points operations that the
  330. task will have to achieve. This is useful for easily getting GFlops
  331. curves from starpu_perfmodel_plot(), and for the hypervisor load
  332. balancing.
  333. \var starpu_task::starpu_private
  334. \private
  335. This is private to StarPU, do not modify. If the task is allocated by
  336. hand (without starpu_task_create()), this field should be set to NULL.
  337. \var starpu_task::magic
  338. \private
  339. This field is set when initializing a task. It prevents a task from
  340. being submitted if it has not been properly initialized.
  341. \fn void starpu_task_init(struct starpu_task *task)
  342. \ingroup Codelet_And_Tasks
  343. \brief Initialize task with default values. This function is
  344. implicitly called by starpu_task_create(). By default, tasks initialized
  345. with starpu_task_init() must be deinitialized explicitly with
  346. starpu_task_clean(). Tasks can also be initialized statically, using
  347. STARPU_TASK_INITIALIZER.
  348. \def STARPU_TASK_INITIALIZER
  349. \ingroup Codelet_And_Tasks
  350. \brief It is possible to initialize statically allocated tasks with
  351. this value. This is equivalent to initializing a structure starpu_task
  352. with the function starpu_task_init() function.
  353. \def STARPU_TASK_GET_HANDLE(struct starpu_task *task, int i)
  354. \ingroup Codelet_And_Tasks
  355. \brief Return the \p i th data handle of the given task. If the task
  356. is defined with a static or dynamic number of handles, will either
  357. return the \p i th element of the field starpu_task::handles or the \p
  358. i th element of the field starpu_task::dyn_handles (see \ref
  359. Setting_the_Data_Handles_for_a_Task)
  360. \def STARPU_TASK_SET_HANDLE(struct starpu_task *task, starpu_data_handle_t handle, int i)
  361. \ingroup Codelet_And_Tasks
  362. \brief Set the \p i th data handle of the given task with the given
  363. dat handle. If the task is defined with a static or dynamic number of
  364. handles, will either set the \p i th element of the field
  365. starpu_task::handles or the \p i th element of the field
  366. starpu_task::dyn_handles (see \ref
  367. Setting_the_Data_Handles_for_a_Task)
  368. \def STARPU_CODELET_GET_MODE(struct starpu_codelet *codelet, int i)
  369. \ingroup Codelet_And_Tasks
  370. \brief Return the access mode of the \p i th data handle of the given
  371. codelet. If the codelet is defined with a static or dynamic number of
  372. handles, will either return the \p i th element of the field
  373. starpu_codelet::modes or the \p i th element of the field
  374. starpu_codelet::dyn_modes (see \ref
  375. Setting_the_Data_Handles_for_a_Task)
  376. \def STARPU_CODELET_SET_MODE(struct starpu_codelet *codelet, enum starpu_data_access_mode mode, int i)
  377. \ingroup Codelet_And_Tasks
  378. \brief Set the access mode of the \p i th data handle of the given
  379. codelet. If the codelet is defined with a static or dynamic number of
  380. handles, will either set the \p i th element of the field
  381. starpu_codelet::modes or the \p i th element of the field
  382. starpu_codelet::dyn_modes (see \ref
  383. Setting_the_Data_Handles_for_a_Task)
  384. \fn struct starpu_task * starpu_task_create(void)
  385. \ingroup Codelet_And_Tasks
  386. \brief Allocate a task structure and initialize it with default
  387. values. Tasks allocated dynamically with starpu_task_create() are
  388. automatically freed when the task is terminated. This means that the
  389. task pointer can not be used any more once the task is submitted,
  390. since it can be executed at any time (unless dependencies make it
  391. wait) and thus freed at any time. If the field starpu_task::destroy is
  392. explicitly unset, the resources used by the task have to be freed by
  393. calling starpu_task_destroy().
  394. \fn struct starpu_task * starpu_task_dup(struct starpu_task *task)
  395. \ingroup Codelet_And_Tasks
  396. \brief Allocate a task structure which is the exact duplicate of the
  397. given task.
  398. \fn void starpu_task_clean(struct starpu_task *task)
  399. \ingroup Codelet_And_Tasks
  400. \brief Release all the structures automatically allocated to execute
  401. task, but not the task structure itself and values set by the user
  402. remain unchanged. It is thus useful for statically allocated tasks for
  403. instance. It is also useful when users want to execute the same
  404. operation several times with as least overhead as possible. It is
  405. called automatically by starpu_task_destroy(). It has to be called
  406. only after explicitly waiting for the task or after starpu_shutdown()
  407. (waiting for the callback is not enough, since StarPU still
  408. manipulates the task after calling the callback).
  409. \fn void starpu_task_destroy(struct starpu_task *task)
  410. \ingroup Codelet_And_Tasks
  411. \brief Free the resource allocated during starpu_task_create() and
  412. associated with task. This function is already called automatically
  413. after the execution of a task when the field starpu_task::destroy is
  414. set, which is the default for tasks created by starpu_task_create().
  415. Calling this function on a statically allocated task results in an
  416. undefined behaviour.
  417. \fn int starpu_task_wait(struct starpu_task *task)
  418. \ingroup Codelet_And_Tasks
  419. \brief This function blocks until \p task has been executed. It is not
  420. possible to synchronize with a task more than once. It is not possible
  421. to wait for synchronous or detached tasks. Upon successful completion,
  422. this function returns 0. Otherwise, <c>-EINVAL</c> indicates that the
  423. specified task was either synchronous or detached.
  424. \fn int starpu_task_submit(struct starpu_task *task)
  425. \ingroup Codelet_And_Tasks
  426. \brief This function submits task to StarPU. Calling this function
  427. does not mean that the task will be executed immediately as there can
  428. be data or task (tag) dependencies that are not fulfilled yet: StarPU
  429. will take care of scheduling this task with respect to such
  430. dependencies. This function returns immediately if the field
  431. starpu_task::synchronous is set to 0, and block until the
  432. termination of the task otherwise. It is also possible to synchronize
  433. the application with asynchronous tasks by the means of tags, using
  434. the function starpu_tag_wait() function for instance. In case of
  435. success, this function returns 0, a return value of <c>-ENODEV</c>
  436. means that there is no worker able to process this task (e.g. there is
  437. no GPU available and this task is only implemented for CUDA devices).
  438. starpu_task_submit() can be called from anywhere, including codelet
  439. functions and callbacks, provided that the field
  440. starpu_task::synchronous is set to 0.
  441. \fn int starpu_task_wait_for_all(void)
  442. \ingroup Codelet_And_Tasks
  443. \brief This function blocks until all the tasks that were submitted
  444. are terminated. It does not destroy these tasks.
  445. \fn int starpu_task_nready(void)
  446. \ingroup Codelet_And_Tasks
  447. \brief TODO
  448. \brief int starpu_task_nsubmitted(void)
  449. \ingroup Codelet_And_Tasks
  450. Return the number of submitted tasks which have not completed yet.
  451. \fn int starpu_task_nready(void)
  452. \ingroup Codelet_And_Tasks
  453. \brief Return the number of submitted tasks which are ready for
  454. execution are already executing. It thus does not include tasks
  455. waiting for dependencies.
  456. \fn struct starpu_task * starpu_task_get_current(void)
  457. \ingroup Codelet_And_Tasks
  458. \brief This function returns the task currently executed by the
  459. worker, or <c>NULL</c> if it is called either from a thread that is not a
  460. task or simply because there is no task being executed at the moment.
  461. \fn void starpu_codelet_display_stats(struct starpu_codelet *cl)
  462. \ingroup Codelet_And_Tasks
  463. \brief Output on stderr some statistics on the codelet \p cl.
  464. \fn int starpu_task_wait_for_no_ready(void)
  465. \ingroup Codelet_And_Tasks
  466. \brief This function waits until there is no more ready task.
  467. \fn void starpu_task_set_implementation(struct starpu_task *task, unsigned impl)
  468. \ingroup Codelet_And_Tasks
  469. \brief This function should be called by schedulers to specify the
  470. codelet implementation to be executed when executing the task.
  471. \fn unsigned starpu_task_get_implementation(struct starpu_task *task)
  472. \ingroup Codelet_And_Tasks
  473. \brief This function return the codelet implementation to be executed
  474. when executing the task.
  475. */