fstarpu_mod.f90 150 KB

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