fstarpu_mod.f90 145 KB

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