data_interfaces.doxy 47 KB

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