fstarpu_mod.f90 101 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674
  1. ! StarPU --- Runtime system for heterogeneous multicore architectures.
  2. !
  3. ! Copyright (C) 2016 Inria
  4. !
  5. ! StarPU is free software; you can redistribute it and/or modify
  6. ! it under the terms of the GNU Lesser General Public License as published by
  7. ! the Free Software Foundation; either version 2.1 of the License, or (at
  8. ! your option) any later version.
  9. !
  10. ! StarPU is distributed in the hope that it will be useful, but
  11. ! WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. !
  14. ! See the GNU Lesser General Public License in COPYING.LGPL for more details.
  15. module fstarpu_mod
  16. use iso_c_binding
  17. implicit none
  18. ! Note: Constants truly are intptr_t, but are declared as c_ptr to be
  19. ! readily usable in c_ptr arrays to mimic variadic functions.
  20. ! Note: Bitwise or operator is provided by the .ior. overloaded operator
  21. type(c_ptr), bind(C) :: FSTARPU_R
  22. type(c_ptr), bind(C) :: FSTARPU_W
  23. type(c_ptr), bind(C) :: FSTARPU_RW
  24. type(c_ptr), bind(C) :: FSTARPU_SCRATCH
  25. type(c_ptr), bind(C) :: FSTARPU_REDUX
  26. type(c_ptr), bind(C) :: FSTARPU_COMMUTE
  27. type(c_ptr), bind(C) :: FSTARPU_SSEND
  28. type(c_ptr), bind(C) :: FSTARPU_LOCALITY
  29. type(c_ptr), bind(C) :: FSTARPU_DATA_ARRAY
  30. type(c_ptr), bind(C) :: FSTARPU_DATA_MODE_ARRAY
  31. type(c_ptr), bind(C) :: FSTARPU_CL_ARGS
  32. type(c_ptr), bind(C) :: FSTARPU_CALLBACK
  33. type(c_ptr), bind(C) :: FSTARPU_CALLBACK_WITH_ARG
  34. type(c_ptr), bind(C) :: FSTARPU_CALLBACK_ARG
  35. type(c_ptr), bind(C) :: FSTARPU_PROLOGUE_CALLBACK
  36. type(c_ptr), bind(C) :: FSTARPU_PROLOGUE_CALLBACK_ARG
  37. type(c_ptr), bind(C) :: FSTARPU_PROLOGUE_CALLBACK_POP
  38. type(c_ptr), bind(C) :: FSTARPU_PROLOGUE_CALLBACK_POP_ARG
  39. type(c_ptr), bind(C) :: FSTARPU_PRIORITY
  40. type(c_ptr), bind(C) :: FSTARPU_EXECUTE_ON_NODE
  41. type(c_ptr), bind(C) :: FSTARPU_EXECUTE_ON_DATA
  42. type(c_ptr), bind(C) :: FSTARPU_EXECUTE_ON_WORKER
  43. type(c_ptr), bind(C) :: FSTARPU_WORKER_ORDER
  44. type(c_ptr), bind(C) :: FSTARPU_HYPERVISOR_TAG
  45. type(c_ptr), bind(C) :: FSTARPU_POSSIBLY_PARALLEL
  46. type(c_ptr), bind(C) :: FSTARPU_FLOPS
  47. type(c_ptr), bind(C) :: FSTARPU_TAG
  48. type(c_ptr), bind(C) :: FSTARPU_TAG_ONLY
  49. type(c_ptr), bind(C) :: FSTARPU_NAME
  50. type(c_ptr), bind(C) :: FSTARPU_NODE_SELECTION_POLICY
  51. type(c_ptr), bind(C) :: FSTARPU_VALUE
  52. type(c_ptr), bind(C) :: FSTARPU_SCHED_CTX
  53. type(c_ptr), bind(C) :: FSTARPU_CPU_WORKER
  54. type(c_ptr), bind(C) :: FSTARPU_CUDA_WORKER
  55. type(c_ptr), bind(C) :: FSTARPU_OPENCL_WORKER
  56. type(c_ptr), bind(C) :: FSTARPU_MIC_WORKER
  57. type(c_ptr), bind(C) :: FSTARPU_SCC_WORKER
  58. type(c_ptr), bind(C) :: FSTARPU_ANY_WORKER
  59. type(c_ptr), bind(C) :: FSTARPU_SZ_INT4
  60. type(c_ptr), bind(C) :: FSTARPU_SZ_INT8
  61. type(c_ptr), bind(C) :: FSTARPU_SZ_REAL4
  62. type(c_ptr), bind(C) :: FSTARPU_SZ_REAL8
  63. interface operator (.ior.)
  64. procedure or_cptrs
  65. end interface operator (.ior.)
  66. interface
  67. ! == starpu.h ==
  68. ! void starpu_conf_init(struct starpu_conf *conf);
  69. subroutine fstarpu_conf_init (conf) bind(C,name="starpu_conf_init")
  70. use iso_c_binding, only: c_ptr
  71. type(c_ptr), value, intent(in) :: conf
  72. end subroutine fstarpu_conf_init
  73. function fstarpu_conf_allocate () bind(C)
  74. use iso_c_binding, only: c_ptr
  75. type(c_ptr) :: fstarpu_conf_allocate
  76. end function fstarpu_conf_allocate
  77. subroutine fstarpu_conf_free (conf) bind(C)
  78. use iso_c_binding, only: c_ptr
  79. type(c_ptr), value, intent(in) :: conf
  80. end subroutine fstarpu_conf_free
  81. subroutine fstarpu_conf_set_sched_policy_name (conf, policy_name) bind(C)
  82. use iso_c_binding, only: c_ptr, c_char
  83. type(c_ptr), value, intent(in) :: conf
  84. character(c_char), intent(in) :: policy_name
  85. end subroutine fstarpu_conf_set_sched_policy_name
  86. subroutine fstarpu_conf_set_min_prio (conf, min_prio) bind(C)
  87. use iso_c_binding, only: c_ptr, c_int
  88. type(c_ptr), value, intent(in) :: conf
  89. integer(c_int), value, intent(in) :: min_prio
  90. end subroutine fstarpu_conf_set_min_prio
  91. subroutine fstarpu_conf_set_max_prio (conf, max_prio) bind(C)
  92. use iso_c_binding, only: c_ptr, c_int
  93. type(c_ptr), value, intent(in) :: conf
  94. integer(c_int), value, intent(in) :: max_prio
  95. end subroutine fstarpu_conf_set_max_prio
  96. subroutine fstarpu_conf_set_ncpu (conf, ncpu) bind(C)
  97. use iso_c_binding, only: c_ptr, c_int
  98. type(c_ptr), value, intent(in) :: conf
  99. integer(c_int), value, intent(in) :: ncpu
  100. end subroutine fstarpu_conf_set_ncpu
  101. subroutine fstarpu_conf_set_ncuda (conf, ncuda) bind(C)
  102. use iso_c_binding, only: c_ptr, c_int
  103. type(c_ptr), value, intent(in) :: conf
  104. integer(c_int), value, intent(in) :: ncuda
  105. end subroutine fstarpu_conf_set_ncuda
  106. subroutine fstarpu_conf_set_nopencl (conf, nopencl) bind(C)
  107. use iso_c_binding, only: c_ptr, c_int
  108. type(c_ptr), value, intent(in) :: conf
  109. integer(c_int), value, intent(in) :: nopencl
  110. end subroutine fstarpu_conf_set_nopencl
  111. subroutine fstarpu_conf_set_nmic (conf, nmic) bind(C)
  112. use iso_c_binding, only: c_ptr, c_int
  113. type(c_ptr), value, intent(in) :: conf
  114. integer(c_int), value, intent(in) :: nmic
  115. end subroutine fstarpu_conf_set_nmic
  116. subroutine fstarpu_conf_set_nscc (conf, nscc) bind(C)
  117. use iso_c_binding, only: c_ptr, c_int
  118. type(c_ptr), value, intent(in) :: conf
  119. integer(c_int), value, intent(in) :: nscc
  120. end subroutine fstarpu_conf_set_nscc
  121. ! starpu_init: see fstarpu_init
  122. ! starpu_initialize: see fstarpu_init
  123. ! void starpu_pause(void);
  124. subroutine fstarpu_pause() bind(C,name="starpu_pause")
  125. end subroutine fstarpu_pause
  126. ! void starpu_resume(void);
  127. subroutine fstarpu_resume() bind(C,name="starpu_resume")
  128. end subroutine fstarpu_resume
  129. ! void starpu_shutdown(void);
  130. subroutine fstarpu_shutdown () bind(C,name="starpu_shutdown")
  131. end subroutine fstarpu_shutdown
  132. ! starpu_topology_print
  133. subroutine fstarpu_topology_print () bind(C)
  134. end subroutine fstarpu_topology_print
  135. ! int starpu_asynchronous_copy_disabled(void);
  136. function fstarpu_asynchronous_copy_disabled() bind(C,name="starpu_asynchronous_copy_disabled")
  137. use iso_c_binding, only: c_int
  138. integer(c_int) :: fstarpu_asynchronous_copy_disabled
  139. end function fstarpu_asynchronous_copy_disabled
  140. ! int starpu_asynchronous_cuda_copy_disabled(void);
  141. function fstarpu_asynchronous_cuda_copy_disabled() bind(C,name="starpu_asynchronous_cuda_copy_disabled")
  142. use iso_c_binding, only: c_int
  143. integer(c_int) :: fstarpu_asynchronous_cuda_copy_disabled
  144. end function fstarpu_asynchronous_cuda_copy_disabled
  145. ! int starpu_asynchronous_opencl_copy_disabled(void);
  146. function fstarpu_asynchronous_opencl_copy_disabled() bind(C,name="starpu_asynchronous_opencl_copy_disabled")
  147. use iso_c_binding, only: c_int
  148. integer(c_int) :: fstarpu_asynchronous_opencl_copy_disabled
  149. end function fstarpu_asynchronous_opencl_copy_disabled
  150. ! int starpu_asynchronous_mic_copy_disabled(void);
  151. function fstarpu_asynchronous_mic_copy_disabled() bind(C,name="starpu_asynchronous_mic_copy_disabled")
  152. use iso_c_binding, only: c_int
  153. integer(c_int) :: fstarpu_asynchronous_mic_copy_disabled
  154. end function fstarpu_asynchronous_mic_copy_disabled
  155. ! void starpu_display_stats();
  156. subroutine fstarpu_display_stats() bind(C,name="starpu_display_stats")
  157. end subroutine fstarpu_display_stats
  158. ! void starpu_get_version(int *major, int *minor, int *release);
  159. subroutine fstarpu_get_version(major,minor,release) bind(C,name="starpu_get_version")
  160. use iso_c_binding, only: c_int
  161. integer(c_int), intent(out) :: major,minor,release
  162. end subroutine fstarpu_get_version
  163. ! == starpu_worker.h ==
  164. ! unsigned starpu_worker_get_count(void);
  165. function fstarpu_worker_get_count() bind(C,name="starpu_worker_get_count")
  166. use iso_c_binding, only: c_int
  167. integer(c_int) :: fstarpu_worker_get_count
  168. end function fstarpu_worker_get_count
  169. ! unsigned starpu_combined_worker_get_count(void);
  170. function fstarpu_combined_worker_get_count() bind(C,name="starpu_combined_worker_get_count")
  171. use iso_c_binding, only: c_int
  172. integer(c_int) :: fstarpu_combined_worker_get_count
  173. end function fstarpu_combined_worker_get_count
  174. ! unsigned starpu_worker_is_combined_worker(int id);
  175. function fstarpu_worker_is_combined_worker(id) bind(C,name="starpu_worker_is_combined_worker")
  176. use iso_c_binding, only: c_int
  177. integer(c_int) :: fstarpu_worker_is_combined_worker
  178. integer(c_int), value, intent(in) :: id
  179. end function fstarpu_worker_is_combined_worker
  180. ! unsigned starpu_cpu_worker_get_count(void);
  181. function fstarpu_cpu_worker_get_count() bind(C,name="starpu_cpu_worker_get_count")
  182. use iso_c_binding, only: c_int
  183. integer(c_int) :: fstarpu_cpu_worker_get_count
  184. end function fstarpu_cpu_worker_get_count
  185. ! unsigned starpu_cuda_worker_get_count(void);
  186. function fstarpu_cuda_worker_get_count() bind(C,name="starpu_cuda_worker_get_count")
  187. use iso_c_binding, only: c_int
  188. integer(c_int) :: fstarpu_cuda_worker_get_count
  189. end function fstarpu_cuda_worker_get_count
  190. ! unsigned starpu_opencl_worker_get_count(void);
  191. function fstarpu_opencl_worker_get_count() bind(C,name="starpu_opencl_worker_get_count")
  192. use iso_c_binding, only: c_int
  193. integer(c_int) :: fstarpu_opencl_worker_get_count
  194. end function fstarpu_opencl_worker_get_count
  195. ! unsigned starpu_mic_worker_get_count(void);
  196. function fstarpu_mic_worker_get_count() bind(C,name="starpu_mic_worker_get_count")
  197. use iso_c_binding, only: c_int
  198. integer(c_int) :: fstarpu_mic_worker_get_count
  199. end function fstarpu_mic_worker_get_count
  200. ! unsigned starpu_scc_worker_get_count(void);
  201. function fstarpu_scc_worker_get_count() bind(C,name="starpu_scc_worker_get_count")
  202. use iso_c_binding, only: c_int
  203. integer(c_int) :: fstarpu_scc_worker_get_count
  204. end function fstarpu_scc_worker_get_count
  205. ! int starpu_worker_get_id(void);
  206. function fstarpu_worker_get_id() bind(C,name="starpu_worker_get_id")
  207. use iso_c_binding, only: c_int
  208. integer(c_int) :: fstarpu_worker_get_id
  209. end function fstarpu_worker_get_id
  210. ! _starpu_worker_get_id_check
  211. ! starpu_worker_get_id_check
  212. ! int starpu_worker_get_bindid(int workerid);
  213. function fstarpu_worker_get_bindid(id) bind(C,name="starpu_worker_get_bindid")
  214. use iso_c_binding, only: c_int
  215. integer(c_int) :: fstarpu_worker_get_bindid
  216. integer(c_int), value, intent(in) :: id
  217. end function fstarpu_worker_get_bindid
  218. ! int starpu_combined_worker_get_id(void);
  219. function fstarpu_combined_worker_get_id() bind(C,name="starpu_combined_worker_get_id")
  220. use iso_c_binding, only: c_int
  221. integer(c_int) :: fstarpu_combined_worker_get_id
  222. end function fstarpu_combined_worker_get_id
  223. ! int starpu_combined_worker_get_size(void);
  224. function fstarpu_combined_worker_get_size() bind(C,name="starpu_combined_worker_get_size")
  225. use iso_c_binding, only: c_int
  226. integer(c_int) :: fstarpu_combined_worker_get_size
  227. end function fstarpu_combined_worker_get_size
  228. ! int starpu_combined_worker_get_rank(void);
  229. function fstarpu_combined_worker_get_rank() bind(C,name="starpu_combined_worker_get_rank")
  230. use iso_c_binding, only: c_int
  231. integer(c_int) :: fstarpu_combined_worker_get_rank
  232. end function fstarpu_combined_worker_get_rank
  233. ! enum starpu_worker_archtype starpu_worker_get_type(int id);
  234. function fstarpu_worker_get_type(id) bind(C)
  235. use iso_c_binding, only: c_int, c_ptr
  236. type(c_ptr) :: fstarpu_worker_get_type ! C function returns c_intptr_t
  237. integer(c_int),value,intent(in) :: id
  238. end function fstarpu_worker_get_type
  239. ! int starpu_worker_get_count_by_type(enum starpu_worker_archtype type);
  240. function fstarpu_worker_get_count_by_type(typeid) bind(C)
  241. use iso_c_binding, only: c_int, c_ptr
  242. integer(c_int) :: fstarpu_worker_get_count_by_type
  243. type(c_ptr),value,intent(in) :: typeid ! c_intptr_t expected by C func
  244. end function fstarpu_worker_get_count_by_type
  245. ! int starpu_worker_get_ids_by_type(enum starpu_worker_archtype type, int *workerids, int maxsize);
  246. function fstarpu_worker_get_ids_by_type(typeid, workerids, maxsize) bind(C)
  247. use iso_c_binding, only: c_int, c_ptr
  248. integer(c_int) :: fstarpu_worker_get_ids_by_type
  249. type(c_ptr),value,intent(in) :: typeid ! c_intptr_t expected by C func
  250. integer(c_int),intent(out) :: workerids(*)
  251. integer(c_int),value,intent(in) :: maxsize
  252. end function fstarpu_worker_get_ids_by_type
  253. ! int starpu_worker_get_by_type(enum starpu_worker_archtype type, int num);
  254. function fstarpu_worker_get_by_type(typeid, num) bind(C)
  255. use iso_c_binding, only: c_int, c_ptr
  256. integer(c_int) :: fstarpu_worker_get_by_type
  257. type(c_ptr),value,intent(in) :: typeid ! c_intptr_t expected by C func
  258. integer(c_int),value,intent(in) :: num
  259. end function fstarpu_worker_get_by_type
  260. ! int starpu_worker_get_by_devid(enum starpu_worker_archtype type, int devid);
  261. function fstarpu_worker_get_by_devid(typeid, devid) bind(C)
  262. use iso_c_binding, only: c_int, c_ptr
  263. integer(c_int) :: fstarpu_worker_get_by_type
  264. type(c_ptr),value,intent(in) :: typeid ! c_intptr_t expected by C func
  265. integer(c_int),value,intent(in) :: devid
  266. end function fstarpu_worker_get_by_devid
  267. ! void starpu_worker_get_name(int id, char *dst, size_t maxlen);
  268. subroutine fstarpu_worker_get_name(id, dst, maxlen) bind(C,name="starpu_worker_get_name")
  269. use iso_c_binding, only: c_int, c_char, c_size_t
  270. integer(c_int),value,intent(in) :: id
  271. character(c_char),intent(out) :: dst(*)
  272. integer(c_size_t),value,intent(in) :: maxlen
  273. end subroutine fstarpu_worker_get_name
  274. ! int starpu_worker_get_devid(int id);
  275. function fstarpu_worker_get_devid(id) bind(C,name="starpu_worker_get_devid")
  276. use iso_c_binding, only: c_int
  277. integer(c_int) :: fstarpu_worker_get_devid
  278. integer(c_int), value, intent(in) :: id
  279. end function fstarpu_worker_get_devid
  280. ! int starpu_worker_get_mp_nodeid(int id);
  281. function fstarpu_worker_get_mp_nodeid(id) bind(C,name="starpu_worker_get_mp_nodeid")
  282. use iso_c_binding, only: c_int
  283. integer(c_int) :: fstarpu_worker_get_mp_nodeid
  284. integer(c_int), value, intent(in) :: id
  285. end function fstarpu_worker_get_mp_nodeid
  286. ! struct starpu_tree* starpu_workers_get_tree(void);
  287. ! unsigned starpu_worker_get_sched_ctx_list(int worker, unsigned **sched_ctx);
  288. ! unsigned starpu_worker_is_blocked(int workerid);
  289. function fstarpu_worker_is_blocked(id) bind(C,name="starpu_worker_is_blocked")
  290. use iso_c_binding, only: c_int
  291. integer(c_int) :: fstarpu_worker_is_blocked
  292. integer(c_int), value, intent(in) :: id
  293. end function fstarpu_worker_is_blocked
  294. ! unsigned starpu_worker_is_slave_somewhere(int workerid);
  295. function fstarpu_worker_is_slave_somewhere(id) bind(C,name="starpu_worker_is_slave_somewhere")
  296. use iso_c_binding, only: c_int
  297. integer(c_int) :: fstarpu_worker_is_slave_somewhere
  298. integer(c_int), value, intent(in) :: id
  299. end function fstarpu_worker_is_slave_somewhere
  300. ! char *starpu_worker_get_type_as_string(enum starpu_worker_archtype type);
  301. subroutine fstarpu_worker_get_type_as_string(typeid,dst,maxlen) bind(C)
  302. use iso_c_binding, only: c_ptr, c_char, c_size_t
  303. type(c_ptr),value,intent(in) :: typeid ! c_intptr_t expected by C func
  304. character(c_char),intent(out) :: dst(*)
  305. integer(c_size_t),value,intent(in) :: maxlen
  306. end subroutine fstarpu_worker_get_type_as_string
  307. ! int starpu_bindid_get_workerids(int bindid, int **workerids);
  308. ! == starpu_task.h ==
  309. ! void starpu_tag_declare_deps(starpu_tag_t id, unsigned ndeps, ...);
  310. ! void starpu_tag_declare_deps_array(starpu_tag_t id, unsigned ndeps, starpu_tag_t *array);
  311. subroutine fstarpu_tag_declare_deps_array(id,ndeps,tag_array) bind(C,name="starpu_tag_declare_deps_array")
  312. use iso_c_binding, only: c_int, c_long_long
  313. integer(c_int), value, intent(in) :: id
  314. integer(c_int), value, intent(in) :: ndeps
  315. integer(c_long_long), intent(in) :: tag_array(*)
  316. end subroutine fstarpu_tag_declare_deps_array
  317. ! void starpu_task_declare_deps_array(struct starpu_task *task, unsigned ndeps, struct starpu_task *task_array[]);
  318. subroutine fstarpu_task_declare_deps_array(task,ndeps,task_array) bind(C,name="starpu_task_declare_deps_array")
  319. use iso_c_binding, only: c_int, c_ptr
  320. type(c_ptr), value, intent(in) :: task
  321. integer(c_int), value, intent(in) :: ndeps
  322. type(c_ptr), intent(in) :: task_array(*)
  323. end subroutine fstarpu_task_declare_deps_array
  324. ! int starpu_tag_wait(starpu_tag_t id);
  325. function fstarpu_tag_wait(id) bind(C,name="starpu_tag_wait")
  326. use iso_c_binding, only: c_int, c_long_long
  327. integer(c_int) :: fstarpu_tag_wait
  328. integer(c_long_long), value, intent(in) :: id
  329. end function fstarpu_tag_wait
  330. ! int starpu_tag_wait_array(unsigned ntags, starpu_tag_t *id);
  331. function fstarpu_tag_wait_array(ntags,tag_array) bind(C,name="starpu_tag_wait_array")
  332. use iso_c_binding, only: c_int, c_long_long
  333. integer(c_int) :: fstarpu_tag_wait_array
  334. integer(c_int), value, intent(in) :: ntags
  335. integer(c_long_long), intent(in) :: tag_array(*)
  336. end function fstarpu_tag_wait_array
  337. ! void starpu_tag_notify_from_apps(starpu_tag_t id);
  338. subroutine fstarpu_tag_notify_from_apps(id) bind(C,name="starpu_tag_notify_from_apps")
  339. use iso_c_binding, only: c_long_long
  340. integer(c_long_long), value, intent(in) :: id
  341. end subroutine fstarpu_tag_notify_from_apps
  342. ! void starpu_tag_restart(starpu_tag_t id);
  343. subroutine fstarpu_tag_restart(id) bind(C,name="starpu_tag_restart")
  344. use iso_c_binding, only: c_long_long
  345. integer(c_long_long), value, intent(in) :: id
  346. end subroutine fstarpu_tag_restart
  347. ! void starpu_tag_remove(starpu_tag_t id);
  348. subroutine fstarpu_tag_remove(id) bind(C,name="starpu_tag_remove")
  349. use iso_c_binding, only: c_long_long
  350. integer(c_long_long), value, intent(in) :: id
  351. end subroutine fstarpu_tag_remove
  352. ! struct starpu_task *starpu_tag_get_task(starpu_tag_t id);
  353. function fstarpu_tag_get_task(id) bind(C,name="starpu_tag_get_task")
  354. use iso_c_binding, only: c_ptr, c_long_long
  355. type(c_ptr) :: fstarpu_tag_get_task
  356. integer(c_long_long), value, intent(in) :: id
  357. end function fstarpu_tag_get_task
  358. ! void starpu_task_init(struct starpu_task *task);
  359. subroutine fstarpu_task_init (task) bind(C,name="starpu_task_init")
  360. use iso_c_binding, only: c_ptr
  361. type(c_ptr), value, intent(in) :: task
  362. end subroutine fstarpu_task_init
  363. ! void starpu_task_clean(struct starpu_task *task);
  364. subroutine fstarpu_task_clean (task) bind(C,name="starpu_task_clean")
  365. use iso_c_binding, only: c_ptr
  366. type(c_ptr), value, intent(in) :: task
  367. end subroutine fstarpu_task_clean
  368. ! struct starpu_task *starpu_task_create(void) STARPU_ATTRIBUTE_MALLOC;
  369. function fstarpu_task_create () bind(C,name="starpu_task_create")
  370. use iso_c_binding, only: c_ptr
  371. type(c_ptr) :: fstarpu_task_create
  372. end function fstarpu_task_create
  373. ! void starpu_task_destroy(struct starpu_task *task);
  374. subroutine fstarpu_task_destroy (task) bind(C,name="starpu_task_destroy")
  375. use iso_c_binding, only: c_ptr
  376. type(c_ptr), value, intent(in) :: task
  377. end subroutine fstarpu_task_destroy
  378. ! int starpu_task_submit(struct starpu_task *task) STARPU_WARN_UNUSED_RESULT;
  379. function fstarpu_task_submit (task) bind(C,name="starpu_task_submit")
  380. use iso_c_binding, only: c_int,c_ptr
  381. integer(c_int) :: fstarpu_task_submit
  382. type(c_ptr), value, intent(in) :: task
  383. end function fstarpu_task_submit
  384. ! int starpu_task_submit_to_ctx(struct starpu_task *task, unsigned sched_ctx_id);
  385. function fstarpu_task_submit_to_ctx (task,sched_ctx_id) bind(C,name="starpu_task_submit_to_ctx")
  386. use iso_c_binding, only: c_int,c_ptr
  387. integer(c_int) :: fstarpu_task_submit_to_ctx
  388. type(c_ptr), value, intent(in) :: task
  389. integer(c_int), value, intent(in) :: sched_ctx_id
  390. end function fstarpu_task_submit_to_ctx
  391. ! int starpu_task_finished(struct starpu_task *task) STARPU_WARN_UNUSED_RESULT;
  392. function fstarpu_task_finished (task) bind(C,name="starpu_task_finished")
  393. use iso_c_binding, only: c_int,c_ptr
  394. integer(c_int) :: fstarpu_task_finished
  395. type(c_ptr), value, intent(in) :: task
  396. end function fstarpu_task_finished
  397. ! int starpu_task_wait(struct starpu_task *task) STARPU_WARN_UNUSED_RESULT;
  398. function fstarpu_task_wait (task) bind(C,name="starpu_task_wait")
  399. use iso_c_binding, only: c_int,c_ptr
  400. integer(c_int) :: fstarpu_task_wait
  401. type(c_ptr), value, intent(in) :: task
  402. end function fstarpu_task_wait
  403. ! int starpu_task_wait_array(struct starpu_task **tasks, unsigned nb_tasks) STARPU_WARN_UNUSED_RESULT;
  404. function fstarpu_task_wait_array(task_array,ntasks) bind(C,name="starpu_task_wait_array")
  405. use iso_c_binding, only: c_int, c_ptr
  406. integer(c_int) :: fstarpu_task_wait_array
  407. integer(c_int), value, intent(in) :: ntasks
  408. type(c_ptr), intent(in) :: task_array
  409. end function fstarpu_task_wait_array
  410. ! int starpu_task_wait_for_all(void);
  411. subroutine fstarpu_task_wait_for_all () bind(C,name="starpu_task_wait_for_all")
  412. end subroutine fstarpu_task_wait_for_all
  413. ! int starpu_task_wait_for_n_submitted(unsigned n);
  414. subroutine fstarpu_task_wait_for_n_submitted (n) bind(C,name="starpu_task_wait_for_n_submitted")
  415. use iso_c_binding, only: c_int
  416. integer(c_int), value, intent(in) :: n
  417. end subroutine fstarpu_task_wait_for_n_submitted
  418. ! int starpu_task_wait_for_all_in_ctx(unsigned sched_ctx_id);
  419. subroutine fstarpu_task_wait_for_all_in_ctx (ctx) bind(C,name="starpu_task_wait_for_all_in_ctx")
  420. use iso_c_binding, only: c_int
  421. integer(c_int), value, intent(in) :: ctx
  422. end subroutine fstarpu_task_wait_for_all_in_ctx
  423. ! int starpu_task_wait_for_n_submitted_in_ctx(unsigned sched_ctx_id, unsigned n);
  424. subroutine fstarpu_task_wait_for_n_submitted_in_ctx (ctx,n) bind(C,name="starpu_task_wait_for_n_submitted_in_ctx")
  425. use iso_c_binding, only: c_int
  426. integer(c_int), value, intent(in) :: ctx
  427. integer(c_int), value, intent(in) :: n
  428. end subroutine fstarpu_task_wait_for_n_submitted_in_ctx
  429. ! int starpu_task_wait_for_no_ready(void);
  430. function fstarpu_task_wait_for_no_ready () bind(C,name="starpu_task_wait_for_no_ready")
  431. use iso_c_binding, only: c_int
  432. integer(c_int) :: fstarpu_task_wait_for_no_ready
  433. end function fstarpu_task_wait_for_no_ready
  434. ! int starpu_task_nready(void);
  435. function fstarpu_task_nready () bind(C,name="starpu_task_nready")
  436. use iso_c_binding, only: c_int
  437. integer(c_int) :: fstarpu_task_nready
  438. end function fstarpu_task_nready
  439. ! int starpu_task_nsubmitted(void);
  440. function fstarpu_task_nsubmitted () bind(C,name="starpu_task_nsubmitted")
  441. use iso_c_binding, only: c_int
  442. integer(c_int) :: fstarpu_task_nsubmitted
  443. end function fstarpu_task_nsubmitted
  444. ! void starpu_do_schedule(void);
  445. subroutine fstarpu_do_schedule () bind(C,name="starpu_do_schedule")
  446. end subroutine fstarpu_do_schedule
  447. ! starpu_codelet_init
  448. subroutine fstarpu_codelet_init (codelet) bind(C,name="starpu_codelet_init")
  449. use iso_c_binding, only: c_ptr
  450. type(c_ptr), value, intent(in) :: codelet
  451. end subroutine fstarpu_codelet_init
  452. ! starpu_codelet_display_stats
  453. subroutine fstarpu_codelet_display_stats (codelet) bind(C,name="starpu_codelet_display_stats")
  454. use iso_c_binding, only: c_ptr
  455. type(c_ptr), value, intent(in) :: codelet
  456. end subroutine fstarpu_codelet_display_stats
  457. ! struct starpu_task *starpu_task_get_current(void);
  458. function fstarpu_task_get_current () bind(C,name="starpu_task_get_current")
  459. use iso_c_binding, only: c_ptr
  460. type(c_ptr) :: fstarpu_task_get_current
  461. end function fstarpu_task_get_current
  462. ! void starpu_parallel_task_barrier_init(struct starpu_task *task, int workerid);
  463. subroutine fstarpu_parallel_task_barrier_init_init (task,id) &
  464. bind(C,name="starpu_parallel_task_barrier_init_init")
  465. use iso_c_binding, only: c_ptr, c_int
  466. type(c_ptr), value, intent(in) :: task
  467. integer(c_int), value, intent(in) :: id
  468. end subroutine fstarpu_parallel_task_barrier_init_init
  469. ! void starpu_parallel_task_barrier_init_n(struct starpu_task *task, int worker_size);
  470. subroutine fstarpu_parallel_task_barrier_init_n_init_n (task,sz) &
  471. bind(C,name="starpu_parallel_task_barrier_init_n_init_n")
  472. use iso_c_binding, only: c_ptr, c_int
  473. type(c_ptr), value, intent(in) :: task
  474. integer(c_int), value, intent(in) :: sz
  475. end subroutine fstarpu_parallel_task_barrier_init_n_init_n
  476. ! struct starpu_task *starpu_task_dup(struct starpu_task *task);
  477. function fstarpu_task_dup (task) bind(C,name="starpu_task_dup")
  478. use iso_c_binding, only: c_ptr
  479. type(c_ptr) :: fstarpu_task_dup
  480. type(c_ptr), value, intent(in) :: task
  481. end function fstarpu_task_dup
  482. ! void starpu_task_set_implementation(struct starpu_task *task, unsigned impl);
  483. subroutine fstarpu_task_set_implementation (task,impl) &
  484. bind(C,name="starpu_task_set_implementation")
  485. use iso_c_binding, only: c_ptr,c_int
  486. type(c_ptr), value, intent(in) :: task
  487. integer(c_int), value, intent(in) :: impl
  488. end subroutine fstarpu_task_set_implementation
  489. ! unsigned starpu_task_get_implementation(struct starpu_task *task);
  490. function fstarpu_task_get_implementation (task) &
  491. bind(C,name="starpu_task_get_implementation")
  492. use iso_c_binding, only: c_ptr,c_int
  493. type(c_ptr), value, intent(in) :: task
  494. integer(c_int) :: fstarpu_task_get_implementation
  495. end function fstarpu_task_get_implementation
  496. ! --
  497. function fstarpu_codelet_allocate () bind(C)
  498. use iso_c_binding, only: c_ptr
  499. type(c_ptr) :: fstarpu_codelet_allocate
  500. end function fstarpu_codelet_allocate
  501. subroutine fstarpu_codelet_free (cl) bind(C)
  502. use iso_c_binding, only: c_ptr
  503. type(c_ptr), value, intent(in) :: cl
  504. end subroutine fstarpu_codelet_free
  505. subroutine fstarpu_codelet_set_name (cl, cl_name) bind(C)
  506. use iso_c_binding, only: c_ptr, c_char
  507. type(c_ptr), value, intent(in) :: cl
  508. character(c_char), intent(in) :: cl_name
  509. end subroutine fstarpu_codelet_set_name
  510. subroutine fstarpu_codelet_add_cpu_func (cl, f_ptr) bind(C)
  511. use iso_c_binding, only: c_ptr, c_funptr
  512. type(c_ptr), value, intent(in) :: cl
  513. type(c_funptr), value, intent(in) :: f_ptr
  514. end subroutine fstarpu_codelet_add_cpu_func
  515. subroutine fstarpu_codelet_add_cuda_func (cl, f_ptr) bind(C)
  516. use iso_c_binding, only: c_ptr, c_funptr
  517. type(c_ptr), value, intent(in) :: cl
  518. type(c_funptr), value, intent(in) :: f_ptr
  519. end subroutine fstarpu_codelet_add_cuda_func
  520. subroutine fstarpu_codelet_add_opencl_func (cl, f_ptr) bind(C)
  521. use iso_c_binding, only: c_ptr, c_funptr
  522. type(c_ptr), value, intent(in) :: cl
  523. type(c_funptr), value, intent(in) :: f_ptr
  524. end subroutine fstarpu_codelet_add_opencl_func
  525. subroutine fstarpu_codelet_add_mic_func (cl, f_ptr) bind(C)
  526. use iso_c_binding, only: c_ptr, c_funptr
  527. type(c_ptr), value, intent(in) :: cl
  528. type(c_funptr), value, intent(in) :: f_ptr
  529. end subroutine fstarpu_codelet_add_mic_func
  530. subroutine fstarpu_codelet_add_scc_func (cl, f_ptr) bind(C)
  531. use iso_c_binding, only: c_ptr, c_funptr
  532. type(c_ptr), value, intent(in) :: cl
  533. type(c_funptr), value, intent(in) :: f_ptr
  534. end subroutine fstarpu_codelet_add_scc_func
  535. subroutine fstarpu_codelet_add_buffer (cl, mode) bind(C)
  536. use iso_c_binding, only: c_ptr
  537. type(c_ptr), value, intent(in) :: cl
  538. type(c_ptr), value, intent(in) :: mode ! C function expects an intptr_t
  539. end subroutine fstarpu_codelet_add_buffer
  540. subroutine fstarpu_codelet_set_nbuffers (cl, nbuffers) bind(C)
  541. use iso_c_binding, only: c_ptr,c_int
  542. type(c_ptr), value, intent(in) :: cl
  543. integer(c_int), value, intent(in) :: nbuffers
  544. end subroutine fstarpu_codelet_set_nbuffers
  545. ! == starpu_data_interface.h ==
  546. ! uintptr_t starpu_malloc_on_node_flags(unsigned dst_node, size_t size, int flags);
  547. ! uintptr_t starpu_malloc_on_node(unsigned dst_node, size_t size);
  548. function fstarpu_malloc_on_node(node,sz) bind(C,name="starpu_malloc_on_node")
  549. use iso_c_binding, only: c_int,c_intptr_t,c_size_t
  550. integer(c_intptr_t) :: fstarpu_malloc_on_node
  551. integer(c_int), value, intent(in) :: node
  552. integer(c_size_t), value, intent(in) :: sz
  553. end function fstarpu_malloc_on_node
  554. ! void starpu_free_on_node_flags(unsigned dst_node, uintptr_t addr, size_t size, int flags);
  555. ! void starpu_free_on_node(unsigned dst_node, uintptr_t addr, size_t size);
  556. subroutine fstarpu_free_on_node(node,addr,sz) bind(C,name="starpu_free_on_node")
  557. use iso_c_binding, only: c_int,c_intptr_t,c_size_t
  558. integer(c_int), value, intent(in) :: node
  559. integer(c_intptr_t), value, intent(in) :: addr
  560. integer(c_size_t), value, intent(in) :: sz
  561. end subroutine fstarpu_free_on_node
  562. ! void starpu_malloc_on_node_set_default_flags(unsigned node, int flags);
  563. ! int starpu_data_interface_get_next_id(void);
  564. ! void starpu_data_register(starpu_data_handle_t *handleptr, unsigned home_node, void *data_interface, struct starpu_data_interface_ops *ops);
  565. ! void starpu_data_ptr_register(starpu_data_handle_t handle, unsigned node);
  566. subroutine fstarpug_data_ptr_register (dh,node) bind(C,name="starpu_data_ptr_register")
  567. use iso_c_binding, only: c_ptr, c_int
  568. type(c_ptr), value, intent(in) :: dh
  569. integer(c_int), value, intent(in) :: node
  570. end subroutine fstarpug_data_ptr_register
  571. ! void starpu_data_register_same(starpu_data_handle_t *handledst, starpu_data_handle_t handlesrc);
  572. subroutine fstarpu_data_register_same (dh_dst,dh_src) bind(C,name="starpu_data_register_same")
  573. use iso_c_binding, only: c_ptr
  574. type(c_ptr), intent(out) :: dh_dst
  575. type(c_ptr), value, intent(in) :: dh_src
  576. end subroutine fstarpu_data_register_same
  577. ! void *starpu_data_handle_to_pointer(starpu_data_handle_t handle, unsigned node);
  578. function fstarpu_data_handle_to_pointer (dh,node) bind(C,name="starpu_data_handle_to_pointer")
  579. use iso_c_binding, only: c_ptr, c_int
  580. type(c_ptr) :: fstarpu_data_handle_to_pointer
  581. type(c_ptr), value, intent(in) :: dh
  582. integer(c_int), value, intent(in) :: node
  583. end function fstarpu_data_handle_to_pointer
  584. ! void *starpu_data_get_local_ptr(starpu_data_handle_t handle);
  585. function fstarpu_data_get_local_ptr (dh) bind(C,name="starpu_data_get_local_ptr")
  586. use iso_c_binding, only: c_ptr, c_int
  587. type(c_ptr) :: fstarpu_data_get_local_ptr
  588. type(c_ptr), value, intent(in) :: dh
  589. end function fstarpu_data_get_local_ptr
  590. ! void *starpu_data_get_interface_on_node(starpu_data_handle_t handle, unsigned memory_node);
  591. ! == starpu_data_interface.h: block ==
  592. ! 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);
  593. subroutine fstarpu_block_data_register(dh, home_node, ptr, ldy, ldz, nx, ny, nz, elt_size) &
  594. bind(C,name="starpu_block_data_register")
  595. use iso_c_binding, only: c_ptr, c_int, c_size_t
  596. type(c_ptr), intent(out) :: dh
  597. integer(c_int), value, intent(in) :: home_node
  598. type(c_ptr), value, intent(in) :: ptr
  599. integer(c_int), value, intent(in) :: ldy
  600. integer(c_int), value, intent(in) :: ldz
  601. integer(c_int), value, intent(in) :: nx
  602. integer(c_int), value, intent(in) :: ny
  603. integer(c_int), value, intent(in) :: nz
  604. integer(c_size_t), value, intent(in) :: elt_size
  605. end subroutine fstarpu_block_data_register
  606. ! 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);
  607. subroutine fstarpu_block_ptr_register(dh, node, ptr, dev_handle, offset, ldy, ldz) &
  608. bind(C,name="starpu_block_ptr_register")
  609. use iso_c_binding, only: c_ptr, c_int, c_size_t
  610. type(c_ptr), intent(out) :: dh
  611. integer(c_int), value, intent(in) :: node
  612. type(c_ptr), value, intent(in) :: ptr
  613. type(c_ptr), value, intent(in) :: dev_handle
  614. integer(c_size_t), value, intent(in) :: offset
  615. integer(c_int), value, intent(in) :: ldy
  616. integer(c_int), value, intent(in) :: ldz
  617. end subroutine fstarpu_block_ptr_register
  618. function fstarpu_block_get_ptr(buffers, i) bind(C)
  619. use iso_c_binding, only: c_ptr, c_int
  620. type(c_ptr) :: fstarpu_block_get_ptr
  621. type(c_ptr), value, intent(in) :: buffers
  622. integer(c_int), value, intent(in) :: i
  623. end function fstarpu_block_get_ptr
  624. function fstarpu_block_get_ldy(buffers, i) bind(C)
  625. use iso_c_binding, only: c_ptr, c_int
  626. integer(c_int) :: fstarpu_block_get_ldy
  627. type(c_ptr), value, intent(in) :: buffers
  628. integer(c_int), value, intent(in) :: i
  629. end function fstarpu_block_get_ldy
  630. function fstarpu_block_get_ldz(buffers, i) bind(C)
  631. use iso_c_binding, only: c_ptr, c_int
  632. integer(c_int) :: fstarpu_block_get_ldz
  633. type(c_ptr), value, intent(in) :: buffers
  634. integer(c_int), value, intent(in) :: i
  635. end function fstarpu_block_get_ldz
  636. function fstarpu_block_get_nx(buffers, i) bind(C)
  637. use iso_c_binding, only: c_ptr, c_int
  638. integer(c_int) :: fstarpu_block_get_nx
  639. type(c_ptr), value, intent(in) :: buffers
  640. integer(c_int), value, intent(in) :: i
  641. end function fstarpu_block_get_nx
  642. function fstarpu_block_get_ny(buffers, i) bind(C)
  643. use iso_c_binding, only: c_ptr, c_int
  644. integer(c_int) :: fstarpu_block_get_ny
  645. type(c_ptr), value, intent(in) :: buffers
  646. integer(c_int), value, intent(in) :: i
  647. end function fstarpu_block_get_ny
  648. function fstarpu_block_get_nz(buffers, i) bind(C)
  649. use iso_c_binding, only: c_ptr, c_int
  650. integer(c_int) :: fstarpu_block_get_nz
  651. type(c_ptr), value, intent(in) :: buffers
  652. integer(c_int), value, intent(in) :: i
  653. end function fstarpu_block_get_nz
  654. ! == starpu_data_interface.h: matrix ==
  655. ! 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);
  656. subroutine fstarpu_matrix_data_register(dh, home_node, ptr, ld, nx, ny, elt_size) &
  657. bind(C,name="starpu_matrix_data_register")
  658. use iso_c_binding, only: c_ptr, c_int, c_size_t
  659. type(c_ptr), intent(out) :: dh
  660. integer(c_int), value, intent(in) :: home_node
  661. type(c_ptr), value, intent(in) :: ptr
  662. integer(c_int), value, intent(in) :: ld
  663. integer(c_int), value, intent(in) :: nx
  664. integer(c_int), value, intent(in) :: ny
  665. integer(c_size_t), value, intent(in) :: elt_size
  666. end subroutine fstarpu_matrix_data_register
  667. ! 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);
  668. subroutine fstarpu_matrix_ptr_register(dh, node, ptr, dev_handle, offset, ld) &
  669. bind(C,name="starpu_matrix_ptr_register")
  670. use iso_c_binding, only: c_ptr, c_int, c_size_t
  671. type(c_ptr), intent(out) :: dh
  672. integer(c_int), value, intent(in) :: node
  673. type(c_ptr), value, intent(in) :: ptr
  674. type(c_ptr), value, intent(in) :: dev_handle
  675. integer(c_size_t), value, intent(in) :: offset
  676. integer(c_int), value, intent(in) :: ld
  677. end subroutine fstarpu_matrix_ptr_register
  678. function fstarpu_matrix_get_ptr(buffers, i) bind(C)
  679. use iso_c_binding, only: c_ptr, c_int
  680. type(c_ptr) :: fstarpu_matrix_get_ptr
  681. type(c_ptr), value, intent(in) :: buffers
  682. integer(c_int), value, intent(in) :: i
  683. end function fstarpu_matrix_get_ptr
  684. function fstarpu_matrix_get_ld(buffers, i) bind(C)
  685. use iso_c_binding, only: c_ptr, c_int
  686. integer(c_int) :: fstarpu_matrix_get_ld
  687. type(c_ptr), value, intent(in) :: buffers
  688. integer(c_int), value, intent(in) :: i
  689. end function fstarpu_matrix_get_ld
  690. function fstarpu_matrix_get_nx(buffers, i) bind(C)
  691. use iso_c_binding, only: c_ptr, c_int
  692. integer(c_int) :: fstarpu_matrix_get_nx
  693. type(c_ptr), value, intent(in) :: buffers
  694. integer(c_int), value, intent(in) :: i
  695. end function fstarpu_matrix_get_nx
  696. function fstarpu_matrix_get_ny(buffers, i) bind(C)
  697. use iso_c_binding, only: c_ptr, c_int
  698. integer(c_int) :: fstarpu_matrix_get_ny
  699. type(c_ptr), value, intent(in) :: buffers
  700. integer(c_int), value, intent(in) :: i
  701. end function fstarpu_matrix_get_ny
  702. ! == starpu_data_interface.h: vector ==
  703. ! void starpu_vector_data_register(starpu_data_handle_t *handle, unsigned home_node, uintptr_t ptr, uint32_t nx, size_t elemsize);
  704. subroutine fstarpu_vector_data_register(dh, home_node, ptr,nx, elt_size) &
  705. bind(C,name="starpu_vector_data_register")
  706. use iso_c_binding, only: c_ptr, c_int, c_size_t
  707. type(c_ptr), intent(out) :: dh
  708. integer(c_int), value, intent(in) :: home_node
  709. type(c_ptr), value, intent(in) :: ptr
  710. integer(c_int), value, intent(in) :: nx
  711. integer(c_size_t), value, intent(in) :: elt_size
  712. end subroutine fstarpu_vector_data_register
  713. ! void starpu_vector_ptr_register(starpu_data_handle_t handle, unsigned node, uintptr_t ptr, uintptr_t dev_handle, size_t offset);
  714. subroutine fstarpu_vector_ptr_register(dh, node, ptr, dev_handle, offset, ld) &
  715. bind(C,name="starpu_vector_ptr_register")
  716. use iso_c_binding, only: c_ptr, c_int, c_size_t
  717. type(c_ptr), intent(out) :: dh
  718. integer(c_int), value, intent(in) :: node
  719. type(c_ptr), value, intent(in) :: ptr
  720. type(c_ptr), value, intent(in) :: dev_handle
  721. integer(c_size_t), value, intent(in) :: offset
  722. end subroutine fstarpu_vector_ptr_register
  723. function fstarpu_vector_get_ptr(buffers, i) bind(C)
  724. use iso_c_binding, only: c_ptr, c_int
  725. type(c_ptr) :: fstarpu_vector_get_ptr
  726. type(c_ptr), value, intent(in) :: buffers
  727. integer(c_int), value, intent(in) :: i
  728. end function fstarpu_vector_get_ptr
  729. function fstarpu_vector_get_nx(buffers, i) bind(C)
  730. use iso_c_binding, only: c_ptr, c_int
  731. integer(c_int) :: fstarpu_vector_get_nx
  732. type(c_ptr), value, intent(in) :: buffers
  733. integer(c_int), value, intent(in) :: i
  734. end function fstarpu_vector_get_nx
  735. ! == starpu_data_interface.h: variable ==
  736. ! void starpu_variable_data_register(starpu_data_handle_t *handle, unsigned home_node, uintptr_t ptr, size_t size);
  737. subroutine fstarpu_variable_data_register(dh, home_node, ptr, elt_size) &
  738. bind(C,name="starpu_variable_data_register")
  739. use iso_c_binding, only: c_ptr, c_int, c_size_t
  740. type(c_ptr), intent(out) :: dh
  741. integer(c_int), value, intent(in) :: home_node
  742. type(c_ptr), value, intent(in) :: ptr
  743. integer(c_size_t), value, intent(in) :: elt_size
  744. end subroutine fstarpu_variable_data_register
  745. ! void starpu_variable_ptr_register(starpu_data_handle_t handle, unsigned node, uintptr_t ptr, uintptr_t dev_handle, size_t offset);
  746. subroutine fstarpu_variable_ptr_register(dh, node, ptr, dev_handle, offset, ld) &
  747. bind(C,name="starpu_variable_ptr_register")
  748. use iso_c_binding, only: c_ptr, c_int, c_size_t
  749. type(c_ptr), intent(out) :: dh
  750. integer(c_int), value, intent(in) :: node
  751. type(c_ptr), value, intent(in) :: ptr
  752. type(c_ptr), value, intent(in) :: dev_handle
  753. integer(c_size_t), value, intent(in) :: offset
  754. end subroutine fstarpu_variable_ptr_register
  755. function fstarpu_variable_get_ptr(buffers, i) bind(C)
  756. use iso_c_binding, only: c_ptr, c_int
  757. type(c_ptr) :: fstarpu_variable_get_ptr
  758. type(c_ptr), value, intent(in) :: buffers
  759. integer(c_int), value, intent(in) :: i
  760. end function fstarpu_variable_get_ptr
  761. ! == starpu_data_interface.h: void ==
  762. ! void starpu_void_data_register(starpu_data_handle_t *handle);
  763. subroutine fstarpu_void_data_register(dh) &
  764. bind(C,name="starpu_void_data_register")
  765. use iso_c_binding, only: c_ptr, c_int, c_size_t
  766. type(c_ptr), intent(out) :: dh
  767. end subroutine fstarpu_void_data_register
  768. ! == starpu_data_filter.h ==
  769. ! void starpu_data_partition(starpu_data_handle_t initial_handle, struct starpu_data_filter *f);
  770. subroutine fstarpu_data_partition (dh,filter) bind(C,name="starpu_data_partition")
  771. use iso_c_binding, only: c_ptr
  772. type(c_ptr), value, intent(in) :: dh
  773. type(c_ptr), value, intent(in) :: filter
  774. end subroutine fstarpu_data_partition
  775. ! void starpu_data_unpartition(starpu_data_handle_t root_data, unsigned gathering_node);
  776. subroutine fstarpug_data_data_unpartition (root_dh,gathering_node) bind(C,name="starpu_data_data_unpartition")
  777. use iso_c_binding, only: c_ptr, c_int
  778. type(c_ptr), value, intent(in) :: root_dh
  779. integer(c_int), value, intent(in) :: gathering_node
  780. end subroutine fstarpug_data_data_unpartition
  781. ! void starpu_data_partition_plan(starpu_data_handle_t initial_handle, struct starpu_data_filter *f, starpu_data_handle_t *children);
  782. subroutine fstarpu_data_partition_plan (dh,filter,children) &
  783. bind(C,name="starpu_data_partition_plan")
  784. use iso_c_binding, only: c_ptr
  785. type(c_ptr), value, intent(in) :: dh
  786. type(c_ptr), value, intent(in) :: filter
  787. type(c_ptr), intent(in) :: children(*)
  788. end subroutine fstarpu_data_partition_plan
  789. ! void starpu_data_partition_submit(starpu_data_handle_t initial_handle, unsigned nparts, starpu_data_handle_t *children);
  790. subroutine fstarpu_data_partition_submit (dh,nparts,children) &
  791. bind(C,name="starpu_data_partition_submit")
  792. use iso_c_binding, only: c_ptr
  793. type(c_ptr), value, intent(in) :: dh
  794. type(c_ptr), value, intent(in) :: nparts
  795. type(c_ptr), intent(in) :: children(*)
  796. end subroutine fstarpu_data_partition_submit
  797. ! void starpu_data_partition_readonly_submit(starpu_data_handle_t initial_handle, unsigned nparts, starpu_data_handle_t *children);
  798. subroutine fstarpu_data_partition_readonly_submit (dh,nparts,children) &
  799. bind(C,name="starpu_data_partition_readonly_submit")
  800. use iso_c_binding, only: c_ptr
  801. type(c_ptr), value, intent(in) :: dh
  802. type(c_ptr), value, intent(in) :: nparts
  803. type(c_ptr), intent(in) :: children(*)
  804. end subroutine fstarpu_data_partition_readonly_submit
  805. ! void starpu_data_partition_readwrite_upgrade_submit(starpu_data_handle_t initial_handle, unsigned nparts, starpu_data_handle_t *children);
  806. subroutine fstarpu_data_partition_readwrite_upgrade_submit (dh,nparts,children) &
  807. bind(C,name="starpu_data_partition_readwrite_upgrade_submit")
  808. use iso_c_binding, only: c_ptr
  809. type(c_ptr), value, intent(in) :: dh
  810. type(c_ptr), value, intent(in) :: nparts
  811. type(c_ptr), intent(in) :: children(*)
  812. end subroutine fstarpu_data_partition_readwrite_upgrade_submit
  813. ! void starpu_data_unpartition_submit(starpu_data_handle_t initial_handle, unsigned nparts, starpu_data_handle_t *children, int gathering_node);
  814. subroutine fstarpu_data_unpartition_submit (dh,nparts,children,gathering_node) &
  815. bind(C,name="starpu_data_unpartition_submit")
  816. use iso_c_binding, only: c_ptr, c_int
  817. type(c_ptr), value, intent(in) :: dh
  818. type(c_ptr), value, intent(in) :: nparts
  819. type(c_ptr), intent(in) :: children(*)
  820. integer(c_int), value, intent(in) :: gathering_node
  821. end subroutine fstarpu_data_unpartition_submit
  822. ! void starpu_data_unpartition_readonly_submit(starpu_data_handle_t initial_handle, unsigned nparts, starpu_data_handle_t *children, int gathering_node);
  823. subroutine fstarpu_data_unpartition_readonly_submit (dh,nparts,children,gathering_node) &
  824. bind(C,name="starpu_data_unpartition_readonly_submit")
  825. use iso_c_binding, only: c_ptr, c_int
  826. type(c_ptr), value, intent(in) :: dh
  827. type(c_ptr), value, intent(in) :: nparts
  828. type(c_ptr), intent(in) :: children(*)
  829. integer(c_int), value, intent(in) :: gathering_node
  830. end subroutine fstarpu_data_unpartition_readonly_submit
  831. ! void starpu_data_partition_clean(starpu_data_handle_t root_data, unsigned nparts, starpu_data_handle_t *children);
  832. subroutine fstarpu_data_partition_clean (dh,nparts,children) &
  833. bind(C,name="starpu_data_partition_clean")
  834. use iso_c_binding, only: c_ptr
  835. type(c_ptr), value, intent(in) :: dh
  836. type(c_ptr), value, intent(in) :: nparts
  837. type(c_ptr), intent(in) :: children(*)
  838. end subroutine fstarpu_data_partition_clean
  839. ! int starpu_data_get_nb_children(starpu_data_handle_t handle);
  840. function fstarpu_data_get_nb_children(dh) bind(C,name="starpu_data_get_nb_children")
  841. use iso_c_binding, only: c_ptr, c_int
  842. integer(c_int) :: fstarpu_data_get_nb_children
  843. type(c_ptr), value, intent(in) :: dh
  844. end function fstarpu_data_get_nb_children
  845. ! starpu_data_handle_t starpu_data_get_child(starpu_data_handle_t handle, unsigned i);
  846. function fstarpu_data_get_child(dh,i) bind(C,name="starpu_data_get_child")
  847. use iso_c_binding, only: c_ptr, c_int
  848. type(c_ptr) :: fstarpu_data_get_child
  849. type(c_ptr), value, intent(in) :: dh
  850. integer(c_int), value, intent(in) :: i
  851. end function fstarpu_data_get_child
  852. ! starpu_data_handle_t starpu_data_get_sub_data(starpu_data_handle_t root_data, unsigned depth, ... );
  853. ! starpu_data_handle_t starpu_data_vget_sub_data(starpu_data_handle_t root_data, unsigned depth, va_list pa);
  854. ! void starpu_matrix_filter_block(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  855. subroutine fstarpu_matrix_filter_block (father_interface,child_interface,filter,id,nparts) &
  856. bind(C,name="starpu_matrix_filter_block")
  857. use iso_c_binding, only: c_ptr
  858. type(c_ptr), value, intent(in) :: father_interface
  859. type(c_ptr), value, intent(in) :: child_interface
  860. type(c_ptr), value, intent(in) :: filter
  861. type(c_ptr), value, intent(in) :: id
  862. type(c_ptr), value, intent(in) :: nparts
  863. end subroutine fstarpu_matrix_filter_block
  864. ! void starpu_matrix_filter_block_shadow(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  865. subroutine fstarpu_matrix_filter_block_shadow (father_interface,child_interface,filter,id,nparts) &
  866. bind(C,name="starpu_matrix_filter_block_shadow")
  867. use iso_c_binding, only: c_ptr
  868. type(c_ptr), value, intent(in) :: father_interface
  869. type(c_ptr), value, intent(in) :: child_interface
  870. type(c_ptr), value, intent(in) :: filter
  871. type(c_ptr), value, intent(in) :: id
  872. type(c_ptr), value, intent(in) :: nparts
  873. end subroutine fstarpu_matrix_filter_block_shadow
  874. ! void starpu_matrix_filter_vertical_block(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  875. subroutine fstarpu_matrix_filter_vertical_block (father_interface,child_interface,filter,id,nparts) &
  876. bind(C,name="starpu_matrix_filter_vertical_block")
  877. use iso_c_binding, only: c_ptr
  878. type(c_ptr), value, intent(in) :: father_interface
  879. type(c_ptr), value, intent(in) :: child_interface
  880. type(c_ptr), value, intent(in) :: filter
  881. type(c_ptr), value, intent(in) :: id
  882. type(c_ptr), value, intent(in) :: nparts
  883. end subroutine fstarpu_matrix_filter_vertical_block
  884. ! void starpu_matrix_filter_vertical_block_shadow(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  885. subroutine fstarpu_matrix_filter_vertical_block_shadow (father_interface,child_interface,filter,id,nparts) &
  886. bind(C,name="starpu_matrix_filter_vertical_block_shadow")
  887. use iso_c_binding, only: c_ptr
  888. type(c_ptr), value, intent(in) :: father_interface
  889. type(c_ptr), value, intent(in) :: child_interface
  890. type(c_ptr), value, intent(in) :: filter
  891. type(c_ptr), value, intent(in) :: id
  892. type(c_ptr), value, intent(in) :: nparts
  893. end subroutine fstarpu_matrix_filter_vertical_block_shadow
  894. ! void starpu_vector_filter_block(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  895. subroutine fstarpu_vector_filter_block (father_interface,child_interface,filter,id,nparts) &
  896. bind(C,name="starpu_vector_filter_block")
  897. use iso_c_binding, only: c_ptr
  898. type(c_ptr), value, intent(in) :: father_interface
  899. type(c_ptr), value, intent(in) :: child_interface
  900. type(c_ptr), value, intent(in) :: filter
  901. type(c_ptr), value, intent(in) :: id
  902. type(c_ptr), value, intent(in) :: nparts
  903. end subroutine fstarpu_vector_filter_block
  904. ! void starpu_vector_filter_block_shadow(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  905. subroutine fstarpu_vector_filter_block_shadow (father_interface,child_interface,filter,id,nparts) &
  906. bind(C,name="starpu_vector_filter_block_shadow")
  907. use iso_c_binding, only: c_ptr
  908. type(c_ptr), value, intent(in) :: father_interface
  909. type(c_ptr), value, intent(in) :: child_interface
  910. type(c_ptr), value, intent(in) :: filter
  911. type(c_ptr), value, intent(in) :: id
  912. type(c_ptr), value, intent(in) :: nparts
  913. end subroutine fstarpu_vector_filter_block_shadow
  914. ! void starpu_vector_filter_list(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  915. subroutine fstarpu_vector_filter_list (father_interface,child_interface,filter,id,nparts) &
  916. bind(C,name="starpu_vector_filter_list")
  917. use iso_c_binding, only: c_ptr
  918. type(c_ptr), value, intent(in) :: father_interface
  919. type(c_ptr), value, intent(in) :: child_interface
  920. type(c_ptr), value, intent(in) :: filter
  921. type(c_ptr), value, intent(in) :: id
  922. type(c_ptr), value, intent(in) :: nparts
  923. end subroutine fstarpu_vector_filter_list
  924. ! void starpu_vector_filter_divide_in_2(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  925. ! void starpu_vector_filter_list(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  926. subroutine fstarpu_vector_divide_in_2 (father_interface,child_interface,filter,id,nparts) &
  927. bind(C,name="starpu_vector_divide_in_2")
  928. use iso_c_binding, only: c_ptr
  929. type(c_ptr), value, intent(in) :: father_interface
  930. type(c_ptr), value, intent(in) :: child_interface
  931. type(c_ptr), value, intent(in) :: filter
  932. type(c_ptr), value, intent(in) :: id
  933. type(c_ptr), value, intent(in) :: nparts
  934. end subroutine fstarpu_vector_divide_in_2
  935. ! void starpu_block_filter_block(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  936. subroutine fstarpu_block_filter_block (father_interface,child_interface,filter,id,nparts) &
  937. bind(C,name="starpu_block_filter_block")
  938. use iso_c_binding, only: c_ptr
  939. type(c_ptr), value, intent(in) :: father_interface
  940. type(c_ptr), value, intent(in) :: child_interface
  941. type(c_ptr), value, intent(in) :: filter
  942. type(c_ptr), value, intent(in) :: id
  943. type(c_ptr), value, intent(in) :: nparts
  944. end subroutine fstarpu_block_filter_block
  945. ! void starpu_block_filter_block_shadow(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  946. subroutine fstarpu_block_filter_block_shadow (father_interface,child_interface,filter,id,nparts) &
  947. bind(C,name="starpu_block_filter_block_shadow")
  948. use iso_c_binding, only: c_ptr
  949. type(c_ptr), value, intent(in) :: father_interface
  950. type(c_ptr), value, intent(in) :: child_interface
  951. type(c_ptr), value, intent(in) :: filter
  952. type(c_ptr), value, intent(in) :: id
  953. type(c_ptr), value, intent(in) :: nparts
  954. end subroutine fstarpu_block_filter_block_shadow
  955. ! void starpu_block_filter_vertical_block(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  956. subroutine fstarpu_block_filter_vertical_block (father_interface,child_interface,filter,id,nparts) &
  957. bind(C,name="starpu_block_filter_vertical_block")
  958. use iso_c_binding, only: c_ptr
  959. type(c_ptr), value, intent(in) :: father_interface
  960. type(c_ptr), value, intent(in) :: child_interface
  961. type(c_ptr), value, intent(in) :: filter
  962. type(c_ptr), value, intent(in) :: id
  963. type(c_ptr), value, intent(in) :: nparts
  964. end subroutine fstarpu_block_filter_vertical_block
  965. ! void starpu_block_filter_vertical_block_shadow(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  966. subroutine fstarpu_block_filter_vertical_block_shadow (father_interface,child_interface,filter,id,nparts) &
  967. bind(C,name="starpu_block_filter_vertical_block_shadow")
  968. use iso_c_binding, only: c_ptr
  969. type(c_ptr), value, intent(in) :: father_interface
  970. type(c_ptr), value, intent(in) :: child_interface
  971. type(c_ptr), value, intent(in) :: filter
  972. type(c_ptr), value, intent(in) :: id
  973. type(c_ptr), value, intent(in) :: nparts
  974. end subroutine fstarpu_block_filter_vertical_block_shadow
  975. ! void starpu_block_filter_depth_block(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  976. subroutine fstarpu_block_filter_depth_block (father_interface,child_interface,filter,id,nparts) &
  977. bind(C,name="starpu_block_filter_depth_block")
  978. use iso_c_binding, only: c_ptr
  979. type(c_ptr), value, intent(in) :: father_interface
  980. type(c_ptr), value, intent(in) :: child_interface
  981. type(c_ptr), value, intent(in) :: filter
  982. type(c_ptr), value, intent(in) :: id
  983. type(c_ptr), value, intent(in) :: nparts
  984. end subroutine fstarpu_block_filter_depth_block
  985. ! void starpu_block_filter_depth_block_shadow(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  986. subroutine fstarpu_block_filter_depth_block_shadow (father_interface,child_interface,filter,id,nparts) &
  987. bind(C,name="starpu_block_filter_depth_block_shadow")
  988. use iso_c_binding, only: c_ptr
  989. type(c_ptr), value, intent(in) :: father_interface
  990. type(c_ptr), value, intent(in) :: child_interface
  991. type(c_ptr), value, intent(in) :: filter
  992. type(c_ptr), value, intent(in) :: id
  993. type(c_ptr), value, intent(in) :: nparts
  994. end subroutine fstarpu_block_filter_depth_block_shadow
  995. ! == starpu_data.h ==
  996. ! void starpu_data_unregister(starpu_data_handle_t handle);
  997. subroutine fstarpu_data_unregister (dh) bind(C,name="starpu_data_unregister")
  998. use iso_c_binding, only: c_ptr
  999. type(c_ptr), value, intent(in) :: dh
  1000. end subroutine fstarpu_data_unregister
  1001. ! void starpu_data_unregister_no_coherency(starpu_data_handle_t handle);
  1002. subroutine fstarpu_data_unregister_no_coherency (dh) bind(C,name="starpu_data_unregister_no_coherency")
  1003. use iso_c_binding, only: c_ptr
  1004. type(c_ptr), value, intent(in) :: dh
  1005. end subroutine fstarpu_data_unregister_no_coherency
  1006. ! void starpu_data_unregister_submit(starpu_data_handle_t handle);
  1007. subroutine fstarpu_data_unregister_submit (dh) bind(C,name="starpu_data_unregister_submit")
  1008. use iso_c_binding, only: c_ptr
  1009. type(c_ptr), value, intent(in) :: dh
  1010. end subroutine fstarpu_data_unregister_submit
  1011. ! void starpu_data_invalidate(starpu_data_handle_t handle);
  1012. subroutine fstarpu_data_invalidate (dh) bind(C,name="starpu_data_invalidate")
  1013. use iso_c_binding, only: c_ptr
  1014. type(c_ptr), value, intent(in) :: dh
  1015. end subroutine fstarpu_data_invalidate
  1016. ! void starpu_data_invalidate_submit(starpu_data_handle_t handle);
  1017. subroutine fstarpu_data_invalidate_submit (dh) bind(C,name="starpu_data_invalidate_submit")
  1018. use iso_c_binding, only: c_ptr
  1019. type(c_ptr), value, intent(in) :: dh
  1020. end subroutine fstarpu_data_invalidate_submit
  1021. ! void starpu_data_advise_as_important(starpu_data_handle_t handle, unsigned is_important);
  1022. subroutine fstarpu_data_advise_as_important (dh,is_important) bind(C,name="starpu_data_advise_as_important")
  1023. use iso_c_binding, only: c_ptr,c_int
  1024. type(c_ptr), value, intent(in) :: dh
  1025. integer(c_int), value, intent(in) :: is_important
  1026. end subroutine fstarpu_data_advise_as_important
  1027. ! starpu_data_acquire: see fstarpu_data_acquire
  1028. subroutine fstarpu_data_acquire (dh, mode) bind(C)
  1029. use iso_c_binding, only: c_ptr
  1030. type(c_ptr), value, intent(in) :: dh
  1031. type(c_ptr), value, intent(in) :: mode ! C function expects an intptr_t
  1032. end subroutine fstarpu_data_acquire
  1033. ! int starpu_data_acquire_on_node(starpu_data_handle_t handle, int node, enum starpu_data_access_mode mode);
  1034. ! int starpu_data_acquire_cb(starpu_data_handle_t handle, enum starpu_data_access_mode mode, void (*callback)(void *), void *arg);
  1035. ! int starpu_data_acquire_on_node_cb(starpu_data_handle_t handle, int node, enum starpu_data_access_mode mode, void (*callback)(void *), void *arg);
  1036. ! int starpu_data_acquire_cb_sequential_consistency(starpu_data_handle_t handle, enum starpu_data_access_mode mode, void (*callback)(void *), void *arg, int sequential_consistency);
  1037. ! int starpu_data_acquire_on_node_cb_sequential_consistency(starpu_data_handle_t handle, int node, enum starpu_data_access_mode mode, void (*callback)(void *), void *arg, int sequential_consistency);
  1038. ! void starpu_data_release(starpu_data_handle_t handle);
  1039. subroutine fstarpu_data_release (dh) bind(C,name="starpu_data_release")
  1040. use iso_c_binding, only: c_ptr
  1041. type(c_ptr), value, intent(in) :: dh
  1042. end subroutine fstarpu_data_release
  1043. ! void starpu_data_release_on_node(starpu_data_handle_t handle, int node);
  1044. subroutine fstarpu_data_release_on_node (dh, node) bind(C,name="starpu_data_release_on_node")
  1045. use iso_c_binding, only: c_ptr, c_int
  1046. type(c_ptr), value, intent(in) :: dh
  1047. integer(c_int), value, intent(in) :: node
  1048. end subroutine fstarpu_data_release_on_node
  1049. ! void starpu_data_assign_arbiter(starpu_data_handle_t handle, starpu_arbiter_t arbiter);
  1050. ! void starpu_arbiter_destroy(starpu_arbiter_t arbiter);
  1051. ! void starpu_data_display_memory_stats();
  1052. subroutine fstarpu_display_memory_stats() bind(C,name="starpu_display_memory_stats")
  1053. end subroutine fstarpu_display_memory_stats
  1054. ! int starpu_data_request_allocation(starpu_data_handle_t handle, unsigned node);
  1055. subroutine fstarpu_data_request_allocation (dh, node) &
  1056. bind(C,name="starpu_data_request_allocation")
  1057. use iso_c_binding, only: c_ptr, c_int
  1058. type(c_ptr), value, intent(in) :: dh
  1059. integer(c_int), value, intent(in) :: node
  1060. end subroutine fstarpu_data_request_allocation
  1061. ! int starpu_data_fetch_on_node(starpu_data_handle_t handle, unsigned node, unsigned async);
  1062. subroutine fstarpu_data_fetch_on_node (dh, node, async) &
  1063. bind(C,name="starpu_data_fetch_on_node")
  1064. use iso_c_binding, only: c_ptr, c_int
  1065. type(c_ptr), value, intent(in) :: dh
  1066. integer(c_int), value, intent(in) :: node
  1067. integer(c_int), value, intent(in) :: async
  1068. end subroutine fstarpu_data_fetch_on_node
  1069. ! int starpu_data_prefetch_on_node(starpu_data_handle_t handle, unsigned node, unsigned async);
  1070. subroutine fstarpu_data_prefetch_on_node (dh, node, async) &
  1071. bind(C,name="starpu_data_prefetch_on_node")
  1072. use iso_c_binding, only: c_ptr, c_int
  1073. type(c_ptr), value, intent(in) :: dh
  1074. integer(c_int), value, intent(in) :: node
  1075. integer(c_int), value, intent(in) :: async
  1076. end subroutine fstarpu_data_prefetch_on_node
  1077. ! int starpu_data_prefetch_on_node_prio(starpu_data_handle_t handle, unsigned node, unsigned async, int prio);
  1078. subroutine fstarpu_data_prefetch_on_node_prio (dh, node, async, prio) &
  1079. bind(C,name="starpu_data_prefetch_on_node_prio")
  1080. use iso_c_binding, only: c_ptr, c_int
  1081. type(c_ptr), value, intent(in) :: dh
  1082. integer(c_int), value, intent(in) :: node
  1083. integer(c_int), value, intent(in) :: async
  1084. integer(c_int), value, intent(in) :: prio
  1085. end subroutine fstarpu_data_prefetch_on_node_prio
  1086. ! int starpu_data_idle_prefetch_on_node(starpu_data_handle_t handle, unsigned node, unsigned async);
  1087. subroutine fstarpu_data_idle_prefetch_on_node (dh, node, async) &
  1088. bind(C,name="starpu_data_idle_prefetch_on_node")
  1089. use iso_c_binding, only: c_ptr, c_int
  1090. type(c_ptr), value, intent(in) :: dh
  1091. integer(c_int), value, intent(in) :: node
  1092. integer(c_int), value, intent(in) :: async
  1093. end subroutine fstarpu_data_idle_prefetch_on_node
  1094. ! int starpu_data_idle_prefetch_on_node_prio(starpu_data_handle_t handle, unsigned node, unsigned async, int prio);
  1095. subroutine fstarpu_data_idle_prefetch_on_node_prio (dh, node, async, prio) &
  1096. bind(C,name="starpu_data_idle_prefetch_on_node_prio")
  1097. use iso_c_binding, only: c_ptr, c_int
  1098. type(c_ptr), value, intent(in) :: dh
  1099. integer(c_int), value, intent(in) :: node
  1100. integer(c_int), value, intent(in) :: async
  1101. integer(c_int), value, intent(in) :: prio
  1102. end subroutine fstarpu_data_idle_prefetch_on_node_prio
  1103. ! void starpu_data_wont_use(starpu_data_handle_t handle);
  1104. subroutine fstarpu_data_wont_use (dh) bind(c,name="starpu_data_wont_use")
  1105. use iso_c_binding, only: c_ptr
  1106. type(c_ptr), value, intent(in) :: dh
  1107. end subroutine fstarpu_data_wont_use
  1108. ! unsigned starpu_worker_get_memory_node(unsigned workerid);
  1109. function fstarpu_worker_get_memory_node(id) bind(C,name="starpu_worker_get_memory_node")
  1110. use iso_c_binding, only: c_int
  1111. integer(c_int) :: fstarpu_worker_get_memory_node
  1112. integer(c_int), value, intent(in) :: id
  1113. end function fstarpu_worker_get_memory_node
  1114. ! unsigned starpu_memory_nodes_get_count(void);
  1115. function fstarpu_memory_nodes_get_count() bind(C,name="starpu_memory_nodes_get_count")
  1116. use iso_c_binding, only: c_int
  1117. integer(c_int) :: fstarpu_memory_nodes_get_count
  1118. end function fstarpu_memory_nodes_get_count
  1119. ! enum starpu_node_kind starpu_node_get_kind(unsigned node);
  1120. ! void starpu_data_set_wt_mask(starpu_data_handle_t handle, uint32_t wt_mask);
  1121. ! void starpu_data_set_sequential_consistency_flag(starpu_data_handle_t handle, unsigned flag);
  1122. ! unsigned starpu_data_get_sequential_consistency_flag(starpu_data_handle_t handle);
  1123. ! unsigned starpu_data_get_default_sequential_consistency_flag(void);
  1124. ! void starpu_data_set_default_sequential_consistency_flag(unsigned flag);
  1125. ! void starpu_data_query_status(starpu_data_handle_t handle, int memory_node, int *is_allocated, int *is_valid, int *is_requested);
  1126. ! void starpu_data_set_reduction_methods(starpu_data_handle_t handle, struct starpu_codelet *redux_cl, struct starpu_codelet *init_cl);
  1127. subroutine fstarpu_data_set_reduction_methods (dh,redux_cl,init_cl) bind(C,name="starpu_data_set_reduction_methods")
  1128. use iso_c_binding, only: c_ptr
  1129. type(c_ptr), value, intent(in) :: dh
  1130. type(c_ptr), value, intent(in) :: redux_cl
  1131. type(c_ptr), value, intent(in) :: init_cl
  1132. end subroutine fstarpu_data_set_reduction_methods
  1133. ! struct starpu_data_interface_ops* starpu_data_get_interface_ops(starpu_data_handle_t handle);
  1134. ! unsigned starpu_data_test_if_allocated_on_node(starpu_data_handle_t handle, unsigned memory_node);
  1135. function fstarpu_data_test_if_allocated_on_node(dh,mem_node) bind(C,name="starpu_data_test_if_allocated_on_node")
  1136. use iso_c_binding, only: c_ptr, c_int
  1137. integer(c_int) :: fstarpu_data_test_if_allocated_on_node
  1138. type(c_ptr), value, intent(in) :: dh
  1139. integer(c_int), value, intent(in) :: mem_node
  1140. end function fstarpu_data_test_if_allocated_on_node
  1141. ! void starpu_memchunk_tidy(unsigned memory_node);
  1142. subroutine fstarpu_memchunk_tidy (mem_node) bind(c,name="starpu_memchunk_tidy")
  1143. use iso_c_binding, only: c_int
  1144. integer(c_int), value, intent(in) :: mem_node
  1145. end subroutine fstarpu_memchunk_tidy
  1146. ! == starpu_task_util.h ==
  1147. ! struct starpu_data_handle *fstarpu_data_handle_array_alloc(int nb);
  1148. function fstarpu_data_handle_array_alloc (nb) bind(C)
  1149. use iso_c_binding, only: c_ptr, c_int
  1150. type(c_ptr) :: fstarpu_data_handle_array_alloc
  1151. integer(c_int), value, intent(in) :: nb
  1152. end function fstarpu_data_handle_array_alloc
  1153. ! void fstarpu_data_handle_array_free(starpu_data_handle_t *handles);
  1154. subroutine fstarpu_data_handle_array_free (handles) bind(C)
  1155. use iso_c_binding, only: c_ptr
  1156. type(c_ptr), value, intent(in) :: handles
  1157. end subroutine fstarpu_data_handle_array_free
  1158. ! void fstarpu_data_handle_array_set(starpu_data_handle_t *handles, int i, starpu_data_handle_t handle);
  1159. subroutine fstarpu_data_handle_array_set (handles, i, handle) bind(C)
  1160. use iso_c_binding, only: c_ptr, c_int
  1161. type(c_ptr), value, intent(in) :: handles
  1162. integer(c_int), value, intent(in) :: i
  1163. type(c_ptr), value, intent(in) :: handle
  1164. end subroutine fstarpu_data_handle_array_set
  1165. ! struct starpu_data_descr *fstarpu_data_descr_array_alloc(int nb);
  1166. function fstarpu_data_descr_array_alloc (nb) bind(C)
  1167. use iso_c_binding, only: c_ptr, c_int
  1168. type(c_ptr) :: fstarpu_data_descr_array_alloc
  1169. integer(c_int), value, intent(in) :: nb
  1170. end function fstarpu_data_descr_array_alloc
  1171. ! struct starpu_data_descr *fstarpu_data_descr_alloc(void);
  1172. function fstarpu_data_descr_alloc (nb) bind(C)
  1173. use iso_c_binding, only: c_ptr
  1174. type(c_ptr) :: fstarpu_data_descr_alloc
  1175. end function fstarpu_data_descr_alloc
  1176. ! void fstarpu_data_descr_array_free(struct starpu_data_descr *descrs);
  1177. subroutine fstarpu_data_descr_array_free (descrs) bind(C)
  1178. use iso_c_binding, only: c_ptr
  1179. type(c_ptr), value, intent(in) :: descrs
  1180. end subroutine fstarpu_data_descr_array_free
  1181. ! void fstarpu_data_descr_free(struct starpu_data_descr *descr);
  1182. subroutine fstarpu_data_descrg_free (descr) bind(C)
  1183. use iso_c_binding, only: c_ptr
  1184. type(c_ptr), value, intent(in) :: descr
  1185. end subroutine fstarpu_data_descrg_free
  1186. ! void fstarpu_data_descr_array_set(struct starpu_data_descr *descrs, int i, starpu_data_handle_t handle, intptr_t mode);
  1187. subroutine fstarpu_data_descr_array_set (descrs, i, handle, mode) bind(C)
  1188. use iso_c_binding, only: c_ptr, c_int, c_intptr_t
  1189. type(c_ptr), value, intent(in) :: descrs
  1190. integer(c_int), value, intent(in) :: i
  1191. type(c_ptr), value, intent(in) :: handle
  1192. integer(c_intptr_t), value, intent(in) :: mode
  1193. end subroutine fstarpu_data_descr_array_set
  1194. ! void fstarpu_data_descr_set(struct starpu_data_descr *descr, starpu_data_handle_t handle, intptr_t mode);
  1195. subroutine fstarpu_data_descr_set (descr, handle, mode) bind(C)
  1196. use iso_c_binding, only: c_ptr, c_intptr_t
  1197. type(c_ptr), value, intent(in) :: descr
  1198. type(c_ptr), value, intent(in) :: handle
  1199. integer(c_intptr_t), value, intent(in) :: mode
  1200. end subroutine fstarpu_data_descr_set
  1201. subroutine fstarpu_insert_task(arglist) bind(C)
  1202. use iso_c_binding, only: c_ptr
  1203. type(c_ptr), dimension(:), intent(in) :: arglist
  1204. end subroutine fstarpu_insert_task
  1205. subroutine fstarpu_unpack_arg(cl_arg,bufferlist) bind(C)
  1206. use iso_c_binding, only: c_ptr
  1207. type(c_ptr), value, intent(in) :: cl_arg
  1208. type(c_ptr), dimension(:), intent(in) :: bufferlist
  1209. end subroutine fstarpu_unpack_arg
  1210. ! == starpu_sched_ctx.h ==
  1211. ! starpu_sched_ctx_create: see fstarpu_sched_ctx_create
  1212. function fstarpu_sched_ctx_create(workers_array,nworkers,ctx_name) bind(C)
  1213. use iso_c_binding, only: c_int, c_char
  1214. integer(c_int) :: fstarpu_sched_ctx_create
  1215. integer(c_int), intent(in) :: workers_array(*)
  1216. integer(c_int), value, intent(in) :: nworkers
  1217. character(c_char), intent(in) :: ctx_name
  1218. end function fstarpu_sched_ctx_create
  1219. ! unsigned starpu_sched_ctx_create_inside_interval(const char *policy_name, const char *sched_ctx_name, int min_ncpus, int max_ncpus, int min_ngpus, int max_ngpus, unsigned allow_overlap);
  1220. ! void starpu_sched_ctx_register_close_callback(unsigned sched_ctx_id, void (*close_callback)(unsigned sched_ctx_id, void* args), void *args);
  1221. ! void starpu_sched_ctx_add_workers(int *workerids_ctx, int nworkers_ctx, unsigned sched_ctx_id);
  1222. subroutine fstarpu_sched_ctx_add_workers(workerids,nworkers,ctx) bind(C,name="starpu_sched_ctx_add_workers")
  1223. use iso_c_binding, only: c_int
  1224. integer(c_int), intent(in) :: workerids (*)
  1225. integer(c_int), value, intent(in) :: nworkers
  1226. integer(c_int), value, intent(in) :: ctx
  1227. end subroutine fstarpu_sched_ctx_add_workers
  1228. ! void starpu_sched_ctx_remove_workers(int *workerids_ctx, int nworkers_ctx, unsigned sched_ctx_id);
  1229. subroutine fstarpu_sched_ctx_remove_workers(workerids,nworkers,ctx) bind(C,name="starpu_sched_ctx_remove_workers")
  1230. use iso_c_binding, only: c_int
  1231. integer(c_int), intent(in) :: workerids (*)
  1232. integer(c_int), value, intent(in) :: nworkers
  1233. integer(c_int), value, intent(in) :: ctx
  1234. end subroutine fstarpu_sched_ctx_remove_workers
  1235. ! starpu_sched_ctx_display_workers: see fstarpu_sched_ctx_display_workers
  1236. subroutine fstarpu_sched_ctx_display_workers (ctx) bind(C)
  1237. use iso_c_binding, only: c_int
  1238. integer(c_int), value, intent(in) :: ctx
  1239. end subroutine fstarpu_sched_ctx_display_workers
  1240. ! void starpu_sched_ctx_delete(unsigned sched_ctx_id);
  1241. subroutine fstarpu_sched_ctx_delete (ctx) bind(C,name="starpu_sched_ctx_delete")
  1242. use iso_c_binding, only: c_int
  1243. integer(c_int), value, intent(in) :: ctx
  1244. end subroutine fstarpu_sched_ctx_delete
  1245. ! void starpu_sched_ctx_set_inheritor(unsigned sched_ctx_id, unsigned inheritor);
  1246. subroutine fstarpu_sched_ctx_set_inheritor (ctx,inheritor) bind(C,name="starpu_sched_ctx_set_inheritor")
  1247. use iso_c_binding, only: c_int
  1248. integer(c_int), value, intent(in) :: ctx
  1249. integer(c_int), value, intent(in) :: inheritor
  1250. end subroutine fstarpu_sched_ctx_set_inheritor
  1251. ! unsigned starpu_sched_ctx_get_inheritor(unsigned sched_ctx_id);
  1252. function fstarpu_sched_ctx_get_inheritor (ctx) bind(C,name="starpu_sched_ctx_get_inheritor")
  1253. use iso_c_binding, only: c_int
  1254. integer(c_int) :: fstarpu_sched_ctx_get_inheritor
  1255. integer(c_int), value, intent(in) :: ctx
  1256. end function fstarpu_sched_ctx_get_inheritor
  1257. ! unsigned starpu_sched_ctx_get_hierarchy_level(unsigned sched_ctx_id);
  1258. function fstarpu_sched_ctx_get_hierarchy_level (ctx) bind(C,name="starpu_sched_ctx_get_hierarchy_level")
  1259. use iso_c_binding, only: c_int
  1260. integer(c_int) :: fstarpu_sched_ctx_get_hierarchy_level
  1261. integer(c_int), value, intent(in) :: ctx
  1262. end function fstarpu_sched_ctx_get_hierarchy_level
  1263. ! void starpu_sched_ctx_set_context(unsigned *sched_ctx_id);
  1264. subroutine fstarpu_sched_ctx_set_context (ctx_ptr) bind(C,name="starpu_sched_ctx_set_context")
  1265. use iso_c_binding, only: c_ptr
  1266. type(c_ptr), value, intent(in) :: ctx_ptr
  1267. end subroutine fstarpu_sched_ctx_set_context
  1268. ! unsigned starpu_sched_ctx_get_context(void);
  1269. function fstarpu_sched_ctx_get_context () bind(C,name="starpu_sched_ctx_get_context")
  1270. use iso_c_binding, only: c_int
  1271. integer(c_int) :: fstarpu_sched_ctx_get_context
  1272. end function fstarpu_sched_ctx_get_context
  1273. ! == starpu_fxt.h ==
  1274. ! void starpu_fxt_options_init(struct starpu_fxt_options *options);
  1275. subroutine fstarpu_fxt_options_init (fxt_options) bind(C,name="starpu_fxt_options_init")
  1276. use iso_c_binding, only: c_ptr
  1277. type(c_ptr), value, intent(in) :: fxt_options
  1278. end subroutine fstarpu_fxt_options_init
  1279. ! void starpu_fxt_generate_trace(struct starpu_fxt_options *options);
  1280. subroutine fstarpu_fxt_generate_trace (fxt_options) bind(C,name="starpu_fxt_generate_trace")
  1281. use iso_c_binding, only: c_ptr
  1282. type(c_ptr), value, intent(in) :: fxt_options
  1283. end subroutine fstarpu_fxt_generate_trace
  1284. ! void starpu_fxt_autostart_profiling(int autostart);
  1285. subroutine fstarpu_fxt_autostart_profiling (autostart) bind(c,name="starpu_fxt_autostart_profiling")
  1286. use iso_c_binding, only: c_int
  1287. integer(c_int), value, intent(in) :: autostart
  1288. end subroutine fstarpu_fxt_autostart_profiling
  1289. ! void starpu_fxt_start_profiling(void);
  1290. subroutine fstarpu_fxt_start_profiling () bind(c,name="starpu_fxt_start_profiling")
  1291. use iso_c_binding
  1292. end subroutine fstarpu_fxt_start_profiling
  1293. ! void starpu_fxt_stop_profiling(void);
  1294. subroutine fstarpu_fxt_stop_profiling () bind(c,name="starpu_fxt_stop_profiling")
  1295. use iso_c_binding
  1296. end subroutine fstarpu_fxt_stop_profiling
  1297. ! void starpu_fxt_write_data_trace(char *filename_in);
  1298. subroutine fstarpu_fxt_write_data_trace (filename) bind(c,name="starpu_fxt_write_data_trace")
  1299. use iso_c_binding, only: c_char
  1300. character(c_char), intent(in) :: filename
  1301. end subroutine fstarpu_fxt_write_data_trace
  1302. ! void starpu_fxt_trace_user_event(unsigned long code);
  1303. subroutine fstarpu_trace_user_event (code) bind(c,name="starpu_trace_user_event")
  1304. use iso_c_binding, only: c_long
  1305. integer(c_long), value, intent(in) :: code
  1306. end subroutine fstarpu_trace_user_event
  1307. end interface
  1308. contains
  1309. function or_cptrs(op1,op2)
  1310. type(c_ptr) :: or_cptrs
  1311. type(c_ptr),intent(in) :: op1,op2
  1312. integer(c_intptr_t) :: i_op1,i_op2
  1313. i_op1 = transfer(op1,0_c_intptr_t)
  1314. i_op2 = transfer(op2,0_c_intptr_t)
  1315. or_cptrs = transfer(ior(i_op1,i_op2), C_NULL_PTR)
  1316. end function
  1317. function ip_to_p(i) bind(C)
  1318. use iso_c_binding, only: c_ptr,c_intptr_t,C_NULL_PTR
  1319. type(c_ptr) :: ip_to_p
  1320. integer(c_intptr_t), value, intent(in) :: i
  1321. ip_to_p = transfer(i,C_NULL_PTR)
  1322. end function ip_to_p
  1323. function sz_to_p(sz) bind(C)
  1324. use iso_c_binding, only: c_ptr,c_size_t,c_intptr_t
  1325. type(c_ptr) :: sz_to_p
  1326. integer(c_size_t), value, intent(in) :: sz
  1327. sz_to_p = ip_to_p(int(sz,kind=c_intptr_t))
  1328. end function sz_to_p
  1329. function fstarpu_init (conf) bind(C)
  1330. use iso_c_binding
  1331. integer(c_int) :: fstarpu_init
  1332. type(c_ptr), value, intent(in) :: conf
  1333. integer(4) :: FSTARPU_SZ_INT4_dummy
  1334. integer(8) :: FSTARPU_SZ_INT8_dummy
  1335. real(4) :: FSTARPU_SZ_REAL4_dummy
  1336. real(8) :: FSTARPU_SZ_REAL8_dummy
  1337. ! Note: Referencing global C constants from Fortran has
  1338. ! been found unreliable on some architectures, notably
  1339. ! on Darwin. The get_integer/get_pointer_constant
  1340. ! scheme is a workaround to that issue.
  1341. interface
  1342. ! These functions are not exported to the end user
  1343. function fstarpu_get_constant(s) bind(C)
  1344. use iso_c_binding, only: c_ptr,c_char
  1345. type(c_ptr) :: fstarpu_get_constant ! C function returns an intptr_t
  1346. character(kind=c_char) :: s
  1347. end function fstarpu_get_constant
  1348. function fstarpu_init_internal (conf) bind(C,name="starpu_init")
  1349. use iso_c_binding, only: c_ptr,c_int
  1350. integer(c_int) :: fstarpu_init_internal
  1351. type(c_ptr), value :: conf
  1352. end function fstarpu_init_internal
  1353. end interface
  1354. ! Initialize Fortran constants from C peers
  1355. FSTARPU_R = fstarpu_get_constant(C_CHAR_"FSTARPU_R"//C_NULL_CHAR)
  1356. FSTARPU_W = fstarpu_get_constant(C_CHAR_"FSTARPU_W"//C_NULL_CHAR)
  1357. FSTARPU_RW = fstarpu_get_constant(C_CHAR_"FSTARPU_RW"//C_NULL_CHAR)
  1358. FSTARPU_SCRATCH = fstarpu_get_constant(C_CHAR_"FSTARPU_SCRATCH"//C_NULL_CHAR)
  1359. FSTARPU_REDUX = fstarpu_get_constant(C_CHAR_"FSTARPU_REDUX"//C_NULL_CHAR)
  1360. FSTARPU_COMMUTE = fstarpu_get_constant(C_CHAR_"FSTARPU_COMMUTE"//C_NULL_CHAR)
  1361. FSTARPU_SSEND = fstarpu_get_constant(C_CHAR_"FSTARPU_SSEND"//C_NULL_CHAR)
  1362. FSTARPU_LOCALITY = fstarpu_get_constant(C_CHAR_"FSTARPU_LOCALITY"//C_NULL_CHAR)
  1363. FSTARPU_DATA_ARRAY = fstarpu_get_constant(C_CHAR_"FSTARPU_DATA_ARRAY"//C_NULL_CHAR)
  1364. FSTARPU_DATA_MODE_ARRAY = fstarpu_get_constant(C_CHAR_"FSTARPU_DATA_MODE_ARRAY"//C_NULL_CHAR)
  1365. FSTARPU_CL_ARGS = fstarpu_get_constant(C_CHAR_"FSTARPU_CL_ARGS"//C_NULL_CHAR)
  1366. FSTARPU_CALLBACK = fstarpu_get_constant(C_CHAR_"FSTARPU_CALLBACK"//C_NULL_CHAR)
  1367. FSTARPU_CALLBACK_WITH_ARG = fstarpu_get_constant(C_CHAR_"FSTARPU_CALLBACK_WITH_ARG"//C_NULL_CHAR)
  1368. FSTARPU_CALLBACK_ARG = fstarpu_get_constant(C_CHAR_"FSTARPU_CALLBACK_ARG"//C_NULL_CHAR)
  1369. FSTARPU_PROLOGUE_CALLBACK = fstarpu_get_constant(C_CHAR_"FSTARPU_PROLOGUE_CALLBACK"//C_NULL_CHAR)
  1370. FSTARPU_PROLOGUE_CALLBACK_ARG = fstarpu_get_constant(C_CHAR_"FSTARPU_PROLOGUE_CALLBACK_ARG"//C_NULL_CHAR)
  1371. FSTARPU_PROLOGUE_CALLBACK_POP = fstarpu_get_constant(C_CHAR_"FSTARPU_PROLOGUE_CALLBACK_POP"//C_NULL_CHAR)
  1372. FSTARPU_PROLOGUE_CALLBACK_POP_ARG = &
  1373. fstarpu_get_constant(C_CHAR_"FSTARPU_PROLOGUE_CALLBACK_POP_ARG"//C_NULL_CHAR)
  1374. FSTARPU_PRIORITY = fstarpu_get_constant(C_CHAR_"FSTARPU_PRIORITY"//C_NULL_CHAR)
  1375. FSTARPU_EXECUTE_ON_NODE = fstarpu_get_constant(C_CHAR_"FSTARPU_EXECUTE_ON_NODE"//C_NULL_CHAR)
  1376. FSTARPU_EXECUTE_ON_DATA = fstarpu_get_constant(C_CHAR_"FSTARPU_EXECUTE_ON_DATA"//C_NULL_CHAR)
  1377. FSTARPU_EXECUTE_ON_WORKER = fstarpu_get_constant(C_CHAR_"FSTARPU_EXECUTE_ON_WORKER"//C_NULL_CHAR)
  1378. FSTARPU_WORKER_ORDER = fstarpu_get_constant(C_CHAR_"FSTARPU_WORKER_ORDER"//C_NULL_CHAR)
  1379. FSTARPU_HYPERVISOR_TAG = fstarpu_get_constant(C_CHAR_"FSTARPU_HYPERVISOR_TAG"//C_NULL_CHAR)
  1380. FSTARPU_POSSIBLY_PARALLEL = fstarpu_get_constant(C_CHAR_"FSTARPU_POSSIBLY_PARALLEL"//C_NULL_CHAR)
  1381. FSTARPU_FLOPS = fstarpu_get_constant(C_CHAR_"FSTARPU_FLOPS"//C_NULL_CHAR)
  1382. FSTARPU_TAG = fstarpu_get_constant(C_CHAR_"FSTARPU_TAG"//C_NULL_CHAR)
  1383. FSTARPU_TAG_ONLY = fstarpu_get_constant(C_CHAR_"FSTARPU_TAG_ONLY"//C_NULL_CHAR)
  1384. FSTARPU_NAME = fstarpu_get_constant(C_CHAR_"FSTARPU_NAME"//C_NULL_CHAR)
  1385. FSTARPU_NODE_SELECTION_POLICY = fstarpu_get_constant(C_CHAR_"FSTARPU_NODE_SELECTION_POLICY"//C_NULL_CHAR)
  1386. FSTARPU_VALUE = fstarpu_get_constant(C_CHAR_"FSTARPU_VALUE"//C_NULL_CHAR)
  1387. FSTARPU_SCHED_CTX = fstarpu_get_constant(C_CHAR_"FSTARPU_SCHED_CTX"//C_NULL_CHAR)
  1388. FSTARPU_CPU_WORKER = fstarpu_get_constant(C_CHAR_"FSTARPU_CPU_WORKER"//C_NULL_CHAR)
  1389. FSTARPU_CUDA_WORKER = fstarpu_get_constant(C_CHAR_"FSTARPU_CUDA_WORKER"//C_NULL_CHAR)
  1390. FSTARPU_OPENCL_WORKER = fstarpu_get_constant(C_CHAR_"FSTARPU_OPENCL_WORKER"//C_NULL_CHAR)
  1391. FSTARPU_MIC_WORKER = fstarpu_get_constant(C_CHAR_"FSTARPU_MIC_WORKER"//C_NULL_CHAR)
  1392. FSTARPU_SCC_WORKER = fstarpu_get_constant(C_CHAR_"FSTARPU_SCC_WORKER"//C_NULL_CHAR)
  1393. FSTARPU_ANY_WORKER = fstarpu_get_constant(C_CHAR_"FSTARPU_ANY_WORKER"//C_NULL_CHAR)
  1394. ! Initialize size constants as 'c_ptr'
  1395. FSTARPU_SZ_INT4 = sz_to_p(c_sizeof(FSTARPU_SZ_INT4_dummy))
  1396. FSTARPU_SZ_INT8 = sz_to_p(c_sizeof(FSTARPU_SZ_INT8_dummy))
  1397. FSTARPU_SZ_REAL4 = sz_to_p(c_sizeof(FSTARPU_SZ_REAL4_dummy))
  1398. FSTARPU_SZ_REAL8 = sz_to_p(c_sizeof(FSTARPU_SZ_REAL8_dummy))
  1399. ! Initialize StarPU
  1400. if (c_associated(conf)) then
  1401. fstarpu_init = fstarpu_init_internal(conf)
  1402. else
  1403. fstarpu_init = fstarpu_init_internal(C_NULL_PTR)
  1404. end if
  1405. end function fstarpu_init
  1406. function fstarpu_csizet_to_cptr(i) bind(C)
  1407. use iso_c_binding
  1408. type(c_ptr) :: fstarpu_csizet_to_cptr
  1409. integer(c_size_t) :: i
  1410. fstarpu_csizet_to_cptr = transfer(int(i,kind=c_intptr_t),C_NULL_PTR)
  1411. end function fstarpu_csizet_to_cptr
  1412. function fstarpu_int_to_cptr(i) bind(C)
  1413. use iso_c_binding
  1414. type(c_ptr) :: fstarpu_int_to_cptr
  1415. integer :: i
  1416. fstarpu_int_to_cptr = transfer(int(i,kind=c_intptr_t),C_NULL_PTR)
  1417. end function fstarpu_int_to_cptr
  1418. end module fstarpu_mod