fstarpu_mod.f90 145 KB

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