fstarpu_mod.f90 145 KB

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