fstarpu_mod.f90 145 KB

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