data_interfaces.doxy 43 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054
  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 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 starpu_data_copy_methods::can_copy
  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 starpu_data_copy_methods::ram_to_ram
  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 starpu_data_copy_methods::ram_to_cuda
  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 starpu_data_copy_methods::ram_to_opencl
  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 starpu_data_copy_methods::ram_to_mic
  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 starpu_data_copy_methods::cuda_to_ram
  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 starpu_data_copy_methods::cuda_to_cuda
  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 starpu_data_copy_methods::cuda_to_opencl
  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 starpu_data_copy_methods::opencl_to_ram
  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 starpu_data_copy_methods::opencl_to_cuda
  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 starpu_data_copy_methods::opencl_to_opencl
  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 starpu_data_copy_methods::mic_to_ram
  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 starpu_data_copy_methods::scc_src_to_sink
  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 starpu_data_copy_methods::scc_sink_to_src
  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 starpu_data_copy_methods::scc_sink_to_sink
  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 starpu_data_copy_methods::ram_to_cuda_async
  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 starpu_data_copy_methods::cuda_to_ram_async
  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 starpu_data_copy_methods::cuda_to_cuda_async
  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 starpu_data_copy_methods::ram_to_opencl_async
  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 starpu_data_copy_methods::opencl_to_ram_async
  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 starpu_data_copy_methods::opencl_to_opencl_async
  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 starpu_data_copy_methods::ram_to_mic_async
  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 starpu_data_copy_methods::mic_to_ram_async
  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 starpu_data_copy_methods::any_to_any
  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 starpu_variable_interface::id
  355. Identifier of the interface
  356. \var starpu_variable_interface::ptr
  357. local pointer of the variable
  358. \var starpu_variable_interface::dev_handle
  359. device handle of the variable.
  360. \var starpu_variable_interface::offset
  361. offset in the variable
  362. \var 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 starpu_vector_interface::id
  391. Identifier of the interface
  392. \var starpu_vector_interface::ptr
  393. local pointer of the vector
  394. \var starpu_vector_interface::dev_handle
  395. device handle of the vector.
  396. \var starpu_vector_interface::offset
  397. offset in the vector
  398. \var starpu_vector_interface::nx
  399. number of elements on the x-axis of the vector
  400. \var starpu_vector_interface::elemsize
  401. size of the elements of the vector
  402. \fn uint32_t starpu_vector_get_nx(starpu_data_handle_t handle)
  403. \ingroup API_Data_Interfaces
  404. Return the number of elements registered into the array designated by \p handle.
  405. \fn size_t starpu_vector_get_elemsize(starpu_data_handle_t handle)
  406. \ingroup API_Data_Interfaces
  407. Return the size of each element of the array designated by \p handle.
  408. \fn uintptr_t starpu_vector_get_local_ptr(starpu_data_handle_t handle)
  409. \ingroup API_Data_Interfaces
  410. Return the local pointer associated with \p handle.
  411. \def STARPU_VECTOR_GET_PTR(interface)
  412. \ingroup API_Data_Interfaces
  413. Return a pointer to the array designated by \p interface, valid on
  414. CPUs and CUDA only. For OpenCL, the device handle and offset need to
  415. be used instead.
  416. \def STARPU_VECTOR_GET_DEV_HANDLE(interface)
  417. \ingroup API_Data_Interfaces
  418. Return a device handle for the array designated by \p interface,
  419. to be used on OpenCL. the offset documented below has to be used in
  420. addition to this.
  421. \def STARPU_VECTOR_GET_OFFSET(interface)
  422. \ingroup API_Data_Interfaces
  423. Return the offset in the array designated by \p interface, to be
  424. used with the device handle.
  425. \def STARPU_VECTOR_GET_NX(interface)
  426. \ingroup API_Data_Interfaces
  427. Return the number of elements registered into the array
  428. designated by \p interface.
  429. \def STARPU_VECTOR_GET_ELEMSIZE(interface)
  430. \ingroup API_Data_Interfaces
  431. Return the size of each element of the array designated by
  432. \p interface.
  433. \def STARPU_VECTOR_GET_SLICE_BASE(interface)
  434. \ingroup API_Data_Interfaces
  435. Return the OpenMP slice base annotation of each element of the array designated by
  436. \p interface.
  437. \sa starpu_omp_vector_annotate
  438. @name Accessing Matrix Data Interfaces
  439. \ingroup API_Data_Interfaces
  440. \struct starpu_matrix_interface
  441. Matrix interface for dense matrices
  442. \ingroup API_Data_Interfaces
  443. \var starpu_matrix_interface::id
  444. Identifier of the interface
  445. \var starpu_matrix_interface::ptr
  446. local pointer of the matrix
  447. \var starpu_matrix_interface::dev_handle
  448. device handle of the matrix.
  449. \var starpu_matrix_interface::offset
  450. offset in the matrix
  451. \var starpu_matrix_interface::nx
  452. number of elements on the x-axis of the matrix
  453. \var starpu_matrix_interface::ny
  454. number of elements on the y-axis of the matrix
  455. \var starpu_matrix_interface::ld
  456. number of elements between each row of the matrix. Maybe be equal to
  457. starpu_matrix_interface::nx when there is no padding.
  458. \var starpu_matrix_interface::elemsize
  459. size of the elements of the matrix
  460. \fn uint32_t starpu_matrix_get_nx(starpu_data_handle_t handle)
  461. \ingroup API_Data_Interfaces
  462. Return the number of elements on the x-axis of the matrix
  463. designated by \p handle.
  464. \fn uint32_t starpu_matrix_get_ny(starpu_data_handle_t handle)
  465. \ingroup API_Data_Interfaces
  466. Return the number of elements on the y-axis of the matrix
  467. designated by \p handle.
  468. \fn uint32_t starpu_matrix_get_local_ld(starpu_data_handle_t handle)
  469. \ingroup API_Data_Interfaces
  470. Return the number of elements between each row of the matrix
  471. designated by \p handle. Maybe be equal to nx when there is no padding.
  472. \fn uintptr_t starpu_matrix_get_local_ptr(starpu_data_handle_t handle)
  473. \ingroup API_Data_Interfaces
  474. Return the local pointer associated with \p handle.
  475. \fn size_t starpu_matrix_get_elemsize(starpu_data_handle_t handle)
  476. \ingroup API_Data_Interfaces
  477. Return the size of the elements registered into the matrix
  478. designated by \p handle.
  479. \def STARPU_MATRIX_GET_PTR(interface)
  480. \ingroup API_Data_Interfaces
  481. Return a pointer to the matrix designated by \p interface, valid
  482. on CPUs and CUDA devices only. For OpenCL devices, the device handle
  483. and offset need to be used instead.
  484. \def STARPU_MATRIX_GET_DEV_HANDLE(interface)
  485. \ingroup API_Data_Interfaces
  486. Return a device handle for the matrix designated by \p interface,
  487. to be used on OpenCL. The offset documented below has to be used in
  488. addition to this.
  489. \def STARPU_MATRIX_GET_OFFSET(interface)
  490. \ingroup API_Data_Interfaces
  491. Return the offset in the matrix designated by \p interface, to be
  492. used with the device handle.
  493. \def STARPU_MATRIX_GET_NX(interface)
  494. \ingroup API_Data_Interfaces
  495. Return the number of elements on the x-axis of the matrix
  496. designated by \p interface.
  497. \def STARPU_MATRIX_GET_NY(interface)
  498. \ingroup API_Data_Interfaces
  499. Return the number of elements on the y-axis of the matrix
  500. designated by \p interface.
  501. \def STARPU_MATRIX_GET_LD(interface)
  502. \ingroup API_Data_Interfaces
  503. Return the number of elements between each row of the matrix
  504. designated by \p interface. May be equal to nx when there is no padding.
  505. \def STARPU_MATRIX_GET_ELEMSIZE(interface)
  506. \ingroup API_Data_Interfaces
  507. Return the size of the elements registered into the matrix
  508. designated by \p interface.
  509. @name Accessing Block Data Interfaces
  510. \ingroup API_Data_Interfaces
  511. \struct starpu_block_interface
  512. Block interface for 3D dense blocks
  513. \ingroup API_Data_Interfaces
  514. \var starpu_block_interface::id
  515. identifier of the interface
  516. \var starpu_block_interface::ptr
  517. local pointer of the block
  518. \var starpu_block_interface::dev_handle
  519. device handle of the block.
  520. \var starpu_block_interface::offset
  521. offset in the block.
  522. \var starpu_block_interface::nx
  523. number of elements on the x-axis of the block.
  524. \var starpu_block_interface::ny
  525. number of elements on the y-axis of the block.
  526. \var starpu_block_interface::nz
  527. number of elements on the z-axis of the block.
  528. \var starpu_block_interface::ldy
  529. number of elements between two lines
  530. \var starpu_block_interface::ldz
  531. number of elements between two planes
  532. \var starpu_block_interface::elemsize
  533. size of the elements of the block.
  534. \fn uint32_t starpu_block_get_nx(starpu_data_handle_t handle)
  535. \ingroup API_Data_Interfaces
  536. Return the number of elements on the x-axis of the block
  537. designated by \p handle.
  538. \fn uint32_t starpu_block_get_ny(starpu_data_handle_t handle)
  539. \ingroup API_Data_Interfaces
  540. Return the number of elements on the y-axis of the block
  541. designated by \p handle.
  542. \fn uint32_t starpu_block_get_nz(starpu_data_handle_t handle)
  543. \ingroup API_Data_Interfaces
  544. Return the number of elements on the z-axis of the block
  545. designated by \p handle.
  546. \fn uint32_t starpu_block_get_local_ldy(starpu_data_handle_t handle)
  547. \ingroup API_Data_Interfaces
  548. Return the number of elements between each row of the block
  549. designated by \p handle, in the format of the current memory node.
  550. \fn uint32_t starpu_block_get_local_ldz(starpu_data_handle_t handle)
  551. \ingroup API_Data_Interfaces
  552. Return the number of elements between each z plane of the block
  553. designated by \p handle, in the format of the current memory node.
  554. \fn uintptr_t starpu_block_get_local_ptr(starpu_data_handle_t handle)
  555. \ingroup API_Data_Interfaces
  556. Return the local pointer associated with \p handle.
  557. \fn size_t starpu_block_get_elemsize(starpu_data_handle_t handle)
  558. \ingroup API_Data_Interfaces
  559. Return the size of the elements of the block designated by
  560. \p handle.
  561. \def STARPU_BLOCK_GET_PTR(interface)
  562. \ingroup API_Data_Interfaces
  563. Return a pointer to the block designated by \p interface.
  564. \def STARPU_BLOCK_GET_DEV_HANDLE(interface)
  565. \ingroup API_Data_Interfaces
  566. Return a device handle for the block designated by \p interface,
  567. to be used on OpenCL. The offset document below has to be used in
  568. addition to this.
  569. \def STARPU_BLOCK_GET_OFFSET(interface)
  570. \ingroup API_Data_Interfaces
  571. Return the offset in the block designated by \p interface, to be
  572. used with the device handle.
  573. \def STARPU_BLOCK_GET_NX(interface)
  574. \ingroup API_Data_Interfaces
  575. Return the number of elements on the x-axis of the block
  576. designated by \p interface.
  577. \def STARPU_BLOCK_GET_NY(interface)
  578. \ingroup API_Data_Interfaces
  579. Return the number of elements on the y-axis of the block
  580. designated by \p interface.
  581. \def STARPU_BLOCK_GET_NZ(interface)
  582. \ingroup API_Data_Interfaces
  583. Return the number of elements on the z-axis of the block
  584. designated by \p interface.
  585. \def STARPU_BLOCK_GET_LDY(interface)
  586. \ingroup API_Data_Interfaces
  587. Return the number of elements between each row of the block
  588. designated by \p interface. May be equal to nx when there is no padding.
  589. \def STARPU_BLOCK_GET_LDZ(interface)
  590. \ingroup API_Data_Interfaces
  591. Return the number of elements between each z plane of the block
  592. designated by \p interface. May be equal to nx*ny when there is no
  593. padding.
  594. \def STARPU_BLOCK_GET_ELEMSIZE(interface)
  595. \ingroup API_Data_Interfaces
  596. Return the size of the elements of the block designated by
  597. \p interface.
  598. @name Accessing BCSR Data Interfaces
  599. \ingroup API_Data_Interfaces
  600. \struct starpu_bcsr_interface
  601. BCSR interface for sparse matrices (blocked compressed sparse
  602. row representation)
  603. \ingroup API_Data_Interfaces
  604. \var starpu_bcsr_interface::id
  605. Identifier of the interface
  606. \var starpu_bcsr_interface::nnz
  607. number of non-zero BLOCKS
  608. \var starpu_bcsr_interface::nrow
  609. number of rows (in terms of BLOCKS)
  610. \var starpu_bcsr_interface::nzval
  611. non-zero values
  612. \var starpu_bcsr_interface::colind
  613. position of non-zero entried on the row
  614. \var starpu_bcsr_interface::rowptr
  615. index (in nzval) of the first entry of the row
  616. \var starpu_bcsr_interface::firstentry
  617. k for k-based indexing (0 or 1 usually). Also useful when partitionning the matrix.
  618. \var starpu_bcsr_interface::r
  619. size of the blocks
  620. \var starpu_bcsr_interface::c
  621. size of the blocks
  622. \var starpu_bcsr_interface::elemsize;
  623. size of the elements of the matrix
  624. \fn uint32_t starpu_bcsr_get_nnz(starpu_data_handle_t handle)
  625. \ingroup API_Data_Interfaces
  626. Return the number of non-zero elements in the matrix designated
  627. by \p handle.
  628. \fn uint32_t starpu_bcsr_get_nrow(starpu_data_handle_t handle)
  629. \ingroup API_Data_Interfaces
  630. Return the number of rows (in terms of blocks of size r*c) in
  631. the matrix designated by \p handle.
  632. \fn uint32_t starpu_bcsr_get_firstentry(starpu_data_handle_t handle)
  633. \ingroup API_Data_Interfaces
  634. Return the index at which all arrays (the column indexes, the
  635. row pointers...) of the matrix desginated by \p handle.
  636. \fn uintptr_t starpu_bcsr_get_local_nzval(starpu_data_handle_t handle)
  637. \ingroup API_Data_Interfaces
  638. Return a pointer to the non-zero values of the matrix
  639. designated by \p handle.
  640. \fn uint32_t *starpu_bcsr_get_local_colind(starpu_data_handle_t handle)
  641. \ingroup API_Data_Interfaces
  642. Return a pointer to the column index, which holds the positions
  643. of the non-zero entries in the matrix designated by \p handle.
  644. \fn uint32_t *starpu_bcsr_get_local_rowptr(starpu_data_handle_t handle)
  645. \ingroup API_Data_Interfaces
  646. Return the row pointer array of the matrix designated by
  647. \p handle.
  648. \fn uint32_t starpu_bcsr_get_r(starpu_data_handle_t handle)
  649. \ingroup API_Data_Interfaces
  650. Return the number of rows in a block.
  651. \fn uint32_t starpu_bcsr_get_c(starpu_data_handle_t handle)
  652. \ingroup API_Data_Interfaces
  653. Return the numberof columns in a block.
  654. \fn size_t starpu_bcsr_get_elemsize(starpu_data_handle_t handle)
  655. \ingroup API_Data_Interfaces
  656. Return the size of the elements in the matrix designated by
  657. \p handle.
  658. \def STARPU_BCSR_GET_NNZ(interface)
  659. \ingroup API_Data_Interfaces
  660. Return the number of non-zero values in the matrix designated
  661. by \p interface.
  662. \def STARPU_BCSR_GET_NZVAL(interface)
  663. \ingroup API_Data_Interfaces
  664. Return a pointer to the non-zero values of the matrix
  665. designated by \p interface.
  666. \def STARPU_BCSR_GET_NZVAL_DEV_HANDLE(interface)
  667. \ingroup API_Data_Interfaces
  668. Return a device handle for the array of non-zero values in the
  669. matrix designated by \p interface. The offset documented below has to be
  670. used in addition to this.
  671. \def STARPU_BCSR_GET_COLIND(interface)
  672. \ingroup API_Data_Interfaces
  673. Return a pointer to the column index of the matrix designated
  674. by \p interface.
  675. \def STARPU_BCSR_GET_COLIND_DEV_HANDLE(interface)
  676. \ingroup API_Data_Interfaces
  677. Return a device handle for the column index of the matrix
  678. designated by \p interface. The offset documented below has to be used in
  679. addition to this.
  680. \def STARPU_BCSR_GET_ROWPTR(interface)
  681. \ingroup API_Data_Interfaces
  682. Return a pointer to the row pointer array of the matrix
  683. designated by \p interface.
  684. \def STARPU_BCSR_GET_ROWPTR_DEV_HANDLE(interface)
  685. \ingroup API_Data_Interfaces
  686. Return a device handle for the row pointer array of the matrix
  687. designated by \p interface. The offset documented below has to be used in
  688. addition to this.
  689. \def STARPU_BCSR_GET_OFFSET
  690. \ingroup API_Data_Interfaces
  691. Return the offset in the arrays (coling, rowptr, nzval) of the
  692. matrix designated by \p interface, to be used with the device handles.
  693. @name Accessing CSR Data Interfaces
  694. \ingroup API_Data_Interfaces
  695. \struct starpu_csr_interface
  696. CSR interface for sparse matrices (compressed sparse row representation)
  697. \ingroup API_Data_Interfaces
  698. \var starpu_csr_interface::id
  699. Identifier of the interface
  700. \var starpu_csr_interface::nnz
  701. number of non-zero entries
  702. \var starpu_csr_interface::nrow
  703. number of rows
  704. \var starpu_csr_interface::nzval
  705. non-zero values
  706. \var starpu_csr_interface::colind
  707. position of non-zero entries on the row
  708. \var starpu_csr_interface::rowptr
  709. index (in nzval) of the first entry of the row
  710. \var starpu_csr_interface::firstentry
  711. k for k-based indexing (0 or 1 usually). also useful when partitionning the matrix.
  712. \var starpu_csr_interface::elemsize
  713. size of the elements of the matrix
  714. \fn uint32_t starpu_csr_get_nnz(starpu_data_handle_t handle)
  715. \ingroup API_Data_Interfaces
  716. Return the number of non-zero values in the matrix designated
  717. by \p handle.
  718. \fn uint32_t starpu_csr_get_nrow(starpu_data_handle_t handle)
  719. \ingroup API_Data_Interfaces
  720. Return the size of the row pointer array of the matrix
  721. designated by \p handle.
  722. \fn uint32_t starpu_csr_get_firstentry(starpu_data_handle_t handle)
  723. \ingroup API_Data_Interfaces
  724. Return the index at which all arrays (the column indexes, the
  725. row pointers...) of the matrix designated by \p handle.
  726. \fn uintptr_t starpu_csr_get_local_nzval(starpu_data_handle_t handle)
  727. \ingroup API_Data_Interfaces
  728. Return a local pointer to the non-zero values of the matrix
  729. designated by \p handle.
  730. \fn uint32_t *starpu_csr_get_local_colind(starpu_data_handle_t handle)
  731. \ingroup API_Data_Interfaces
  732. Return a local pointer to the column index of the matrix
  733. designated by \p handle.
  734. \fn uint32_t *starpu_csr_get_local_rowptr(starpu_data_handle_t handle)
  735. \ingroup API_Data_Interfaces
  736. Return a local pointer to the row pointer array of the matrix
  737. designated by \p handle.
  738. \fn size_t starpu_csr_get_elemsize(starpu_data_handle_t handle)
  739. \ingroup API_Data_Interfaces
  740. Return the size of the elements registered into the matrix
  741. designated by \p handle.
  742. \def STARPU_CSR_GET_NNZ(interface)
  743. \ingroup API_Data_Interfaces
  744. Return the number of non-zero values in the matrix designated
  745. by \p interface.
  746. \def STARPU_CSR_GET_NROW(interface)
  747. \ingroup API_Data_Interfaces
  748. Return the size of the row pointer array of the matrix
  749. designated by \p interface.
  750. \def STARPU_CSR_GET_NZVAL(interface)
  751. \ingroup API_Data_Interfaces
  752. Return a pointer to the non-zero values of the matrix
  753. designated by \p interface.
  754. \def STARPU_CSR_GET_NZVAL_DEV_HANDLE(interface)
  755. \ingroup API_Data_Interfaces
  756. Return a device handle for the array of non-zero values in the
  757. matrix designated by \p interface. The offset documented below has to be
  758. used in addition to this.
  759. \def STARPU_CSR_GET_COLIND(interface)
  760. \ingroup API_Data_Interfaces
  761. Return a pointer to the column index of the matrix designated
  762. by \p interface.
  763. \def STARPU_CSR_GET_COLIND_DEV_HANDLE(interface)
  764. \ingroup API_Data_Interfaces
  765. Return a device handle for the column index of the matrix
  766. designated by \p interface. The offset documented below has to be used in
  767. addition to this.
  768. \def STARPU_CSR_GET_ROWPTR(interface)
  769. \ingroup API_Data_Interfaces
  770. Return a pointer to the row pointer array of the matrix
  771. designated by \p interface.
  772. \def STARPU_CSR_GET_ROWPTR_DEV_HANDLE(interface)
  773. \ingroup API_Data_Interfaces
  774. Return a device handle for the row pointer array of the matrix
  775. designated by \p interface. The offset documented below has to be used in
  776. addition to this.
  777. \def STARPU_CSR_GET_OFFSET
  778. \ingroup API_Data_Interfaces
  779. Return the offset in the arrays (colind, rowptr, nzval) of the
  780. matrix designated by \p interface, to be used with the device handles.
  781. \def STARPU_CSR_GET_FIRSTENTRY(interface)
  782. \ingroup API_Data_Interfaces
  783. Return the index at which all arrays (the column indexes, the
  784. row pointers...) of the \p interface start.
  785. \def STARPU_CSR_GET_ELEMSIZE(interface)
  786. \ingroup API_Data_Interfaces
  787. Return the size of the elements registered into the matrix
  788. designated by \p interface.
  789. @name Accessing COO Data Interfaces
  790. \ingroup API_Data_Interfaces
  791. \struct starpu_coo_interface
  792. COO Matrices
  793. \ingroup API_Data_Interfaces
  794. \var starpu_coo_interface::id
  795. identifier of the interface
  796. \var starpu_coo_interface::columns
  797. column array of the matrix
  798. \var starpu_coo_interface::rows
  799. row array of the matrix
  800. \var starpu_coo_interface::values
  801. values of the matrix
  802. \var starpu_coo_interface::nx
  803. number of elements on the x-axis of the matrix
  804. \var starpu_coo_interface::ny
  805. number of elements on the y-axis of the matrix
  806. \var starpu_coo_interface::n_values
  807. number of values registered in the matrix
  808. \var starpu_coo_interface::elemsize
  809. size of the elements of the matrix
  810. \def STARPU_COO_GET_COLUMNS(interface)
  811. \ingroup API_Data_Interfaces
  812. Return a pointer to the column array of the matrix designated
  813. by \p interface.
  814. \def STARPU_COO_GET_COLUMNS_DEV_HANDLE(interface)
  815. \ingroup API_Data_Interfaces
  816. Return a device handle for the column array of the matrix
  817. designated by \p interface, to be used on OpenCL. The offset documented
  818. below has to be used in addition to this.
  819. \def STARPU_COO_GET_ROWS(interface)
  820. \ingroup API_Data_Interfaces
  821. Return a pointer to the rows array of the matrix designated by
  822. \p interface.
  823. \def STARPU_COO_GET_ROWS_DEV_HANDLE(interface)
  824. \ingroup API_Data_Interfaces
  825. Return a device handle for the row array of the matrix
  826. designated by \p interface, to be used on OpenCL. The offset documented
  827. below has to be used in addition to this.
  828. \def STARPU_COO_GET_VALUES(interface)
  829. \ingroup API_Data_Interfaces
  830. Return a pointer to the values array of the matrix designated
  831. by \p interface.
  832. \def STARPU_COO_GET_VALUES_DEV_HANDLE(interface)
  833. \ingroup API_Data_Interfaces
  834. Return a device handle for the value array of the matrix
  835. designated by \p interface, to be used on OpenCL. The offset documented
  836. below has to be used in addition to this.
  837. \def STARPU_COO_GET_OFFSET
  838. \ingroup API_Data_Interfaces
  839. Return the offset in the arrays of the COO matrix designated by
  840. \p interface.
  841. \def STARPU_COO_GET_NX(interface)
  842. \ingroup API_Data_Interfaces
  843. Return the number of elements on the x-axis of the matrix
  844. designated by \p interface.
  845. \def STARPU_COO_GET_NY(interface)
  846. \ingroup API_Data_Interfaces
  847. Return the number of elements on the y-axis of the matrix
  848. designated by \p interface.
  849. \def STARPU_COO_GET_NVALUES(interface)
  850. \ingroup API_Data_Interfaces
  851. Return the number of values registered in the matrix designated
  852. by \p interface.
  853. \def STARPU_COO_GET_ELEMSIZE(interface)
  854. \ingroup API_Data_Interfaces
  855. Return the size of the elements registered into the matrix
  856. designated by \p interface.
  857. @name Defining Interface
  858. \ingroup API_Data_Interfaces
  859. Applications can provide their own interface as shown in \ref
  860. DefiningANewDataInterface.
  861. \fn uintptr_t starpu_malloc_on_node(unsigned dst_node, size_t size)
  862. \ingroup API_Data_Interfaces
  863. Allocate \p size bytes on node \p dst_node. This returns 0 if
  864. allocation failed, the allocation method should then return <c>-ENOMEM</c> as
  865. allocated size. Deallocation must be done with starpu_free_on_node.
  866. \fn void starpu_free_on_node(unsigned dst_node, uintptr_t addr, size_t size)
  867. \ingroup API_Data_Interfaces
  868. Free \p addr of \p size bytes on node \p dst_node which was previously allocated
  869. with starpu_malloc_on_node.
  870. \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)
  871. \ingroup API_Data_Interfaces
  872. Copy \p size bytes from byte offset \p src_offset of \p src on \p src_node
  873. to byte offset \p dst_offset of \p dst on \p dst_node. This is to be used in
  874. the any_to_any() copy method, which is provided with the async_data to
  875. be passed to starpu_interface_copy(). this returns <c>-EAGAIN</c> if the
  876. transfer is still ongoing, or 0 if the transfer is already completed.
  877. \fn uint32_t starpu_hash_crc32c_be_n(const void *input, size_t n, uint32_t inputcrc)
  878. \ingroup API_Data_Interfaces
  879. Compute the CRC of a byte buffer seeded by the \p inputcrc
  880. <em>current state</em>. The return value should be considered as the new
  881. <em>current state</em> for future CRC computation. This is used for computing
  882. data size footprint.
  883. \fn uint32_t starpu_hash_crc32c_be(uint32_t input, uint32_t inputcrc)
  884. \ingroup API_Data_Interfaces
  885. Compute the CRC of a 32bit number seeded by the \p inputcrc
  886. <em>current state</em>. The return value should be considered as the new
  887. <em>current state</em> for future CRC computation. This is used for computing
  888. data size footprint.
  889. \fn uint32_t starpu_hash_crc32c_string(const char *str, uint32_t inputcrc)
  890. \ingroup API_Data_Interfaces
  891. Compute the CRC of a string seeded by the \p inputcrc <em>current
  892. state</em>. The return value should be considered as the new <em>current
  893. state</em> for future CRC computation. This is used for computing data
  894. size footprint.
  895. \fn int starpu_data_interface_get_next_id(void)
  896. \ingroup API_Data_Interfaces
  897. Return the next available id for a newly created data interface
  898. (\ref DefiningANewDataInterface).
  899. */