starpu_data_filters.h 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2009-2012,2014,2015,2017,2019-2020 Université de Bordeaux
  4. * Copyright (C) 2010 Mehdi Juhoor
  5. * Copyright (C) 2010-2013,2015,2017,2018,2019 CNRS
  6. * Copyright (C) 2011 Inria
  7. *
  8. * StarPU is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU Lesser General Public License as published by
  10. * the Free Software Foundation; either version 2.1 of the License, or (at
  11. * your option) any later version.
  12. *
  13. * StarPU is distributed in the hope that it will be useful, but
  14. * WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  16. *
  17. * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  18. */
  19. #ifndef __STARPU_DATA_FILTERS_H__
  20. #define __STARPU_DATA_FILTERS_H__
  21. #include <starpu.h>
  22. #include <stdarg.h>
  23. #ifdef __cplusplus
  24. extern "C"
  25. {
  26. #endif
  27. /**
  28. @defgroup API_Data_Partition Data Partition
  29. @{
  30. */
  31. struct starpu_data_interface_ops;
  32. /**
  33. Describe a data partitioning operation, to be given to starpu_data_partition()
  34. */
  35. struct starpu_data_filter
  36. {
  37. /**
  38. Fill the \p child_interface structure with interface information
  39. for the \p i -th child of the parent \p father_interface (among
  40. \p nparts). The \p filter structure is provided, allowing to inspect the
  41. starpu_data_filter::filter_arg and starpu_data_filter::filter_arg_ptr
  42. parameters.
  43. The details of what needs to be filled in \p child_interface vary according
  44. to the data interface, but generally speaking:
  45. <ul>
  46. <li> <c>id</c> is usually just copied over from the father,
  47. when the sub data has the same structure as the father,
  48. e.g. a subvector is a vector, a submatrix is a matrix, etc.
  49. This is however not the case for instance when dividing a
  50. BCSR matrix into its dense blocks, which then are matrices.
  51. </li>
  52. <li> <c>nx</c>, <c>ny</c> and alike are usually divided by
  53. the number of subdata, depending how the subdivision is
  54. done (e.g. nx division vs ny division for vertical matrix
  55. division vs horizontal matrix division). </li>
  56. <li> <c>ld</c> for matrix interfaces are usually just
  57. copied over: the leading dimension (ld) usually does not
  58. change. </li>
  59. <li> <c>elemsize</c> is usually just copied over. </li>
  60. <li> <c>ptr</c>, the pointer to the data, has to be
  61. computed according to \p i and the father's <c>ptr</c>, so
  62. as to point to the start of the sub data. This should
  63. however be done only if the father has <c>ptr</c> different
  64. from NULL: in the OpenCL case notably, the
  65. <c>dev_handle</c> and <c>offset</c> fields are used
  66. instead. </li>
  67. <li> <c>dev_handle</c> should be just copied over from the
  68. parent. </li>
  69. <li> <c>offset</c> has to be computed according to \p i and
  70. the father's <c>offset</c>, so as to provide the offset of
  71. the start of the sub data. This is notably used for the
  72. OpenCL case.
  73. </ul>
  74. */
  75. void (*filter_func)(void *father_interface, void *child_interface, struct starpu_data_filter *, unsigned id, unsigned nparts);
  76. unsigned nchildren; /**< Number of parts to partition the data into. */
  77. /**
  78. Return the number of children. This can be used instead of
  79. starpu_data_filter::nchildren when the number of children depends
  80. on the actual data (e.g. the number of blocks in a sparse
  81. matrix).
  82. */
  83. unsigned (*get_nchildren)(struct starpu_data_filter *, starpu_data_handle_t initial_handle);
  84. /**
  85. When children use different data interface,
  86. return which interface is used by child number \p id.
  87. */
  88. struct starpu_data_interface_ops *(*get_child_ops)(struct starpu_data_filter *, unsigned id);
  89. unsigned filter_arg; /**< Additional parameter for the filter function */
  90. /**
  91. Additional pointer parameter for
  92. the filter function, such as the
  93. sizes of the different parts. */
  94. void *filter_arg_ptr;
  95. };
  96. /**
  97. @name Basic API
  98. @{
  99. */
  100. /**
  101. Request the partitioning of \p initial_handle into several subdata
  102. according to the filter \p f.
  103. Here an example of how to use the function.
  104. \code{.c}
  105. struct starpu_data_filter f =
  106. {
  107. .filter_func = starpu_matrix_filter_block,
  108. .nchildren = nslicesx
  109. };
  110. starpu_data_partition(A_handle, &f);
  111. \endcode
  112. */
  113. void starpu_data_partition(starpu_data_handle_t initial_handle, struct starpu_data_filter *f);
  114. /**
  115. Unapply the filter which has been applied to \p root_data, thus
  116. unpartitioning the data. The pieces of data are collected back into
  117. one big piece in the \p gathering_node (usually ::STARPU_MAIN_RAM).
  118. Tasks working on the partitioned data will be waited for
  119. by starpu_data_unpartition().
  120. Here an example of how to use the function.
  121. \code{.c}
  122. starpu_data_unpartition(A_handle, STARPU_MAIN_RAM);
  123. \endcode
  124. */
  125. void starpu_data_unpartition(starpu_data_handle_t root_data, unsigned gathering_node);
  126. /**
  127. Return the \p i -th child of the given \p handle, which must have
  128. been partitionned beforehand.
  129. */
  130. starpu_data_handle_t starpu_data_get_child(starpu_data_handle_t handle, unsigned i);
  131. /**
  132. Return the number of children \p handle has been partitioned into.
  133. */
  134. int starpu_data_get_nb_children(starpu_data_handle_t handle);
  135. /**
  136. After partitioning a StarPU data by applying a filter,
  137. starpu_data_get_sub_data() can be used to get handles for each of the
  138. data portions. \p root_data is the parent data that was partitioned.
  139. \p depth is the number of filters to traverse (in case several filters
  140. have been applied, to e.g. partition in row blocks, and then in column
  141. blocks), and the subsequent parameters are the indexes. The function
  142. returns a handle to the subdata.
  143. Here an example of how to use the function.
  144. \code{.c}
  145. h = starpu_data_get_sub_data(A_handle, 1, taskx);
  146. \endcode
  147. */
  148. starpu_data_handle_t starpu_data_get_sub_data(starpu_data_handle_t root_data, unsigned depth, ... );
  149. /**
  150. Similar to starpu_data_get_sub_data() but use a \c va_list for the
  151. parameter list.
  152. */
  153. starpu_data_handle_t starpu_data_vget_sub_data(starpu_data_handle_t root_data, unsigned depth, va_list pa);
  154. /**
  155. Apply \p nfilters filters to the handle designated by \p
  156. root_handle recursively. \p nfilters pointers to variables of the
  157. type starpu_data_filter should be given.
  158. */
  159. void starpu_data_map_filters(starpu_data_handle_t root_data, unsigned nfilters, ...);
  160. /**
  161. Apply \p nfilters filters to the handle designated by
  162. \p root_handle recursively. Use a \p va_list of pointers to
  163. variables of the type starpu_data_filter.
  164. */
  165. void starpu_data_vmap_filters(starpu_data_handle_t root_data, unsigned nfilters, va_list pa);
  166. /** @} */
  167. /**
  168. @name Asynchronous API
  169. @{
  170. */
  171. /**
  172. Plan to partition \p initial_handle into several subdata according to
  173. the filter \p f.
  174. The handles are returned into the \p children array, which has to be
  175. the same size as the number of parts described in \p f. These handles
  176. are not immediately usable, starpu_data_partition_submit() has to be
  177. called to submit the actual partitioning.
  178. Here is an example of how to use the function:
  179. \code{.c}
  180. starpu_data_handle_t children[nslicesx];
  181. struct starpu_data_filter f =
  182. {
  183. .filter_func = starpu_matrix_filter_block,
  184. .nchildren = nslicesx
  185. };
  186. starpu_data_partition_plan(A_handle, &f, children);
  187. \endcode
  188. */
  189. void starpu_data_partition_plan(starpu_data_handle_t initial_handle, struct starpu_data_filter *f, starpu_data_handle_t *children);
  190. /**
  191. Submit the actual partitioning of \p initial_handle into the \p nparts
  192. \p children handles. This call is asynchronous, it only submits that the
  193. partitioning should be done, so that the \p children handles can now be used to
  194. submit tasks, and \p initial_handle can not be used to submit tasks any more (to
  195. guarantee coherency).
  196. For instance,
  197. \code{.c}
  198. starpu_data_partition_submit(A_handle, nslicesx, children);
  199. \endcode
  200. */
  201. void starpu_data_partition_submit(starpu_data_handle_t initial_handle, unsigned nparts, starpu_data_handle_t *children);
  202. /**
  203. Similar to starpu_data_partition_submit(), but do not invalidate \p
  204. initial_handle. This allows to continue using it, but the application has to be
  205. careful not to write to \p initial_handle or \p children handles, only read from
  206. them, since the coherency is otherwise not guaranteed. This thus allows to
  207. submit various tasks which concurrently read from various partitions of the data.
  208. When the application wants to write to \p initial_handle again, it should call
  209. starpu_data_unpartition_submit(), which will properly add dependencies between the
  210. reads on the \p children and the writes to be submitted.
  211. If instead the application wants to write to \p children handles, it should
  212. call starpu_data_partition_readwrite_upgrade_submit(), which will correctly add
  213. dependencies between the reads on the \p initial_handle and the writes to be
  214. submitted.
  215. */
  216. void starpu_data_partition_readonly_submit(starpu_data_handle_t initial_handle, unsigned nparts, starpu_data_handle_t *children);
  217. /**
  218. Assume that a partitioning of \p initial_handle has already been submited
  219. in readonly mode through starpu_data_partition_readonly_submit(), and will upgrade
  220. that partitioning into read-write mode for the \p children, by invalidating \p
  221. initial_handle, and adding the necessary dependencies.
  222. */
  223. void starpu_data_partition_readwrite_upgrade_submit(starpu_data_handle_t initial_handle, unsigned nparts, starpu_data_handle_t *children);
  224. /**
  225. Assuming that \p initial_handle is partitioned into \p children,
  226. submit an unpartitionning of \p initial_handle, i.e. submit a
  227. gathering of the pieces on the requested \p gathering_node memory
  228. node, and submit an invalidation of the children.
  229. */
  230. void starpu_data_unpartition_submit(starpu_data_handle_t initial_handle, unsigned nparts, starpu_data_handle_t *children, int gathering_node);
  231. void starpu_data_unpartition_submit_r(starpu_data_handle_t initial_handle, int gathering_node);
  232. /**
  233. Similar to starpu_data_partition_submit(), but do not invalidate \p
  234. initial_handle. This allows to continue using it, but the application has to be
  235. careful not to write to \p initial_handle or \p children handles, only read from
  236. them, since the coherency is otherwise not guaranteed. This thus allows to
  237. submit various tasks which concurrently read from various
  238. partitions of the data.
  239. */
  240. void starpu_data_unpartition_readonly_submit(starpu_data_handle_t initial_handle, unsigned nparts, starpu_data_handle_t *children, int gathering_node);
  241. /**
  242. Clear the partition planning established between \p root_data and
  243. \p children with starpu_data_partition_plan(). This will notably
  244. submit an unregister all the \p children, which can thus not be
  245. used any more afterwards.
  246. */
  247. void starpu_data_partition_clean(starpu_data_handle_t root_data, unsigned nparts, starpu_data_handle_t *children);
  248. /**
  249. Similar to starpu_data_unpartition_submit_sequential_consistency()
  250. but allow to specify a callback function for the unpartitiong task
  251. */
  252. void starpu_data_unpartition_submit_sequential_consistency_cb(starpu_data_handle_t initial_handle, unsigned nparts, starpu_data_handle_t *children, int gather_node, int sequential_consistency, void (*callback_func)(void *), void *callback_arg);
  253. /**
  254. Similar to starpu_data_partition_submit() but also allow to specify
  255. the coherency to be used for the main data \p initial_handle
  256. through the parameter \p sequential_consistency.
  257. */
  258. void starpu_data_partition_submit_sequential_consistency(starpu_data_handle_t initial_handle, unsigned nparts, starpu_data_handle_t *children, int sequential_consistency);
  259. /**
  260. Similar to starpu_data_unpartition_submit() but also allow to specify
  261. the coherency to be used for the main data \p initial_handle
  262. through the parameter \p sequential_consistency.
  263. */
  264. void starpu_data_unpartition_submit_sequential_consistency(starpu_data_handle_t initial_handle, unsigned nparts, starpu_data_handle_t *children, int gathering_node, int sequential_consistency);
  265. /**
  266. Disable the automatic partitioning of the data \p handle for which
  267. a asynchronous plan has previously been submitted
  268. */
  269. void starpu_data_partition_not_automatic(starpu_data_handle_t handle);
  270. /** @} */
  271. /**
  272. @name Predefined BCSR Filter Functions
  273. Predefined partitioning functions for BCSR data. Examples on how to
  274. use them are shown in \ref PartitioningData.
  275. @{
  276. */
  277. /**
  278. Partition a block-sparse matrix into dense matrices.
  279. starpu_data_filter::get_child_ops needs to be set to
  280. starpu_bcsr_filter_canonical_block_child_ops()
  281. */
  282. void starpu_bcsr_filter_canonical_block(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  283. /**
  284. Return the child_ops of the partition obtained with starpu_bcsr_filter_canonical_block().
  285. */
  286. struct starpu_data_interface_ops *starpu_bcsr_filter_canonical_block_child_ops(struct starpu_data_filter *f, unsigned child);
  287. /**
  288. Partition a block-sparse matrix into block-sparse matrices.
  289. The split is done along the leading dimension, i.e. along adjacent nnz blocks.
  290. */
  291. void starpu_bcsr_filter_vertical_block(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  292. /** @} */
  293. /**
  294. @name Predefined CSR Filter Functions
  295. Predefined partitioning functions for CSR data. Examples on how to
  296. use them are shown in \ref PartitioningData.
  297. @{
  298. */
  299. /**
  300. Partition a block-sparse matrix into vertical block-sparse matrices.
  301. */
  302. void starpu_csr_filter_vertical_block(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  303. /** @} */
  304. /**
  305. @name Predefined Matrix Filter Functions
  306. Predefined partitioning functions for matrix
  307. data. Examples on how to use them are shown in \ref
  308. PartitioningData.
  309. Note: this is using the C element order which is row-major, i.e. elements
  310. with consecutive x coordinates are consecutive in memory.
  311. @{
  312. */
  313. /**
  314. Partition a dense Matrix along the x dimension, thus getting (x/\p
  315. nparts ,y) matrices. If \p nparts does not divide x, the last
  316. submatrix contains the remainder.
  317. */
  318. void starpu_matrix_filter_block(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  319. /**
  320. Partition a dense Matrix along the x dimension, with a
  321. shadow border <c>filter_arg_ptr</c>, thus getting ((x-2*shadow)/\p
  322. nparts +2*shadow,y) matrices. If \p nparts does not divide x-2*shadow,
  323. the last submatrix contains the remainder.
  324. <b>IMPORTANT</b>: This can
  325. only be used for read-only access, as no coherency is enforced for the
  326. shadowed parts. A usage example is available in
  327. examples/filters/shadow2d.c
  328. */
  329. void starpu_matrix_filter_block_shadow(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  330. /**
  331. Partition a dense Matrix along the y dimension, thus getting
  332. (x,y/\p nparts) matrices. If \p nparts does not divide y, the last
  333. submatrix contains the remainder.
  334. */
  335. void starpu_matrix_filter_vertical_block(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  336. /**
  337. Partition a dense Matrix along the y dimension, with a
  338. shadow border <c>filter_arg_ptr</c>, thus getting
  339. (x,(y-2*shadow)/\p nparts +2*shadow) matrices. If \p nparts does not
  340. divide y-2*shadow, the last submatrix contains the remainder.
  341. <b>IMPORTANT</b>: This can only be used for read-only access, as no
  342. coherency is enforced for the shadowed parts. A usage example is
  343. available in examples/filters/shadow2d.c
  344. */
  345. void starpu_matrix_filter_vertical_block_shadow(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  346. /** @} */
  347. /**
  348. @name Predefined Vector Filter Functions
  349. Predefined partitioning functions for vector
  350. data. Examples on how to use them are shown in \ref
  351. PartitioningData.
  352. @{
  353. */
  354. /**
  355. Return in \p child_interface the \p id th element of the vector
  356. represented by \p father_interface once partitioned in \p nparts chunks of
  357. equal size.
  358. */
  359. void starpu_vector_filter_block(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  360. /**
  361. Return in \p child_interface the \p id th element of the vector
  362. represented by \p father_interface once partitioned in \p nparts chunks of
  363. equal size with a shadow border <c>filter_arg_ptr</c>, thus getting a vector
  364. of size <c>(n-2*shadow)/nparts+2*shadow</c>. The <c>filter_arg_ptr</c> field
  365. of \p f must be the shadow size casted into \c void*.
  366. <b>IMPORTANT</b>: This can only be used for read-only access, as no coherency is
  367. enforced for the shadowed parts. An usage example is available in
  368. examples/filters/shadow.c
  369. */
  370. void starpu_vector_filter_block_shadow(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  371. /**
  372. Return in \p child_interface the \p id th element of the vector
  373. represented by \p father_interface once partitioned into \p nparts chunks
  374. according to the <c>filter_arg_ptr</c> field of \p f. The
  375. <c>filter_arg_ptr</c> field must point to an array of \p nparts long
  376. elements, each of which specifies the number of elements in each chunk
  377. of the partition.
  378. */
  379. void starpu_vector_filter_list_long(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  380. /**
  381. Return in \p child_interface the \p id th element of the vector
  382. represented by \p father_interface once partitioned into \p nparts chunks
  383. according to the <c>filter_arg_ptr</c> field of \p f. The
  384. <c>filter_arg_ptr</c> field must point to an array of \p nparts uint32_t
  385. elements, each of which specifies the number of elements in each chunk
  386. of the partition.
  387. */
  388. void starpu_vector_filter_list(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  389. /**
  390. Return in \p child_interface the \p id th element of the vector
  391. represented by \p father_interface once partitioned in <c>2</c> chunks of
  392. equal size, ignoring nparts. Thus, \p id must be <c>0</c> or <c>1</c>.
  393. */
  394. void starpu_vector_filter_divide_in_2(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  395. /** @} */
  396. /**
  397. @name Predefined Block Filter Functions
  398. Predefined partitioning functions for block data. Examples on how
  399. to use them are shown in \ref PartitioningData. An example is
  400. available in \c examples/filters/shadow3d.c
  401. Note: this is using the C element order which is row-major, i.e. elements
  402. with consecutive x coordinates are consecutive in memory.
  403. @{
  404. */
  405. /**
  406. Partition a block along the X dimension, thus getting
  407. (x/\p nparts ,y,z) 3D matrices. If \p nparts does not divide x, the last
  408. submatrix contains the remainder.
  409. */
  410. void starpu_block_filter_block(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  411. /**
  412. Partition a block along the X dimension, with a
  413. shadow border <c>filter_arg_ptr</c>, thus getting
  414. ((x-2*shadow)/\p nparts +2*shadow,y,z) blocks. If \p nparts does not
  415. divide x, the last submatrix contains the remainder.
  416. <b>IMPORTANT</b>:
  417. This can only be used for read-only access, as no coherency is
  418. enforced for the shadowed parts.
  419. */
  420. void starpu_block_filter_block_shadow(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  421. /**
  422. Partition a block along the Y dimension, thus getting
  423. (x,y/\p nparts ,z) blocks. If \p nparts does not divide y, the last
  424. submatrix contains the remainder.
  425. */
  426. void starpu_block_filter_vertical_block(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  427. /**
  428. Partition a block along the Y dimension, with a
  429. shadow border <c>filter_arg_ptr</c>, thus getting
  430. (x,(y-2*shadow)/\p nparts +2*shadow,z) 3D matrices. If \p nparts does not
  431. divide y, the last submatrix contains the remainder.
  432. <b>IMPORTANT</b>:
  433. This can only be used for read-only access, as no coherency is
  434. enforced for the shadowed parts.
  435. */
  436. void starpu_block_filter_vertical_block_shadow(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  437. /**
  438. Partition a block along the Z dimension, thus getting
  439. (x,y,z/\p nparts) blocks. If \p nparts does not divide z, the last
  440. submatrix contains the remainder.
  441. */
  442. void starpu_block_filter_depth_block(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  443. /**
  444. Partition a block along the Z dimension, with a
  445. shadow border <c>filter_arg_ptr</c>, thus getting
  446. (x,y,(z-2*shadow)/\p nparts +2*shadow) blocks. If \p nparts does not
  447. divide z, the last submatrix contains the remainder.
  448. <b>IMPORTANT</b>:
  449. This can only be used for read-only access, as no coherency is
  450. enforced for the shadowed parts.
  451. */
  452. void starpu_block_filter_depth_block_shadow(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  453. /**
  454. Given an integer \p n, \p n the number of parts it must be divided in, \p id the
  455. part currently considered, determines the \p chunk_size and the \p offset, taking
  456. into account the size of the elements stored in the data structure \p elemsize
  457. and \p ld, the leading dimension, which is most often 1.
  458. */
  459. void
  460. starpu_filter_nparts_compute_chunk_size_and_offset(unsigned n, unsigned nparts,
  461. size_t elemsize, unsigned id,
  462. unsigned ld, unsigned *chunk_size,
  463. size_t *offset);
  464. /** @} */
  465. /** @} */
  466. #ifdef __cplusplus
  467. }
  468. #endif
  469. #endif