fstarpu_mod.f90 138 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278
  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. ! (some) portable iso_c_binding types
  61. type(c_ptr), bind(C) :: FSTARPU_SZ_C_DOUBLE
  62. type(c_ptr), bind(C) :: FSTARPU_SZ_C_FLOAT
  63. type(c_ptr), bind(C) :: FSTARPU_SZ_C_INT
  64. type(c_ptr), bind(C) :: FSTARPU_SZ_C_INTPTR_T
  65. type(c_ptr), bind(C) :: FSTARPU_SZ_C_PTR
  66. type(c_ptr), bind(C) :: FSTARPU_SZ_C_SIZE_T
  67. ! (some) native Fortran types
  68. type(c_ptr), bind(C) :: FSTARPU_SZ_INTEGER
  69. type(c_ptr), bind(C) :: FSTARPU_SZ_INT4
  70. type(c_ptr), bind(C) :: FSTARPU_SZ_INT8
  71. type(c_ptr), bind(C) :: FSTARPU_SZ_REAL
  72. type(c_ptr), bind(C) :: FSTARPU_SZ_REAL4
  73. type(c_ptr), bind(C) :: FSTARPU_SZ_REAL8
  74. type(c_ptr), bind(C) :: FSTARPU_SZ_DOUBLE_PRECISION
  75. type(c_ptr), bind(C) :: FSTARPU_SZ_COMPLEX
  76. interface operator (.ior.)
  77. procedure or_cptrs
  78. end interface operator (.ior.)
  79. interface
  80. ! == starpu.h ==
  81. ! void starpu_conf_init(struct starpu_conf *conf);
  82. subroutine fstarpu_conf_init (conf) bind(C,name="starpu_conf_init")
  83. use iso_c_binding, only: c_ptr
  84. type(c_ptr), value, intent(in) :: conf
  85. end subroutine fstarpu_conf_init
  86. function fstarpu_conf_allocate () bind(C)
  87. use iso_c_binding, only: c_ptr
  88. type(c_ptr) :: fstarpu_conf_allocate
  89. end function fstarpu_conf_allocate
  90. subroutine fstarpu_conf_free (conf) bind(C)
  91. use iso_c_binding, only: c_ptr
  92. type(c_ptr), value, intent(in) :: conf
  93. end subroutine fstarpu_conf_free
  94. subroutine fstarpu_conf_set_sched_policy_name (conf, policy_name) bind(C)
  95. use iso_c_binding, only: c_ptr, c_char
  96. type(c_ptr), value, intent(in) :: conf
  97. character(c_char), intent(in) :: policy_name
  98. end subroutine fstarpu_conf_set_sched_policy_name
  99. subroutine fstarpu_conf_set_min_prio (conf, min_prio) 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) :: min_prio
  103. end subroutine fstarpu_conf_set_min_prio
  104. subroutine fstarpu_conf_set_max_prio (conf, max_prio) 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) :: max_prio
  108. end subroutine fstarpu_conf_set_max_prio
  109. subroutine fstarpu_conf_set_ncpu (conf, ncpu) 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) :: ncpu
  113. end subroutine fstarpu_conf_set_ncpu
  114. subroutine fstarpu_conf_set_ncuda (conf, ncuda) 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) :: ncuda
  118. end subroutine fstarpu_conf_set_ncuda
  119. subroutine fstarpu_conf_set_nopencl (conf, nopencl) 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) :: nopencl
  123. end subroutine fstarpu_conf_set_nopencl
  124. subroutine fstarpu_conf_set_nmic (conf, nmic) bind(C)
  125. use iso_c_binding, only: c_ptr, c_int
  126. type(c_ptr), value, intent(in) :: conf
  127. integer(c_int), value, intent(in) :: nmic
  128. end subroutine fstarpu_conf_set_nmic
  129. subroutine fstarpu_conf_set_nscc (conf, nscc) bind(C)
  130. use iso_c_binding, only: c_ptr, c_int
  131. type(c_ptr), value, intent(in) :: conf
  132. integer(c_int), value, intent(in) :: nscc
  133. end subroutine fstarpu_conf_set_nscc
  134. ! starpu_init: see fstarpu_init
  135. ! starpu_initialize: see fstarpu_init
  136. ! void starpu_pause(void);
  137. subroutine fstarpu_pause() bind(C,name="starpu_pause")
  138. end subroutine fstarpu_pause
  139. ! void starpu_resume(void);
  140. subroutine fstarpu_resume() bind(C,name="starpu_resume")
  141. end subroutine fstarpu_resume
  142. ! void starpu_shutdown(void);
  143. subroutine fstarpu_shutdown () bind(C,name="starpu_shutdown")
  144. end subroutine fstarpu_shutdown
  145. ! starpu_topology_print
  146. subroutine fstarpu_topology_print () bind(C)
  147. end subroutine fstarpu_topology_print
  148. ! int starpu_asynchronous_copy_disabled(void);
  149. function fstarpu_asynchronous_copy_disabled() bind(C,name="starpu_asynchronous_copy_disabled")
  150. use iso_c_binding, only: c_int
  151. integer(c_int) :: fstarpu_asynchronous_copy_disabled
  152. end function fstarpu_asynchronous_copy_disabled
  153. ! int starpu_asynchronous_cuda_copy_disabled(void);
  154. function fstarpu_asynchronous_cuda_copy_disabled() bind(C,name="starpu_asynchronous_cuda_copy_disabled")
  155. use iso_c_binding, only: c_int
  156. integer(c_int) :: fstarpu_asynchronous_cuda_copy_disabled
  157. end function fstarpu_asynchronous_cuda_copy_disabled
  158. ! int starpu_asynchronous_opencl_copy_disabled(void);
  159. function fstarpu_asynchronous_opencl_copy_disabled() bind(C,name="starpu_asynchronous_opencl_copy_disabled")
  160. use iso_c_binding, only: c_int
  161. integer(c_int) :: fstarpu_asynchronous_opencl_copy_disabled
  162. end function fstarpu_asynchronous_opencl_copy_disabled
  163. ! int starpu_asynchronous_mic_copy_disabled(void);
  164. function fstarpu_asynchronous_mic_copy_disabled() bind(C,name="starpu_asynchronous_mic_copy_disabled")
  165. use iso_c_binding, only: c_int
  166. integer(c_int) :: fstarpu_asynchronous_mic_copy_disabled
  167. end function fstarpu_asynchronous_mic_copy_disabled
  168. ! void starpu_display_stats();
  169. subroutine fstarpu_display_stats() bind(C,name="starpu_display_stats")
  170. end subroutine fstarpu_display_stats
  171. ! void starpu_get_version(int *major, int *minor, int *release);
  172. subroutine fstarpu_get_version(major,minor,release) bind(C,name="starpu_get_version")
  173. use iso_c_binding, only: c_int
  174. integer(c_int), intent(out) :: major,minor,release
  175. end subroutine fstarpu_get_version
  176. ! == starpu_worker.h ==
  177. ! unsigned starpu_worker_get_count(void);
  178. function fstarpu_worker_get_count() bind(C,name="starpu_worker_get_count")
  179. use iso_c_binding, only: c_int
  180. integer(c_int) :: fstarpu_worker_get_count
  181. end function fstarpu_worker_get_count
  182. ! unsigned starpu_combined_worker_get_count(void);
  183. function fstarpu_combined_worker_get_count() bind(C,name="starpu_combined_worker_get_count")
  184. use iso_c_binding, only: c_int
  185. integer(c_int) :: fstarpu_combined_worker_get_count
  186. end function fstarpu_combined_worker_get_count
  187. ! unsigned starpu_worker_is_combined_worker(int id);
  188. function fstarpu_worker_is_combined_worker(id) bind(C,name="starpu_worker_is_combined_worker")
  189. use iso_c_binding, only: c_int
  190. integer(c_int) :: fstarpu_worker_is_combined_worker
  191. integer(c_int), value, intent(in) :: id
  192. end function fstarpu_worker_is_combined_worker
  193. ! unsigned starpu_cpu_worker_get_count(void);
  194. function fstarpu_cpu_worker_get_count() bind(C,name="starpu_cpu_worker_get_count")
  195. use iso_c_binding, only: c_int
  196. integer(c_int) :: fstarpu_cpu_worker_get_count
  197. end function fstarpu_cpu_worker_get_count
  198. ! unsigned starpu_cuda_worker_get_count(void);
  199. function fstarpu_cuda_worker_get_count() bind(C,name="starpu_cuda_worker_get_count")
  200. use iso_c_binding, only: c_int
  201. integer(c_int) :: fstarpu_cuda_worker_get_count
  202. end function fstarpu_cuda_worker_get_count
  203. ! unsigned starpu_opencl_worker_get_count(void);
  204. function fstarpu_opencl_worker_get_count() bind(C,name="starpu_opencl_worker_get_count")
  205. use iso_c_binding, only: c_int
  206. integer(c_int) :: fstarpu_opencl_worker_get_count
  207. end function fstarpu_opencl_worker_get_count
  208. ! unsigned starpu_mic_worker_get_count(void);
  209. function fstarpu_mic_worker_get_count() bind(C,name="starpu_mic_worker_get_count")
  210. use iso_c_binding, only: c_int
  211. integer(c_int) :: fstarpu_mic_worker_get_count
  212. end function fstarpu_mic_worker_get_count
  213. ! unsigned starpu_scc_worker_get_count(void);
  214. function fstarpu_scc_worker_get_count() bind(C,name="starpu_scc_worker_get_count")
  215. use iso_c_binding, only: c_int
  216. integer(c_int) :: fstarpu_scc_worker_get_count
  217. end function fstarpu_scc_worker_get_count
  218. ! int starpu_worker_get_id(void);
  219. function fstarpu_worker_get_id() bind(C,name="starpu_worker_get_id")
  220. use iso_c_binding, only: c_int
  221. integer(c_int) :: fstarpu_worker_get_id
  222. end function fstarpu_worker_get_id
  223. ! _starpu_worker_get_id_check
  224. ! starpu_worker_get_id_check
  225. ! int starpu_worker_get_bindid(int workerid);
  226. function fstarpu_worker_get_bindid(id) bind(C,name="starpu_worker_get_bindid")
  227. use iso_c_binding, only: c_int
  228. integer(c_int) :: fstarpu_worker_get_bindid
  229. integer(c_int), value, intent(in) :: id
  230. end function fstarpu_worker_get_bindid
  231. ! int starpu_combined_worker_get_id(void);
  232. function fstarpu_combined_worker_get_id() bind(C,name="starpu_combined_worker_get_id")
  233. use iso_c_binding, only: c_int
  234. integer(c_int) :: fstarpu_combined_worker_get_id
  235. end function fstarpu_combined_worker_get_id
  236. ! int starpu_combined_worker_get_size(void);
  237. function fstarpu_combined_worker_get_size() bind(C,name="starpu_combined_worker_get_size")
  238. use iso_c_binding, only: c_int
  239. integer(c_int) :: fstarpu_combined_worker_get_size
  240. end function fstarpu_combined_worker_get_size
  241. ! int starpu_combined_worker_get_rank(void);
  242. function fstarpu_combined_worker_get_rank() bind(C,name="starpu_combined_worker_get_rank")
  243. use iso_c_binding, only: c_int
  244. integer(c_int) :: fstarpu_combined_worker_get_rank
  245. end function fstarpu_combined_worker_get_rank
  246. ! enum starpu_worker_archtype starpu_worker_get_type(int id);
  247. function fstarpu_worker_get_type(id) bind(C)
  248. use iso_c_binding, only: c_int, c_ptr
  249. type(c_ptr) :: fstarpu_worker_get_type ! C function returns c_intptr_t
  250. integer(c_int),value,intent(in) :: id
  251. end function fstarpu_worker_get_type
  252. ! int starpu_worker_get_count_by_type(enum starpu_worker_archtype type);
  253. function fstarpu_worker_get_count_by_type(typeid) bind(C)
  254. use iso_c_binding, only: c_int, c_ptr
  255. integer(c_int) :: fstarpu_worker_get_count_by_type
  256. type(c_ptr),value,intent(in) :: typeid ! c_intptr_t expected by C func
  257. end function fstarpu_worker_get_count_by_type
  258. ! int starpu_worker_get_ids_by_type(enum starpu_worker_archtype type, int *workerids, int maxsize);
  259. function fstarpu_worker_get_ids_by_type(typeid, workerids, maxsize) bind(C)
  260. use iso_c_binding, only: c_int, c_ptr
  261. integer(c_int) :: fstarpu_worker_get_ids_by_type
  262. type(c_ptr),value,intent(in) :: typeid ! c_intptr_t expected by C func
  263. integer(c_int),intent(out) :: workerids(*)
  264. integer(c_int),value,intent(in) :: maxsize
  265. end function fstarpu_worker_get_ids_by_type
  266. ! int starpu_worker_get_by_type(enum starpu_worker_archtype type, int num);
  267. function fstarpu_worker_get_by_type(typeid, num) bind(C)
  268. use iso_c_binding, only: c_int, c_ptr
  269. integer(c_int) :: fstarpu_worker_get_by_type
  270. type(c_ptr),value,intent(in) :: typeid ! c_intptr_t expected by C func
  271. integer(c_int),value,intent(in) :: num
  272. end function fstarpu_worker_get_by_type
  273. ! int starpu_worker_get_by_devid(enum starpu_worker_archtype type, int devid);
  274. function fstarpu_worker_get_by_devid(typeid, devid) bind(C)
  275. use iso_c_binding, only: c_int, c_ptr
  276. integer(c_int) :: fstarpu_worker_get_by_type
  277. type(c_ptr),value,intent(in) :: typeid ! c_intptr_t expected by C func
  278. integer(c_int),value,intent(in) :: devid
  279. end function fstarpu_worker_get_by_devid
  280. ! void starpu_worker_get_name(int id, char *dst, size_t maxlen);
  281. subroutine fstarpu_worker_get_name(id, dst, maxlen) bind(C,name="starpu_worker_get_name")
  282. use iso_c_binding, only: c_int, c_char, c_size_t
  283. integer(c_int),value,intent(in) :: id
  284. character(c_char),intent(out) :: dst(*)
  285. integer(c_size_t),value,intent(in) :: maxlen
  286. end subroutine fstarpu_worker_get_name
  287. ! int starpu_worker_get_devid(int id);
  288. function fstarpu_worker_get_devid(id) bind(C,name="starpu_worker_get_devid")
  289. use iso_c_binding, only: c_int
  290. integer(c_int) :: fstarpu_worker_get_devid
  291. integer(c_int), value, intent(in) :: id
  292. end function fstarpu_worker_get_devid
  293. ! int starpu_worker_get_mp_nodeid(int id);
  294. function fstarpu_worker_get_mp_nodeid(id) bind(C,name="starpu_worker_get_mp_nodeid")
  295. use iso_c_binding, only: c_int
  296. integer(c_int) :: fstarpu_worker_get_mp_nodeid
  297. integer(c_int), value, intent(in) :: id
  298. end function fstarpu_worker_get_mp_nodeid
  299. ! struct starpu_tree* starpu_workers_get_tree(void);
  300. ! unsigned starpu_worker_get_sched_ctx_list(int worker, unsigned **sched_ctx);
  301. ! unsigned starpu_worker_is_blocked(int workerid);
  302. function fstarpu_worker_is_blocked(id) bind(C,name="starpu_worker_is_blocked")
  303. use iso_c_binding, only: c_int
  304. integer(c_int) :: fstarpu_worker_is_blocked
  305. integer(c_int), value, intent(in) :: id
  306. end function fstarpu_worker_is_blocked
  307. ! unsigned starpu_worker_is_slave_somewhere(int workerid);
  308. function fstarpu_worker_is_slave_somewhere(id) bind(C,name="starpu_worker_is_slave_somewhere")
  309. use iso_c_binding, only: c_int
  310. integer(c_int) :: fstarpu_worker_is_slave_somewhere
  311. integer(c_int), value, intent(in) :: id
  312. end function fstarpu_worker_is_slave_somewhere
  313. ! char *starpu_worker_get_type_as_string(enum starpu_worker_archtype type);
  314. subroutine fstarpu_worker_get_type_as_string(typeid,dst,maxlen) bind(C)
  315. use iso_c_binding, only: c_ptr, c_char, c_size_t
  316. type(c_ptr),value,intent(in) :: typeid ! c_intptr_t expected by C func
  317. character(c_char),intent(out) :: dst(*)
  318. integer(c_size_t),value,intent(in) :: maxlen
  319. end subroutine fstarpu_worker_get_type_as_string
  320. ! int starpu_bindid_get_workerids(int bindid, int **workerids);
  321. ! == starpu_task.h ==
  322. ! void starpu_tag_declare_deps(starpu_tag_t id, unsigned ndeps, ...);
  323. ! void starpu_tag_declare_deps_array(starpu_tag_t id, unsigned ndeps, starpu_tag_t *array);
  324. subroutine fstarpu_tag_declare_deps_array(id,ndeps,tag_array) bind(C,name="starpu_tag_declare_deps_array")
  325. use iso_c_binding, only: c_int, c_long_long
  326. integer(c_int), value, intent(in) :: id
  327. integer(c_int), value, intent(in) :: ndeps
  328. integer(c_long_long), intent(in) :: tag_array(*)
  329. end subroutine fstarpu_tag_declare_deps_array
  330. ! void starpu_task_declare_deps_array(struct starpu_task *task, unsigned ndeps, struct starpu_task *task_array[]);
  331. subroutine fstarpu_task_declare_deps_array(task,ndeps,task_array) bind(C,name="starpu_task_declare_deps_array")
  332. use iso_c_binding, only: c_int, c_ptr
  333. type(c_ptr), value, intent(in) :: task
  334. integer(c_int), value, intent(in) :: ndeps
  335. type(c_ptr), intent(in) :: task_array(*)
  336. end subroutine fstarpu_task_declare_deps_array
  337. ! int starpu_tag_wait(starpu_tag_t id);
  338. function fstarpu_tag_wait(id) bind(C,name="starpu_tag_wait")
  339. use iso_c_binding, only: c_int, c_long_long
  340. integer(c_int) :: fstarpu_tag_wait
  341. integer(c_long_long), value, intent(in) :: id
  342. end function fstarpu_tag_wait
  343. ! int starpu_tag_wait_array(unsigned ntags, starpu_tag_t *id);
  344. function fstarpu_tag_wait_array(ntags,tag_array) bind(C,name="starpu_tag_wait_array")
  345. use iso_c_binding, only: c_int, c_long_long
  346. integer(c_int) :: fstarpu_tag_wait_array
  347. integer(c_int), value, intent(in) :: ntags
  348. integer(c_long_long), intent(in) :: tag_array(*)
  349. end function fstarpu_tag_wait_array
  350. ! void starpu_tag_notify_from_apps(starpu_tag_t id);
  351. subroutine fstarpu_tag_notify_from_apps(id) bind(C,name="starpu_tag_notify_from_apps")
  352. use iso_c_binding, only: c_long_long
  353. integer(c_long_long), value, intent(in) :: id
  354. end subroutine fstarpu_tag_notify_from_apps
  355. ! void starpu_tag_restart(starpu_tag_t id);
  356. subroutine fstarpu_tag_restart(id) bind(C,name="starpu_tag_restart")
  357. use iso_c_binding, only: c_long_long
  358. integer(c_long_long), value, intent(in) :: id
  359. end subroutine fstarpu_tag_restart
  360. ! void starpu_tag_remove(starpu_tag_t id);
  361. subroutine fstarpu_tag_remove(id) bind(C,name="starpu_tag_remove")
  362. use iso_c_binding, only: c_long_long
  363. integer(c_long_long), value, intent(in) :: id
  364. end subroutine fstarpu_tag_remove
  365. ! struct starpu_task *starpu_tag_get_task(starpu_tag_t id);
  366. function fstarpu_tag_get_task(id) bind(C,name="starpu_tag_get_task")
  367. use iso_c_binding, only: c_ptr, c_long_long
  368. type(c_ptr) :: fstarpu_tag_get_task
  369. integer(c_long_long), value, intent(in) :: id
  370. end function fstarpu_tag_get_task
  371. ! void starpu_task_init(struct starpu_task *task);
  372. subroutine fstarpu_task_init (task) bind(C,name="starpu_task_init")
  373. use iso_c_binding, only: c_ptr
  374. type(c_ptr), value, intent(in) :: task
  375. end subroutine fstarpu_task_init
  376. ! void starpu_task_clean(struct starpu_task *task);
  377. subroutine fstarpu_task_clean (task) bind(C,name="starpu_task_clean")
  378. use iso_c_binding, only: c_ptr
  379. type(c_ptr), value, intent(in) :: task
  380. end subroutine fstarpu_task_clean
  381. ! struct starpu_task *starpu_task_create(void) STARPU_ATTRIBUTE_MALLOC;
  382. function fstarpu_task_create () bind(C,name="starpu_task_create")
  383. use iso_c_binding, only: c_ptr
  384. type(c_ptr) :: fstarpu_task_create
  385. end function fstarpu_task_create
  386. ! void starpu_task_destroy(struct starpu_task *task);
  387. subroutine fstarpu_task_destroy (task) bind(C,name="starpu_task_destroy")
  388. use iso_c_binding, only: c_ptr
  389. type(c_ptr), value, intent(in) :: task
  390. end subroutine fstarpu_task_destroy
  391. ! int starpu_task_submit(struct starpu_task *task) STARPU_WARN_UNUSED_RESULT;
  392. function fstarpu_task_submit (task) bind(C,name="starpu_task_submit")
  393. use iso_c_binding, only: c_int,c_ptr
  394. integer(c_int) :: fstarpu_task_submit
  395. type(c_ptr), value, intent(in) :: task
  396. end function fstarpu_task_submit
  397. ! int starpu_task_submit_to_ctx(struct starpu_task *task, unsigned sched_ctx_id);
  398. function fstarpu_task_submit_to_ctx (task,sched_ctx_id) bind(C,name="starpu_task_submit_to_ctx")
  399. use iso_c_binding, only: c_int,c_ptr
  400. integer(c_int) :: fstarpu_task_submit_to_ctx
  401. type(c_ptr), value, intent(in) :: task
  402. integer(c_int), value, intent(in) :: sched_ctx_id
  403. end function fstarpu_task_submit_to_ctx
  404. ! int starpu_task_finished(struct starpu_task *task) STARPU_WARN_UNUSED_RESULT;
  405. function fstarpu_task_finished (task) bind(C,name="starpu_task_finished")
  406. use iso_c_binding, only: c_int,c_ptr
  407. integer(c_int) :: fstarpu_task_finished
  408. type(c_ptr), value, intent(in) :: task
  409. end function fstarpu_task_finished
  410. ! int starpu_task_wait(struct starpu_task *task) STARPU_WARN_UNUSED_RESULT;
  411. function fstarpu_task_wait (task) bind(C,name="starpu_task_wait")
  412. use iso_c_binding, only: c_int,c_ptr
  413. integer(c_int) :: fstarpu_task_wait
  414. type(c_ptr), value, intent(in) :: task
  415. end function fstarpu_task_wait
  416. ! int starpu_task_wait_array(struct starpu_task **tasks, unsigned nb_tasks) STARPU_WARN_UNUSED_RESULT;
  417. function fstarpu_task_wait_array(task_array,ntasks) bind(C,name="starpu_task_wait_array")
  418. use iso_c_binding, only: c_int, c_ptr
  419. integer(c_int) :: fstarpu_task_wait_array
  420. integer(c_int), value, intent(in) :: ntasks
  421. type(c_ptr), intent(in) :: task_array
  422. end function fstarpu_task_wait_array
  423. ! int starpu_task_wait_for_all(void);
  424. subroutine fstarpu_task_wait_for_all () bind(C,name="starpu_task_wait_for_all")
  425. end subroutine fstarpu_task_wait_for_all
  426. ! int starpu_task_wait_for_n_submitted(unsigned n);
  427. subroutine fstarpu_task_wait_for_n_submitted (n) bind(C,name="starpu_task_wait_for_n_submitted")
  428. use iso_c_binding, only: c_int
  429. integer(c_int), value, intent(in) :: n
  430. end subroutine fstarpu_task_wait_for_n_submitted
  431. ! int starpu_task_wait_for_all_in_ctx(unsigned sched_ctx_id);
  432. subroutine fstarpu_task_wait_for_all_in_ctx (ctx) bind(C,name="starpu_task_wait_for_all_in_ctx")
  433. use iso_c_binding, only: c_int
  434. integer(c_int), value, intent(in) :: ctx
  435. end subroutine fstarpu_task_wait_for_all_in_ctx
  436. ! int starpu_task_wait_for_n_submitted_in_ctx(unsigned sched_ctx_id, unsigned n);
  437. subroutine fstarpu_task_wait_for_n_submitted_in_ctx (ctx,n) bind(C,name="starpu_task_wait_for_n_submitted_in_ctx")
  438. use iso_c_binding, only: c_int
  439. integer(c_int), value, intent(in) :: ctx
  440. integer(c_int), value, intent(in) :: n
  441. end subroutine fstarpu_task_wait_for_n_submitted_in_ctx
  442. ! int starpu_task_wait_for_no_ready(void);
  443. function fstarpu_task_wait_for_no_ready () bind(C,name="starpu_task_wait_for_no_ready")
  444. use iso_c_binding, only: c_int
  445. integer(c_int) :: fstarpu_task_wait_for_no_ready
  446. end function fstarpu_task_wait_for_no_ready
  447. ! int starpu_task_nready(void);
  448. function fstarpu_task_nready () bind(C,name="starpu_task_nready")
  449. use iso_c_binding, only: c_int
  450. integer(c_int) :: fstarpu_task_nready
  451. end function fstarpu_task_nready
  452. ! int starpu_task_nsubmitted(void);
  453. function fstarpu_task_nsubmitted () bind(C,name="starpu_task_nsubmitted")
  454. use iso_c_binding, only: c_int
  455. integer(c_int) :: fstarpu_task_nsubmitted
  456. end function fstarpu_task_nsubmitted
  457. ! void starpu_do_schedule(void);
  458. subroutine fstarpu_do_schedule () bind(C,name="starpu_do_schedule")
  459. end subroutine fstarpu_do_schedule
  460. ! starpu_codelet_init
  461. subroutine fstarpu_codelet_init (codelet) bind(C,name="starpu_codelet_init")
  462. use iso_c_binding, only: c_ptr
  463. type(c_ptr), value, intent(in) :: codelet
  464. end subroutine fstarpu_codelet_init
  465. ! starpu_codelet_display_stats
  466. subroutine fstarpu_codelet_display_stats (codelet) bind(C,name="starpu_codelet_display_stats")
  467. use iso_c_binding, only: c_ptr
  468. type(c_ptr), value, intent(in) :: codelet
  469. end subroutine fstarpu_codelet_display_stats
  470. ! struct starpu_task *starpu_task_get_current(void);
  471. function fstarpu_task_get_current () bind(C,name="starpu_task_get_current")
  472. use iso_c_binding, only: c_ptr
  473. type(c_ptr) :: fstarpu_task_get_current
  474. end function fstarpu_task_get_current
  475. ! void starpu_parallel_task_barrier_init(struct starpu_task *task, int workerid);
  476. subroutine fstarpu_parallel_task_barrier_init_init (task,id) &
  477. bind(C,name="starpu_parallel_task_barrier_init_init")
  478. use iso_c_binding, only: c_ptr, c_int
  479. type(c_ptr), value, intent(in) :: task
  480. integer(c_int), value, intent(in) :: id
  481. end subroutine fstarpu_parallel_task_barrier_init_init
  482. ! void starpu_parallel_task_barrier_init_n(struct starpu_task *task, int worker_size);
  483. subroutine fstarpu_parallel_task_barrier_init_n_init_n (task,sz) &
  484. bind(C,name="starpu_parallel_task_barrier_init_n_init_n")
  485. use iso_c_binding, only: c_ptr, c_int
  486. type(c_ptr), value, intent(in) :: task
  487. integer(c_int), value, intent(in) :: sz
  488. end subroutine fstarpu_parallel_task_barrier_init_n_init_n
  489. ! struct starpu_task *starpu_task_dup(struct starpu_task *task);
  490. function fstarpu_task_dup (task) bind(C,name="starpu_task_dup")
  491. use iso_c_binding, only: c_ptr
  492. type(c_ptr) :: fstarpu_task_dup
  493. type(c_ptr), value, intent(in) :: task
  494. end function fstarpu_task_dup
  495. ! void starpu_task_set_implementation(struct starpu_task *task, unsigned impl);
  496. subroutine fstarpu_task_set_implementation (task,impl) &
  497. bind(C,name="starpu_task_set_implementation")
  498. use iso_c_binding, only: c_ptr,c_int
  499. type(c_ptr), value, intent(in) :: task
  500. integer(c_int), value, intent(in) :: impl
  501. end subroutine fstarpu_task_set_implementation
  502. ! unsigned starpu_task_get_implementation(struct starpu_task *task);
  503. function fstarpu_task_get_implementation (task) &
  504. bind(C,name="starpu_task_get_implementation")
  505. use iso_c_binding, only: c_ptr,c_int
  506. type(c_ptr), value, intent(in) :: task
  507. integer(c_int) :: fstarpu_task_get_implementation
  508. end function fstarpu_task_get_implementation
  509. ! --
  510. function fstarpu_codelet_allocate () bind(C)
  511. use iso_c_binding, only: c_ptr
  512. type(c_ptr) :: fstarpu_codelet_allocate
  513. end function fstarpu_codelet_allocate
  514. subroutine fstarpu_codelet_free (cl) bind(C)
  515. use iso_c_binding, only: c_ptr
  516. type(c_ptr), value, intent(in) :: cl
  517. end subroutine fstarpu_codelet_free
  518. subroutine fstarpu_codelet_set_name (cl, cl_name) bind(C)
  519. use iso_c_binding, only: c_ptr, c_char
  520. type(c_ptr), value, intent(in) :: cl
  521. character(c_char), intent(in) :: cl_name
  522. end subroutine fstarpu_codelet_set_name
  523. subroutine fstarpu_codelet_add_cpu_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_cpu_func
  528. subroutine fstarpu_codelet_add_cuda_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_cuda_func
  533. subroutine fstarpu_codelet_add_opencl_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_opencl_func
  538. subroutine fstarpu_codelet_add_mic_func (cl, f_ptr) bind(C)
  539. use iso_c_binding, only: c_ptr, c_funptr
  540. type(c_ptr), value, intent(in) :: cl
  541. type(c_funptr), value, intent(in) :: f_ptr
  542. end subroutine fstarpu_codelet_add_mic_func
  543. subroutine fstarpu_codelet_add_scc_func (cl, f_ptr) bind(C)
  544. use iso_c_binding, only: c_ptr, c_funptr
  545. type(c_ptr), value, intent(in) :: cl
  546. type(c_funptr), value, intent(in) :: f_ptr
  547. end subroutine fstarpu_codelet_add_scc_func
  548. subroutine fstarpu_codelet_add_buffer (cl, mode) bind(C)
  549. use iso_c_binding, only: c_ptr
  550. type(c_ptr), value, intent(in) :: cl
  551. type(c_ptr), value, intent(in) :: mode ! C function expects an intptr_t
  552. end subroutine fstarpu_codelet_add_buffer
  553. subroutine fstarpu_codelet_set_variable_nbuffers (cl) bind(C)
  554. use iso_c_binding, only: c_ptr,c_int
  555. type(c_ptr), value, intent(in) :: cl
  556. end subroutine fstarpu_codelet_set_variable_nbuffers
  557. subroutine fstarpu_codelet_set_nbuffers (cl, nbuffers) bind(C)
  558. use iso_c_binding, only: c_ptr,c_int
  559. type(c_ptr), value, intent(in) :: cl
  560. integer(c_int), value, intent(in) :: nbuffers
  561. end subroutine fstarpu_codelet_set_nbuffers
  562. ! == starpu_data_interface.h ==
  563. ! uintptr_t starpu_malloc_on_node_flags(unsigned dst_node, size_t size, int flags);
  564. ! uintptr_t starpu_malloc_on_node(unsigned dst_node, size_t size);
  565. function fstarpu_malloc_on_node(node,sz) bind(C,name="starpu_malloc_on_node")
  566. use iso_c_binding, only: c_int,c_intptr_t,c_size_t
  567. integer(c_intptr_t) :: fstarpu_malloc_on_node
  568. integer(c_int), value, intent(in) :: node
  569. integer(c_size_t), value, intent(in) :: sz
  570. end function fstarpu_malloc_on_node
  571. ! void starpu_free_on_node_flags(unsigned dst_node, uintptr_t addr, size_t size, int flags);
  572. ! void starpu_free_on_node(unsigned dst_node, uintptr_t addr, size_t size);
  573. subroutine fstarpu_free_on_node(node,addr,sz) bind(C,name="starpu_free_on_node")
  574. use iso_c_binding, only: c_int,c_intptr_t,c_size_t
  575. integer(c_int), value, intent(in) :: node
  576. integer(c_intptr_t), value, intent(in) :: addr
  577. integer(c_size_t), value, intent(in) :: sz
  578. end subroutine fstarpu_free_on_node
  579. ! void starpu_malloc_on_node_set_default_flags(unsigned node, int flags);
  580. ! int starpu_data_interface_get_next_id(void);
  581. ! void starpu_data_register(starpu_data_handle_t *handleptr, unsigned home_node, void *data_interface, struct starpu_data_interface_ops *ops);
  582. ! void starpu_data_ptr_register(starpu_data_handle_t handle, unsigned node);
  583. subroutine fstarpug_data_ptr_register (dh,node) bind(C,name="starpu_data_ptr_register")
  584. use iso_c_binding, only: c_ptr, c_int
  585. type(c_ptr), value, intent(in) :: dh
  586. integer(c_int), value, intent(in) :: node
  587. end subroutine fstarpug_data_ptr_register
  588. ! void starpu_data_register_same(starpu_data_handle_t *handledst, starpu_data_handle_t handlesrc);
  589. subroutine fstarpu_data_register_same (dh_dst,dh_src) bind(C,name="starpu_data_register_same")
  590. use iso_c_binding, only: c_ptr
  591. type(c_ptr), intent(out) :: dh_dst
  592. type(c_ptr), value, intent(in) :: dh_src
  593. end subroutine fstarpu_data_register_same
  594. ! void *starpu_data_handle_to_pointer(starpu_data_handle_t handle, unsigned node);
  595. function fstarpu_data_handle_to_pointer (dh,node) bind(C,name="starpu_data_handle_to_pointer")
  596. use iso_c_binding, only: c_ptr, c_int
  597. type(c_ptr) :: fstarpu_data_handle_to_pointer
  598. type(c_ptr), value, intent(in) :: dh
  599. integer(c_int), value, intent(in) :: node
  600. end function fstarpu_data_handle_to_pointer
  601. ! void *starpu_data_get_local_ptr(starpu_data_handle_t handle);
  602. function fstarpu_data_get_local_ptr (dh) bind(C,name="starpu_data_get_local_ptr")
  603. use iso_c_binding, only: c_ptr, c_int
  604. type(c_ptr) :: fstarpu_data_get_local_ptr
  605. type(c_ptr), value, intent(in) :: dh
  606. end function fstarpu_data_get_local_ptr
  607. ! void *starpu_data_get_interface_on_node(starpu_data_handle_t handle, unsigned memory_node);
  608. ! == starpu_data_interface.h: block ==
  609. ! 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);
  610. subroutine fstarpu_block_data_register(dh, home_node, ptr, ldy, ldz, nx, ny, nz, elt_size) &
  611. bind(C,name="starpu_block_data_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) :: home_node
  615. type(c_ptr), value, intent(in) :: ptr
  616. integer(c_int), value, intent(in) :: ldy
  617. integer(c_int), value, intent(in) :: ldz
  618. integer(c_int), value, intent(in) :: nx
  619. integer(c_int), value, intent(in) :: ny
  620. integer(c_int), value, intent(in) :: nz
  621. integer(c_size_t), value, intent(in) :: elt_size
  622. end subroutine fstarpu_block_data_register
  623. ! 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);
  624. subroutine fstarpu_block_ptr_register(dh, node, ptr, dev_handle, offset, ldy, ldz) &
  625. bind(C,name="starpu_block_ptr_register")
  626. use iso_c_binding, only: c_ptr, c_int, c_size_t
  627. type(c_ptr), intent(out) :: dh
  628. integer(c_int), value, intent(in) :: node
  629. type(c_ptr), value, intent(in) :: ptr
  630. type(c_ptr), value, intent(in) :: dev_handle
  631. integer(c_size_t), value, intent(in) :: offset
  632. integer(c_int), value, intent(in) :: ldy
  633. integer(c_int), value, intent(in) :: ldz
  634. end subroutine fstarpu_block_ptr_register
  635. function fstarpu_block_get_ptr(buffers, i) bind(C)
  636. use iso_c_binding, only: c_ptr, c_int
  637. type(c_ptr) :: fstarpu_block_get_ptr
  638. type(c_ptr), value, intent(in) :: buffers
  639. integer(c_int), value, intent(in) :: i
  640. end function fstarpu_block_get_ptr
  641. function fstarpu_block_get_ldy(buffers, i) bind(C)
  642. use iso_c_binding, only: c_ptr, c_int
  643. integer(c_int) :: fstarpu_block_get_ldy
  644. type(c_ptr), value, intent(in) :: buffers
  645. integer(c_int), value, intent(in) :: i
  646. end function fstarpu_block_get_ldy
  647. function fstarpu_block_get_ldz(buffers, i) bind(C)
  648. use iso_c_binding, only: c_ptr, c_int
  649. integer(c_int) :: fstarpu_block_get_ldz
  650. type(c_ptr), value, intent(in) :: buffers
  651. integer(c_int), value, intent(in) :: i
  652. end function fstarpu_block_get_ldz
  653. function fstarpu_block_get_nx(buffers, i) bind(C)
  654. use iso_c_binding, only: c_ptr, c_int
  655. integer(c_int) :: fstarpu_block_get_nx
  656. type(c_ptr), value, intent(in) :: buffers
  657. integer(c_int), value, intent(in) :: i
  658. end function fstarpu_block_get_nx
  659. function fstarpu_block_get_ny(buffers, i) bind(C)
  660. use iso_c_binding, only: c_ptr, c_int
  661. integer(c_int) :: fstarpu_block_get_ny
  662. type(c_ptr), value, intent(in) :: buffers
  663. integer(c_int), value, intent(in) :: i
  664. end function fstarpu_block_get_ny
  665. function fstarpu_block_get_nz(buffers, i) bind(C)
  666. use iso_c_binding, only: c_ptr, c_int
  667. integer(c_int) :: fstarpu_block_get_nz
  668. type(c_ptr), value, intent(in) :: buffers
  669. integer(c_int), value, intent(in) :: i
  670. end function fstarpu_block_get_nz
  671. ! == starpu_data_interface.h: matrix ==
  672. ! 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);
  673. subroutine fstarpu_matrix_data_register(dh, home_node, ptr, ld, nx, ny, elt_size) &
  674. bind(C,name="starpu_matrix_data_register")
  675. use iso_c_binding, only: c_ptr, c_int, c_size_t
  676. type(c_ptr), intent(out) :: dh
  677. integer(c_int), value, intent(in) :: home_node
  678. type(c_ptr), value, intent(in) :: ptr
  679. integer(c_int), value, intent(in) :: ld
  680. integer(c_int), value, intent(in) :: nx
  681. integer(c_int), value, intent(in) :: ny
  682. integer(c_size_t), value, intent(in) :: elt_size
  683. end subroutine fstarpu_matrix_data_register
  684. ! 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);
  685. subroutine fstarpu_matrix_ptr_register(dh, node, ptr, dev_handle, offset, ld) &
  686. bind(C,name="starpu_matrix_ptr_register")
  687. use iso_c_binding, only: c_ptr, c_int, c_size_t
  688. type(c_ptr), intent(out) :: dh
  689. integer(c_int), value, intent(in) :: node
  690. type(c_ptr), value, intent(in) :: ptr
  691. type(c_ptr), value, intent(in) :: dev_handle
  692. integer(c_size_t), value, intent(in) :: offset
  693. integer(c_int), value, intent(in) :: ld
  694. end subroutine fstarpu_matrix_ptr_register
  695. function fstarpu_matrix_get_ptr(buffers, i) bind(C)
  696. use iso_c_binding, only: c_ptr, c_int
  697. type(c_ptr) :: fstarpu_matrix_get_ptr
  698. type(c_ptr), value, intent(in) :: buffers
  699. integer(c_int), value, intent(in) :: i
  700. end function fstarpu_matrix_get_ptr
  701. function fstarpu_matrix_get_ld(buffers, i) bind(C)
  702. use iso_c_binding, only: c_ptr, c_int
  703. integer(c_int) :: fstarpu_matrix_get_ld
  704. type(c_ptr), value, intent(in) :: buffers
  705. integer(c_int), value, intent(in) :: i
  706. end function fstarpu_matrix_get_ld
  707. function fstarpu_matrix_get_nx(buffers, i) bind(C)
  708. use iso_c_binding, only: c_ptr, c_int
  709. integer(c_int) :: fstarpu_matrix_get_nx
  710. type(c_ptr), value, intent(in) :: buffers
  711. integer(c_int), value, intent(in) :: i
  712. end function fstarpu_matrix_get_nx
  713. function fstarpu_matrix_get_ny(buffers, i) bind(C)
  714. use iso_c_binding, only: c_ptr, c_int
  715. integer(c_int) :: fstarpu_matrix_get_ny
  716. type(c_ptr), value, intent(in) :: buffers
  717. integer(c_int), value, intent(in) :: i
  718. end function fstarpu_matrix_get_ny
  719. ! == starpu_data_interface.h: vector ==
  720. ! void starpu_vector_data_register(starpu_data_handle_t *handle, unsigned home_node, uintptr_t ptr, uint32_t nx, size_t elemsize);
  721. subroutine fstarpu_vector_data_register(dh, home_node, ptr,nx, elt_size) &
  722. bind(C,name="starpu_vector_data_register")
  723. use iso_c_binding, only: c_ptr, c_int, c_size_t
  724. type(c_ptr), intent(out) :: dh
  725. integer(c_int), value, intent(in) :: home_node
  726. type(c_ptr), value, intent(in) :: ptr
  727. integer(c_int), value, intent(in) :: nx
  728. integer(c_size_t), value, intent(in) :: elt_size
  729. end subroutine fstarpu_vector_data_register
  730. ! void starpu_vector_ptr_register(starpu_data_handle_t handle, unsigned node, uintptr_t ptr, uintptr_t dev_handle, size_t offset);
  731. subroutine fstarpu_vector_ptr_register(dh, node, ptr, dev_handle, offset, ld) &
  732. bind(C,name="starpu_vector_ptr_register")
  733. use iso_c_binding, only: c_ptr, c_int, c_size_t
  734. type(c_ptr), intent(out) :: dh
  735. integer(c_int), value, intent(in) :: node
  736. type(c_ptr), value, intent(in) :: ptr
  737. type(c_ptr), value, intent(in) :: dev_handle
  738. integer(c_size_t), value, intent(in) :: offset
  739. end subroutine fstarpu_vector_ptr_register
  740. function fstarpu_vector_get_ptr(buffers, i) bind(C)
  741. use iso_c_binding, only: c_ptr, c_int
  742. type(c_ptr) :: fstarpu_vector_get_ptr
  743. type(c_ptr), value, intent(in) :: buffers
  744. integer(c_int), value, intent(in) :: i
  745. end function fstarpu_vector_get_ptr
  746. function fstarpu_vector_get_nx(buffers, i) bind(C)
  747. use iso_c_binding, only: c_ptr, c_int
  748. integer(c_int) :: fstarpu_vector_get_nx
  749. type(c_ptr), value, intent(in) :: buffers
  750. integer(c_int), value, intent(in) :: i
  751. end function fstarpu_vector_get_nx
  752. ! == starpu_data_interface.h: variable ==
  753. ! void starpu_variable_data_register(starpu_data_handle_t *handle, unsigned home_node, uintptr_t ptr, size_t size);
  754. subroutine fstarpu_variable_data_register(dh, home_node, ptr, elt_size) &
  755. bind(C,name="starpu_variable_data_register")
  756. use iso_c_binding, only: c_ptr, c_int, c_size_t
  757. type(c_ptr), intent(out) :: dh
  758. integer(c_int), value, intent(in) :: home_node
  759. type(c_ptr), value, intent(in) :: ptr
  760. integer(c_size_t), value, intent(in) :: elt_size
  761. end subroutine fstarpu_variable_data_register
  762. ! void starpu_variable_ptr_register(starpu_data_handle_t handle, unsigned node, uintptr_t ptr, uintptr_t dev_handle, size_t offset);
  763. subroutine fstarpu_variable_ptr_register(dh, node, ptr, dev_handle, offset, ld) &
  764. bind(C,name="starpu_variable_ptr_register")
  765. use iso_c_binding, only: c_ptr, c_int, c_size_t
  766. type(c_ptr), intent(out) :: dh
  767. integer(c_int), value, intent(in) :: node
  768. type(c_ptr), value, intent(in) :: ptr
  769. type(c_ptr), value, intent(in) :: dev_handle
  770. integer(c_size_t), value, intent(in) :: offset
  771. end subroutine fstarpu_variable_ptr_register
  772. function fstarpu_variable_get_ptr(buffers, i) bind(C)
  773. use iso_c_binding, only: c_ptr, c_int
  774. type(c_ptr) :: fstarpu_variable_get_ptr
  775. type(c_ptr), value, intent(in) :: buffers
  776. integer(c_int), value, intent(in) :: i
  777. end function fstarpu_variable_get_ptr
  778. ! == starpu_data_interface.h: void ==
  779. ! void starpu_void_data_register(starpu_data_handle_t *handle);
  780. subroutine fstarpu_void_data_register(dh) &
  781. bind(C,name="starpu_void_data_register")
  782. use iso_c_binding, only: c_ptr, c_int, c_size_t
  783. type(c_ptr), intent(out) :: dh
  784. end subroutine fstarpu_void_data_register
  785. ! == starpu_data_filter.h ==
  786. function fstarpu_data_filter_allocate () bind(C)
  787. use iso_c_binding, only: c_ptr
  788. type(c_ptr) :: fstarpu_data_filter_allocate
  789. end function fstarpu_data_filter_allocate
  790. subroutine fstarpu_data_filter_free (filter) bind(C)
  791. use iso_c_binding, only: c_ptr
  792. type(c_ptr), value, intent(in) :: filter
  793. end subroutine fstarpu_data_filter_free
  794. ! Note: use fstarpu_df_alloc_ prefix instead of fstarpu_data_filter_allocate_
  795. ! to fit within the Fortran id length limit */
  796. function fstarpu_df_alloc_bcsr_filter_canonical_block () bind(C)
  797. use iso_c_binding, only: c_ptr
  798. type(c_ptr) :: fstarpu_df_alloc_bcsr_filter_canonical_block
  799. end function fstarpu_df_alloc_bcsr_filter_canonical_block
  800. function fstarpu_df_alloc_csr_filter_vertical_block () bind(C)
  801. use iso_c_binding, only: c_ptr
  802. type(c_ptr) :: fstarpu_df_alloc_csr_filter_vertical_block
  803. end function fstarpu_df_alloc_csr_filter_vertical_block
  804. function fstarpu_df_alloc_matrix_filter_block () bind(C)
  805. use iso_c_binding, only: c_ptr
  806. type(c_ptr) :: fstarpu_df_alloc_matrix_filter_block
  807. end function fstarpu_df_alloc_matrix_filter_block
  808. function fstarpu_df_alloc_matrix_filter_block_shadow () bind(C)
  809. use iso_c_binding, only: c_ptr
  810. type(c_ptr) :: fstarpu_df_alloc_matrix_filter_block_shadow
  811. end function fstarpu_df_alloc_matrix_filter_block_shadow
  812. function fstarpu_df_alloc_matrix_filter_vertical_block () bind(C)
  813. use iso_c_binding, only: c_ptr
  814. type(c_ptr) :: fstarpu_df_alloc_matrix_filter_vertical_block
  815. end function fstarpu_df_alloc_matrix_filter_vertical_block
  816. function fstarpu_df_alloc_matrix_filter_vertical_block_shadow () bind(C)
  817. use iso_c_binding, only: c_ptr
  818. type(c_ptr) :: fstarpu_df_alloc_matrix_filter_vertical_block_shadow
  819. end function fstarpu_df_alloc_matrix_filter_vertical_block_shadow
  820. function fstarpu_df_alloc_vector_filter_block () bind(C)
  821. use iso_c_binding, only: c_ptr
  822. type(c_ptr) :: fstarpu_df_alloc_vector_filter_block
  823. end function fstarpu_df_alloc_vector_filter_block
  824. function fstarpu_df_alloc_vector_filter_block_shadow () bind(C)
  825. use iso_c_binding, only: c_ptr
  826. type(c_ptr) :: fstarpu_df_alloc_vector_filter_block_shadow
  827. end function fstarpu_df_alloc_vector_filter_block_shadow
  828. function fstarpu_df_alloc_vector_filter_list () bind(C)
  829. use iso_c_binding, only: c_ptr
  830. type(c_ptr) :: fstarpu_df_alloc_vector_filter_list
  831. end function fstarpu_df_alloc_vector_filter_list
  832. function fstarpu_df_alloc_vector_filter_divide_in_2 () bind(C)
  833. use iso_c_binding, only: c_ptr
  834. type(c_ptr) :: fstarpu_df_alloc_vector_filter_divide_in_2
  835. end function fstarpu_df_alloc_vector_filter_divide_in_2
  836. function fstarpu_df_alloc_block_filter_block () bind(C)
  837. use iso_c_binding, only: c_ptr
  838. type(c_ptr) :: fstarpu_df_alloc_block_filter_block
  839. end function fstarpu_df_alloc_block_filter_block
  840. function fstarpu_df_alloc_block_filter_block_shadow () bind(C)
  841. use iso_c_binding, only: c_ptr
  842. type(c_ptr) :: fstarpu_df_alloc_block_filter_block_shadow
  843. end function fstarpu_df_alloc_block_filter_block_shadow
  844. function fstarpu_df_alloc_block_filter_vertical_block () bind(C)
  845. use iso_c_binding, only: c_ptr
  846. type(c_ptr) :: fstarpu_df_alloc_block_filter_vertical_block
  847. end function fstarpu_df_alloc_block_filter_vertical_block
  848. function fstarpu_df_alloc_block_filter_vertical_block_shadow () bind(C)
  849. use iso_c_binding, only: c_ptr
  850. type(c_ptr) :: fstarpu_df_alloc_block_filter_vertical_block_shadow
  851. end function fstarpu_df_alloc_block_filter_vertical_block_shadow
  852. subroutine fstarpu_data_filter_set_filter_func (filter, f_ptr) bind(C)
  853. use iso_c_binding, only: c_ptr, c_funptr
  854. type(c_ptr), value, intent(in) :: filter
  855. type(c_funptr), value, intent(in) :: f_ptr
  856. end subroutine fstarpu_data_filter_set_filter_func
  857. subroutine fstarpu_data_filter_set_nchildren (filter, nchildren) bind(C)
  858. use iso_c_binding, only: c_ptr, c_int
  859. type(c_ptr), value, intent(in) :: filter
  860. integer(c_int), value, intent(in) :: nchildren
  861. end subroutine fstarpu_data_filter_set_nchildren
  862. subroutine fstarpu_data_filter_set_get_nchildren_func (filter, f_ptr) bind(C)
  863. use iso_c_binding, only: c_ptr, c_funptr
  864. type(c_ptr), value, intent(in) :: filter
  865. type(c_funptr), value, intent(in) :: f_ptr
  866. end subroutine fstarpu_data_filter_set_get_nchildren_func
  867. subroutine fstarpu_data_filter_set_get_child_ops_func (filter, f_ptr) bind(C)
  868. use iso_c_binding, only: c_ptr, c_funptr
  869. type(c_ptr), value, intent(in) :: filter
  870. type(c_funptr), value, intent(in) :: f_ptr
  871. end subroutine fstarpu_data_filter_set_get_child_ops_func
  872. subroutine fstarpu_data_filter_set_filter_arg (filter, filter_arg) bind(C)
  873. use iso_c_binding, only: c_ptr, c_int
  874. type(c_ptr), value, intent(in) :: filter
  875. integer(c_int), value, intent(in) :: filter_arg
  876. end subroutine fstarpu_data_filter_set_filter_arg
  877. subroutine fstarpu_data_filter_set_filter_arg_ptr (filter, filter_arg_ptr) bind(C)
  878. use iso_c_binding, only: c_ptr
  879. type(c_ptr), value, intent(in) :: filter
  880. type(c_ptr), value, intent(in) :: filter_arg_ptr
  881. end subroutine fstarpu_data_filter_set_filter_arg_ptr
  882. ! void starpu_data_partition(starpu_data_handle_t initial_handle, struct starpu_data_filter *f);
  883. subroutine fstarpu_data_partition (dh,filter) bind(C,name="starpu_data_partition")
  884. use iso_c_binding, only: c_ptr
  885. type(c_ptr), value, intent(in) :: dh
  886. type(c_ptr), value, intent(in) :: filter
  887. end subroutine fstarpu_data_partition
  888. ! void starpu_data_unpartition(starpu_data_handle_t root_data, unsigned gathering_node);
  889. subroutine fstarpu_data_unpartition (root_dh,gathering_node) bind(C,name="starpu_data_unpartition")
  890. use iso_c_binding, only: c_ptr, c_int
  891. type(c_ptr), value, intent(in) :: root_dh
  892. integer(c_int), value, intent(in) :: gathering_node
  893. end subroutine fstarpu_data_unpartition
  894. ! void starpu_data_partition_plan(starpu_data_handle_t initial_handle, struct starpu_data_filter *f, starpu_data_handle_t *children);
  895. subroutine fstarpu_data_partition_plan (dh,filter,children) &
  896. bind(C,name="starpu_data_partition_plan")
  897. use iso_c_binding, only: c_ptr
  898. type(c_ptr), value, intent(in) :: dh
  899. type(c_ptr), value, intent(in) :: filter
  900. type(c_ptr), intent(in) :: children(*)
  901. end subroutine fstarpu_data_partition_plan
  902. ! void starpu_data_partition_submit(starpu_data_handle_t initial_handle, unsigned nparts, starpu_data_handle_t *children);
  903. subroutine fstarpu_data_partition_submit (dh,nparts,children) &
  904. bind(C,name="starpu_data_partition_submit")
  905. use iso_c_binding, only: c_ptr, c_int
  906. type(c_ptr), value, intent(in) :: dh
  907. integer(c_int), value, intent(in) :: nparts
  908. type(c_ptr), intent(in) :: children(*)
  909. end subroutine fstarpu_data_partition_submit
  910. ! void starpu_data_partition_readonly_submit(starpu_data_handle_t initial_handle, unsigned nparts, starpu_data_handle_t *children);
  911. subroutine fstarpu_data_partition_readonly_submit (dh,nparts,children) &
  912. bind(C,name="starpu_data_partition_readonly_submit")
  913. use iso_c_binding, only: c_ptr, c_int
  914. type(c_ptr), value, intent(in) :: dh
  915. integer(c_int), value, intent(in) :: nparts
  916. type(c_ptr), intent(in) :: children(*)
  917. end subroutine fstarpu_data_partition_readonly_submit
  918. ! void starpu_data_partition_readwrite_upgrade_submit(starpu_data_handle_t initial_handle, unsigned nparts, starpu_data_handle_t *children);
  919. subroutine fstarpu_data_partition_readwrite_upgrade_submit (dh,nparts,children) &
  920. bind(C,name="starpu_data_partition_readwrite_upgrade_submit")
  921. use iso_c_binding, only: c_ptr, c_int
  922. type(c_ptr), value, intent(in) :: dh
  923. integer(c_int), value, intent(in) :: nparts
  924. type(c_ptr), intent(in) :: children(*)
  925. end subroutine fstarpu_data_partition_readwrite_upgrade_submit
  926. ! void starpu_data_unpartition_submit(starpu_data_handle_t initial_handle, unsigned nparts, starpu_data_handle_t *children, int gathering_node);
  927. subroutine fstarpu_data_unpartition_submit (dh,nparts,children,gathering_node) &
  928. bind(C,name="starpu_data_unpartition_submit")
  929. use iso_c_binding, only: c_ptr, c_int
  930. type(c_ptr), value, intent(in) :: dh
  931. integer(c_int), value, intent(in) :: nparts
  932. type(c_ptr), intent(in) :: children(*)
  933. integer(c_int), value, intent(in) :: gathering_node
  934. end subroutine fstarpu_data_unpartition_submit
  935. ! void starpu_data_unpartition_readonly_submit(starpu_data_handle_t initial_handle, unsigned nparts, starpu_data_handle_t *children, int gathering_node);
  936. subroutine fstarpu_data_unpartition_readonly_submit (dh,nparts,children,gathering_node) &
  937. bind(C,name="starpu_data_unpartition_readonly_submit")
  938. use iso_c_binding, only: c_ptr, c_int
  939. type(c_ptr), value, intent(in) :: dh
  940. integer(c_int), value, intent(in) :: nparts
  941. type(c_ptr), intent(in) :: children(*)
  942. integer(c_int), value, intent(in) :: gathering_node
  943. end subroutine fstarpu_data_unpartition_readonly_submit
  944. ! void starpu_data_partition_clean(starpu_data_handle_t root_data, unsigned nparts, starpu_data_handle_t *children);
  945. subroutine fstarpu_data_partition_clean (dh,nparts,children) &
  946. bind(C,name="starpu_data_partition_clean")
  947. use iso_c_binding, only: c_ptr, c_int
  948. type(c_ptr), value, intent(in) :: dh
  949. integer(c_int), value, intent(in) :: nparts
  950. type(c_ptr), intent(in) :: children(*)
  951. end subroutine fstarpu_data_partition_clean
  952. ! int starpu_data_get_nb_children(starpu_data_handle_t handle);
  953. function fstarpu_data_get_nb_children(dh) bind(C,name="starpu_data_get_nb_children")
  954. use iso_c_binding, only: c_ptr, c_int
  955. integer(c_int) :: fstarpu_data_get_nb_children
  956. type(c_ptr), value, intent(in) :: dh
  957. end function fstarpu_data_get_nb_children
  958. ! starpu_data_handle_t starpu_data_get_child(starpu_data_handle_t handle, unsigned i);
  959. function fstarpu_data_get_child(dh,i) bind(C,name="starpu_data_get_child")
  960. use iso_c_binding, only: c_ptr, c_int
  961. type(c_ptr) :: fstarpu_data_get_child
  962. type(c_ptr), value, intent(in) :: dh
  963. integer(c_int), value, intent(in) :: i
  964. end function fstarpu_data_get_child
  965. ! starpu_data_handle_t starpu_data_get_sub_data(starpu_data_handle_t root_data, unsigned depth, ... );
  966. ! . see: fstarpu_data_get_sub_data
  967. ! starpu_data_handle_t starpu_data_vget_sub_data(starpu_data_handle_t root_data, unsigned depth, va_list pa);
  968. ! . see: fstarpu_data_get_sub_data
  969. ! note: defined in filters.c
  970. function fstarpu_data_get_sub_data (root_dh,depth,indices) bind(C)
  971. use iso_c_binding, only: c_ptr, c_int
  972. type(c_ptr) :: fstarpu_data_get_sub_data
  973. type(c_ptr), value, intent(in) :: root_dh
  974. integer(c_int), value, intent(in) :: depth
  975. integer(c_int), intent(in) :: indices(*)
  976. end function fstarpu_data_get_sub_data
  977. ! void starpu_data_map_filters(starpu_data_handle_t root_data, unsigned nfilters, ...);
  978. ! . see fstarpu_data_map_filters
  979. ! void starpu_data_vmap_filters(starpu_data_handle_t root_data, unsigned nfilters, va_list pa);
  980. ! . see fstarpu_data_map_filters
  981. ! note: defined in filters.c
  982. subroutine fstarpu_data_map_filters (root_dh,nfilters,filters) bind(C)
  983. use iso_c_binding, only: c_ptr, c_int
  984. type(c_ptr), value, intent(in) :: root_dh
  985. integer(c_int), value, intent(in) :: nfilters
  986. type(c_ptr), intent(in) :: filters(*)
  987. end subroutine fstarpu_data_map_filters
  988. ! void starpu_matrix_filter_block(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  989. subroutine fstarpu_matrix_filter_block (father_interface,child_interface,filter,id,nparts) &
  990. bind(C,name="starpu_matrix_filter_block")
  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_matrix_filter_block
  998. ! void starpu_matrix_filter_block_shadow(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  999. subroutine fstarpu_matrix_filter_block_shadow (father_interface,child_interface,filter,id,nparts) &
  1000. bind(C,name="starpu_matrix_filter_block_shadow")
  1001. use iso_c_binding, only: c_ptr
  1002. type(c_ptr), value, intent(in) :: father_interface
  1003. type(c_ptr), value, intent(in) :: child_interface
  1004. type(c_ptr), value, intent(in) :: filter
  1005. type(c_ptr), value, intent(in) :: id
  1006. type(c_ptr), value, intent(in) :: nparts
  1007. end subroutine fstarpu_matrix_filter_block_shadow
  1008. ! void starpu_matrix_filter_vertical_block(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  1009. subroutine fstarpu_matrix_filter_vertical_block (father_interface,child_interface,filter,id,nparts) &
  1010. bind(C,name="starpu_matrix_filter_vertical_block")
  1011. use iso_c_binding, only: c_ptr
  1012. type(c_ptr), value, intent(in) :: father_interface
  1013. type(c_ptr), value, intent(in) :: child_interface
  1014. type(c_ptr), value, intent(in) :: filter
  1015. type(c_ptr), value, intent(in) :: id
  1016. type(c_ptr), value, intent(in) :: nparts
  1017. end subroutine fstarpu_matrix_filter_vertical_block
  1018. ! void starpu_matrix_filter_vertical_block_shadow(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  1019. subroutine fstarpu_matrix_filter_vertical_block_shadow (father_interface,child_interface,filter,id,nparts) &
  1020. bind(C,name="starpu_matrix_filter_vertical_block_shadow")
  1021. use iso_c_binding, only: c_ptr
  1022. type(c_ptr), value, intent(in) :: father_interface
  1023. type(c_ptr), value, intent(in) :: child_interface
  1024. type(c_ptr), value, intent(in) :: filter
  1025. type(c_ptr), value, intent(in) :: id
  1026. type(c_ptr), value, intent(in) :: nparts
  1027. end subroutine fstarpu_matrix_filter_vertical_block_shadow
  1028. ! void starpu_vector_filter_block(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  1029. subroutine fstarpu_vector_filter_block (father_interface,child_interface,filter,id,nparts) &
  1030. bind(C,name="starpu_vector_filter_block")
  1031. use iso_c_binding, only: c_ptr
  1032. type(c_ptr), value, intent(in) :: father_interface
  1033. type(c_ptr), value, intent(in) :: child_interface
  1034. type(c_ptr), value, intent(in) :: filter
  1035. type(c_ptr), value, intent(in) :: id
  1036. type(c_ptr), value, intent(in) :: nparts
  1037. end subroutine fstarpu_vector_filter_block
  1038. ! void starpu_vector_filter_block_shadow(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  1039. subroutine fstarpu_vector_filter_block_shadow (father_interface,child_interface,filter,id,nparts) &
  1040. bind(C,name="starpu_vector_filter_block_shadow")
  1041. use iso_c_binding, only: c_ptr
  1042. type(c_ptr), value, intent(in) :: father_interface
  1043. type(c_ptr), value, intent(in) :: child_interface
  1044. type(c_ptr), value, intent(in) :: filter
  1045. type(c_ptr), value, intent(in) :: id
  1046. type(c_ptr), value, intent(in) :: nparts
  1047. end subroutine fstarpu_vector_filter_block_shadow
  1048. ! void starpu_vector_filter_list(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  1049. subroutine fstarpu_vector_filter_list (father_interface,child_interface,filter,id,nparts) &
  1050. bind(C,name="starpu_vector_filter_list")
  1051. use iso_c_binding, only: c_ptr
  1052. type(c_ptr), value, intent(in) :: father_interface
  1053. type(c_ptr), value, intent(in) :: child_interface
  1054. type(c_ptr), value, intent(in) :: filter
  1055. type(c_ptr), value, intent(in) :: id
  1056. type(c_ptr), value, intent(in) :: nparts
  1057. end subroutine fstarpu_vector_filter_list
  1058. ! void starpu_vector_filter_divide_in_2(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  1059. subroutine fstarpu_vector_divide_in_2 (father_interface,child_interface,filter,id,nparts) &
  1060. bind(C,name="starpu_vector_divide_in_2")
  1061. use iso_c_binding, only: c_ptr
  1062. type(c_ptr), value, intent(in) :: father_interface
  1063. type(c_ptr), value, intent(in) :: child_interface
  1064. type(c_ptr), value, intent(in) :: filter
  1065. type(c_ptr), value, intent(in) :: id
  1066. type(c_ptr), value, intent(in) :: nparts
  1067. end subroutine fstarpu_vector_divide_in_2
  1068. ! void starpu_block_filter_block(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  1069. subroutine fstarpu_block_filter_block (father_interface,child_interface,filter,id,nparts) &
  1070. bind(C,name="starpu_block_filter_block")
  1071. use iso_c_binding, only: c_ptr
  1072. type(c_ptr), value, intent(in) :: father_interface
  1073. type(c_ptr), value, intent(in) :: child_interface
  1074. type(c_ptr), value, intent(in) :: filter
  1075. type(c_ptr), value, intent(in) :: id
  1076. type(c_ptr), value, intent(in) :: nparts
  1077. end subroutine fstarpu_block_filter_block
  1078. ! void starpu_block_filter_block_shadow(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  1079. subroutine fstarpu_block_filter_block_shadow (father_interface,child_interface,filter,id,nparts) &
  1080. bind(C,name="starpu_block_filter_block_shadow")
  1081. use iso_c_binding, only: c_ptr
  1082. type(c_ptr), value, intent(in) :: father_interface
  1083. type(c_ptr), value, intent(in) :: child_interface
  1084. type(c_ptr), value, intent(in) :: filter
  1085. type(c_ptr), value, intent(in) :: id
  1086. type(c_ptr), value, intent(in) :: nparts
  1087. end subroutine fstarpu_block_filter_block_shadow
  1088. ! void starpu_block_filter_vertical_block(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  1089. subroutine fstarpu_block_filter_vertical_block (father_interface,child_interface,filter,id,nparts) &
  1090. bind(C,name="starpu_block_filter_vertical_block")
  1091. use iso_c_binding, only: c_ptr
  1092. type(c_ptr), value, intent(in) :: father_interface
  1093. type(c_ptr), value, intent(in) :: child_interface
  1094. type(c_ptr), value, intent(in) :: filter
  1095. type(c_ptr), value, intent(in) :: id
  1096. type(c_ptr), value, intent(in) :: nparts
  1097. end subroutine fstarpu_block_filter_vertical_block
  1098. ! void starpu_block_filter_vertical_block_shadow(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  1099. subroutine fstarpu_block_filter_vertical_block_shadow (father_interface,child_interface,filter,id,nparts) &
  1100. bind(C,name="starpu_block_filter_vertical_block_shadow")
  1101. use iso_c_binding, only: c_ptr
  1102. type(c_ptr), value, intent(in) :: father_interface
  1103. type(c_ptr), value, intent(in) :: child_interface
  1104. type(c_ptr), value, intent(in) :: filter
  1105. type(c_ptr), value, intent(in) :: id
  1106. type(c_ptr), value, intent(in) :: nparts
  1107. end subroutine fstarpu_block_filter_vertical_block_shadow
  1108. ! void starpu_block_filter_depth_block(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  1109. subroutine fstarpu_block_filter_depth_block (father_interface,child_interface,filter,id,nparts) &
  1110. bind(C,name="starpu_block_filter_depth_block")
  1111. use iso_c_binding, only: c_ptr
  1112. type(c_ptr), value, intent(in) :: father_interface
  1113. type(c_ptr), value, intent(in) :: child_interface
  1114. type(c_ptr), value, intent(in) :: filter
  1115. type(c_ptr), value, intent(in) :: id
  1116. type(c_ptr), value, intent(in) :: nparts
  1117. end subroutine fstarpu_block_filter_depth_block
  1118. ! void starpu_block_filter_depth_block_shadow(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  1119. subroutine fstarpu_block_filter_depth_block_shadow (father_interface,child_interface,filter,id,nparts) &
  1120. bind(C,name="starpu_block_filter_depth_block_shadow")
  1121. use iso_c_binding, only: c_ptr
  1122. type(c_ptr), value, intent(in) :: father_interface
  1123. type(c_ptr), value, intent(in) :: child_interface
  1124. type(c_ptr), value, intent(in) :: filter
  1125. type(c_ptr), value, intent(in) :: id
  1126. type(c_ptr), value, intent(in) :: nparts
  1127. end subroutine fstarpu_block_filter_depth_block_shadow
  1128. ! == starpu_data.h ==
  1129. ! void starpu_data_unregister(starpu_data_handle_t handle);
  1130. subroutine fstarpu_data_unregister (dh) bind(C,name="starpu_data_unregister")
  1131. use iso_c_binding, only: c_ptr
  1132. type(c_ptr), value, intent(in) :: dh
  1133. end subroutine fstarpu_data_unregister
  1134. ! void starpu_data_unregister_no_coherency(starpu_data_handle_t handle);
  1135. subroutine fstarpu_data_unregister_no_coherency (dh) bind(C,name="starpu_data_unregister_no_coherency")
  1136. use iso_c_binding, only: c_ptr
  1137. type(c_ptr), value, intent(in) :: dh
  1138. end subroutine fstarpu_data_unregister_no_coherency
  1139. ! void starpu_data_unregister_submit(starpu_data_handle_t handle);
  1140. subroutine fstarpu_data_unregister_submit (dh) bind(C,name="starpu_data_unregister_submit")
  1141. use iso_c_binding, only: c_ptr
  1142. type(c_ptr), value, intent(in) :: dh
  1143. end subroutine fstarpu_data_unregister_submit
  1144. ! void starpu_data_invalidate(starpu_data_handle_t handle);
  1145. subroutine fstarpu_data_invalidate (dh) bind(C,name="starpu_data_invalidate")
  1146. use iso_c_binding, only: c_ptr
  1147. type(c_ptr), value, intent(in) :: dh
  1148. end subroutine fstarpu_data_invalidate
  1149. ! void starpu_data_invalidate_submit(starpu_data_handle_t handle);
  1150. subroutine fstarpu_data_invalidate_submit (dh) bind(C,name="starpu_data_invalidate_submit")
  1151. use iso_c_binding, only: c_ptr
  1152. type(c_ptr), value, intent(in) :: dh
  1153. end subroutine fstarpu_data_invalidate_submit
  1154. ! void starpu_data_advise_as_important(starpu_data_handle_t handle, unsigned is_important);
  1155. subroutine fstarpu_data_advise_as_important (dh,is_important) bind(C,name="starpu_data_advise_as_important")
  1156. use iso_c_binding, only: c_ptr,c_int
  1157. type(c_ptr), value, intent(in) :: dh
  1158. integer(c_int), value, intent(in) :: is_important
  1159. end subroutine fstarpu_data_advise_as_important
  1160. ! starpu_data_acquire: see fstarpu_data_acquire
  1161. subroutine fstarpu_data_acquire (dh, mode) bind(C)
  1162. use iso_c_binding, only: c_ptr
  1163. type(c_ptr), value, intent(in) :: dh
  1164. type(c_ptr), value, intent(in) :: mode ! C function expects an intptr_t
  1165. end subroutine fstarpu_data_acquire
  1166. ! int starpu_data_acquire_on_node(starpu_data_handle_t handle, int node, enum starpu_data_access_mode mode);
  1167. ! int starpu_data_acquire_cb(starpu_data_handle_t handle, enum starpu_data_access_mode mode, void (*callback)(void *), void *arg);
  1168. ! 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);
  1169. ! 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);
  1170. ! 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);
  1171. ! void starpu_data_release(starpu_data_handle_t handle);
  1172. subroutine fstarpu_data_release (dh) bind(C,name="starpu_data_release")
  1173. use iso_c_binding, only: c_ptr
  1174. type(c_ptr), value, intent(in) :: dh
  1175. end subroutine fstarpu_data_release
  1176. ! void starpu_data_release_on_node(starpu_data_handle_t handle, int node);
  1177. subroutine fstarpu_data_release_on_node (dh, node) bind(C,name="starpu_data_release_on_node")
  1178. use iso_c_binding, only: c_ptr, c_int
  1179. type(c_ptr), value, intent(in) :: dh
  1180. integer(c_int), value, intent(in) :: node
  1181. end subroutine fstarpu_data_release_on_node
  1182. ! starpu_arbiter_t starpu_arbiter_create(void) STARPU_ATTRIBUTE_MALLOC;
  1183. function fstarpu_arbiter_create () bind(C,name="starpu_arbiter_create")
  1184. use iso_c_binding, only: c_ptr
  1185. type(c_ptr) :: fstarpu_arbiter_create
  1186. end function fstarpu_arbiter_create
  1187. ! void starpu_data_assign_arbiter(starpu_data_handle_t handle, starpu_arbiter_t arbiter);
  1188. subroutine fstarpu_data_assign_arbiter (dh,arbiter) bind(C,name="starpu_data_assign_arbiter")
  1189. use iso_c_binding, only: c_ptr
  1190. type(c_ptr), intent(out) :: dh
  1191. type(c_ptr), value, intent(in) :: arbiter
  1192. end subroutine fstarpu_data_assign_arbiter
  1193. ! void starpu_arbiter_destroy(starpu_arbiter_t arbiter);
  1194. subroutine fstarpu_data_arbiter_destroy (arbiter) bind(C,name="starpu_data_arbiter_destroy")
  1195. use iso_c_binding, only: c_ptr
  1196. type(c_ptr), value, intent(in) :: arbiter
  1197. end subroutine fstarpu_data_arbiter_destroy
  1198. ! void starpu_data_display_memory_stats();
  1199. subroutine fstarpu_display_memory_stats() bind(C,name="starpu_display_memory_stats")
  1200. end subroutine fstarpu_display_memory_stats
  1201. ! int starpu_data_request_allocation(starpu_data_handle_t handle, unsigned node);
  1202. subroutine fstarpu_data_request_allocation (dh, node) &
  1203. bind(C,name="starpu_data_request_allocation")
  1204. use iso_c_binding, only: c_ptr, c_int
  1205. type(c_ptr), value, intent(in) :: dh
  1206. integer(c_int), value, intent(in) :: node
  1207. end subroutine fstarpu_data_request_allocation
  1208. ! int starpu_data_fetch_on_node(starpu_data_handle_t handle, unsigned node, unsigned async);
  1209. subroutine fstarpu_data_fetch_on_node (dh, node, async) &
  1210. bind(C,name="starpu_data_fetch_on_node")
  1211. use iso_c_binding, only: c_ptr, c_int
  1212. type(c_ptr), value, intent(in) :: dh
  1213. integer(c_int), value, intent(in) :: node
  1214. integer(c_int), value, intent(in) :: async
  1215. end subroutine fstarpu_data_fetch_on_node
  1216. ! int starpu_data_prefetch_on_node(starpu_data_handle_t handle, unsigned node, unsigned async);
  1217. subroutine fstarpu_data_prefetch_on_node (dh, node, async) &
  1218. bind(C,name="starpu_data_prefetch_on_node")
  1219. use iso_c_binding, only: c_ptr, c_int
  1220. type(c_ptr), value, intent(in) :: dh
  1221. integer(c_int), value, intent(in) :: node
  1222. integer(c_int), value, intent(in) :: async
  1223. end subroutine fstarpu_data_prefetch_on_node
  1224. ! int starpu_data_prefetch_on_node_prio(starpu_data_handle_t handle, unsigned node, unsigned async, int prio);
  1225. subroutine fstarpu_data_prefetch_on_node_prio (dh, node, async, prio) &
  1226. bind(C,name="starpu_data_prefetch_on_node_prio")
  1227. use iso_c_binding, only: c_ptr, c_int
  1228. type(c_ptr), value, intent(in) :: dh
  1229. integer(c_int), value, intent(in) :: node
  1230. integer(c_int), value, intent(in) :: async
  1231. integer(c_int), value, intent(in) :: prio
  1232. end subroutine fstarpu_data_prefetch_on_node_prio
  1233. ! int starpu_data_idle_prefetch_on_node(starpu_data_handle_t handle, unsigned node, unsigned async);
  1234. subroutine fstarpu_data_idle_prefetch_on_node (dh, node, async) &
  1235. bind(C,name="starpu_data_idle_prefetch_on_node")
  1236. use iso_c_binding, only: c_ptr, c_int
  1237. type(c_ptr), value, intent(in) :: dh
  1238. integer(c_int), value, intent(in) :: node
  1239. integer(c_int), value, intent(in) :: async
  1240. end subroutine fstarpu_data_idle_prefetch_on_node
  1241. ! int starpu_data_idle_prefetch_on_node_prio(starpu_data_handle_t handle, unsigned node, unsigned async, int prio);
  1242. subroutine fstarpu_data_idle_prefetch_on_node_prio (dh, node, async, prio) &
  1243. bind(C,name="starpu_data_idle_prefetch_on_node_prio")
  1244. use iso_c_binding, only: c_ptr, c_int
  1245. type(c_ptr), value, intent(in) :: dh
  1246. integer(c_int), value, intent(in) :: node
  1247. integer(c_int), value, intent(in) :: async
  1248. integer(c_int), value, intent(in) :: prio
  1249. end subroutine fstarpu_data_idle_prefetch_on_node_prio
  1250. ! void starpu_data_wont_use(starpu_data_handle_t handle);
  1251. subroutine fstarpu_data_wont_use (dh) bind(c,name="starpu_data_wont_use")
  1252. use iso_c_binding, only: c_ptr
  1253. type(c_ptr), value, intent(in) :: dh
  1254. end subroutine fstarpu_data_wont_use
  1255. ! unsigned starpu_worker_get_memory_node(unsigned workerid);
  1256. function fstarpu_worker_get_memory_node(id) bind(C,name="starpu_worker_get_memory_node")
  1257. use iso_c_binding, only: c_int
  1258. integer(c_int) :: fstarpu_worker_get_memory_node
  1259. integer(c_int), value, intent(in) :: id
  1260. end function fstarpu_worker_get_memory_node
  1261. ! unsigned starpu_memory_nodes_get_count(void);
  1262. function fstarpu_memory_nodes_get_count() bind(C,name="starpu_memory_nodes_get_count")
  1263. use iso_c_binding, only: c_int
  1264. integer(c_int) :: fstarpu_memory_nodes_get_count
  1265. end function fstarpu_memory_nodes_get_count
  1266. ! enum starpu_node_kind starpu_node_get_kind(unsigned node);
  1267. ! void starpu_data_set_wt_mask(starpu_data_handle_t handle, uint32_t wt_mask);
  1268. ! void starpu_data_set_sequential_consistency_flag(starpu_data_handle_t handle, unsigned flag);
  1269. ! unsigned starpu_data_get_sequential_consistency_flag(starpu_data_handle_t handle);
  1270. ! unsigned starpu_data_get_default_sequential_consistency_flag(void);
  1271. ! void starpu_data_set_default_sequential_consistency_flag(unsigned flag);
  1272. ! void starpu_data_query_status(starpu_data_handle_t handle, int memory_node, int *is_allocated, int *is_valid, int *is_requested);
  1273. ! void starpu_data_set_reduction_methods(starpu_data_handle_t handle, struct starpu_codelet *redux_cl, struct starpu_codelet *init_cl);
  1274. subroutine fstarpu_data_set_reduction_methods (dh,redux_cl,init_cl) bind(C,name="starpu_data_set_reduction_methods")
  1275. use iso_c_binding, only: c_ptr
  1276. type(c_ptr), value, intent(in) :: dh
  1277. type(c_ptr), value, intent(in) :: redux_cl
  1278. type(c_ptr), value, intent(in) :: init_cl
  1279. end subroutine fstarpu_data_set_reduction_methods
  1280. ! struct starpu_data_interface_ops* starpu_data_get_interface_ops(starpu_data_handle_t handle);
  1281. ! unsigned starpu_data_test_if_allocated_on_node(starpu_data_handle_t handle, unsigned memory_node);
  1282. function fstarpu_data_test_if_allocated_on_node(dh,mem_node) bind(C,name="starpu_data_test_if_allocated_on_node")
  1283. use iso_c_binding, only: c_ptr, c_int
  1284. integer(c_int) :: fstarpu_data_test_if_allocated_on_node
  1285. type(c_ptr), value, intent(in) :: dh
  1286. integer(c_int), value, intent(in) :: mem_node
  1287. end function fstarpu_data_test_if_allocated_on_node
  1288. ! void starpu_memchunk_tidy(unsigned memory_node);
  1289. subroutine fstarpu_memchunk_tidy (mem_node) bind(c,name="starpu_memchunk_tidy")
  1290. use iso_c_binding, only: c_int
  1291. integer(c_int), value, intent(in) :: mem_node
  1292. end subroutine fstarpu_memchunk_tidy
  1293. ! == starpu_task_util.h ==
  1294. ! struct starpu_data_handle *fstarpu_data_handle_array_alloc(int nb);
  1295. function fstarpu_data_handle_array_alloc (nb) bind(C)
  1296. use iso_c_binding, only: c_ptr, c_int
  1297. type(c_ptr) :: fstarpu_data_handle_array_alloc
  1298. integer(c_int), value, intent(in) :: nb
  1299. end function fstarpu_data_handle_array_alloc
  1300. ! void fstarpu_data_handle_array_free(starpu_data_handle_t *handles);
  1301. subroutine fstarpu_data_handle_array_free (handles) bind(C)
  1302. use iso_c_binding, only: c_ptr
  1303. type(c_ptr), value, intent(in) :: handles
  1304. end subroutine fstarpu_data_handle_array_free
  1305. ! void fstarpu_data_handle_array_set(starpu_data_handle_t *handles, int i, starpu_data_handle_t handle);
  1306. subroutine fstarpu_data_handle_array_set (handles, i, handle) bind(C)
  1307. use iso_c_binding, only: c_ptr, c_int
  1308. type(c_ptr), value, intent(in) :: handles
  1309. integer(c_int), value, intent(in) :: i
  1310. type(c_ptr), value, intent(in) :: handle
  1311. end subroutine fstarpu_data_handle_array_set
  1312. ! struct starpu_data_descr *fstarpu_data_descr_array_alloc(int nb);
  1313. function fstarpu_data_descr_array_alloc (nb) bind(C)
  1314. use iso_c_binding, only: c_ptr, c_int
  1315. type(c_ptr) :: fstarpu_data_descr_array_alloc
  1316. integer(c_int), value, intent(in) :: nb
  1317. end function fstarpu_data_descr_array_alloc
  1318. ! struct starpu_data_descr *fstarpu_data_descr_alloc(void);
  1319. function fstarpu_data_descr_alloc (nb) bind(C)
  1320. use iso_c_binding, only: c_ptr
  1321. type(c_ptr) :: fstarpu_data_descr_alloc
  1322. end function fstarpu_data_descr_alloc
  1323. ! void fstarpu_data_descr_array_free(struct starpu_data_descr *descrs);
  1324. subroutine fstarpu_data_descr_array_free (descrs) bind(C)
  1325. use iso_c_binding, only: c_ptr
  1326. type(c_ptr), value, intent(in) :: descrs
  1327. end subroutine fstarpu_data_descr_array_free
  1328. ! void fstarpu_data_descr_free(struct starpu_data_descr *descr);
  1329. subroutine fstarpu_data_descrg_free (descr) bind(C)
  1330. use iso_c_binding, only: c_ptr
  1331. type(c_ptr), value, intent(in) :: descr
  1332. end subroutine fstarpu_data_descrg_free
  1333. ! void fstarpu_data_descr_array_set(struct starpu_data_descr *descrs, int i, starpu_data_handle_t handle, intptr_t mode);
  1334. subroutine fstarpu_data_descr_array_set (descrs, i, handle, mode) bind(C)
  1335. use iso_c_binding, only: c_ptr, c_int, c_intptr_t
  1336. type(c_ptr), value, intent(in) :: descrs
  1337. integer(c_int), value, intent(in) :: i
  1338. type(c_ptr), value, intent(in) :: handle
  1339. type(c_ptr), value, intent(in) :: mode ! C func expects c_intptr_t
  1340. end subroutine fstarpu_data_descr_array_set
  1341. ! void fstarpu_data_descr_set(struct starpu_data_descr *descr, starpu_data_handle_t handle, intptr_t mode);
  1342. subroutine fstarpu_data_descr_set (descr, handle, mode) bind(C)
  1343. use iso_c_binding, only: c_ptr, c_intptr_t
  1344. type(c_ptr), value, intent(in) :: descr
  1345. type(c_ptr), value, intent(in) :: handle
  1346. type(c_ptr), value, intent(in) :: mode ! C func expects c_intptr_t
  1347. end subroutine fstarpu_data_descr_set
  1348. subroutine fstarpu_task_insert(arglist) bind(C)
  1349. use iso_c_binding, only: c_ptr
  1350. type(c_ptr), dimension(:), intent(in) :: arglist
  1351. end subroutine fstarpu_task_insert
  1352. subroutine fstarpu_insert_task(arglist) bind(C,name="fstarpu_task_insert")
  1353. use iso_c_binding, only: c_ptr
  1354. type(c_ptr), dimension(:), intent(in) :: arglist
  1355. end subroutine fstarpu_insert_task
  1356. subroutine fstarpu_unpack_arg(cl_arg,bufferlist) bind(C)
  1357. use iso_c_binding, only: c_ptr
  1358. type(c_ptr), value, intent(in) :: cl_arg
  1359. type(c_ptr), dimension(:), intent(in) :: bufferlist
  1360. end subroutine fstarpu_unpack_arg
  1361. ! == starpu_sched_ctx.h ==
  1362. ! starpu_sched_ctx_create: see fstarpu_sched_ctx_create
  1363. function fstarpu_sched_ctx_create(workers_array,nworkers,ctx_name) bind(C)
  1364. use iso_c_binding, only: c_int, c_char
  1365. integer(c_int) :: fstarpu_sched_ctx_create
  1366. integer(c_int), intent(in) :: workers_array(*)
  1367. integer(c_int), value, intent(in) :: nworkers
  1368. character(c_char), intent(in) :: ctx_name
  1369. end function fstarpu_sched_ctx_create
  1370. ! 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);
  1371. function fstarpu_sched_ctx_create_inside_interval(policy_name, sched_ctx_name, &
  1372. min_ncpus, max_ncpus, min_ngpus, max_ngpus, allow_overlap) &
  1373. bind(C,name="starpu_sched_ctx_create_inside_interval")
  1374. use iso_c_binding, only: c_int, c_char
  1375. integer(c_int) :: fstarpu_sched_ctx_create_inside_interval
  1376. character(c_char), intent(in) :: policy_name
  1377. character(c_char), intent(in) :: sched_ctx_name
  1378. integer(c_int), value, intent(in) :: min_ncpus
  1379. integer(c_int), value, intent(in) :: max_ncpus
  1380. integer(c_int), value, intent(in) :: min_ngpus
  1381. integer(c_int), value, intent(in) :: max_ngpus
  1382. integer(c_int), value, intent(in) :: allow_overlap
  1383. end function fstarpu_sched_ctx_create_inside_interval
  1384. ! void starpu_sched_ctx_register_close_callback(unsigned sched_ctx_id, void (*close_callback)(unsigned sched_ctx_id, void* args), void *args);
  1385. subroutine fstarpu_sched_ctx_register_close_callback (sched_ctx_id, close_callback, args) &
  1386. bind(c,name="starpu_sched_ctx_register_close_callback")
  1387. use iso_c_binding, only: c_ptr, c_funptr, c_int
  1388. integer(c_int), value, intent(in) :: sched_ctx_id
  1389. type(c_funptr), value, intent(in) :: close_callback
  1390. type(c_ptr), value, intent(in) :: args
  1391. end subroutine fstarpu_sched_ctx_register_close_callback
  1392. ! void starpu_sched_ctx_add_workers(int *workerids_ctx, int nworkers_ctx, unsigned sched_ctx_id);
  1393. subroutine fstarpu_sched_ctx_add_workers(workerids,nworkers,ctx) bind(C,name="starpu_sched_ctx_add_workers")
  1394. use iso_c_binding, only: c_int
  1395. integer(c_int), intent(in) :: workerids (*)
  1396. integer(c_int), value, intent(in) :: nworkers
  1397. integer(c_int), value, intent(in) :: ctx
  1398. end subroutine fstarpu_sched_ctx_add_workers
  1399. ! void starpu_sched_ctx_remove_workers(int *workerids_ctx, int nworkers_ctx, unsigned sched_ctx_id);
  1400. subroutine fstarpu_sched_ctx_remove_workers(workerids,nworkers,ctx) bind(C,name="starpu_sched_ctx_remove_workers")
  1401. use iso_c_binding, only: c_int
  1402. integer(c_int), intent(in) :: workerids (*)
  1403. integer(c_int), value, intent(in) :: nworkers
  1404. integer(c_int), value, intent(in) :: ctx
  1405. end subroutine fstarpu_sched_ctx_remove_workers
  1406. ! starpu_sched_ctx_display_workers: see fstarpu_sched_ctx_display_workers
  1407. subroutine fstarpu_sched_ctx_display_workers (ctx) bind(C)
  1408. use iso_c_binding, only: c_int
  1409. integer(c_int), value, intent(in) :: ctx
  1410. end subroutine fstarpu_sched_ctx_display_workers
  1411. ! void starpu_sched_ctx_delete(unsigned sched_ctx_id);
  1412. subroutine fstarpu_sched_ctx_delete (ctx) bind(C,name="starpu_sched_ctx_delete")
  1413. use iso_c_binding, only: c_int
  1414. integer(c_int), value, intent(in) :: ctx
  1415. end subroutine fstarpu_sched_ctx_delete
  1416. ! void starpu_sched_ctx_set_inheritor(unsigned sched_ctx_id, unsigned inheritor);
  1417. subroutine fstarpu_sched_ctx_set_inheritor (ctx,inheritor) bind(C,name="starpu_sched_ctx_set_inheritor")
  1418. use iso_c_binding, only: c_int
  1419. integer(c_int), value, intent(in) :: ctx
  1420. integer(c_int), value, intent(in) :: inheritor
  1421. end subroutine fstarpu_sched_ctx_set_inheritor
  1422. ! unsigned starpu_sched_ctx_get_inheritor(unsigned sched_ctx_id);
  1423. function fstarpu_sched_ctx_get_inheritor (ctx) bind(C,name="starpu_sched_ctx_get_inheritor")
  1424. use iso_c_binding, only: c_int
  1425. integer(c_int) :: fstarpu_sched_ctx_get_inheritor
  1426. integer(c_int), value, intent(in) :: ctx
  1427. end function fstarpu_sched_ctx_get_inheritor
  1428. ! unsigned starpu_sched_ctx_get_hierarchy_level(unsigned sched_ctx_id);
  1429. function fstarpu_sched_ctx_get_hierarchy_level (ctx) bind(C,name="starpu_sched_ctx_get_hierarchy_level")
  1430. use iso_c_binding, only: c_int
  1431. integer(c_int) :: fstarpu_sched_ctx_get_hierarchy_level
  1432. integer(c_int), value, intent(in) :: ctx
  1433. end function fstarpu_sched_ctx_get_hierarchy_level
  1434. ! void starpu_sched_ctx_set_context(unsigned *sched_ctx_id);
  1435. subroutine fstarpu_sched_ctx_set_context (ctx_ptr) bind(C,name="starpu_sched_ctx_set_context")
  1436. use iso_c_binding, only: c_ptr
  1437. type(c_ptr), value, intent(in) :: ctx_ptr
  1438. end subroutine fstarpu_sched_ctx_set_context
  1439. ! unsigned starpu_sched_ctx_get_context(void);
  1440. function fstarpu_sched_ctx_get_context () bind(C,name="starpu_sched_ctx_get_context")
  1441. use iso_c_binding, only: c_int
  1442. integer(c_int) :: fstarpu_sched_ctx_get_context
  1443. end function fstarpu_sched_ctx_get_context
  1444. ! void starpu_sched_ctx_stop_task_submission(void);
  1445. subroutine fstarpu_sched_ctx_stop_task_submission () bind(c,name="starpu_sched_ctx_stop_task_submission")
  1446. use iso_c_binding
  1447. end subroutine fstarpu_sched_ctx_stop_task_submission
  1448. ! void starpu_sched_ctx_finished_submit(unsigned sched_ctx_id);
  1449. subroutine fstarpu_sched_ctx_finished_submit (sched_ctx_id) bind(c,name="starpu_sched_ctx_finished_submit")
  1450. use iso_c_binding, only: c_int
  1451. integer(c_int), value, intent(in) :: sched_ctx_id
  1452. end subroutine fstarpu_sched_ctx_finished_submit
  1453. ! unsigned starpu_sched_ctx_get_workers_list(unsigned sched_ctx_id, int **workerids);
  1454. ! unsigned starpu_sched_ctx_get_nworkers(unsigned sched_ctx_id);
  1455. function fstarpu_sched_ctx_get_nworkers (sched_ctx_id) &
  1456. bind(c,name="starpu_sched_ctx_get_nworkers")
  1457. use iso_c_binding, only: c_int
  1458. integer(c_int) :: fstarpu_sched_ctx_get_nworkers
  1459. integer(c_int), value, intent(in) :: sched_ctx_id
  1460. end function fstarpu_sched_ctx_get_nworkers
  1461. ! unsigned starpu_sched_ctx_get_nshared_workers(unsigned sched_ctx_id, unsigned sched_ctx_id2);
  1462. function fstarpu_sched_ctx_get_nshared_workers (sched_ctx_id, sched_ctx_id2) &
  1463. bind(c,name="starpu_sched_ctx_get_nshared_workers")
  1464. use iso_c_binding, only: c_int
  1465. integer(c_int) :: fstarpu_sched_ctx_get_nshared_workers
  1466. integer(c_int), value, intent(in) :: sched_ctx_id
  1467. integer(c_int), value, intent(in) :: sched_ctx_id2
  1468. end function fstarpu_sched_ctx_get_nshared_workers
  1469. ! unsigned starpu_sched_ctx_contains_worker(int workerid, unsigned sched_ctx_id);
  1470. function fstarpu_sched_ctx_contains_worker (workerid, sched_ctx_id) &
  1471. bind(c,name="starpu_sched_ctx_contains_worker")
  1472. use iso_c_binding, only: c_int
  1473. integer(c_int) :: fstarpu_sched_ctx_contains_worker
  1474. integer(c_int), value, intent(in) :: workerid
  1475. integer(c_int), value, intent(in) :: sched_ctx_id
  1476. end function fstarpu_sched_ctx_contains_worker
  1477. ! unsigned starpu_sched_ctx_contains_type_of_worker(enum starpu_worker_archtype arch, unsigned sched_ctx_id);
  1478. function fstarpu_sched_ctx_contains_type_of_worker (arch, sched_ctx_id) &
  1479. bind(c,name="starpu_sched_ctx_contains_type_of_worker")
  1480. use iso_c_binding, only: c_int
  1481. integer(c_int) :: fstarpu_sched_ctx_contains_type_of_worker
  1482. integer(c_int), value, intent(in) :: arch
  1483. integer(c_int), value, intent(in) :: sched_ctx_id
  1484. end function fstarpu_sched_ctx_contains_type_of_worker
  1485. ! unsigned starpu_sched_ctx_worker_get_id(unsigned sched_ctx_id);
  1486. function fstarpu_sched_ctx_worker_get_id (sched_ctx_id) &
  1487. bind(c,name="starpu_sched_ctx_worker_get_id")
  1488. use iso_c_binding, only: c_int
  1489. integer(c_int) :: fstarpu_sched_ctx_worker_get_id
  1490. integer(c_int), value, intent(in) :: sched_ctx_id
  1491. end function fstarpu_sched_ctx_worker_get_id
  1492. ! unsigned starpu_sched_ctx_get_ctx_for_task(struct starpu_task *task);
  1493. function fstarpu_sched_ctx_get_ctx_for_task (task) &
  1494. bind(c,name="starpu_sched_ctx_get_ctx_for_task")
  1495. use iso_c_binding, only: c_int, c_ptr
  1496. integer(c_int) :: fstarpu_sched_ctx_get_ctx_for_task
  1497. type(c_ptr), value, intent(in) :: task
  1498. end function fstarpu_sched_ctx_get_ctx_for_task
  1499. ! unsigned starpu_sched_ctx_overlapping_ctxs_on_worker(int workerid);
  1500. function fstarpu_sched_ctx_overlapping_ctxs_on_worker (workerid) &
  1501. bind(c,name="starpu_sched_ctx_overlapping_ctxs_on_worker")
  1502. use iso_c_binding, only: c_int
  1503. integer(c_int) :: fstarpu_sched_ctx_overlapping_ctxs_on_worker
  1504. integer(c_int), value, intent(in) :: workerid
  1505. end function fstarpu_sched_ctx_overlapping_ctxs_on_worker
  1506. ! int starpu_sched_get_min_priority(void);
  1507. function fstarpu_sched_get_min_priority () &
  1508. bind(c,name="starpu_sched_get_min_priority")
  1509. use iso_c_binding, only: c_int
  1510. integer(c_int) :: fstarpu_sched_get_min_priority
  1511. end function fstarpu_sched_get_min_priority
  1512. ! int starpu_sched_get_max_priority(void);
  1513. function fstarpu_sched_get_max_priority () &
  1514. bind(c,name="starpu_sched_get_max_priority")
  1515. use iso_c_binding, only: c_int
  1516. integer(c_int) :: fstarpu_sched_get_max_priority
  1517. end function fstarpu_sched_get_max_priority
  1518. ! int starpu_sched_set_min_priority(int min_prio);
  1519. function fstarpu_sched_set_min_priority (min_prio) &
  1520. bind(c,name="starpu_sched_set_min_priority")
  1521. use iso_c_binding, only: c_int
  1522. integer(c_int) :: fstarpu_sched_set_min_priority
  1523. integer(c_int), value, intent(in) :: min_prio
  1524. end function fstarpu_sched_set_min_priority
  1525. ! int starpu_sched_set_max_priority(int max_prio);
  1526. function fstarpu_sched_set_max_priority (max_prio) &
  1527. bind(c,name="starpu_sched_set_max_priority")
  1528. use iso_c_binding, only: c_int
  1529. integer(c_int) :: fstarpu_sched_set_max_priority
  1530. integer(c_int), value, intent(in) :: max_prio
  1531. end function fstarpu_sched_set_max_priority
  1532. ! int starpu_sched_ctx_get_min_priority(unsigned sched_ctx_id);
  1533. function fstarpu_sched_ctx_get_min_priority (sched_ctx_id) &
  1534. bind(c,name="starpu_sched_ctx_get_min_priority")
  1535. use iso_c_binding, only: c_int
  1536. integer(c_int) :: fstarpu_sched_ctx_get_min_priority
  1537. integer(c_int), value, intent(in) :: sched_ctx_id
  1538. end function fstarpu_sched_ctx_get_min_priority
  1539. ! int starpu_sched_ctx_get_max_priority(unsigned sched_ctx_id);
  1540. function fstarpu_sched_ctx_get_max_priority (sched_ctx_id) &
  1541. bind(c,name="starpu_sched_ctx_get_max_priority")
  1542. use iso_c_binding, only: c_int
  1543. integer(c_int) :: fstarpu_sched_ctx_get_max_priority
  1544. integer(c_int), value, intent(in) :: sched_ctx_id
  1545. end function fstarpu_sched_ctx_get_max_priority
  1546. ! int starpu_sched_ctx_set_min_priority(unsigned sched_ctx_id, int min_prio);
  1547. function fstarpu_sched_ctx_set_min_priority (sched_ctx_id, min_prio) &
  1548. bind(c,name="starpu_sched_ctx_set_min_priority")
  1549. use iso_c_binding, only: c_int
  1550. integer(c_int) :: fstarpu_sched_ctx_set_min_priority
  1551. integer(c_int), value, intent(in) :: sched_ctx_id
  1552. integer(c_int), value, intent(in) :: min_prio
  1553. end function fstarpu_sched_ctx_set_min_priority
  1554. ! int starpu_sched_ctx_set_max_priority(unsigned sched_ctx_id, int max_prio);
  1555. function fstarpu_sched_ctx_set_max_priority (sched_ctx_id, max_prio) &
  1556. bind(c,name="starpu_sched_ctx_set_max_priority")
  1557. use iso_c_binding, only: c_int
  1558. integer(c_int) :: fstarpu_sched_ctx_set_max_priority
  1559. integer(c_int), value, intent(in) :: sched_ctx_id
  1560. integer(c_int), value, intent(in) :: max_prio
  1561. end function fstarpu_sched_ctx_set_max_priority
  1562. ! int starpu_sched_ctx_min_priority_is_set(unsigned sched_ctx_id);
  1563. function fstarpu_sched_ctx_min_priority_is_set (sched_ctx_id) &
  1564. bind(c,name="starpu_sched_ctx_min_priority_is_set")
  1565. use iso_c_binding, only: c_int
  1566. integer(c_int) :: fstarpu_sched_ctx_min_priority_is_set
  1567. integer(c_int), value, intent(in) :: sched_ctx_id
  1568. end function fstarpu_sched_ctx_min_priority_is_set
  1569. ! int starpu_sched_ctx_max_priority_is_set(unsigned sched_ctx_id);
  1570. function fstarpu_sched_ctx_max_priority_is_set (sched_ctx_id) &
  1571. bind(c,name="starpu_sched_ctx_max_priority_is_set")
  1572. use iso_c_binding, only: c_int
  1573. integer(c_int) :: fstarpu_sched_ctx_max_priority_is_set
  1574. integer(c_int), value, intent(in) :: sched_ctx_id
  1575. end function fstarpu_sched_ctx_max_priority_is_set
  1576. ! struct starpu_worker_collection *starpu_sched_ctx_create_worker_collection(unsigned sched_ctx_id, enum starpu_worker_collection_type type) STARPU_ATTRIBUTE_MALLOC;
  1577. ! void starpu_sched_ctx_delete_worker_collection(unsigned sched_ctx_id);
  1578. subroutine fstarpu_sched_ctx_delete_worker_collection (sched_ctx_id) &
  1579. bind(c,name="starpu_sched_ctx_delete_worker_collection")
  1580. use iso_c_binding, only: c_int
  1581. integer(c_int), value, intent(in) :: sched_ctx_id
  1582. end subroutine fstarpu_sched_ctx_delete_worker_collection
  1583. ! struct starpu_worker_collection *starpu_sched_ctx_get_worker_collection(unsigned sched_ctx_id);
  1584. ! void starpu_sched_ctx_set_policy_data(unsigned sched_ctx_id, void *policy_data);
  1585. subroutine fstarpu_sched_ctx_set_policy_data (sched_ctx_id, policy_data) &
  1586. bind(c,name="starpu_sched_ctx_set_policy_data")
  1587. use iso_c_binding, only: c_int, c_ptr
  1588. integer(c_int), value, intent(in) :: sched_ctx_id
  1589. type(c_ptr), value, intent(in) :: policy_data
  1590. end subroutine fstarpu_sched_ctx_set_policy_data
  1591. ! void *starpu_sched_ctx_get_policy_data(unsigned sched_ctx_id);
  1592. function fstarpu_sched_ctx_get_policy_data (sched_ctx_id) &
  1593. bind(c,name="starpu_sched_ctx_get_policy_data")
  1594. use iso_c_binding, only: c_int, c_ptr
  1595. type(c_ptr) :: fstarpu_sched_ctx_get_policy_data
  1596. integer(c_int), value, intent(in) :: sched_ctx_id
  1597. end function fstarpu_sched_ctx_get_policy_data
  1598. ! void *starpu_sched_ctx_exec_parallel_code(void* (*func)(void*), void *param, unsigned sched_ctx_id);
  1599. function fstarpu_sched_ctx_exec_parallel_code (func, param, sched_ctx_id) &
  1600. bind(c,name="starpu_sched_ctx_exec_parallel_code")
  1601. use iso_c_binding, only: c_int, c_funptr, c_ptr
  1602. type(c_ptr) :: fstarpu_sched_ctx_exec_parallel_code
  1603. type(c_funptr), value, intent(in) :: func
  1604. type(c_ptr), value, intent(in) :: param
  1605. integer(c_int), value, intent(in) :: sched_ctx_id
  1606. end function fstarpu_sched_ctx_exec_parallel_code
  1607. ! int starpu_sched_ctx_get_nready_tasks(unsigned sched_ctx_id);
  1608. function fstarpu_sched_ctx_get_nready_tasks (sched_ctx_id) &
  1609. bind(c,name="starpu_sched_ctx_get_nready_tasks")
  1610. use iso_c_binding, only: c_int
  1611. integer(c_int) :: fstarpu_sched_ctx_get_nready_tasks
  1612. integer(c_int), value, intent(in) :: sched_ctx_id
  1613. end function fstarpu_sched_ctx_get_nready_tasks
  1614. ! double starpu_sched_ctx_get_nready_flops(unsigned sched_ctx_id);
  1615. function fstarpu_sched_ctx_get_nready_flops (sched_ctx_id) &
  1616. bind(c,name="starpu_sched_ctx_get_nready_flops")
  1617. use iso_c_binding, only: c_int, c_double
  1618. real(c_double) :: fstarpu_sched_ctx_get_nready_flops
  1619. integer(c_int), value, intent(in) :: sched_ctx_id
  1620. end function fstarpu_sched_ctx_get_nready_flops
  1621. ! void starpu_sched_ctx_list_task_counters_increment(unsigned sched_ctx_id, int workerid);
  1622. subroutine fstarpu_sched_ctx_list_task_counters_increment (sched_ctx_id, workerid) &
  1623. bind(c,name="starpu_sched_ctx_list_task_counters_increment")
  1624. use iso_c_binding, only: c_int
  1625. integer(c_int), value, intent(in) :: sched_ctx_id
  1626. integer(c_int), value, intent(in) :: workerid
  1627. end subroutine fstarpu_sched_ctx_list_task_counters_increment
  1628. ! void starpu_sched_ctx_list_task_counters_decrement(unsigned sched_ctx_id, int workerid);
  1629. subroutine fstarpu_sched_ctx_list_task_counters_decrement (sched_ctx_id, workerid) &
  1630. bind(c,name="starpu_sched_ctx_list_task_counters_decrement")
  1631. use iso_c_binding, only: c_int
  1632. integer(c_int), value, intent(in) :: sched_ctx_id
  1633. integer(c_int), value, intent(in) :: workerid
  1634. end subroutine fstarpu_sched_ctx_list_task_counters_decrement
  1635. ! void starpu_sched_ctx_list_task_counters_reset(unsigned sched_ctx_id, int workerid);
  1636. subroutine fstarpu_sched_ctx_list_task_counters_reset (sched_ctx_id, workerid) &
  1637. bind(c,name="starpu_sched_ctx_list_task_counters_reset")
  1638. use iso_c_binding, only: c_int
  1639. integer(c_int), value, intent(in) :: sched_ctx_id
  1640. integer(c_int), value, intent(in) :: workerid
  1641. end subroutine fstarpu_sched_ctx_list_task_counters_reset
  1642. ! void starpu_sched_ctx_list_task_counters_increment_all(struct starpu_task *task, unsigned sched_ctx_id);
  1643. subroutine fstarpu_sched_ctx_list_task_counters_increment_all (task, sched_ctx_id) &
  1644. bind(c,name="starpu_sched_ctx_list_task_counters_increment_all")
  1645. use iso_c_binding, only: c_ptr, c_int
  1646. type(c_ptr), value, intent(in) :: task
  1647. integer(c_int), value, intent(in) :: sched_ctx_id
  1648. end subroutine fstarpu_sched_ctx_list_task_counters_increment_all
  1649. ! void starpu_sched_ctx_list_task_counters_decrement_all(struct starpu_task *task, unsigned sched_ctx_id);
  1650. subroutine fstarpu_sched_ctx_list_task_counters_decrement_all (task, sched_ctx_id) &
  1651. bind(c,name="starpu_sched_ctx_list_task_counters_decrement_all")
  1652. use iso_c_binding, only: c_ptr, c_int
  1653. type(c_ptr), value, intent(in) :: task
  1654. integer(c_int), value, intent(in) :: sched_ctx_id
  1655. end subroutine fstarpu_sched_ctx_list_task_counters_decrement_all
  1656. ! void starpu_sched_ctx_list_task_counters_reset_all(struct starpu_task *task, unsigned sched_ctx_id);
  1657. subroutine fstarpu_sched_ctx_list_task_counters_reset_all (task, sched_ctx_id) &
  1658. bind(c,name="starpu_sched_ctx_list_task_counters_reset_all")
  1659. use iso_c_binding, only: c_ptr, c_int
  1660. type(c_ptr), value, intent(in) :: task
  1661. integer(c_int), value, intent(in) :: sched_ctx_id
  1662. end subroutine fstarpu_sched_ctx_list_task_counters_reset_all
  1663. ! void starpu_sched_ctx_set_priority(int *workers, int nworkers, unsigned sched_ctx_id, unsigned priority);
  1664. subroutine fstarpu_sched_ctx_set_priority (workers, nworkers, sched_ctx_id, priority) &
  1665. bind(c,name="starpu_sched_ctx_set_priority")
  1666. use iso_c_binding, only: c_int
  1667. integer(c_int), intent(in) :: workers(*)
  1668. integer(c_int), value, intent(in) :: nworkers
  1669. integer(c_int), value, intent(in) :: sched_ctx_id
  1670. integer(c_int), value, intent(in) :: priority
  1671. end subroutine fstarpu_sched_ctx_set_priority
  1672. ! void starpu_sched_ctx_set_priority_on_level(int* workers_to_add, unsigned nworkers_to_add, unsigned sched_ctx, unsigned priority);
  1673. subroutine fstarpu_sched_ctx_set_priority_on_level ( workers_to_add, nworkers_to_add, sched_ctx, priority) &
  1674. bind(c,name="starpu_sched_ctx_set_priority_on_level")
  1675. use iso_c_binding, only: c_int
  1676. integer(c_int), intent(in) :: workers_to_add(*)
  1677. integer(c_int), value, intent(in) :: nworkers_to_add
  1678. integer(c_int), value, intent(in) :: sched_ctx
  1679. integer(c_int), value, intent(in) :: priority
  1680. end subroutine fstarpu_sched_ctx_set_priority_on_level
  1681. ! unsigned starpu_sched_ctx_get_priority(int worker, unsigned sched_ctx_id);
  1682. function fstarpu_sched_ctx_get_priority (worker, sched_ctx_id) &
  1683. bind(c,name="starpu_sched_ctx_get_priority")
  1684. use iso_c_binding, only: c_int
  1685. integer(c_int) :: fstarpu_sched_ctx_get_priority
  1686. integer(c_int), value, intent(in) :: worker
  1687. integer(c_int), value, intent(in) :: sched_ctx_id
  1688. end function fstarpu_sched_ctx_get_priority
  1689. ! void starpu_sched_ctx_get_available_cpuids(unsigned sched_ctx_id, int **cpuids, int *ncpuids);
  1690. ! void starpu_sched_ctx_bind_current_thread_to_cpuid(unsigned cpuid);
  1691. subroutine fstarpu_sched_ctx_bind_current_thread_to_cpuid (cpuid) &
  1692. bind(c,name="starpu_sched_ctx_bind_current_thread_to_cpuid")
  1693. use iso_c_binding, only: c_int
  1694. integer(c_int), value, intent(in) :: cpuid
  1695. end subroutine fstarpu_sched_ctx_bind_current_thread_to_cpuid
  1696. ! int starpu_sched_ctx_book_workers_for_task(unsigned sched_ctx_id, int *workerids, int nworkers);
  1697. function fstarpu_sched_ctx_book_workers_for_task (sched_ctx_id, workerids, nworkers) &
  1698. bind(c,name="starpu_sched_ctx_book_workers_for_task")
  1699. use iso_c_binding, only: c_int
  1700. integer(c_int) :: fstarpu_sched_ctx_book_workers_for_task
  1701. integer(c_int), value, intent(in) :: sched_ctx_id
  1702. integer(c_int), intent(in) :: workerids(*)
  1703. integer(c_int), value, intent(in) :: nworkers
  1704. end function fstarpu_sched_ctx_book_workers_for_task
  1705. ! void starpu_sched_ctx_unbook_workers_for_task(unsigned sched_ctx_id, int master);
  1706. subroutine fstarpu_sched_ctx_unbook_workers_for_task (sched_ctx_id, master) &
  1707. bind(c,name="starpu_sched_ctx_unbook_workers_for_task")
  1708. use iso_c_binding, only: c_int
  1709. integer(c_int), value, intent(in) :: sched_ctx_id
  1710. integer(c_int), value, intent(in) :: master
  1711. end subroutine fstarpu_sched_ctx_unbook_workers_for_task
  1712. ! unsigned starpu_sched_ctx_worker_is_master_for_child_ctx(int workerid, unsigned sched_ctx_id);
  1713. function fstarpu_sched_ctx_worker_is_master_for_child_ctx (workerid, sched_ctx_id) &
  1714. bind(c,name="starpu_sched_ctx_worker_is_master_for_child_ctx")
  1715. use iso_c_binding, only: c_int
  1716. integer(c_int) :: fstarpu_sched_ctx_worker_is_master_for_child_ctx
  1717. integer(c_int), value, intent(in) :: workerid
  1718. integer(c_int), value, intent(in) :: sched_ctx_id
  1719. end function fstarpu_sched_ctx_worker_is_master_for_child_ctx
  1720. ! unsigned starpu_sched_ctx_master_get_context(int masterid);
  1721. function fstarpu_sched_ctx_master_get_context (masterid) &
  1722. bind(c,name="starpu_sched_ctx_master_get_context")
  1723. use iso_c_binding, only: c_int
  1724. integer(c_int) :: fstarpu_sched_ctx_master_get_context
  1725. integer(c_int), value, intent(in) :: masterid
  1726. end function fstarpu_sched_ctx_master_get_context
  1727. ! void starpu_sched_ctx_revert_task_counters(unsigned sched_ctx_id, double flops);
  1728. subroutine fstarpu_sched_ctx_revert_task_counters (sched_ctx_id, flops) &
  1729. bind(c,name="starpu_sched_ctx_revert_task_counters")
  1730. use iso_c_binding, only: c_int, c_double
  1731. integer(c_int), value, intent(in) :: sched_ctx_id
  1732. real(c_double), value, intent(in) :: flops
  1733. end subroutine fstarpu_sched_ctx_revert_task_counters
  1734. ! void starpu_sched_ctx_move_task_to_ctx(struct starpu_task *task, unsigned sched_ctx, unsigned manage_mutex);
  1735. subroutine fstarpu_sched_ctx_move_task_to_ctx (task, sched_ctx, manage_mutex) &
  1736. bind(c,name="starpu_sched_ctx_move_task_to_ctx")
  1737. use iso_c_binding, only: c_ptr, c_int
  1738. type(c_ptr), value, intent(in) :: task
  1739. integer(c_int), value, intent(in) :: sched_ctx
  1740. integer(c_int), value, intent(in) :: manage_mutex
  1741. end subroutine fstarpu_sched_ctx_move_task_to_ctx
  1742. ! int starpu_sched_ctx_get_worker_rank(unsigned sched_ctx_id);
  1743. function fstarpu_sched_ctx_get_worker_rank (sched_ctx_id) &
  1744. bind(c,name="starpu_sched_ctx_get_worker_rank")
  1745. use iso_c_binding, only: c_int
  1746. integer(c_int) :: fstarpu_sched_ctx_get_worker_rank
  1747. integer(c_int), value, intent(in) :: sched_ctx_id
  1748. end function fstarpu_sched_ctx_get_worker_rank
  1749. ! unsigned starpu_sched_ctx_has_starpu_scheduler(unsigned sched_ctx_id, unsigned *awake_workers);
  1750. ! void starpu_sched_ctx_call_pushed_task_cb(int workerid, unsigned sched_ctx_id);
  1751. subroutine fstarpu_sched_ctx_call_pushed_task_cb (workerid, sched_ctx_id) &
  1752. bind(c,name="starpu_sched_ctx_call_pushed_task_cb")
  1753. use iso_c_binding, only: c_int
  1754. integer(c_int), value, intent(in) :: workerid
  1755. integer(c_int), value, intent(in) :: sched_ctx_id
  1756. end subroutine fstarpu_sched_ctx_call_pushed_task_cb
  1757. ! == starpu_fxt.h ==
  1758. ! void starpu_fxt_options_init(struct starpu_fxt_options *options);
  1759. subroutine fstarpu_fxt_options_init (fxt_options) bind(C,name="starpu_fxt_options_init")
  1760. use iso_c_binding, only: c_ptr
  1761. type(c_ptr), value, intent(in) :: fxt_options
  1762. end subroutine fstarpu_fxt_options_init
  1763. ! void starpu_fxt_generate_trace(struct starpu_fxt_options *options);
  1764. subroutine fstarpu_fxt_generate_trace (fxt_options) bind(C,name="starpu_fxt_generate_trace")
  1765. use iso_c_binding, only: c_ptr
  1766. type(c_ptr), value, intent(in) :: fxt_options
  1767. end subroutine fstarpu_fxt_generate_trace
  1768. ! void starpu_fxt_autostart_profiling(int autostart);
  1769. subroutine fstarpu_fxt_autostart_profiling (autostart) bind(c,name="starpu_fxt_autostart_profiling")
  1770. use iso_c_binding, only: c_int
  1771. integer(c_int), value, intent(in) :: autostart
  1772. end subroutine fstarpu_fxt_autostart_profiling
  1773. ! void starpu_fxt_start_profiling(void);
  1774. subroutine fstarpu_fxt_start_profiling () bind(c,name="starpu_fxt_start_profiling")
  1775. use iso_c_binding
  1776. end subroutine fstarpu_fxt_start_profiling
  1777. ! void starpu_fxt_stop_profiling(void);
  1778. subroutine fstarpu_fxt_stop_profiling () bind(c,name="starpu_fxt_stop_profiling")
  1779. use iso_c_binding
  1780. end subroutine fstarpu_fxt_stop_profiling
  1781. ! void starpu_fxt_write_data_trace(char *filename_in);
  1782. subroutine fstarpu_fxt_write_data_trace (filename) bind(c,name="starpu_fxt_write_data_trace")
  1783. use iso_c_binding, only: c_char
  1784. character(c_char), intent(in) :: filename
  1785. end subroutine fstarpu_fxt_write_data_trace
  1786. ! void starpu_fxt_trace_user_event(unsigned long code);
  1787. subroutine fstarpu_trace_user_event (code) bind(c,name="starpu_trace_user_event")
  1788. use iso_c_binding, only: c_long
  1789. integer(c_long), value, intent(in) :: code
  1790. end subroutine fstarpu_trace_user_event
  1791. end interface
  1792. contains
  1793. function or_cptrs(op1,op2)
  1794. type(c_ptr) :: or_cptrs
  1795. type(c_ptr),intent(in) :: op1,op2
  1796. integer(c_intptr_t) :: i_op1,i_op2
  1797. i_op1 = transfer(op1,0_c_intptr_t)
  1798. i_op2 = transfer(op2,0_c_intptr_t)
  1799. or_cptrs = transfer(ior(i_op1,i_op2), C_NULL_PTR)
  1800. end function
  1801. function ip_to_p(i) bind(C)
  1802. use iso_c_binding, only: c_ptr,c_intptr_t,C_NULL_PTR
  1803. type(c_ptr) :: ip_to_p
  1804. integer(c_intptr_t), value, intent(in) :: i
  1805. ip_to_p = transfer(i,C_NULL_PTR)
  1806. end function ip_to_p
  1807. function p_to_ip(p) bind(C)
  1808. use iso_c_binding, only: c_ptr,c_intptr_t
  1809. integer(c_intptr_t) :: p_to_ip
  1810. type(c_ptr), value, intent(in) :: p
  1811. p_to_ip = transfer(p,0_c_intptr_t)
  1812. end function p_to_ip
  1813. function sz_to_p(sz) bind(C)
  1814. use iso_c_binding, only: c_ptr,c_size_t,c_intptr_t
  1815. type(c_ptr) :: sz_to_p
  1816. integer(c_size_t), value, intent(in) :: sz
  1817. sz_to_p = ip_to_p(int(sz,kind=c_intptr_t))
  1818. end function sz_to_p
  1819. function fstarpu_init (conf) bind(C)
  1820. use iso_c_binding
  1821. integer(c_int) :: fstarpu_init
  1822. type(c_ptr), value, intent(in) :: conf
  1823. real(c_double) :: FSTARPU_SZ_C_DOUBLE_dummy
  1824. real(c_float) :: FSTARPU_SZ_C_FLOAT_dummy
  1825. integer(c_int) :: FSTARPU_SZ_C_INT_dummy
  1826. integer(c_intptr_t) :: FSTARPU_SZ_C_INTPTR_T_dummy
  1827. type(c_ptr) :: FSTARPU_SZ_C_PTR_dummy
  1828. integer(c_size_t) :: FSTARPU_SZ_C_SIZE_T_dummy
  1829. integer :: FSTARPU_SZ_INTEGER_dummy
  1830. integer(4) :: FSTARPU_SZ_INT4_dummy
  1831. integer(8) :: FSTARPU_SZ_INT8_dummy
  1832. real :: FSTARPU_SZ_REAL_dummy
  1833. real(4) :: FSTARPU_SZ_REAL4_dummy
  1834. real(8) :: FSTARPU_SZ_REAL8_dummy
  1835. double precision :: FSTARPU_SZ_DOUBLE_PRECISION_dummy
  1836. complex :: FSTARPU_SZ_COMPLEX_dummy
  1837. ! Note: Referencing global C constants from Fortran has
  1838. ! been found unreliable on some architectures, notably
  1839. ! on Darwin. The get_integer/get_pointer_constant
  1840. ! scheme is a workaround to that issue.
  1841. interface
  1842. ! These functions are not exported to the end user
  1843. function fstarpu_get_constant(s) bind(C)
  1844. use iso_c_binding, only: c_ptr,c_char
  1845. type(c_ptr) :: fstarpu_get_constant ! C function returns an intptr_t
  1846. character(kind=c_char) :: s
  1847. end function fstarpu_get_constant
  1848. function fstarpu_init_internal (conf) bind(C,name="starpu_init")
  1849. use iso_c_binding, only: c_ptr,c_int
  1850. integer(c_int) :: fstarpu_init_internal
  1851. type(c_ptr), value :: conf
  1852. end function fstarpu_init_internal
  1853. end interface
  1854. ! Initialize Fortran constants from C peers
  1855. FSTARPU_R = fstarpu_get_constant(C_CHAR_"FSTARPU_R"//C_NULL_CHAR)
  1856. FSTARPU_W = fstarpu_get_constant(C_CHAR_"FSTARPU_W"//C_NULL_CHAR)
  1857. FSTARPU_RW = fstarpu_get_constant(C_CHAR_"FSTARPU_RW"//C_NULL_CHAR)
  1858. FSTARPU_SCRATCH = fstarpu_get_constant(C_CHAR_"FSTARPU_SCRATCH"//C_NULL_CHAR)
  1859. FSTARPU_REDUX = fstarpu_get_constant(C_CHAR_"FSTARPU_REDUX"//C_NULL_CHAR)
  1860. FSTARPU_COMMUTE = fstarpu_get_constant(C_CHAR_"FSTARPU_COMMUTE"//C_NULL_CHAR)
  1861. FSTARPU_SSEND = fstarpu_get_constant(C_CHAR_"FSTARPU_SSEND"//C_NULL_CHAR)
  1862. FSTARPU_LOCALITY = fstarpu_get_constant(C_CHAR_"FSTARPU_LOCALITY"//C_NULL_CHAR)
  1863. FSTARPU_DATA_ARRAY = fstarpu_get_constant(C_CHAR_"FSTARPU_DATA_ARRAY"//C_NULL_CHAR)
  1864. FSTARPU_DATA_MODE_ARRAY = fstarpu_get_constant(C_CHAR_"FSTARPU_DATA_MODE_ARRAY"//C_NULL_CHAR)
  1865. FSTARPU_CL_ARGS = fstarpu_get_constant(C_CHAR_"FSTARPU_CL_ARGS"//C_NULL_CHAR)
  1866. FSTARPU_CALLBACK = fstarpu_get_constant(C_CHAR_"FSTARPU_CALLBACK"//C_NULL_CHAR)
  1867. FSTARPU_CALLBACK_WITH_ARG = fstarpu_get_constant(C_CHAR_"FSTARPU_CALLBACK_WITH_ARG"//C_NULL_CHAR)
  1868. FSTARPU_CALLBACK_ARG = fstarpu_get_constant(C_CHAR_"FSTARPU_CALLBACK_ARG"//C_NULL_CHAR)
  1869. FSTARPU_PROLOGUE_CALLBACK = fstarpu_get_constant(C_CHAR_"FSTARPU_PROLOGUE_CALLBACK"//C_NULL_CHAR)
  1870. FSTARPU_PROLOGUE_CALLBACK_ARG = fstarpu_get_constant(C_CHAR_"FSTARPU_PROLOGUE_CALLBACK_ARG"//C_NULL_CHAR)
  1871. FSTARPU_PROLOGUE_CALLBACK_POP = fstarpu_get_constant(C_CHAR_"FSTARPU_PROLOGUE_CALLBACK_POP"//C_NULL_CHAR)
  1872. FSTARPU_PROLOGUE_CALLBACK_POP_ARG = &
  1873. fstarpu_get_constant(C_CHAR_"FSTARPU_PROLOGUE_CALLBACK_POP_ARG"//C_NULL_CHAR)
  1874. FSTARPU_PRIORITY = fstarpu_get_constant(C_CHAR_"FSTARPU_PRIORITY"//C_NULL_CHAR)
  1875. FSTARPU_EXECUTE_ON_NODE = fstarpu_get_constant(C_CHAR_"FSTARPU_EXECUTE_ON_NODE"//C_NULL_CHAR)
  1876. FSTARPU_EXECUTE_ON_DATA = fstarpu_get_constant(C_CHAR_"FSTARPU_EXECUTE_ON_DATA"//C_NULL_CHAR)
  1877. FSTARPU_EXECUTE_ON_WORKER = fstarpu_get_constant(C_CHAR_"FSTARPU_EXECUTE_ON_WORKER"//C_NULL_CHAR)
  1878. FSTARPU_WORKER_ORDER = fstarpu_get_constant(C_CHAR_"FSTARPU_WORKER_ORDER"//C_NULL_CHAR)
  1879. FSTARPU_HYPERVISOR_TAG = fstarpu_get_constant(C_CHAR_"FSTARPU_HYPERVISOR_TAG"//C_NULL_CHAR)
  1880. FSTARPU_POSSIBLY_PARALLEL = fstarpu_get_constant(C_CHAR_"FSTARPU_POSSIBLY_PARALLEL"//C_NULL_CHAR)
  1881. FSTARPU_FLOPS = fstarpu_get_constant(C_CHAR_"FSTARPU_FLOPS"//C_NULL_CHAR)
  1882. FSTARPU_TAG = fstarpu_get_constant(C_CHAR_"FSTARPU_TAG"//C_NULL_CHAR)
  1883. FSTARPU_TAG_ONLY = fstarpu_get_constant(C_CHAR_"FSTARPU_TAG_ONLY"//C_NULL_CHAR)
  1884. FSTARPU_NAME = fstarpu_get_constant(C_CHAR_"FSTARPU_NAME"//C_NULL_CHAR)
  1885. FSTARPU_NODE_SELECTION_POLICY = fstarpu_get_constant(C_CHAR_"FSTARPU_NODE_SELECTION_POLICY"//C_NULL_CHAR)
  1886. FSTARPU_VALUE = fstarpu_get_constant(C_CHAR_"FSTARPU_VALUE"//C_NULL_CHAR)
  1887. FSTARPU_SCHED_CTX = fstarpu_get_constant(C_CHAR_"FSTARPU_SCHED_CTX"//C_NULL_CHAR)
  1888. FSTARPU_CPU_WORKER = fstarpu_get_constant(C_CHAR_"FSTARPU_CPU_WORKER"//C_NULL_CHAR)
  1889. FSTARPU_CUDA_WORKER = fstarpu_get_constant(C_CHAR_"FSTARPU_CUDA_WORKER"//C_NULL_CHAR)
  1890. FSTARPU_OPENCL_WORKER = fstarpu_get_constant(C_CHAR_"FSTARPU_OPENCL_WORKER"//C_NULL_CHAR)
  1891. FSTARPU_MIC_WORKER = fstarpu_get_constant(C_CHAR_"FSTARPU_MIC_WORKER"//C_NULL_CHAR)
  1892. FSTARPU_SCC_WORKER = fstarpu_get_constant(C_CHAR_"FSTARPU_SCC_WORKER"//C_NULL_CHAR)
  1893. FSTARPU_ANY_WORKER = fstarpu_get_constant(C_CHAR_"FSTARPU_ANY_WORKER"//C_NULL_CHAR)
  1894. FSTARPU_NMAXBUFS = int(p_to_ip(fstarpu_get_constant(C_CHAR_"FSTARPU_NMAXBUFS"//C_NULL_CHAR)),c_int)
  1895. ! Initialize size constants as 'c_ptr'
  1896. FSTARPU_SZ_C_DOUBLE = sz_to_p(c_sizeof(FSTARPU_SZ_C_DOUBLE_dummy))
  1897. FSTARPU_SZ_C_FLOAT = sz_to_p(c_sizeof(FSTARPU_SZ_C_FLOAT_dummy))
  1898. FSTARPU_SZ_C_INT = sz_to_p(c_sizeof(FSTARPU_SZ_C_INT_dummy))
  1899. FSTARPU_SZ_C_INTPTR_T = sz_to_p(c_sizeof(FSTARPU_SZ_C_INTPTR_T_dummy))
  1900. FSTARPU_SZ_C_PTR = sz_to_p(c_sizeof(FSTARPU_SZ_C_PTR_dummy))
  1901. FSTARPU_SZ_C_SIZE_T = sz_to_p(c_sizeof(FSTARPU_SZ_C_SIZE_T_dummy))
  1902. FSTARPU_SZ_INTEGER = sz_to_p(c_sizeof(FSTARPU_SZ_INTEGER_dummy))
  1903. FSTARPU_SZ_INT4 = sz_to_p(c_sizeof(FSTARPU_SZ_INT4_dummy))
  1904. FSTARPU_SZ_INT8 = sz_to_p(c_sizeof(FSTARPU_SZ_INT8_dummy))
  1905. FSTARPU_SZ_REAL = sz_to_p(c_sizeof(FSTARPU_SZ_REAL_dummy))
  1906. FSTARPU_SZ_REAL4 = sz_to_p(c_sizeof(FSTARPU_SZ_REAL4_dummy))
  1907. FSTARPU_SZ_REAL8 = sz_to_p(c_sizeof(FSTARPU_SZ_REAL8_dummy))
  1908. FSTARPU_SZ_DOUBLE_PRECISION = sz_to_p(c_sizeof(FSTARPU_SZ_DOUBLE_PRECISION_dummy))
  1909. FSTARPU_SZ_COMPLEX = sz_to_p(c_sizeof(FSTARPU_SZ_COMPLEX_dummy))
  1910. ! Initialize StarPU
  1911. if (c_associated(conf)) then
  1912. fstarpu_init = fstarpu_init_internal(conf)
  1913. else
  1914. fstarpu_init = fstarpu_init_internal(C_NULL_PTR)
  1915. end if
  1916. end function fstarpu_init
  1917. function fstarpu_csizet_to_cptr(i) bind(C)
  1918. use iso_c_binding
  1919. type(c_ptr) :: fstarpu_csizet_to_cptr
  1920. integer(c_size_t) :: i
  1921. fstarpu_csizet_to_cptr = transfer(int(i,kind=c_intptr_t),C_NULL_PTR)
  1922. end function fstarpu_csizet_to_cptr
  1923. function fstarpu_int_to_cptr(i) bind(C)
  1924. use iso_c_binding
  1925. type(c_ptr) :: fstarpu_int_to_cptr
  1926. integer :: i
  1927. fstarpu_int_to_cptr = transfer(int(i,kind=c_intptr_t),C_NULL_PTR)
  1928. end function fstarpu_int_to_cptr
  1929. end module fstarpu_mod