data_interfaces.doxy 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047
  1. /*
  2. * This file is part of the StarPU Handbook.
  3. * Copyright (C) 2009--2011 Universit@'e de Bordeaux 1
  4. * Copyright (C) 2010, 2011, 2012, 2013 Centre National de la Recherche Scientifique
  5. * Copyright (C) 2011, 2012 Institut National de Recherche en Informatique et Automatique
  6. * See the file version.doxy for copying conditions.
  7. */
  8. /*! \defgroup API_Data_Interfaces Data Interfaces
  9. \struct starpu_data_interface_ops
  10. Per-interface data transfer methods.
  11. \ingroup API_Data_Interfaces
  12. \var starpu_data_interface_ops::register_data_handle
  13. Register an existing interface into a data handle.
  14. \var starpu_data_interface_ops::allocate_data_on_node
  15. Allocate data for the interface on a given node.
  16. \var starpu_data_interface_ops::free_data_on_node
  17. Free data of the interface on a given node.
  18. \var starpu_data_interface_ops::copy_methods
  19. ram/cuda/opencl synchronous and asynchronous transfer methods.
  20. \var starpu_data_interface_ops::handle_to_pointer
  21. Return the current pointer (if any) for the handle on the given node.
  22. \var starpu_data_interface_ops::get_size
  23. Return an estimation of the size of data, for performance models.
  24. \var starpu_data_interface_ops::footprint
  25. Return a 32bit footprint which characterizes the data size.
  26. \var starpu_data_interface_ops::compare
  27. Compare the data size of two interfaces.
  28. \var starpu_data_interface_ops::display
  29. Dump the sizes of a handle to a file.
  30. \var starpu_data_interface_ops::describe
  31. Describe the data into a string.
  32. \var starpu_data_interface_ops::interfaceid
  33. An identifier that is unique to each interface.
  34. \var starpu_data_interface_ops::interface_size
  35. The size of the interface data descriptor.
  36. \var starpu_data_interface_ops::is_multiformat
  37. todo
  38. \var starpu_data_interface_ops::get_mf_ops
  39. todo
  40. \var starpu_data_interface_ops::pack_data
  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 starpu_data_interface_ops::unpack_data
  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. @name Accessing Matrix Data Interfaces
  434. \ingroup API_Data_Interfaces
  435. \struct starpu_matrix_interface
  436. Matrix interface for dense matrices
  437. \ingroup API_Data_Interfaces
  438. \var starpu_matrix_interface::id
  439. Identifier of the interface
  440. \var starpu_matrix_interface::ptr
  441. local pointer of the matrix
  442. \var starpu_matrix_interface::dev_handle
  443. device handle of the matrix.
  444. \var starpu_matrix_interface::offset
  445. offset in the matrix
  446. \var starpu_matrix_interface::nx
  447. number of elements on the x-axis of the matrix
  448. \var starpu_matrix_interface::ny
  449. number of elements on the y-axis of the matrix
  450. \var starpu_matrix_interface::ld
  451. number of elements between each row of the matrix. Maybe be equal to
  452. starpu_matrix_interface::nx when there is no padding.
  453. \var starpu_matrix_interface::elemsize
  454. size of the elements of the matrix
  455. \fn uint32_t starpu_matrix_get_nx(starpu_data_handle_t handle)
  456. \ingroup API_Data_Interfaces
  457. Return the number of elements on the x-axis of the matrix
  458. designated by \p handle.
  459. \fn uint32_t starpu_matrix_get_ny(starpu_data_handle_t handle)
  460. \ingroup API_Data_Interfaces
  461. Return the number of elements on the y-axis of the matrix
  462. designated by \p handle.
  463. \fn uint32_t starpu_matrix_get_local_ld(starpu_data_handle_t handle)
  464. \ingroup API_Data_Interfaces
  465. Return the number of elements between each row of the matrix
  466. designated by \p handle. Maybe be equal to nx when there is no padding.
  467. \fn uintptr_t starpu_matrix_get_local_ptr(starpu_data_handle_t handle)
  468. \ingroup API_Data_Interfaces
  469. Return the local pointer associated with \p handle.
  470. \fn size_t starpu_matrix_get_elemsize(starpu_data_handle_t handle)
  471. \ingroup API_Data_Interfaces
  472. Return the size of the elements registered into the matrix
  473. designated by \p handle.
  474. \def STARPU_MATRIX_GET_PTR(interface)
  475. \ingroup API_Data_Interfaces
  476. Return a pointer to the matrix designated by \p interface, valid
  477. on CPUs and CUDA devices only. For OpenCL devices, the device handle
  478. and offset need to be used instead.
  479. \def STARPU_MATRIX_GET_DEV_HANDLE(interface)
  480. \ingroup API_Data_Interfaces
  481. Return a device handle for the matrix designated by \p interface,
  482. to be used on OpenCL. The offset documented below has to be used in
  483. addition to this.
  484. \def STARPU_MATRIX_GET_OFFSET(interface)
  485. \ingroup API_Data_Interfaces
  486. Return the offset in the matrix designated by \p interface, to be
  487. used with the device handle.
  488. \def STARPU_MATRIX_GET_NX(interface)
  489. \ingroup API_Data_Interfaces
  490. Return the number of elements on the x-axis of the matrix
  491. designated by \p interface.
  492. \def STARPU_MATRIX_GET_NY(interface)
  493. \ingroup API_Data_Interfaces
  494. Return the number of elements on the y-axis of the matrix
  495. designated by \p interface.
  496. \def STARPU_MATRIX_GET_LD(interface)
  497. \ingroup API_Data_Interfaces
  498. Return the number of elements between each row of the matrix
  499. designated by \p interface. May be equal to nx when there is no padding.
  500. \def STARPU_MATRIX_GET_ELEMSIZE(interface)
  501. \ingroup API_Data_Interfaces
  502. Return the size of the elements registered into the matrix
  503. designated by \p interface.
  504. @name Accessing Block Data Interfaces
  505. \ingroup API_Data_Interfaces
  506. \struct starpu_block_interface
  507. Block interface for 3D dense blocks
  508. \ingroup API_Data_Interfaces
  509. \var starpu_block_interface::id
  510. identifier of the interface
  511. \var starpu_block_interface::ptr
  512. local pointer of the block
  513. \var starpu_block_interface::dev_handle
  514. device handle of the block.
  515. \var starpu_block_interface::offset
  516. offset in the block.
  517. \var starpu_block_interface::nx
  518. number of elements on the x-axis of the block.
  519. \var starpu_block_interface::ny
  520. number of elements on the y-axis of the block.
  521. \var starpu_block_interface::nz
  522. number of elements on the z-axis of the block.
  523. \var starpu_block_interface::ldy
  524. number of elements between two lines
  525. \var starpu_block_interface::ldz
  526. number of elements between two planes
  527. \var starpu_block_interface::elemsize
  528. size of the elements of the block.
  529. \fn uint32_t starpu_block_get_nx(starpu_data_handle_t handle)
  530. \ingroup API_Data_Interfaces
  531. Return the number of elements on the x-axis of the block
  532. designated by \p handle.
  533. \fn uint32_t starpu_block_get_ny(starpu_data_handle_t handle)
  534. \ingroup API_Data_Interfaces
  535. Return the number of elements on the y-axis of the block
  536. designated by \p handle.
  537. \fn uint32_t starpu_block_get_nz(starpu_data_handle_t handle)
  538. \ingroup API_Data_Interfaces
  539. Return the number of elements on the z-axis of the block
  540. designated by \p handle.
  541. \fn uint32_t starpu_block_get_local_ldy(starpu_data_handle_t handle)
  542. \ingroup API_Data_Interfaces
  543. Return the number of elements between each row of the block
  544. designated by \p handle, in the format of the current memory node.
  545. \fn uint32_t starpu_block_get_local_ldz(starpu_data_handle_t handle)
  546. \ingroup API_Data_Interfaces
  547. Return the number of elements between each z plane of the block
  548. designated by \p handle, in the format of the current memory node.
  549. \fn uintptr_t starpu_block_get_local_ptr(starpu_data_handle_t handle)
  550. \ingroup API_Data_Interfaces
  551. Return the local pointer associated with \p handle.
  552. \fn size_t starpu_block_get_elemsize(starpu_data_handle_t handle)
  553. \ingroup API_Data_Interfaces
  554. Return the size of the elements of the block designated by
  555. \p handle.
  556. \def STARPU_BLOCK_GET_PTR(interface)
  557. \ingroup API_Data_Interfaces
  558. Return a pointer to the block designated by \p interface.
  559. \def STARPU_BLOCK_GET_DEV_HANDLE(interface)
  560. \ingroup API_Data_Interfaces
  561. Return a device handle for the block designated by \p interface,
  562. to be used on OpenCL. The offset document below has to be used in
  563. addition to this.
  564. \def STARPU_BLOCK_GET_OFFSET(interface)
  565. \ingroup API_Data_Interfaces
  566. Return the offset in the block designated by \p interface, to be
  567. used with the device handle.
  568. \def STARPU_BLOCK_GET_NX(interface)
  569. \ingroup API_Data_Interfaces
  570. Return the number of elements on the x-axis of the block
  571. designated by \p interface.
  572. \def STARPU_BLOCK_GET_NY(interface)
  573. \ingroup API_Data_Interfaces
  574. Return the number of elements on the y-axis of the block
  575. designated by \p interface.
  576. \def STARPU_BLOCK_GET_NZ(interface)
  577. \ingroup API_Data_Interfaces
  578. Return the number of elements on the z-axis of the block
  579. designated by \p interface.
  580. \def STARPU_BLOCK_GET_LDY(interface)
  581. \ingroup API_Data_Interfaces
  582. Return the number of elements between each row of the block
  583. designated by \p interface. May be equal to nx when there is no padding.
  584. \def STARPU_BLOCK_GET_LDZ(interface)
  585. \ingroup API_Data_Interfaces
  586. Return the number of elements between each z plane of the block
  587. designated by \p interface. May be equal to nx*ny when there is no
  588. padding.
  589. \def STARPU_BLOCK_GET_ELEMSIZE(interface)
  590. \ingroup API_Data_Interfaces
  591. Return the size of the elements of the block designated by
  592. \p interface.
  593. @name Accessing BCSR Data Interfaces
  594. \ingroup API_Data_Interfaces
  595. \struct starpu_bcsr_interface
  596. BCSR interface for sparse matrices (blocked compressed sparse
  597. row representation)
  598. \ingroup API_Data_Interfaces
  599. \var starpu_bcsr_interface::id
  600. Identifier of the interface
  601. \var starpu_bcsr_interface::nnz
  602. number of non-zero BLOCKS
  603. \var starpu_bcsr_interface::nrow
  604. number of rows (in terms of BLOCKS)
  605. \var starpu_bcsr_interface::nzval
  606. non-zero values
  607. \var starpu_bcsr_interface::colind
  608. position of non-zero entried on the row
  609. \var starpu_bcsr_interface::rowptr
  610. index (in nzval) of the first entry of the row
  611. \var starpu_bcsr_interface::firstentry
  612. k for k-based indexing (0 or 1 usually). Also useful when partitionning the matrix.
  613. \var starpu_bcsr_interface::r
  614. size of the blocks
  615. \var starpu_bcsr_interface::c
  616. size of the blocks
  617. \var starpu_bcsr_interface::elemsize;
  618. size of the elements of the matrix
  619. \fn uint32_t starpu_bcsr_get_nnz(starpu_data_handle_t handle)
  620. \ingroup API_Data_Interfaces
  621. Return the number of non-zero elements in the matrix designated
  622. by \p handle.
  623. \fn uint32_t starpu_bcsr_get_nrow(starpu_data_handle_t handle)
  624. \ingroup API_Data_Interfaces
  625. Return the number of rows (in terms of blocks of size r*c) in
  626. the matrix designated by \p handle.
  627. \fn uint32_t starpu_bcsr_get_firstentry(starpu_data_handle_t handle)
  628. \ingroup API_Data_Interfaces
  629. Return the index at which all arrays (the column indexes, the
  630. row pointers...) of the matrix desginated by \p handle.
  631. \fn uintptr_t starpu_bcsr_get_local_nzval(starpu_data_handle_t handle)
  632. \ingroup API_Data_Interfaces
  633. Return a pointer to the non-zero values of the matrix
  634. designated by \p handle.
  635. \fn uint32_t *starpu_bcsr_get_local_colind(starpu_data_handle_t handle)
  636. \ingroup API_Data_Interfaces
  637. Return a pointer to the column index, which holds the positions
  638. of the non-zero entries in the matrix designated by \p handle.
  639. \fn uint32_t *starpu_bcsr_get_local_rowptr(starpu_data_handle_t handle)
  640. \ingroup API_Data_Interfaces
  641. Return the row pointer array of the matrix designated by
  642. \p handle.
  643. \fn uint32_t starpu_bcsr_get_r(starpu_data_handle_t handle)
  644. \ingroup API_Data_Interfaces
  645. Return the number of rows in a block.
  646. \fn uint32_t starpu_bcsr_get_c(starpu_data_handle_t handle)
  647. \ingroup API_Data_Interfaces
  648. Return the numberof columns in a block.
  649. \fn size_t starpu_bcsr_get_elemsize(starpu_data_handle_t handle)
  650. \ingroup API_Data_Interfaces
  651. Return the size of the elements in the matrix designated by
  652. \p handle.
  653. \def STARPU_BCSR_GET_NNZ(interface)
  654. \ingroup API_Data_Interfaces
  655. Return the number of non-zero values in the matrix designated
  656. by \p interface.
  657. \def STARPU_BCSR_GET_NZVAL(interface)
  658. \ingroup API_Data_Interfaces
  659. Return a pointer to the non-zero values of the matrix
  660. designated by \p interface.
  661. \def STARPU_BCSR_GET_NZVAL_DEV_HANDLE(interface)
  662. \ingroup API_Data_Interfaces
  663. Return a device handle for the array of non-zero values in the
  664. matrix designated by \p interface. The offset documented below has to be
  665. used in addition to this.
  666. \def STARPU_BCSR_GET_COLIND(interface)
  667. \ingroup API_Data_Interfaces
  668. Return a pointer to the column index of the matrix designated
  669. by \p interface.
  670. \def STARPU_BCSR_GET_COLIND_DEV_HANDLE(interface)
  671. \ingroup API_Data_Interfaces
  672. Return a device handle for the column index of the matrix
  673. designated by \p interface. The offset documented below has to be used in
  674. addition to this.
  675. \def STARPU_BCSR_GET_ROWPTR(interface)
  676. \ingroup API_Data_Interfaces
  677. Return a pointer to the row pointer array of the matrix
  678. designated by \p interface.
  679. \def STARPU_BCSR_GET_ROWPTR_DEV_HANDLE(interface)
  680. \ingroup API_Data_Interfaces
  681. Return a device handle for the row pointer array of the matrix
  682. designated by \p interface. The offset documented below has to be used in
  683. addition to this.
  684. \def STARPU_BCSR_GET_OFFSET
  685. \ingroup API_Data_Interfaces
  686. Return the offset in the arrays (coling, rowptr, nzval) of the
  687. matrix designated by \p interface, to be used with the device handles.
  688. @name Accessing CSR Data Interfaces
  689. \ingroup API_Data_Interfaces
  690. \struct starpu_csr_interface
  691. CSR interface for sparse matrices (compressed sparse row representation)
  692. \ingroup API_Data_Interfaces
  693. \var starpu_csr_interface::id
  694. Identifier of the interface
  695. \var starpu_csr_interface::nnz
  696. number of non-zero entries
  697. \var starpu_csr_interface::nrow
  698. number of rows
  699. \var starpu_csr_interface::nzval
  700. non-zero values
  701. \var starpu_csr_interface::colind
  702. position of non-zero entries on the row
  703. \var starpu_csr_interface::rowptr
  704. index (in nzval) of the first entry of the row
  705. \var starpu_csr_interface::firstentry
  706. k for k-based indexing (0 or 1 usually). also useful when partitionning the matrix.
  707. \var starpu_csr_interface::elemsize
  708. size of the elements of the matrix
  709. \fn uint32_t starpu_csr_get_nnz(starpu_data_handle_t handle)
  710. \ingroup API_Data_Interfaces
  711. Return the number of non-zero values in the matrix designated
  712. by \p handle.
  713. \fn uint32_t starpu_csr_get_nrow(starpu_data_handle_t handle)
  714. \ingroup API_Data_Interfaces
  715. Return the size of the row pointer array of the matrix
  716. designated by \p handle.
  717. \fn uint32_t starpu_csr_get_firstentry(starpu_data_handle_t handle)
  718. \ingroup API_Data_Interfaces
  719. Return the index at which all arrays (the column indexes, the
  720. row pointers...) of the matrix designated by \p handle.
  721. \fn uintptr_t starpu_csr_get_local_nzval(starpu_data_handle_t handle)
  722. \ingroup API_Data_Interfaces
  723. Return a local pointer to the non-zero values of the matrix
  724. designated by \p handle.
  725. \fn uint32_t *starpu_csr_get_local_colind(starpu_data_handle_t handle)
  726. \ingroup API_Data_Interfaces
  727. Return a local pointer to the column index of the matrix
  728. designated by \p handle.
  729. \fn uint32_t *starpu_csr_get_local_rowptr(starpu_data_handle_t handle)
  730. \ingroup API_Data_Interfaces
  731. Return a local pointer to the row pointer array of the matrix
  732. designated by \p handle.
  733. \fn size_t starpu_csr_get_elemsize(starpu_data_handle_t handle)
  734. \ingroup API_Data_Interfaces
  735. Return the size of the elements registered into the matrix
  736. designated by \p handle.
  737. \def STARPU_CSR_GET_NNZ(interface)
  738. \ingroup API_Data_Interfaces
  739. Return the number of non-zero values in the matrix designated
  740. by \p interface.
  741. \def STARPU_CSR_GET_NROW(interface)
  742. \ingroup API_Data_Interfaces
  743. Return the size of the row pointer array of the matrix
  744. designated by \p interface.
  745. \def STARPU_CSR_GET_NZVAL(interface)
  746. \ingroup API_Data_Interfaces
  747. Return a pointer to the non-zero values of the matrix
  748. designated by \p interface.
  749. \def STARPU_CSR_GET_NZVAL_DEV_HANDLE(interface)
  750. \ingroup API_Data_Interfaces
  751. Return a device handle for the array of non-zero values in the
  752. matrix designated by \p interface. The offset documented below has to be
  753. used in addition to this.
  754. \def STARPU_CSR_GET_COLIND(interface)
  755. \ingroup API_Data_Interfaces
  756. Return a pointer to the column index of the matrix designated
  757. by \p interface.
  758. \def STARPU_CSR_GET_COLIND_DEV_HANDLE(interface)
  759. \ingroup API_Data_Interfaces
  760. Return a device handle for the column index of the matrix
  761. designated by \p interface. The offset documented below has to be used in
  762. addition to this.
  763. \def STARPU_CSR_GET_ROWPTR(interface)
  764. \ingroup API_Data_Interfaces
  765. Return a pointer to the row pointer array of the matrix
  766. designated by \p interface.
  767. \def STARPU_CSR_GET_ROWPTR_DEV_HANDLE(interface)
  768. \ingroup API_Data_Interfaces
  769. Return a device handle for the row pointer array of the matrix
  770. designated by \p interface. The offset documented below has to be used in
  771. addition to this.
  772. \def STARPU_CSR_GET_OFFSET
  773. \ingroup API_Data_Interfaces
  774. Return the offset in the arrays (colind, rowptr, nzval) of the
  775. matrix designated by \p interface, to be used with the device handles.
  776. \def STARPU_CSR_GET_FIRSTENTRY(interface)
  777. \ingroup API_Data_Interfaces
  778. Return the index at which all arrays (the column indexes, the
  779. row pointers...) of the \p interface start.
  780. \def STARPU_CSR_GET_ELEMSIZE(interface)
  781. \ingroup API_Data_Interfaces
  782. Return the size of the elements registered into the matrix
  783. designated by \p interface.
  784. @name Accessing COO Data Interfaces
  785. \ingroup API_Data_Interfaces
  786. \struct starpu_coo_interface
  787. COO Matrices
  788. \ingroup API_Data_Interfaces
  789. \var starpu_coo_interface::id
  790. identifier of the interface
  791. \var starpu_coo_interface::columns
  792. column array of the matrix
  793. \var starpu_coo_interface::rows
  794. row array of the matrix
  795. \var starpu_coo_interface::values
  796. values of the matrix
  797. \var starpu_coo_interface::nx
  798. number of elements on the x-axis of the matrix
  799. \var starpu_coo_interface::ny
  800. number of elements on the y-axis of the matrix
  801. \var starpu_coo_interface::n_values
  802. number of values registered in the matrix
  803. \var starpu_coo_interface::elemsize
  804. size of the elements of the matrix
  805. \def STARPU_COO_GET_COLUMNS(interface)
  806. \ingroup API_Data_Interfaces
  807. Return a pointer to the column array of the matrix designated
  808. by \p interface.
  809. \def STARPU_COO_GET_COLUMNS_DEV_HANDLE(interface)
  810. \ingroup API_Data_Interfaces
  811. Return a device handle for the column array of the matrix
  812. designated by \p interface, to be used on OpenCL. The offset documented
  813. below has to be used in addition to this.
  814. \def STARPU_COO_GET_ROWS(interface)
  815. \ingroup API_Data_Interfaces
  816. Return a pointer to the rows array of the matrix designated by
  817. \p interface.
  818. \def STARPU_COO_GET_ROWS_DEV_HANDLE(interface)
  819. \ingroup API_Data_Interfaces
  820. Return a device handle for the row array of the matrix
  821. designated by \p interface, to be used on OpenCL. The offset documented
  822. below has to be used in addition to this.
  823. \def STARPU_COO_GET_VALUES(interface)
  824. \ingroup API_Data_Interfaces
  825. Return a pointer to the values array of the matrix designated
  826. by \p interface.
  827. \def STARPU_COO_GET_VALUES_DEV_HANDLE(interface)
  828. \ingroup API_Data_Interfaces
  829. Return a device handle for the value array of the matrix
  830. designated by \p interface, to be used on OpenCL. The offset documented
  831. below has to be used in addition to this.
  832. \def STARPU_COO_GET_OFFSET
  833. \ingroup API_Data_Interfaces
  834. Return the offset in the arrays of the COO matrix designated by
  835. \p interface.
  836. \def STARPU_COO_GET_NX(interface)
  837. \ingroup API_Data_Interfaces
  838. Return the number of elements on the x-axis of the matrix
  839. designated by \p interface.
  840. \def STARPU_COO_GET_NY(interface)
  841. \ingroup API_Data_Interfaces
  842. Return the number of elements on the y-axis of the matrix
  843. designated by \p interface.
  844. \def STARPU_COO_GET_NVALUES(interface)
  845. \ingroup API_Data_Interfaces
  846. Return the number of values registered in the matrix designated
  847. by \p interface.
  848. \def STARPU_COO_GET_ELEMSIZE(interface)
  849. \ingroup API_Data_Interfaces
  850. Return the size of the elements registered into the matrix
  851. designated by \p interface.
  852. @name Defining Interface
  853. \ingroup API_Data_Interfaces
  854. Applications can provide their own interface as shown in \ref
  855. DefiningANewDataInterface.
  856. \fn uintptr_t starpu_malloc_on_node(unsigned dst_node, size_t size)
  857. \ingroup API_Data_Interfaces
  858. Allocate \p size bytes on node \p dst_node. This returns 0 if
  859. allocation failed, the allocation method should then return <c>-ENOMEM</c> as
  860. allocated size. Deallocation must be done with starpu_free_on_node.
  861. \fn void starpu_free_on_node(unsigned dst_node, uintptr_t addr, size_t size)
  862. \ingroup API_Data_Interfaces
  863. Free \p addr of \p size bytes on node \p dst_node which was previously allocated
  864. with starpu_malloc_on_node.
  865. \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)
  866. \ingroup API_Data_Interfaces
  867. Copy \p size bytes from byte offset \p src_offset of \p src on \p src_node
  868. to byte offset \p dst_offset of \p dst on \p dst_node. This is to be used in
  869. the any_to_any() copy method, which is provided with the async_data to
  870. be passed to starpu_interface_copy(). this returns <c>-EAGAIN</c> if the
  871. transfer is still ongoing, or 0 if the transfer is already completed.
  872. \fn uint32_t starpu_hash_crc32c_be_n(const void *input, size_t n, uint32_t inputcrc)
  873. \ingroup API_Data_Interfaces
  874. Compute the CRC of a byte buffer seeded by the \p inputcrc
  875. <em>current state</em>. The return value should be considered as the new
  876. <em>current state</em> for future CRC computation. This is used for computing
  877. data size footprint.
  878. \fn uint32_t starpu_hash_crc32c_be(uint32_t input, uint32_t inputcrc)
  879. \ingroup API_Data_Interfaces
  880. Compute the CRC of a 32bit number seeded by the \p inputcrc
  881. <em>current state</em>. The return value should be considered as the new
  882. <em>current state</em> for future CRC computation. This is used for computing
  883. data size footprint.
  884. \fn uint32_t starpu_hash_crc32c_string(const char *str, uint32_t inputcrc)
  885. \ingroup API_Data_Interfaces
  886. Compute the CRC of a string seeded by the \p inputcrc <em>current
  887. state</em>. The return value should be considered as the new <em>current
  888. state</em> for future CRC computation. This is used for computing data
  889. size footprint.
  890. \fn int starpu_data_interface_get_next_id(void)
  891. \ingroup API_Data_Interfaces
  892. Return the next available id for a newly created data interface
  893. (\ref DefiningANewDataInterface).
  894. */