fstarpu_mod.f90 144 KB

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