fstarpu_mod.f90 102 KB

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