fstarpu_mod.f90 146 KB

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