data_interfaces.doxy 46 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059
  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_Data_Interfaces Data Interfaces
  9. \struct starpu_data_interface_ops
  10. Per-interface data transfer methods.
  11. \ingroup API_Data_Interfaces
  12. \var void (*starpu_data_interface_ops::register_data_handle)(starpu_data_handle_t handle, unsigned home_node, void *data_interface)
  13. Register an existing interface into a data handle.
  14. \var starpu_ssize_t (*starpu_data_interface_ops::allocate_data_on_node)(void *data_interface, unsigned node)
  15. Allocate data for the interface on a given node.
  16. \var void (*starpu_data_interface_ops::free_data_on_node)(void *data_interface, unsigned node)
  17. Free data of the interface on a given node.
  18. \var const struct starpu_data_copy_methods *starpu_data_interface_ops::copy_methods
  19. ram/cuda/opencl synchronous and asynchronous transfer methods.
  20. \var void *(*starpu_data_interface_ops::handle_to_pointer)(starpu_data_handle_t handle, unsigned node)
  21. Return the current pointer (if any) for the handle on the given node.
  22. \var size_t (*starpu_data_interface_ops::get_size)(starpu_data_handle_t handle)
  23. Return an estimation of the size of data, for performance models.
  24. \var uint32_t (*starpu_data_interface_ops::footprint)(starpu_data_handle_t handle)
  25. Return a 32bit footprint which characterizes the data size.
  26. \var int (*starpu_data_interface_ops::compare)(void *data_interface_a, void *data_interface_b)
  27. Compare the data size of two interfaces.
  28. \var void (*starpu_data_interface_ops::display)(starpu_data_handle_t handle, FILE *f)
  29. Dump the sizes of a handle to a file.
  30. \var starpu_ssize_t (*starpu_data_interface_ops::describe)(void *data_interface, char *buf, size_t size)
  31. Describe the data into a string.
  32. \var enum starpu_data_interface_id starpu_data_interface_ops::interfaceid
  33. An identifier that is unique to each interface.
  34. \var size_t starpu_data_interface_ops::interface_size
  35. The size of the interface data descriptor.
  36. \var int starpu_data_interface_ops::is_multiformat
  37. todo
  38. \var struct starpu_multiformat_data_interface_ops* (*starpu_data_interface_ops::get_mf_ops)(void *data_interface)
  39. todo
  40. \var int (*starpu_data_interface_ops::pack_data)(starpu_data_handle_t handle, unsigned node, void **ptr, starpu_ssize_t *count)
  41. Pack the data handle into a contiguous buffer at the address ptr and
  42. set the size of the newly created buffer in count. If ptr is NULL, the
  43. function should not copy the data in the buffer but just set count to
  44. the size of the buffer which would have been allocated. The special
  45. value -1 indicates the size is yet unknown.
  46. \var int (*starpu_data_interface_ops::unpack_data) (starpu_data_handle_t handle, unsigned node, void *ptr, size_t count)
  47. Unpack the data handle from the contiguous buffer at the address ptr
  48. of size count
  49. \struct starpu_data_copy_methods
  50. Defines the per-interface methods. If the any_to_any method is
  51. provided, it will be used by default if no more specific method is
  52. provided. It can still be useful to provide more specific method in
  53. case of e.g. available particular CUDA or OpenCL support.
  54. \ingroup API_Data_Interfaces
  55. \var int (*starpu_data_copy_methods::can_copy)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, unsigned handling_node)
  56. If defined, allows the interface to declare whether it supports transferring
  57. from \p src_interface on node \p src_node to \p dst_interface on node \p
  58. dst_node, run from node \p handling_node. If not defined, it is assumed that the
  59. interface supports all transfers.
  60. \var int (*starpu_data_copy_methods::ram_to_ram)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node)
  61. Define how to copy data from the \p src_interface interface on the \p
  62. src_node CPU node to the \p dst_interface interface on the \p dst_node
  63. CPU node. Return 0 on success.
  64. \var int (*starpu_data_copy_methods::ram_to_cuda)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node)
  65. Define how to copy data from the \p src_interface interface on the
  66. \p src_node CPU node to the \p dst_interface interface on the \p dst_node CUDA
  67. node. Return 0 on success.
  68. \var int (*starpu_data_copy_methods::ram_to_opencl)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node)
  69. Define how to copy data from the \p src_interface interface on the
  70. \p src_node CPU node to the \p dst_interface interface on the \p dst_node
  71. OpenCL node. Return 0 on success.
  72. \var int (*starpu_data_copy_methods::ram_to_mic)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node)
  73. Define how to copy data from the \p src_interface interface on the
  74. \p src_node CPU node to the \p dst_interface interface on the \p dst_node MIC
  75. node. Return 0 on success.
  76. \var int (*starpu_data_copy_methods::cuda_to_ram)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node)
  77. Define how to copy data from the \p src_interface interface on the
  78. \p src_node CUDA node to the \p dst_interface interface on the \p dst_node
  79. CPU node. Return 0 on success.
  80. \var int (*starpu_data_copy_methods::cuda_to_cuda)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node)
  81. Define how to copy data from the \p src_interface interface on the
  82. \p src_node CUDA node to the \p dst_interface interface on the \p dst_node CUDA
  83. node. Return 0 on success.
  84. \var int (*starpu_data_copy_methods::cuda_to_opencl)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node)
  85. Define how to copy data from the \p src_interface interface on the
  86. \p src_node CUDA node to the \p dst_interface interface on the \p dst_node
  87. OpenCL node. Return 0 on success.
  88. \var int (*starpu_data_copy_methods::opencl_to_ram)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node)
  89. Define how to copy data from the \p src_interface interface on the
  90. \p src_node OpenCL node to the \p dst_interface interface on the \p dst_node
  91. CPU node. Return 0 on success.
  92. \var int (*starpu_data_copy_methods::opencl_to_cuda)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node)
  93. Define how to copy data from the \p src_interface interface on the
  94. \p src_node OpenCL node to the \p dst_interface interface on the \p dst_node
  95. CUDA node. Return 0 on success.
  96. \var int (*starpu_data_copy_methods::opencl_to_opencl)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node)
  97. Define how to copy data from the \p src_interface interface on the
  98. \p src_node OpenCL node to the \p dst_interface interface on the \p dst_node
  99. OpenCL node. Return 0 on success.
  100. \var int (*starpu_data_copy_methods::mic_to_ram)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node)
  101. Define how to copy data from the \p src_interface interface on the
  102. \p src_node MIC node to the \p dst_interface interface on the \p dst_node CPU
  103. node. Return 0 on success.
  104. \var int (*starpu_data_copy_methods::scc_src_to_sink)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node)
  105. Define how to copy data from the \p src_interface interface on the
  106. \p src_node node to the \p dst_interface interface on the \p dst_node node.
  107. Must return 0 if the transfer was actually completed completely
  108. synchronously, or -EAGAIN if at least some transfers are still ongoing
  109. and should be awaited for by the core.
  110. \var int (*starpu_data_copy_methods::scc_sink_to_src)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node)
  111. Define how to copy data from the \p src_interface interface on the
  112. \p src_node node to the \p dst_interface interface on the \p dst_node node.
  113. Must return 0 if the transfer was actually completed completely
  114. synchronously, or -EAGAIN if at least some transfers are still ongoing
  115. and should be awaited for by the core.
  116. \var int (*starpu_data_copy_methods::scc_sink_to_sink)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node)
  117. Define how to copy data from the \p src_interface interface on the
  118. \p src_node node to the \p dst_interface interface on the \p dst_node node.
  119. Must return 0 if the transfer was actually completed completely
  120. synchronously, or -EAGAIN if at least some transfers are still ongoing
  121. and should be awaited for by the core.
  122. \var int (*starpu_data_copy_methods::ram_to_cuda_async)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, cudaStream_t stream)
  123. Define how to copy data from the \p src_interface interface on the
  124. \p src_node CPU node to the \p dst_interface interface on the \p dst_node CUDA
  125. node, using the given stream. Must return 0 if the transfer was
  126. actually completed completely synchronously, or -EAGAIN if at least
  127. some transfers are still ongoing and should be awaited for by the core.
  128. \var int (*starpu_data_copy_methods::cuda_to_ram_async)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, cudaStream_t stream)
  129. Define how to copy data from the \p src_interface interface on the
  130. \p src_node CUDA node to the \p dst_interface interface on the \p dst_node CPU
  131. node, using the given stream. Must return 0 if the transfer was
  132. actually completed completely synchronously, or -EAGAIN if at least
  133. some transfers are still ongoing and should be awaited for by the core.
  134. \var int (*starpu_data_copy_methods::cuda_to_cuda_async)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, cudaStream_t stream)
  135. Define how to copy data from the \p src_interface interface on the
  136. \p src_node CUDA node to the \p dst_interface interface on the \p dst_node CUDA
  137. node, using the given stream. Must return 0 if the transfer was
  138. actually completed completely synchronously, or -EAGAIN if at least
  139. some transfers are still ongoing and should be awaited for by the core.
  140. \var int (*starpu_data_copy_methods::ram_to_opencl_async)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, cl_event *event)
  141. Define how to copy data from the \p src_interface interface on the
  142. \p src_node CPU node to the \p dst_interface interface on the \p dst_node
  143. OpenCL node, by recording in event, a pointer to a cl_event, the event
  144. of the last submitted transfer. Must return 0 if the transfer was
  145. actually completed completely synchronously, or -EAGAIN if at least
  146. some transfers are still ongoing and should be awaited for by the
  147. core.
  148. \var int (*starpu_data_copy_methods::opencl_to_ram_async)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, cl_event *event)
  149. Define how to copy data from the \p src_interface interface on the
  150. \p src_node OpenCL node to the \p dst_interface interface on the \p dst_node
  151. CPU node, by recording in event, a pointer to a cl_event, the event of
  152. the last submitted transfer. Must return 0 if the transfer was
  153. actually completed completely synchronously, or -EAGAIN if at least
  154. some transfers are still ongoing and should be awaited for by the
  155. core.
  156. \var int (*starpu_data_copy_methods::opencl_to_opencl_async)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, cl_event *event)
  157. Define how to copy data from the \p src_interface interface on the
  158. \p src_node OpenCL node to the \p dst_interface interface on the \p dst_node
  159. OpenCL node, by recording in event, a pointer to a cl_event, the event
  160. of the last submitted transfer. Must return 0 if the transfer was
  161. actually completed completely synchronously, or -EAGAIN if at least
  162. some transfers are still ongoing and should be awaited for by the
  163. core.
  164. \var int (*starpu_data_copy_methods::ram_to_mic_async)(void *src_intreface, unsigned src_node, void *dst_interface, unsigned dst_node)
  165. Define how to copy data from the \p src_interface interface on the
  166. \p src_node CPU node to the \p dst_interface interface on the \p dst_node
  167. MIC node. Must return 0 if the transfer was actually completed
  168. completely synchronously, or -EAGAIN if at least some transfers are
  169. still ongoing and should be awaited for by the core.
  170. \var int (*starpu_data_copy_methods::mic_to_ram_async)(void *src_intreface, unsigned src_node, void *dst_interface, unsigned dst_node)
  171. Define how to copy data from the \p src_interface interface on the
  172. \p src_node MIC node to the \p dst_interface interface on the \p dst_node
  173. CPU node. Must return 0 if the transfer was actually completed
  174. completely synchronously, or -EAGAIN if at least some transfers are
  175. still ongoing and should be awaited for by the core.
  176. \var int (*starpu_data_copy_methods::any_to_any)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, void *async_data)
  177. Define how to copy data from the \p src_interface interface on the
  178. \p src_node node to the \p dst_interface interface on the \p dst_node node.
  179. This is meant to be implemented through the starpu_interface_copy()
  180. helper, to which async_data should be passed as such, and will be used
  181. to manage asynchronicity. This must return -EAGAIN if any of the
  182. starpu_interface_copy() calls has returned -EAGAIN (i.e. at least some
  183. transfer is still ongoing), and return 0 otherwise.
  184. \enum starpu_data_interface_id
  185. \ingroup API_Data_Interfaces
  186. Identifier for all predefined StarPU data interfaces
  187. \var starpu_data_interface_id::STARPU_UNKNOWN_INTERFACE_ID
  188. Unknown interface
  189. \var starpu_data_interface_id::STARPU_MATRIX_INTERFACE_ID
  190. Identifier for the matrix data interface
  191. \var starpu_data_interface_id::STARPU_BLOCK_INTERFACE_ID
  192. Identifier for block data interface
  193. \var starpu_data_interface_id::STARPU_VECTOR_INTERFACE_ID
  194. Identifier for the vector data interface
  195. \var starpu_data_interface_id::STARPU_CSR_INTERFACE_ID
  196. Identifier for the csr data interface
  197. \var starpu_data_interface_id::STARPU_BCSR_INTERFACE_ID
  198. Identifier for the bcsr data interface
  199. \var starpu_data_interface_id::STARPU_VARIABLE_INTERFACE_ID
  200. Identifier for the variable data interface
  201. \var starpu_data_interface_id::STARPU_VOID_INTERFACE_ID
  202. Identifier for the void data interface
  203. \var starpu_data_interface_id::STARPU_MULTIFORMAT_INTERFACE_ID
  204. Identifier for the multiformat data interface
  205. \var starpu_data_interface_id::STARPU_COO_INTERFACE_ID
  206. Identifier for the coo data interface
  207. \var starpu_data_interface_id::STARPU_MAX_INTERFACE_ID
  208. Maximum number of data interfaces
  209. @name Registering Data
  210. \ingroup API_Data_Interfaces
  211. There are several ways to register a memory region so that it can be
  212. managed by StarPU. The functions below allow the registration of
  213. vectors, 2D matrices, 3D matrices as well as BCSR and CSR sparse
  214. matrices.
  215. \fn void starpu_void_data_register(starpu_data_handle_t *handle)
  216. \ingroup API_Data_Interfaces
  217. Register a void interface. There is no data really associated
  218. to that interface, but it may be used as a synchronization mechanism.
  219. It also permits to express an abstract piece of data that is managed
  220. by the application internally: this makes it possible to forbid the
  221. concurrent execution of different tasks accessing the same <c>void</c> data
  222. in read-write concurrently.
  223. \fn void starpu_variable_data_register(starpu_data_handle_t *handle, unsigned home_node, uintptr_t ptr, size_t size)
  224. \ingroup API_Data_Interfaces
  225. Register the \p size byte element pointed to by \p ptr, which is
  226. typically a scalar, and initialize \p handle to represent this data item.
  227. Here an example of how to use the function.
  228. \code{.c}
  229. float var;
  230. starpu_data_handle_t var_handle;
  231. starpu_variable_data_register(&var_handle, STARPU_MAIN_RAM, (uintptr_t)&var, sizeof(var));
  232. \endcode
  233. \fn void starpu_variable_ptr_register(starpu_data_handle_t handle, unsigned node, uintptr_t ptr, uintptr_t dev_handle, size_t offset)
  234. \ingroup API_Data_Interfaces
  235. Register into the \p handle that to store data on node \p node it should use the
  236. buffer located at \p ptr, or device handle \p dev_handle and offset \p offset
  237. (for OpenCL, notably)
  238. \fn void starpu_vector_data_register(starpu_data_handle_t *handle, unsigned home_node, uintptr_t ptr, uint32_t nx, size_t elemsize)
  239. \ingroup API_Data_Interfaces
  240. Register the \p nx elemsize-byte elements pointed to by \p ptr and initialize \p handle to represent it.
  241. Here an example of how to use the function.
  242. \code{.c}
  243. float vector[NX];
  244. starpu_data_handle_t vector_handle;
  245. starpu_vector_data_register(&vector_handle, STARPU_MAIN_RAM, (uintptr_t)vector, NX, sizeof(vector[0]));
  246. \endcode
  247. \fn void starpu_vector_ptr_register(starpu_data_handle_t handle, unsigned node, uintptr_t ptr, uintptr_t dev_handle, size_t offset)
  248. \ingroup API_Data_Interfaces
  249. Register into the \p handle that to store data on node \p node it should use the
  250. buffer located at \p ptr, or device handle \p dev_handle and offset \p offset
  251. (for OpenCL, notably)
  252. \fn void starpu_matrix_data_register(starpu_data_handle_t *handle, unsigned home_node, uintptr_t ptr, uint32_t ld, uint32_t nx, uint32_t ny, size_t elemsize)
  253. \ingroup API_Data_Interfaces
  254. Register the \p nx x \p ny 2D matrix of \p elemsize-byte elements pointed
  255. by \p ptr and initialize \p handle to represent it. \p ld specifies the number
  256. of elements between rows. a value greater than \p nx adds padding, which
  257. can be useful for alignment purposes.
  258. Here an example of how to use the function.
  259. \code{.c}
  260. float *matrix;
  261. starpu_data_handle_t matrix_handle;
  262. matrix = (float*)malloc(width * height * sizeof(float));
  263. starpu_matrix_data_register(&matrix_handle, STARPU_MAIN_RAM, (uintptr_t)matrix, width, width, height, sizeof(float));
  264. \endcode
  265. \fn void starpu_matrix_ptr_register(starpu_data_handle_t handle, unsigned node, uintptr_t ptr, uintptr_t dev_handle, size_t offset, uint32_t ld)
  266. \ingroup API_Data_Interfaces
  267. Register into the \p handle that to store data on node \p node it should use the
  268. buffer located at \p ptr, or device handle \p dev_handle and offset \p offset
  269. (for OpenCL, notably), with \p ld elements between rows.
  270. \fn void starpu_block_data_register(starpu_data_handle_t *handle, unsigned home_node, uintptr_t ptr, uint32_t ldy, uint32_t ldz, uint32_t nx, uint32_t ny, uint32_t nz, size_t elemsize)
  271. \ingroup API_Data_Interfaces
  272. Register the \p nx x \p ny x \p nz 3D matrix of \p elemsize byte elements
  273. pointed by \p ptr and initialize \p handle to represent it. Again, \p ldy and
  274. \p ldz specify the number of elements between rows and between z planes.
  275. Here an example of how to use the function.
  276. \code{.c}
  277. float *block;
  278. starpu_data_handle_t block_handle;
  279. block = (float*)malloc(nx*ny*nz*sizeof(float));
  280. starpu_block_data_register(&block_handle, STARPU_MAIN_RAM, (uintptr_t)block, nx, nx*ny, nx, ny, nz, sizeof(float));
  281. \endcode
  282. \fn void starpu_block_ptr_register(starpu_data_handle_t handle, unsigned node, uintptr_t ptr, uintptr_t dev_handle, size_t offset, uint32_t ldy, uint32_t ldz)
  283. \ingroup API_Data_Interfaces
  284. Register into the \p handle that to store data on node \p node it should use the
  285. buffer located at \p ptr, or device handle \p dev_handle and offset \p offset
  286. (for OpenCL, notably), with \p ldy elements between rows and \ldz elements between z planes.
  287. \fn void starpu_bcsr_data_register(starpu_data_handle_t *handle, unsigned home_node, uint32_t nnz, uint32_t nrow, uintptr_t nzval, uint32_t *colind, uint32_t *rowptr, uint32_t firstentry, uint32_t r, uint32_t c, size_t elemsize)
  288. \ingroup API_Data_Interfaces
  289. This variant of starpu_data_register() uses the BCSR (Blocked
  290. Compressed Sparse Row Representation) sparse matrix interface.
  291. Register the sparse matrix made of \p nnz non-zero blocks of elements of
  292. size \p elemsize stored in \p nzval and initializes \p handle to represent it.
  293. Blocks have size \p r * \p c. \p nrow is the number of rows (in terms of
  294. blocks), \p colind[i] is the block-column index for block i in \p nzval,
  295. \p rowptr[i] is the block-index (in \p nzval) of the first block of row i.
  296. \p firstentry is the index of the first entry of the given arrays
  297. (usually 0 or 1).
  298. \fn void starpu_csr_data_register(starpu_data_handle_t *handle, unsigned home_node, uint32_t nnz, uint32_t nrow, uintptr_t nzval, uint32_t *colind, uint32_t *rowptr, uint32_t firstentry, size_t elemsize)
  299. \ingroup API_Data_Interfaces
  300. This variant of starpu_data_register() uses the CSR (Compressed
  301. Sparse Row Representation) sparse matrix interface. TODO
  302. \fn void starpu_coo_data_register(starpu_data_handle_t *handleptr, unsigned home_node, uint32_t nx, uint32_t ny, uint32_t n_values, uint32_t *columns, uint32_t *rows, uintptr_t values, size_t elemsize);
  303. \ingroup API_Data_Interfaces
  304. Register the \p nx x \p ny 2D matrix given in the COO format, using the
  305. \p columns, \p rows, \p values arrays, which must have \p n_values elements of
  306. size \p elemsize. Initialize \p handleptr.
  307. \fn void *starpu_data_get_interface_on_node(starpu_data_handle_t handle, unsigned memory_node)
  308. \ingroup API_Data_Interfaces
  309. Return the interface associated with \p handle on \p memory_node.
  310. @name Accessing Data Interfaces
  311. \ingroup API_Data_Interfaces
  312. Each data interface is provided with a set of field access functions.
  313. The ones using a void * parameter aimed to be used in codelet
  314. implementations (see for example the code in \ref
  315. VectorScalingUsingStarPUAPI).
  316. \fn void *starpu_data_handle_to_pointer(starpu_data_handle_t handle, unsigned node)
  317. \ingroup API_Data_Interfaces
  318. Return the pointer associated with \p handle on node \p node or <c>NULL</c>
  319. if handle’s interface does not support this operation or data for this
  320. \p handle is not allocated on that \p node.
  321. \fn void *starpu_data_get_local_ptr(starpu_data_handle_t handle)
  322. \ingroup API_Data_Interfaces
  323. Return the local pointer associated with \p handle or <c>NULL</c> if
  324. \p handle’s interface does not have data allocated locally
  325. \fn enum starpu_data_interface_id starpu_data_get_interface_id(starpu_data_handle_t handle)
  326. \ingroup API_Data_Interfaces
  327. Return the unique identifier of the interface associated with
  328. the given \p handle.
  329. \fn size_t starpu_data_get_size(starpu_data_handle_t handle)
  330. \ingroup API_Data_Interfaces
  331. Return the size of the data associated with \p handle.
  332. \fn int starpu_data_pack(starpu_data_handle_t handle, void **ptr, starpu_ssize_t *count)
  333. \ingroup API_Data_Interfaces
  334. Execute the packing operation of the interface of the data
  335. registered at \p handle (see starpu_data_interface_ops). This
  336. packing operation must allocate a buffer large enough at \p ptr and copy
  337. into the newly allocated buffer the data associated to \p handle. \p count
  338. will be set to the size of the allocated buffer. If \p ptr is NULL, the
  339. function should not copy the data in the buffer but just set \p count to
  340. the size of the buffer which would have been allocated. The special
  341. value -1 indicates the size is yet unknown.
  342. \fn int starpu_data_unpack(starpu_data_handle_t handle, void *ptr, size_t count)
  343. \ingroup API_Data_Interfaces
  344. Unpack in handle the data located at \p ptr of size \p count as
  345. described by the interface of the data. The interface registered at
  346. \p handle must define a unpacking operation (see
  347. starpu_data_interface_ops). The memory at the address \p ptr is freed
  348. after calling the data unpacking operation.
  349. @name Accessing Variable Data Interfaces
  350. \ingroup API_Data_Interfaces
  351. \struct starpu_variable_interface
  352. Variable interface for a single data (not a vector, a matrix, a list, ...)
  353. \ingroup API_Data_Interfaces
  354. \var enum starpu_data_interface_id starpu_variable_interface::id
  355. Identifier of the interface
  356. \var uintptr_t starpu_variable_interface::ptr
  357. local pointer of the variable
  358. \var uintptr_t starpu_variable_interface::dev_handle
  359. device handle of the variable.
  360. \var size_t starpu_variable_interface::offset
  361. offset in the variable
  362. \var size_t starpu_variable_interface::elemsize
  363. size of the variable
  364. \fn size_t starpu_variable_get_elemsize(starpu_data_handle_t handle)
  365. \ingroup API_Data_Interfaces
  366. Return the size of the variable designated by \p handle.
  367. \fn uintptr_t starpu_variable_get_local_ptr(starpu_data_handle_t handle)
  368. \ingroup API_Data_Interfaces
  369. Return a pointer to the variable designated by \p handle.
  370. \def STARPU_VARIABLE_GET_PTR(interface)
  371. \ingroup API_Data_Interfaces
  372. Return a pointer to the variable designated by \p interface.
  373. \def STARPU_VARIABLE_GET_ELEMSIZE(interface)
  374. \ingroup API_Data_Interfaces
  375. Return the size of the variable designated by \p interface.
  376. \def STARPU_VARIABLE_GET_DEV_HANDLE(interface)
  377. \ingroup API_Data_Interfaces
  378. Return a device handle for the variable designated by
  379. \p interface, to be used on OpenCL. The offset documented below has to be
  380. used in addition to this.
  381. \def STARPU_VARIABLE_GET_OFFSET(interface)
  382. \ingroup API_Data_Interfaces
  383. Return the offset in the variable designated by \p interface, to
  384. be used with the device handle.
  385. @name Accessing Vector Data Interfaces
  386. \ingroup API_Data_Interfaces
  387. \struct starpu_vector_interface
  388. Vector interface
  389. \ingroup API_Data_Interfaces
  390. \var enum starpu_data_interface_id starpu_vector_interface::id
  391. Identifier of the interface
  392. \var uintptr_t starpu_vector_interface::ptr
  393. local pointer of the vector
  394. \var uintptr_t starpu_vector_interface::dev_handle
  395. device handle of the vector.
  396. \var size_t starpu_vector_interface::offset
  397. offset in the vector
  398. \var uint32_t starpu_vector_interface::nx
  399. number of elements on the x-axis of the vector
  400. \var size_t starpu_vector_interface::elemsize
  401. size of the elements of the vector
  402. \var uint32_t starpu_vector_interface::slice_base
  403. vector slice base, used by the StarPU OpenMP runtime support
  404. \fn uint32_t starpu_vector_get_nx(starpu_data_handle_t handle)
  405. \ingroup API_Data_Interfaces
  406. Return the number of elements registered into the array designated by \p handle.
  407. \fn size_t starpu_vector_get_elemsize(starpu_data_handle_t handle)
  408. \ingroup API_Data_Interfaces
  409. Return the size of each element of the array designated by \p handle.
  410. \fn uintptr_t starpu_vector_get_local_ptr(starpu_data_handle_t handle)
  411. \ingroup API_Data_Interfaces
  412. Return the local pointer associated with \p handle.
  413. \def STARPU_VECTOR_GET_PTR(interface)
  414. \ingroup API_Data_Interfaces
  415. Return a pointer to the array designated by \p interface, valid on
  416. CPUs and CUDA only. For OpenCL, the device handle and offset need to
  417. be used instead.
  418. \def STARPU_VECTOR_GET_DEV_HANDLE(interface)
  419. \ingroup API_Data_Interfaces
  420. Return a device handle for the array designated by \p interface,
  421. to be used on OpenCL. the offset documented below has to be used in
  422. addition to this.
  423. \def STARPU_VECTOR_GET_OFFSET(interface)
  424. \ingroup API_Data_Interfaces
  425. Return the offset in the array designated by \p interface, to be
  426. used with the device handle.
  427. \def STARPU_VECTOR_GET_NX(interface)
  428. \ingroup API_Data_Interfaces
  429. Return the number of elements registered into the array
  430. designated by \p interface.
  431. \def STARPU_VECTOR_GET_ELEMSIZE(interface)
  432. \ingroup API_Data_Interfaces
  433. Return the size of each element of the array designated by
  434. \p interface.
  435. \def STARPU_VECTOR_GET_SLICE_BASE(interface)
  436. \ingroup API_Data_Interfaces
  437. Return the OpenMP slice base annotation of each element of the array designated by
  438. \p interface.
  439. \sa starpu_omp_vector_annotate
  440. @name Accessing Matrix Data Interfaces
  441. \ingroup API_Data_Interfaces
  442. \struct starpu_matrix_interface
  443. Matrix interface for dense matrices
  444. \ingroup API_Data_Interfaces
  445. \var enum starpu_data_interface_id starpu_matrix_interface::id
  446. Identifier of the interface
  447. \var uintptr_t starpu_matrix_interface::ptr
  448. local pointer of the matrix
  449. \var uintptr_t starpu_matrix_interface::dev_handle
  450. device handle of the matrix.
  451. \var size_t starpu_matrix_interface::offset
  452. offset in the matrix
  453. \var uint32_t starpu_matrix_interface::nx
  454. number of elements on the x-axis of the matrix
  455. \var uint32_t starpu_matrix_interface::ny
  456. number of elements on the y-axis of the matrix
  457. \var uint32_t starpu_matrix_interface::ld
  458. number of elements between each row of the matrix. Maybe be equal to
  459. starpu_matrix_interface::nx when there is no padding.
  460. \var size_t starpu_matrix_interface::elemsize
  461. size of the elements of the matrix
  462. \fn uint32_t starpu_matrix_get_nx(starpu_data_handle_t handle)
  463. \ingroup API_Data_Interfaces
  464. Return the number of elements on the x-axis of the matrix
  465. designated by \p handle.
  466. \fn uint32_t starpu_matrix_get_ny(starpu_data_handle_t handle)
  467. \ingroup API_Data_Interfaces
  468. Return the number of elements on the y-axis of the matrix
  469. designated by \p handle.
  470. \fn uint32_t starpu_matrix_get_local_ld(starpu_data_handle_t handle)
  471. \ingroup API_Data_Interfaces
  472. Return the number of elements between each row of the matrix
  473. designated by \p handle. Maybe be equal to nx when there is no padding.
  474. \fn uintptr_t starpu_matrix_get_local_ptr(starpu_data_handle_t handle)
  475. \ingroup API_Data_Interfaces
  476. Return the local pointer associated with \p handle.
  477. \fn size_t starpu_matrix_get_elemsize(starpu_data_handle_t handle)
  478. \ingroup API_Data_Interfaces
  479. Return the size of the elements registered into the matrix
  480. designated by \p handle.
  481. \def STARPU_MATRIX_GET_PTR(interface)
  482. \ingroup API_Data_Interfaces
  483. Return a pointer to the matrix designated by \p interface, valid
  484. on CPUs and CUDA devices only. For OpenCL devices, the device handle
  485. and offset need to be used instead.
  486. \def STARPU_MATRIX_GET_DEV_HANDLE(interface)
  487. \ingroup API_Data_Interfaces
  488. Return a device handle for the matrix designated by \p interface,
  489. to be used on OpenCL. The offset documented below has to be used in
  490. addition to this.
  491. \def STARPU_MATRIX_GET_OFFSET(interface)
  492. \ingroup API_Data_Interfaces
  493. Return the offset in the matrix designated by \p interface, to be
  494. used with the device handle.
  495. \def STARPU_MATRIX_GET_NX(interface)
  496. \ingroup API_Data_Interfaces
  497. Return the number of elements on the x-axis of the matrix
  498. designated by \p interface.
  499. \def STARPU_MATRIX_GET_NY(interface)
  500. \ingroup API_Data_Interfaces
  501. Return the number of elements on the y-axis of the matrix
  502. designated by \p interface.
  503. \def STARPU_MATRIX_GET_LD(interface)
  504. \ingroup API_Data_Interfaces
  505. Return the number of elements between each row of the matrix
  506. designated by \p interface. May be equal to nx when there is no padding.
  507. \def STARPU_MATRIX_GET_ELEMSIZE(interface)
  508. \ingroup API_Data_Interfaces
  509. Return the size of the elements registered into the matrix
  510. designated by \p interface.
  511. @name Accessing Block Data Interfaces
  512. \ingroup API_Data_Interfaces
  513. \struct starpu_block_interface
  514. Block interface for 3D dense blocks
  515. \ingroup API_Data_Interfaces
  516. \var enum starpu_data_interface_id starpu_block_interface::id
  517. identifier of the interface
  518. \var uintptr_t starpu_block_interface::ptr
  519. local pointer of the block
  520. \var uintptr_t starpu_block_interface::dev_handle
  521. device handle of the block.
  522. \var size_t starpu_block_interface::offset
  523. offset in the block.
  524. \var uint32_t starpu_block_interface::nx
  525. number of elements on the x-axis of the block.
  526. \var uint32_t starpu_block_interface::ny
  527. number of elements on the y-axis of the block.
  528. \var uint32_t starpu_block_interface::nz
  529. number of elements on the z-axis of the block.
  530. \var uint32_t starpu_block_interface::ldy
  531. number of elements between two lines
  532. \var uint32_t starpu_block_interface::ldz
  533. number of elements between two planes
  534. \var size_t starpu_block_interface::elemsize
  535. size of the elements of the block.
  536. \fn uint32_t starpu_block_get_nx(starpu_data_handle_t handle)
  537. \ingroup API_Data_Interfaces
  538. Return the number of elements on the x-axis of the block
  539. designated by \p handle.
  540. \fn uint32_t starpu_block_get_ny(starpu_data_handle_t handle)
  541. \ingroup API_Data_Interfaces
  542. Return the number of elements on the y-axis of the block
  543. designated by \p handle.
  544. \fn uint32_t starpu_block_get_nz(starpu_data_handle_t handle)
  545. \ingroup API_Data_Interfaces
  546. Return the number of elements on the z-axis of the block
  547. designated by \p handle.
  548. \fn uint32_t starpu_block_get_local_ldy(starpu_data_handle_t handle)
  549. \ingroup API_Data_Interfaces
  550. Return the number of elements between each row of the block
  551. designated by \p handle, in the format of the current memory node.
  552. \fn uint32_t starpu_block_get_local_ldz(starpu_data_handle_t handle)
  553. \ingroup API_Data_Interfaces
  554. Return the number of elements between each z plane of the block
  555. designated by \p handle, in the format of the current memory node.
  556. \fn uintptr_t starpu_block_get_local_ptr(starpu_data_handle_t handle)
  557. \ingroup API_Data_Interfaces
  558. Return the local pointer associated with \p handle.
  559. \fn size_t starpu_block_get_elemsize(starpu_data_handle_t handle)
  560. \ingroup API_Data_Interfaces
  561. Return the size of the elements of the block designated by
  562. \p handle.
  563. \def STARPU_BLOCK_GET_PTR(interface)
  564. \ingroup API_Data_Interfaces
  565. Return a pointer to the block designated by \p interface.
  566. \def STARPU_BLOCK_GET_DEV_HANDLE(interface)
  567. \ingroup API_Data_Interfaces
  568. Return a device handle for the block designated by \p interface,
  569. to be used on OpenCL. The offset document below has to be used in
  570. addition to this.
  571. \def STARPU_BLOCK_GET_OFFSET(interface)
  572. \ingroup API_Data_Interfaces
  573. Return the offset in the block designated by \p interface, to be
  574. used with the device handle.
  575. \def STARPU_BLOCK_GET_NX(interface)
  576. \ingroup API_Data_Interfaces
  577. Return the number of elements on the x-axis of the block
  578. designated by \p interface.
  579. \def STARPU_BLOCK_GET_NY(interface)
  580. \ingroup API_Data_Interfaces
  581. Return the number of elements on the y-axis of the block
  582. designated by \p interface.
  583. \def STARPU_BLOCK_GET_NZ(interface)
  584. \ingroup API_Data_Interfaces
  585. Return the number of elements on the z-axis of the block
  586. designated by \p interface.
  587. \def STARPU_BLOCK_GET_LDY(interface)
  588. \ingroup API_Data_Interfaces
  589. Return the number of elements between each row of the block
  590. designated by \p interface. May be equal to nx when there is no padding.
  591. \def STARPU_BLOCK_GET_LDZ(interface)
  592. \ingroup API_Data_Interfaces
  593. Return the number of elements between each z plane of the block
  594. designated by \p interface. May be equal to nx*ny when there is no
  595. padding.
  596. \def STARPU_BLOCK_GET_ELEMSIZE(interface)
  597. \ingroup API_Data_Interfaces
  598. Return the size of the elements of the block designated by
  599. \p interface.
  600. @name Accessing BCSR Data Interfaces
  601. \ingroup API_Data_Interfaces
  602. \struct starpu_bcsr_interface
  603. BCSR interface for sparse matrices (blocked compressed sparse
  604. row representation)
  605. \ingroup API_Data_Interfaces
  606. \var enum starpu_data_interface_id starpu_bcsr_interface::id
  607. Identifier of the interface
  608. \var uint32_t starpu_bcsr_interface::nnz
  609. number of non-zero BLOCKS
  610. \var uint32_t starpu_bcsr_interface::nrow
  611. number of rows (in terms of BLOCKS)
  612. \var uintptr_t starpu_bcsr_interface::nzval
  613. non-zero values
  614. \var uint32_t *starpu_bcsr_interface::colind
  615. position of non-zero entried on the row
  616. \var uint32_t *starpu_bcsr_interface::rowptr
  617. index (in nzval) of the first entry of the row
  618. \var starpu_bcsr_interface::firstentry
  619. k for k-based indexing (0 or 1 usually). Also useful when partitionning the matrix.
  620. \var uint32_t starpu_bcsr_interface::r
  621. size of the blocks
  622. \var uint32_t starpu_bcsr_interface::c
  623. size of the blocks
  624. \var size_t starpu_bcsr_interface::elemsize;
  625. size of the elements of the matrix
  626. \fn uint32_t starpu_bcsr_get_nnz(starpu_data_handle_t handle)
  627. \ingroup API_Data_Interfaces
  628. Return the number of non-zero elements in the matrix designated
  629. by \p handle.
  630. \fn uint32_t starpu_bcsr_get_nrow(starpu_data_handle_t handle)
  631. \ingroup API_Data_Interfaces
  632. Return the number of rows (in terms of blocks of size r*c) in
  633. the matrix designated by \p handle.
  634. \fn uint32_t starpu_bcsr_get_firstentry(starpu_data_handle_t handle)
  635. \ingroup API_Data_Interfaces
  636. Return the index at which all arrays (the column indexes, the
  637. row pointers...) of the matrix desginated by \p handle.
  638. \fn uintptr_t starpu_bcsr_get_local_nzval(starpu_data_handle_t handle)
  639. \ingroup API_Data_Interfaces
  640. Return a pointer to the non-zero values of the matrix
  641. designated by \p handle.
  642. \fn uint32_t *starpu_bcsr_get_local_colind(starpu_data_handle_t handle)
  643. \ingroup API_Data_Interfaces
  644. Return a pointer to the column index, which holds the positions
  645. of the non-zero entries in the matrix designated by \p handle.
  646. \fn uint32_t *starpu_bcsr_get_local_rowptr(starpu_data_handle_t handle)
  647. \ingroup API_Data_Interfaces
  648. Return the row pointer array of the matrix designated by
  649. \p handle.
  650. \fn uint32_t starpu_bcsr_get_r(starpu_data_handle_t handle)
  651. \ingroup API_Data_Interfaces
  652. Return the number of rows in a block.
  653. \fn uint32_t starpu_bcsr_get_c(starpu_data_handle_t handle)
  654. \ingroup API_Data_Interfaces
  655. Return the numberof columns in a block.
  656. \fn size_t starpu_bcsr_get_elemsize(starpu_data_handle_t handle)
  657. \ingroup API_Data_Interfaces
  658. Return the size of the elements in the matrix designated by
  659. \p handle.
  660. \def STARPU_BCSR_GET_NNZ(interface)
  661. \ingroup API_Data_Interfaces
  662. Return the number of non-zero values in the matrix designated
  663. by \p interface.
  664. \def STARPU_BCSR_GET_NZVAL(interface)
  665. \ingroup API_Data_Interfaces
  666. Return a pointer to the non-zero values of the matrix
  667. designated by \p interface.
  668. \def STARPU_BCSR_GET_NZVAL_DEV_HANDLE(interface)
  669. \ingroup API_Data_Interfaces
  670. Return a device handle for the array of non-zero values in the
  671. matrix designated by \p interface. The offset documented below has to be
  672. used in addition to this.
  673. \def STARPU_BCSR_GET_COLIND(interface)
  674. \ingroup API_Data_Interfaces
  675. Return a pointer to the column index of the matrix designated
  676. by \p interface.
  677. \def STARPU_BCSR_GET_COLIND_DEV_HANDLE(interface)
  678. \ingroup API_Data_Interfaces
  679. Return a device handle for the column index of the matrix
  680. designated by \p interface. The offset documented below has to be used in
  681. addition to this.
  682. \def STARPU_BCSR_GET_ROWPTR(interface)
  683. \ingroup API_Data_Interfaces
  684. Return a pointer to the row pointer array of the matrix
  685. designated by \p interface.
  686. \def STARPU_BCSR_GET_ROWPTR_DEV_HANDLE(interface)
  687. \ingroup API_Data_Interfaces
  688. Return a device handle for the row pointer array of the matrix
  689. designated by \p interface. The offset documented below has to be used in
  690. addition to this.
  691. \def STARPU_BCSR_GET_OFFSET
  692. \ingroup API_Data_Interfaces
  693. Return the offset in the arrays (coling, rowptr, nzval) of the
  694. matrix designated by \p interface, to be used with the device handles.
  695. @name Accessing CSR Data Interfaces
  696. \ingroup API_Data_Interfaces
  697. \struct starpu_csr_interface
  698. CSR interface for sparse matrices (compressed sparse row representation)
  699. \ingroup API_Data_Interfaces
  700. \var enum starpu_data_interface_id starpu_csr_interface::id
  701. Identifier of the interface
  702. \var uint32_t starpu_csr_interface::nnz
  703. number of non-zero entries
  704. \var uint32_t starpu_csr_interface::nrow
  705. number of rows
  706. \var uintptr_t starpu_csr_interface::nzval
  707. non-zero values
  708. \var uint32_t *starpu_csr_interface::colind
  709. position of non-zero entries on the row
  710. \var uint32_t *starpu_csr_interface::rowptr
  711. index (in nzval) of the first entry of the row
  712. \var uint32_t starpu_csr_interface::firstentry
  713. k for k-based indexing (0 or 1 usually). also useful when partitionning the matrix.
  714. \var size_t starpu_csr_interface::elemsize
  715. size of the elements of the matrix
  716. \fn uint32_t starpu_csr_get_nnz(starpu_data_handle_t handle)
  717. \ingroup API_Data_Interfaces
  718. Return the number of non-zero values in the matrix designated
  719. by \p handle.
  720. \fn uint32_t starpu_csr_get_nrow(starpu_data_handle_t handle)
  721. \ingroup API_Data_Interfaces
  722. Return the size of the row pointer array of the matrix
  723. designated by \p handle.
  724. \fn uint32_t starpu_csr_get_firstentry(starpu_data_handle_t handle)
  725. \ingroup API_Data_Interfaces
  726. Return the index at which all arrays (the column indexes, the
  727. row pointers...) of the matrix designated by \p handle.
  728. \fn uintptr_t starpu_csr_get_local_nzval(starpu_data_handle_t handle)
  729. \ingroup API_Data_Interfaces
  730. Return a local pointer to the non-zero values of the matrix
  731. designated by \p handle.
  732. \fn uint32_t *starpu_csr_get_local_colind(starpu_data_handle_t handle)
  733. \ingroup API_Data_Interfaces
  734. Return a local pointer to the column index of the matrix
  735. designated by \p handle.
  736. \fn uint32_t *starpu_csr_get_local_rowptr(starpu_data_handle_t handle)
  737. \ingroup API_Data_Interfaces
  738. Return a local pointer to the row pointer array of the matrix
  739. designated by \p handle.
  740. \fn size_t starpu_csr_get_elemsize(starpu_data_handle_t handle)
  741. \ingroup API_Data_Interfaces
  742. Return the size of the elements registered into the matrix
  743. designated by \p handle.
  744. \def STARPU_CSR_GET_NNZ(interface)
  745. \ingroup API_Data_Interfaces
  746. Return the number of non-zero values in the matrix designated
  747. by \p interface.
  748. \def STARPU_CSR_GET_NROW(interface)
  749. \ingroup API_Data_Interfaces
  750. Return the size of the row pointer array of the matrix
  751. designated by \p interface.
  752. \def STARPU_CSR_GET_NZVAL(interface)
  753. \ingroup API_Data_Interfaces
  754. Return a pointer to the non-zero values of the matrix
  755. designated by \p interface.
  756. \def STARPU_CSR_GET_NZVAL_DEV_HANDLE(interface)
  757. \ingroup API_Data_Interfaces
  758. Return a device handle for the array of non-zero values in the
  759. matrix designated by \p interface. The offset documented below has to be
  760. used in addition to this.
  761. \def STARPU_CSR_GET_COLIND(interface)
  762. \ingroup API_Data_Interfaces
  763. Return a pointer to the column index of the matrix designated
  764. by \p interface.
  765. \def STARPU_CSR_GET_COLIND_DEV_HANDLE(interface)
  766. \ingroup API_Data_Interfaces
  767. Return a device handle for the column index of the matrix
  768. designated by \p interface. The offset documented below has to be used in
  769. addition to this.
  770. \def STARPU_CSR_GET_ROWPTR(interface)
  771. \ingroup API_Data_Interfaces
  772. Return a pointer to the row pointer array of the matrix
  773. designated by \p interface.
  774. \def STARPU_CSR_GET_ROWPTR_DEV_HANDLE(interface)
  775. \ingroup API_Data_Interfaces
  776. Return a device handle for the row pointer array of the matrix
  777. designated by \p interface. The offset documented below has to be used in
  778. addition to this.
  779. \def STARPU_CSR_GET_OFFSET
  780. \ingroup API_Data_Interfaces
  781. Return the offset in the arrays (colind, rowptr, nzval) of the
  782. matrix designated by \p interface, to be used with the device handles.
  783. \def STARPU_CSR_GET_FIRSTENTRY(interface)
  784. \ingroup API_Data_Interfaces
  785. Return the index at which all arrays (the column indexes, the
  786. row pointers...) of the \p interface start.
  787. \def STARPU_CSR_GET_ELEMSIZE(interface)
  788. \ingroup API_Data_Interfaces
  789. Return the size of the elements registered into the matrix
  790. designated by \p interface.
  791. @name Accessing COO Data Interfaces
  792. \ingroup API_Data_Interfaces
  793. \struct starpu_coo_interface
  794. COO Matrices
  795. \ingroup API_Data_Interfaces
  796. \var enum starpu_data_interface_id starpu_coo_interface::id
  797. identifier of the interface
  798. \var uint32_t *starpu_coo_interface::columns
  799. column array of the matrix
  800. \var uint32_t *starpu_coo_interface::rows
  801. row array of the matrix
  802. \var uintptr_t starpu_coo_interface::values
  803. values of the matrix
  804. \var uint32_t starpu_coo_interface::nx
  805. number of elements on the x-axis of the matrix
  806. \var uint32_t starpu_coo_interface::ny
  807. number of elements on the y-axis of the matrix
  808. \var uint32_t starpu_coo_interface::n_values
  809. number of values registered in the matrix
  810. \var size_t starpu_coo_interface::elemsize
  811. size of the elements of the matrix
  812. \def STARPU_COO_GET_COLUMNS(interface)
  813. \ingroup API_Data_Interfaces
  814. Return a pointer to the column array of the matrix designated
  815. by \p interface.
  816. \def STARPU_COO_GET_COLUMNS_DEV_HANDLE(interface)
  817. \ingroup API_Data_Interfaces
  818. Return a device handle for the column array of the matrix
  819. designated by \p interface, to be used on OpenCL. The offset documented
  820. below has to be used in addition to this.
  821. \def STARPU_COO_GET_ROWS(interface)
  822. \ingroup API_Data_Interfaces
  823. Return a pointer to the rows array of the matrix designated by
  824. \p interface.
  825. \def STARPU_COO_GET_ROWS_DEV_HANDLE(interface)
  826. \ingroup API_Data_Interfaces
  827. Return a device handle for the row array of the matrix
  828. designated by \p interface, to be used on OpenCL. The offset documented
  829. below has to be used in addition to this.
  830. \def STARPU_COO_GET_VALUES(interface)
  831. \ingroup API_Data_Interfaces
  832. Return a pointer to the values array of the matrix designated
  833. by \p interface.
  834. \def STARPU_COO_GET_VALUES_DEV_HANDLE(interface)
  835. \ingroup API_Data_Interfaces
  836. Return a device handle for the value array of the matrix
  837. designated by \p interface, to be used on OpenCL. The offset documented
  838. below has to be used in addition to this.
  839. \def STARPU_COO_GET_OFFSET
  840. \ingroup API_Data_Interfaces
  841. Return the offset in the arrays of the COO matrix designated by
  842. \p interface.
  843. \def STARPU_COO_GET_NX(interface)
  844. \ingroup API_Data_Interfaces
  845. Return the number of elements on the x-axis of the matrix
  846. designated by \p interface.
  847. \def STARPU_COO_GET_NY(interface)
  848. \ingroup API_Data_Interfaces
  849. Return the number of elements on the y-axis of the matrix
  850. designated by \p interface.
  851. \def STARPU_COO_GET_NVALUES(interface)
  852. \ingroup API_Data_Interfaces
  853. Return the number of values registered in the matrix designated
  854. by \p interface.
  855. \def STARPU_COO_GET_ELEMSIZE(interface)
  856. \ingroup API_Data_Interfaces
  857. Return the size of the elements registered into the matrix
  858. designated by \p interface.
  859. @name Defining Interface
  860. \ingroup API_Data_Interfaces
  861. Applications can provide their own interface as shown in \ref
  862. DefiningANewDataInterface.
  863. \fn uintptr_t starpu_malloc_on_node(unsigned dst_node, size_t size)
  864. \ingroup API_Data_Interfaces
  865. Allocate \p size bytes on node \p dst_node. This returns 0 if
  866. allocation failed, the allocation method should then return <c>-ENOMEM</c> as
  867. allocated size. Deallocation must be done with starpu_free_on_node.
  868. \fn void starpu_free_on_node(unsigned dst_node, uintptr_t addr, size_t size)
  869. \ingroup API_Data_Interfaces
  870. Free \p addr of \p size bytes on node \p dst_node which was previously allocated
  871. with starpu_malloc_on_node.
  872. \fn int starpu_interface_copy(uintptr_t src, size_t src_offset, unsigned src_node, uintptr_t dst, size_t dst_offset, unsigned dst_node, size_t size, void *async_data)
  873. \ingroup API_Data_Interfaces
  874. Copy \p size bytes from byte offset \p src_offset of \p src on \p src_node
  875. to byte offset \p dst_offset of \p dst on \p dst_node. This is to be used in
  876. the any_to_any() copy method, which is provided with the async_data to
  877. be passed to starpu_interface_copy(). this returns <c>-EAGAIN</c> if the
  878. transfer is still ongoing, or 0 if the transfer is already completed.
  879. \fn uint32_t starpu_hash_crc32c_be_n(const void *input, size_t n, uint32_t inputcrc)
  880. \ingroup API_Data_Interfaces
  881. Compute the CRC of a byte buffer seeded by the \p inputcrc
  882. <em>current state</em>. The return value should be considered as the new
  883. <em>current state</em> for future CRC computation. This is used for computing
  884. data size footprint.
  885. \fn uint32_t starpu_hash_crc32c_be(uint32_t input, uint32_t inputcrc)
  886. \ingroup API_Data_Interfaces
  887. Compute the CRC of a 32bit number seeded by the \p inputcrc
  888. <em>current state</em>. The return value should be considered as the new
  889. <em>current state</em> for future CRC computation. This is used for computing
  890. data size footprint.
  891. \fn uint32_t starpu_hash_crc32c_string(const char *str, uint32_t inputcrc)
  892. \ingroup API_Data_Interfaces
  893. Compute the CRC of a string seeded by the \p inputcrc <em>current
  894. state</em>. The return value should be considered as the new <em>current
  895. state</em> for future CRC computation. This is used for computing data
  896. size footprint.
  897. \fn int starpu_data_interface_get_next_id(void)
  898. \ingroup API_Data_Interfaces
  899. Return the next available id for a newly created data interface
  900. (\ref DefiningANewDataInterface).
  901. */