fstarpu_mod.f90 145 KB

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