fstarpu_mod.f90 93 KB

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