fstarpu_mod.f90 145 KB

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