fstarpu_mod.f90 140 KB

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