fstarpu_mod.f90 144 KB

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