insert_task.doxy 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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 API_Insert_Task Insert_Task
  9. \def starpu_insert_task
  10. \ingroup API_Insert_Task
  11. Convenience macro for the function starpu_task_insert() which used to be called starpu_insert_task.
  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 codelets 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> the specific values ::STARPU_VALUE, ::STARPU_CALLBACK,
  23. ::STARPU_CALLBACK_ARG, ::STARPU_CALLBACK_WITH_ARG, ::STARPU_PRIORITY,
  24. ::STARPU_TAG, ::STARPU_FLOPS, ::STARPU_SCHED_CTX followed by the
  25. appropriated objects as defined elsewhere.
  26. </ul>
  27. When using ::STARPU_DATA_ARRAY, the access mode of the data handles is
  28. not defined.
  29. Parameters to be passed to the codelet implementation are defined
  30. through the type ::STARPU_VALUE. The function
  31. starpu_codelet_unpack_args() must be called within the codelet
  32. implementation to retrieve them.
  33. \def STARPU_VALUE
  34. \ingroup API_Insert_Task
  35. this macro is used when calling starpu_task_insert(), and must
  36. be followed by a pointer to a constant value and the size of the
  37. constant
  38. \def STARPU_CALLBACK
  39. \ingroup API_Insert_Task
  40. this macro is used when calling starpu_task_insert(), and must
  41. be followed by a pointer to a callback function
  42. \def STARPU_CALLBACK_WITH_ARG
  43. \ingroup API_Insert_Task
  44. this macro is used when calling starpu_task_insert(), and must
  45. be followed by two pointers: one to a callback function, and the other
  46. to be given as an argument to the callback function; this is
  47. equivalent to using both ::STARPU_CALLBACK and
  48. ::STARPU_CALLBACK_WITH_ARG.
  49. \def STARPU_CALLBACK_ARG
  50. \ingroup API_Insert_Task
  51. this macro is used when calling starpu_task_insert(), and must
  52. be followed by a pointer to be given as an argument to the callback
  53. function
  54. \def STARPU_PRIORITY
  55. \ingroup API_Insert_Task
  56. this macro is used when calling starpu_task_insert(), and must
  57. be followed by a integer defining a priority level
  58. \def STARPU_DATA_ARRAY
  59. \ingroup API_Insert_Task
  60. TODO
  61. \def STARPU_TAG
  62. \ingroup API_Insert_Task
  63. this macro is used when calling starpu_task_insert(), and must be followed by a tag.
  64. \def STARPU_FLOPS
  65. \ingroup API_Insert_Task
  66. this macro is used when calling starpu_task_insert(), and must
  67. be followed by an amount of floating point operations, as a double.
  68. Users <b>MUST</b> explicitly cast into double, otherwise parameter
  69. passing will not work.
  70. \def STARPU_SCHED_CTX
  71. \ingroup API_Insert_Task
  72. this macro is used when calling starpu_task_insert(), and must
  73. be followed by the id of the scheduling context to which we want to
  74. submit the task.
  75. \fn void starpu_codelet_pack_args(void **arg_buffer, size_t *arg_buffer_size, ...)
  76. \ingroup API_Insert_Task
  77. Pack arguments of type ::STARPU_VALUE into a buffer which can be
  78. given to a codelet and later unpacked with the function
  79. starpu_codelet_unpack_args().
  80. \fn void starpu_codelet_unpack_args(void *cl_arg, ...)
  81. \ingroup API_Insert_Task
  82. Retrieve the arguments of type ::STARPU_VALUE associated to a
  83. task automatically created using the function starpu_task_insert().
  84. \fn struct starpu_task *starpu_task_build(struct starpu_codelet *cl, ...)
  85. \ingroup API_Insert_Task
  86. Create a task corresponding to \p cl with the following arguments.
  87. The argument list must be zero-terminated. The arguments
  88. following the codelet are the same as the ones for the function
  89. starpu_task_insert().
  90. */