fstarpu_mod.f90 104 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733
  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. ! (some) portable iso_c_binding types
  61. type(c_ptr), bind(C) :: FSTARPU_SZ_C_DOUBLE
  62. type(c_ptr), bind(C) :: FSTARPU_SZ_C_FLOAT
  63. type(c_ptr), bind(C) :: FSTARPU_SZ_C_INT
  64. type(c_ptr), bind(C) :: FSTARPU_SZ_C_INTPTR_T
  65. type(c_ptr), bind(C) :: FSTARPU_SZ_C_PTR
  66. type(c_ptr), bind(C) :: FSTARPU_SZ_C_SIZE_T
  67. ! (some) native Fortran types
  68. type(c_ptr), bind(C) :: FSTARPU_SZ_INTEGER
  69. type(c_ptr), bind(C) :: FSTARPU_SZ_INT4
  70. type(c_ptr), bind(C) :: FSTARPU_SZ_INT8
  71. type(c_ptr), bind(C) :: FSTARPU_SZ_REAL
  72. type(c_ptr), bind(C) :: FSTARPU_SZ_REAL4
  73. type(c_ptr), bind(C) :: FSTARPU_SZ_REAL8
  74. type(c_ptr), bind(C) :: FSTARPU_SZ_DOUBLE_PRECISION
  75. type(c_ptr), bind(C) :: FSTARPU_SZ_COMPLEX
  76. interface operator (.ior.)
  77. procedure or_cptrs
  78. end interface operator (.ior.)
  79. interface
  80. ! == starpu.h ==
  81. ! void starpu_conf_init(struct starpu_conf *conf);
  82. subroutine fstarpu_conf_init (conf) bind(C,name="starpu_conf_init")
  83. use iso_c_binding, only: c_ptr
  84. type(c_ptr), value, intent(in) :: conf
  85. end subroutine fstarpu_conf_init
  86. function fstarpu_conf_allocate () bind(C)
  87. use iso_c_binding, only: c_ptr
  88. type(c_ptr) :: fstarpu_conf_allocate
  89. end function fstarpu_conf_allocate
  90. subroutine fstarpu_conf_free (conf) bind(C)
  91. use iso_c_binding, only: c_ptr
  92. type(c_ptr), value, intent(in) :: conf
  93. end subroutine fstarpu_conf_free
  94. subroutine fstarpu_conf_set_sched_policy_name (conf, policy_name) bind(C)
  95. use iso_c_binding, only: c_ptr, c_char
  96. type(c_ptr), value, intent(in) :: conf
  97. character(c_char), intent(in) :: policy_name
  98. end subroutine fstarpu_conf_set_sched_policy_name
  99. subroutine fstarpu_conf_set_min_prio (conf, min_prio) bind(C)
  100. use iso_c_binding, only: c_ptr, c_int
  101. type(c_ptr), value, intent(in) :: conf
  102. integer(c_int), value, intent(in) :: min_prio
  103. end subroutine fstarpu_conf_set_min_prio
  104. subroutine fstarpu_conf_set_max_prio (conf, max_prio) bind(C)
  105. use iso_c_binding, only: c_ptr, c_int
  106. type(c_ptr), value, intent(in) :: conf
  107. integer(c_int), value, intent(in) :: max_prio
  108. end subroutine fstarpu_conf_set_max_prio
  109. subroutine fstarpu_conf_set_ncpu (conf, ncpu) bind(C)
  110. use iso_c_binding, only: c_ptr, c_int
  111. type(c_ptr), value, intent(in) :: conf
  112. integer(c_int), value, intent(in) :: ncpu
  113. end subroutine fstarpu_conf_set_ncpu
  114. subroutine fstarpu_conf_set_ncuda (conf, ncuda) bind(C)
  115. use iso_c_binding, only: c_ptr, c_int
  116. type(c_ptr), value, intent(in) :: conf
  117. integer(c_int), value, intent(in) :: ncuda
  118. end subroutine fstarpu_conf_set_ncuda
  119. subroutine fstarpu_conf_set_nopencl (conf, nopencl) bind(C)
  120. use iso_c_binding, only: c_ptr, c_int
  121. type(c_ptr), value, intent(in) :: conf
  122. integer(c_int), value, intent(in) :: nopencl
  123. end subroutine fstarpu_conf_set_nopencl
  124. subroutine fstarpu_conf_set_nmic (conf, nmic) bind(C)
  125. use iso_c_binding, only: c_ptr, c_int
  126. type(c_ptr), value, intent(in) :: conf
  127. integer(c_int), value, intent(in) :: nmic
  128. end subroutine fstarpu_conf_set_nmic
  129. subroutine fstarpu_conf_set_nscc (conf, nscc) bind(C)
  130. use iso_c_binding, only: c_ptr, c_int
  131. type(c_ptr), value, intent(in) :: conf
  132. integer(c_int), value, intent(in) :: nscc
  133. end subroutine fstarpu_conf_set_nscc
  134. ! starpu_init: see fstarpu_init
  135. ! starpu_initialize: see fstarpu_init
  136. ! void starpu_pause(void);
  137. subroutine fstarpu_pause() bind(C,name="starpu_pause")
  138. end subroutine fstarpu_pause
  139. ! void starpu_resume(void);
  140. subroutine fstarpu_resume() bind(C,name="starpu_resume")
  141. end subroutine fstarpu_resume
  142. ! void starpu_shutdown(void);
  143. subroutine fstarpu_shutdown () bind(C,name="starpu_shutdown")
  144. end subroutine fstarpu_shutdown
  145. ! starpu_topology_print
  146. subroutine fstarpu_topology_print () bind(C)
  147. end subroutine fstarpu_topology_print
  148. ! int starpu_asynchronous_copy_disabled(void);
  149. function fstarpu_asynchronous_copy_disabled() bind(C,name="starpu_asynchronous_copy_disabled")
  150. use iso_c_binding, only: c_int
  151. integer(c_int) :: fstarpu_asynchronous_copy_disabled
  152. end function fstarpu_asynchronous_copy_disabled
  153. ! int starpu_asynchronous_cuda_copy_disabled(void);
  154. function fstarpu_asynchronous_cuda_copy_disabled() bind(C,name="starpu_asynchronous_cuda_copy_disabled")
  155. use iso_c_binding, only: c_int
  156. integer(c_int) :: fstarpu_asynchronous_cuda_copy_disabled
  157. end function fstarpu_asynchronous_cuda_copy_disabled
  158. ! int starpu_asynchronous_opencl_copy_disabled(void);
  159. function fstarpu_asynchronous_opencl_copy_disabled() bind(C,name="starpu_asynchronous_opencl_copy_disabled")
  160. use iso_c_binding, only: c_int
  161. integer(c_int) :: fstarpu_asynchronous_opencl_copy_disabled
  162. end function fstarpu_asynchronous_opencl_copy_disabled
  163. ! int starpu_asynchronous_mic_copy_disabled(void);
  164. function fstarpu_asynchronous_mic_copy_disabled() bind(C,name="starpu_asynchronous_mic_copy_disabled")
  165. use iso_c_binding, only: c_int
  166. integer(c_int) :: fstarpu_asynchronous_mic_copy_disabled
  167. end function fstarpu_asynchronous_mic_copy_disabled
  168. ! void starpu_display_stats();
  169. subroutine fstarpu_display_stats() bind(C,name="starpu_display_stats")
  170. end subroutine fstarpu_display_stats
  171. ! void starpu_get_version(int *major, int *minor, int *release);
  172. subroutine fstarpu_get_version(major,minor,release) bind(C,name="starpu_get_version")
  173. use iso_c_binding, only: c_int
  174. integer(c_int), intent(out) :: major,minor,release
  175. end subroutine fstarpu_get_version
  176. ! == starpu_worker.h ==
  177. ! unsigned starpu_worker_get_count(void);
  178. function fstarpu_worker_get_count() bind(C,name="starpu_worker_get_count")
  179. use iso_c_binding, only: c_int
  180. integer(c_int) :: fstarpu_worker_get_count
  181. end function fstarpu_worker_get_count
  182. ! unsigned starpu_combined_worker_get_count(void);
  183. function fstarpu_combined_worker_get_count() bind(C,name="starpu_combined_worker_get_count")
  184. use iso_c_binding, only: c_int
  185. integer(c_int) :: fstarpu_combined_worker_get_count
  186. end function fstarpu_combined_worker_get_count
  187. ! unsigned starpu_worker_is_combined_worker(int id);
  188. function fstarpu_worker_is_combined_worker(id) bind(C,name="starpu_worker_is_combined_worker")
  189. use iso_c_binding, only: c_int
  190. integer(c_int) :: fstarpu_worker_is_combined_worker
  191. integer(c_int), value, intent(in) :: id
  192. end function fstarpu_worker_is_combined_worker
  193. ! unsigned starpu_cpu_worker_get_count(void);
  194. function fstarpu_cpu_worker_get_count() bind(C,name="starpu_cpu_worker_get_count")
  195. use iso_c_binding, only: c_int
  196. integer(c_int) :: fstarpu_cpu_worker_get_count
  197. end function fstarpu_cpu_worker_get_count
  198. ! unsigned starpu_cuda_worker_get_count(void);
  199. function fstarpu_cuda_worker_get_count() bind(C,name="starpu_cuda_worker_get_count")
  200. use iso_c_binding, only: c_int
  201. integer(c_int) :: fstarpu_cuda_worker_get_count
  202. end function fstarpu_cuda_worker_get_count
  203. ! unsigned starpu_opencl_worker_get_count(void);
  204. function fstarpu_opencl_worker_get_count() bind(C,name="starpu_opencl_worker_get_count")
  205. use iso_c_binding, only: c_int
  206. integer(c_int) :: fstarpu_opencl_worker_get_count
  207. end function fstarpu_opencl_worker_get_count
  208. ! unsigned starpu_mic_worker_get_count(void);
  209. function fstarpu_mic_worker_get_count() bind(C,name="starpu_mic_worker_get_count")
  210. use iso_c_binding, only: c_int
  211. integer(c_int) :: fstarpu_mic_worker_get_count
  212. end function fstarpu_mic_worker_get_count
  213. ! unsigned starpu_scc_worker_get_count(void);
  214. function fstarpu_scc_worker_get_count() bind(C,name="starpu_scc_worker_get_count")
  215. use iso_c_binding, only: c_int
  216. integer(c_int) :: fstarpu_scc_worker_get_count
  217. end function fstarpu_scc_worker_get_count
  218. ! int starpu_worker_get_id(void);
  219. function fstarpu_worker_get_id() bind(C,name="starpu_worker_get_id")
  220. use iso_c_binding, only: c_int
  221. integer(c_int) :: fstarpu_worker_get_id
  222. end function fstarpu_worker_get_id
  223. ! _starpu_worker_get_id_check
  224. ! starpu_worker_get_id_check
  225. ! int starpu_worker_get_bindid(int workerid);
  226. function fstarpu_worker_get_bindid(id) bind(C,name="starpu_worker_get_bindid")
  227. use iso_c_binding, only: c_int
  228. integer(c_int) :: fstarpu_worker_get_bindid
  229. integer(c_int), value, intent(in) :: id
  230. end function fstarpu_worker_get_bindid
  231. ! int starpu_combined_worker_get_id(void);
  232. function fstarpu_combined_worker_get_id() bind(C,name="starpu_combined_worker_get_id")
  233. use iso_c_binding, only: c_int
  234. integer(c_int) :: fstarpu_combined_worker_get_id
  235. end function fstarpu_combined_worker_get_id
  236. ! int starpu_combined_worker_get_size(void);
  237. function fstarpu_combined_worker_get_size() bind(C,name="starpu_combined_worker_get_size")
  238. use iso_c_binding, only: c_int
  239. integer(c_int) :: fstarpu_combined_worker_get_size
  240. end function fstarpu_combined_worker_get_size
  241. ! int starpu_combined_worker_get_rank(void);
  242. function fstarpu_combined_worker_get_rank() bind(C,name="starpu_combined_worker_get_rank")
  243. use iso_c_binding, only: c_int
  244. integer(c_int) :: fstarpu_combined_worker_get_rank
  245. end function fstarpu_combined_worker_get_rank
  246. ! enum starpu_worker_archtype starpu_worker_get_type(int id);
  247. function fstarpu_worker_get_type(id) bind(C)
  248. use iso_c_binding, only: c_int, c_ptr
  249. type(c_ptr) :: fstarpu_worker_get_type ! C function returns c_intptr_t
  250. integer(c_int),value,intent(in) :: id
  251. end function fstarpu_worker_get_type
  252. ! int starpu_worker_get_count_by_type(enum starpu_worker_archtype type);
  253. function fstarpu_worker_get_count_by_type(typeid) bind(C)
  254. use iso_c_binding, only: c_int, c_ptr
  255. integer(c_int) :: fstarpu_worker_get_count_by_type
  256. type(c_ptr),value,intent(in) :: typeid ! c_intptr_t expected by C func
  257. end function fstarpu_worker_get_count_by_type
  258. ! int starpu_worker_get_ids_by_type(enum starpu_worker_archtype type, int *workerids, int maxsize);
  259. function fstarpu_worker_get_ids_by_type(typeid, workerids, maxsize) bind(C)
  260. use iso_c_binding, only: c_int, c_ptr
  261. integer(c_int) :: fstarpu_worker_get_ids_by_type
  262. type(c_ptr),value,intent(in) :: typeid ! c_intptr_t expected by C func
  263. integer(c_int),intent(out) :: workerids(*)
  264. integer(c_int),value,intent(in) :: maxsize
  265. end function fstarpu_worker_get_ids_by_type
  266. ! int starpu_worker_get_by_type(enum starpu_worker_archtype type, int num);
  267. function fstarpu_worker_get_by_type(typeid, num) bind(C)
  268. use iso_c_binding, only: c_int, c_ptr
  269. integer(c_int) :: fstarpu_worker_get_by_type
  270. type(c_ptr),value,intent(in) :: typeid ! c_intptr_t expected by C func
  271. integer(c_int),value,intent(in) :: num
  272. end function fstarpu_worker_get_by_type
  273. ! int starpu_worker_get_by_devid(enum starpu_worker_archtype type, int devid);
  274. function fstarpu_worker_get_by_devid(typeid, devid) bind(C)
  275. use iso_c_binding, only: c_int, c_ptr
  276. integer(c_int) :: fstarpu_worker_get_by_type
  277. type(c_ptr),value,intent(in) :: typeid ! c_intptr_t expected by C func
  278. integer(c_int),value,intent(in) :: devid
  279. end function fstarpu_worker_get_by_devid
  280. ! void starpu_worker_get_name(int id, char *dst, size_t maxlen);
  281. subroutine fstarpu_worker_get_name(id, dst, maxlen) bind(C,name="starpu_worker_get_name")
  282. use iso_c_binding, only: c_int, c_char, c_size_t
  283. integer(c_int),value,intent(in) :: id
  284. character(c_char),intent(out) :: dst(*)
  285. integer(c_size_t),value,intent(in) :: maxlen
  286. end subroutine fstarpu_worker_get_name
  287. ! int starpu_worker_get_devid(int id);
  288. function fstarpu_worker_get_devid(id) bind(C,name="starpu_worker_get_devid")
  289. use iso_c_binding, only: c_int
  290. integer(c_int) :: fstarpu_worker_get_devid
  291. integer(c_int), value, intent(in) :: id
  292. end function fstarpu_worker_get_devid
  293. ! int starpu_worker_get_mp_nodeid(int id);
  294. function fstarpu_worker_get_mp_nodeid(id) bind(C,name="starpu_worker_get_mp_nodeid")
  295. use iso_c_binding, only: c_int
  296. integer(c_int) :: fstarpu_worker_get_mp_nodeid
  297. integer(c_int), value, intent(in) :: id
  298. end function fstarpu_worker_get_mp_nodeid
  299. ! struct starpu_tree* starpu_workers_get_tree(void);
  300. ! unsigned starpu_worker_get_sched_ctx_list(int worker, unsigned **sched_ctx);
  301. ! unsigned starpu_worker_is_blocked(int workerid);
  302. function fstarpu_worker_is_blocked(id) bind(C,name="starpu_worker_is_blocked")
  303. use iso_c_binding, only: c_int
  304. integer(c_int) :: fstarpu_worker_is_blocked
  305. integer(c_int), value, intent(in) :: id
  306. end function fstarpu_worker_is_blocked
  307. ! unsigned starpu_worker_is_slave_somewhere(int workerid);
  308. function fstarpu_worker_is_slave_somewhere(id) bind(C,name="starpu_worker_is_slave_somewhere")
  309. use iso_c_binding, only: c_int
  310. integer(c_int) :: fstarpu_worker_is_slave_somewhere
  311. integer(c_int), value, intent(in) :: id
  312. end function fstarpu_worker_is_slave_somewhere
  313. ! char *starpu_worker_get_type_as_string(enum starpu_worker_archtype type);
  314. subroutine fstarpu_worker_get_type_as_string(typeid,dst,maxlen) bind(C)
  315. use iso_c_binding, only: c_ptr, c_char, c_size_t
  316. type(c_ptr),value,intent(in) :: typeid ! c_intptr_t expected by C func
  317. character(c_char),intent(out) :: dst(*)
  318. integer(c_size_t),value,intent(in) :: maxlen
  319. end subroutine fstarpu_worker_get_type_as_string
  320. ! int starpu_bindid_get_workerids(int bindid, int **workerids);
  321. ! == starpu_task.h ==
  322. ! void starpu_tag_declare_deps(starpu_tag_t id, unsigned ndeps, ...);
  323. ! void starpu_tag_declare_deps_array(starpu_tag_t id, unsigned ndeps, starpu_tag_t *array);
  324. subroutine fstarpu_tag_declare_deps_array(id,ndeps,tag_array) bind(C,name="starpu_tag_declare_deps_array")
  325. use iso_c_binding, only: c_int, c_long_long
  326. integer(c_int), value, intent(in) :: id
  327. integer(c_int), value, intent(in) :: ndeps
  328. integer(c_long_long), intent(in) :: tag_array(*)
  329. end subroutine fstarpu_tag_declare_deps_array
  330. ! void starpu_task_declare_deps_array(struct starpu_task *task, unsigned ndeps, struct starpu_task *task_array[]);
  331. subroutine fstarpu_task_declare_deps_array(task,ndeps,task_array) bind(C,name="starpu_task_declare_deps_array")
  332. use iso_c_binding, only: c_int, c_ptr
  333. type(c_ptr), value, intent(in) :: task
  334. integer(c_int), value, intent(in) :: ndeps
  335. type(c_ptr), intent(in) :: task_array(*)
  336. end subroutine fstarpu_task_declare_deps_array
  337. ! int starpu_tag_wait(starpu_tag_t id);
  338. function fstarpu_tag_wait(id) bind(C,name="starpu_tag_wait")
  339. use iso_c_binding, only: c_int, c_long_long
  340. integer(c_int) :: fstarpu_tag_wait
  341. integer(c_long_long), value, intent(in) :: id
  342. end function fstarpu_tag_wait
  343. ! int starpu_tag_wait_array(unsigned ntags, starpu_tag_t *id);
  344. function fstarpu_tag_wait_array(ntags,tag_array) bind(C,name="starpu_tag_wait_array")
  345. use iso_c_binding, only: c_int, c_long_long
  346. integer(c_int) :: fstarpu_tag_wait_array
  347. integer(c_int), value, intent(in) :: ntags
  348. integer(c_long_long), intent(in) :: tag_array(*)
  349. end function fstarpu_tag_wait_array
  350. ! void starpu_tag_notify_from_apps(starpu_tag_t id);
  351. subroutine fstarpu_tag_notify_from_apps(id) bind(C,name="starpu_tag_notify_from_apps")
  352. use iso_c_binding, only: c_long_long
  353. integer(c_long_long), value, intent(in) :: id
  354. end subroutine fstarpu_tag_notify_from_apps
  355. ! void starpu_tag_restart(starpu_tag_t id);
  356. subroutine fstarpu_tag_restart(id) bind(C,name="starpu_tag_restart")
  357. use iso_c_binding, only: c_long_long
  358. integer(c_long_long), value, intent(in) :: id
  359. end subroutine fstarpu_tag_restart
  360. ! void starpu_tag_remove(starpu_tag_t id);
  361. subroutine fstarpu_tag_remove(id) bind(C,name="starpu_tag_remove")
  362. use iso_c_binding, only: c_long_long
  363. integer(c_long_long), value, intent(in) :: id
  364. end subroutine fstarpu_tag_remove
  365. ! struct starpu_task *starpu_tag_get_task(starpu_tag_t id);
  366. function fstarpu_tag_get_task(id) bind(C,name="starpu_tag_get_task")
  367. use iso_c_binding, only: c_ptr, c_long_long
  368. type(c_ptr) :: fstarpu_tag_get_task
  369. integer(c_long_long), value, intent(in) :: id
  370. end function fstarpu_tag_get_task
  371. ! void starpu_task_init(struct starpu_task *task);
  372. subroutine fstarpu_task_init (task) bind(C,name="starpu_task_init")
  373. use iso_c_binding, only: c_ptr
  374. type(c_ptr), value, intent(in) :: task
  375. end subroutine fstarpu_task_init
  376. ! void starpu_task_clean(struct starpu_task *task);
  377. subroutine fstarpu_task_clean (task) bind(C,name="starpu_task_clean")
  378. use iso_c_binding, only: c_ptr
  379. type(c_ptr), value, intent(in) :: task
  380. end subroutine fstarpu_task_clean
  381. ! struct starpu_task *starpu_task_create(void) STARPU_ATTRIBUTE_MALLOC;
  382. function fstarpu_task_create () bind(C,name="starpu_task_create")
  383. use iso_c_binding, only: c_ptr
  384. type(c_ptr) :: fstarpu_task_create
  385. end function fstarpu_task_create
  386. ! void starpu_task_destroy(struct starpu_task *task);
  387. subroutine fstarpu_task_destroy (task) bind(C,name="starpu_task_destroy")
  388. use iso_c_binding, only: c_ptr
  389. type(c_ptr), value, intent(in) :: task
  390. end subroutine fstarpu_task_destroy
  391. ! int starpu_task_submit(struct starpu_task *task) STARPU_WARN_UNUSED_RESULT;
  392. function fstarpu_task_submit (task) bind(C,name="starpu_task_submit")
  393. use iso_c_binding, only: c_int,c_ptr
  394. integer(c_int) :: fstarpu_task_submit
  395. type(c_ptr), value, intent(in) :: task
  396. end function fstarpu_task_submit
  397. ! int starpu_task_submit_to_ctx(struct starpu_task *task, unsigned sched_ctx_id);
  398. function fstarpu_task_submit_to_ctx (task,sched_ctx_id) bind(C,name="starpu_task_submit_to_ctx")
  399. use iso_c_binding, only: c_int,c_ptr
  400. integer(c_int) :: fstarpu_task_submit_to_ctx
  401. type(c_ptr), value, intent(in) :: task
  402. integer(c_int), value, intent(in) :: sched_ctx_id
  403. end function fstarpu_task_submit_to_ctx
  404. ! int starpu_task_finished(struct starpu_task *task) STARPU_WARN_UNUSED_RESULT;
  405. function fstarpu_task_finished (task) bind(C,name="starpu_task_finished")
  406. use iso_c_binding, only: c_int,c_ptr
  407. integer(c_int) :: fstarpu_task_finished
  408. type(c_ptr), value, intent(in) :: task
  409. end function fstarpu_task_finished
  410. ! int starpu_task_wait(struct starpu_task *task) STARPU_WARN_UNUSED_RESULT;
  411. function fstarpu_task_wait (task) bind(C,name="starpu_task_wait")
  412. use iso_c_binding, only: c_int,c_ptr
  413. integer(c_int) :: fstarpu_task_wait
  414. type(c_ptr), value, intent(in) :: task
  415. end function fstarpu_task_wait
  416. ! int starpu_task_wait_array(struct starpu_task **tasks, unsigned nb_tasks) STARPU_WARN_UNUSED_RESULT;
  417. function fstarpu_task_wait_array(task_array,ntasks) bind(C,name="starpu_task_wait_array")
  418. use iso_c_binding, only: c_int, c_ptr
  419. integer(c_int) :: fstarpu_task_wait_array
  420. integer(c_int), value, intent(in) :: ntasks
  421. type(c_ptr), intent(in) :: task_array
  422. end function fstarpu_task_wait_array
  423. ! int starpu_task_wait_for_all(void);
  424. subroutine fstarpu_task_wait_for_all () bind(C,name="starpu_task_wait_for_all")
  425. end subroutine fstarpu_task_wait_for_all
  426. ! int starpu_task_wait_for_n_submitted(unsigned n);
  427. subroutine fstarpu_task_wait_for_n_submitted (n) bind(C,name="starpu_task_wait_for_n_submitted")
  428. use iso_c_binding, only: c_int
  429. integer(c_int), value, intent(in) :: n
  430. end subroutine fstarpu_task_wait_for_n_submitted
  431. ! int starpu_task_wait_for_all_in_ctx(unsigned sched_ctx_id);
  432. subroutine fstarpu_task_wait_for_all_in_ctx (ctx) bind(C,name="starpu_task_wait_for_all_in_ctx")
  433. use iso_c_binding, only: c_int
  434. integer(c_int), value, intent(in) :: ctx
  435. end subroutine fstarpu_task_wait_for_all_in_ctx
  436. ! int starpu_task_wait_for_n_submitted_in_ctx(unsigned sched_ctx_id, unsigned n);
  437. subroutine fstarpu_task_wait_for_n_submitted_in_ctx (ctx,n) bind(C,name="starpu_task_wait_for_n_submitted_in_ctx")
  438. use iso_c_binding, only: c_int
  439. integer(c_int), value, intent(in) :: ctx
  440. integer(c_int), value, intent(in) :: n
  441. end subroutine fstarpu_task_wait_for_n_submitted_in_ctx
  442. ! int starpu_task_wait_for_no_ready(void);
  443. function fstarpu_task_wait_for_no_ready () bind(C,name="starpu_task_wait_for_no_ready")
  444. use iso_c_binding, only: c_int
  445. integer(c_int) :: fstarpu_task_wait_for_no_ready
  446. end function fstarpu_task_wait_for_no_ready
  447. ! int starpu_task_nready(void);
  448. function fstarpu_task_nready () bind(C,name="starpu_task_nready")
  449. use iso_c_binding, only: c_int
  450. integer(c_int) :: fstarpu_task_nready
  451. end function fstarpu_task_nready
  452. ! int starpu_task_nsubmitted(void);
  453. function fstarpu_task_nsubmitted () bind(C,name="starpu_task_nsubmitted")
  454. use iso_c_binding, only: c_int
  455. integer(c_int) :: fstarpu_task_nsubmitted
  456. end function fstarpu_task_nsubmitted
  457. ! void starpu_do_schedule(void);
  458. subroutine fstarpu_do_schedule () bind(C,name="starpu_do_schedule")
  459. end subroutine fstarpu_do_schedule
  460. ! starpu_codelet_init
  461. subroutine fstarpu_codelet_init (codelet) bind(C,name="starpu_codelet_init")
  462. use iso_c_binding, only: c_ptr
  463. type(c_ptr), value, intent(in) :: codelet
  464. end subroutine fstarpu_codelet_init
  465. ! starpu_codelet_display_stats
  466. subroutine fstarpu_codelet_display_stats (codelet) bind(C,name="starpu_codelet_display_stats")
  467. use iso_c_binding, only: c_ptr
  468. type(c_ptr), value, intent(in) :: codelet
  469. end subroutine fstarpu_codelet_display_stats
  470. ! struct starpu_task *starpu_task_get_current(void);
  471. function fstarpu_task_get_current () bind(C,name="starpu_task_get_current")
  472. use iso_c_binding, only: c_ptr
  473. type(c_ptr) :: fstarpu_task_get_current
  474. end function fstarpu_task_get_current
  475. ! void starpu_parallel_task_barrier_init(struct starpu_task *task, int workerid);
  476. subroutine fstarpu_parallel_task_barrier_init_init (task,id) &
  477. bind(C,name="starpu_parallel_task_barrier_init_init")
  478. use iso_c_binding, only: c_ptr, c_int
  479. type(c_ptr), value, intent(in) :: task
  480. integer(c_int), value, intent(in) :: id
  481. end subroutine fstarpu_parallel_task_barrier_init_init
  482. ! void starpu_parallel_task_barrier_init_n(struct starpu_task *task, int worker_size);
  483. subroutine fstarpu_parallel_task_barrier_init_n_init_n (task,sz) &
  484. bind(C,name="starpu_parallel_task_barrier_init_n_init_n")
  485. use iso_c_binding, only: c_ptr, c_int
  486. type(c_ptr), value, intent(in) :: task
  487. integer(c_int), value, intent(in) :: sz
  488. end subroutine fstarpu_parallel_task_barrier_init_n_init_n
  489. ! struct starpu_task *starpu_task_dup(struct starpu_task *task);
  490. function fstarpu_task_dup (task) bind(C,name="starpu_task_dup")
  491. use iso_c_binding, only: c_ptr
  492. type(c_ptr) :: fstarpu_task_dup
  493. type(c_ptr), value, intent(in) :: task
  494. end function fstarpu_task_dup
  495. ! void starpu_task_set_implementation(struct starpu_task *task, unsigned impl);
  496. subroutine fstarpu_task_set_implementation (task,impl) &
  497. bind(C,name="starpu_task_set_implementation")
  498. use iso_c_binding, only: c_ptr,c_int
  499. type(c_ptr), value, intent(in) :: task
  500. integer(c_int), value, intent(in) :: impl
  501. end subroutine fstarpu_task_set_implementation
  502. ! unsigned starpu_task_get_implementation(struct starpu_task *task);
  503. function fstarpu_task_get_implementation (task) &
  504. bind(C,name="starpu_task_get_implementation")
  505. use iso_c_binding, only: c_ptr,c_int
  506. type(c_ptr), value, intent(in) :: task
  507. integer(c_int) :: fstarpu_task_get_implementation
  508. end function fstarpu_task_get_implementation
  509. ! --
  510. function fstarpu_codelet_allocate () bind(C)
  511. use iso_c_binding, only: c_ptr
  512. type(c_ptr) :: fstarpu_codelet_allocate
  513. end function fstarpu_codelet_allocate
  514. subroutine fstarpu_codelet_free (cl) bind(C)
  515. use iso_c_binding, only: c_ptr
  516. type(c_ptr), value, intent(in) :: cl
  517. end subroutine fstarpu_codelet_free
  518. subroutine fstarpu_codelet_set_name (cl, cl_name) bind(C)
  519. use iso_c_binding, only: c_ptr, c_char
  520. type(c_ptr), value, intent(in) :: cl
  521. character(c_char), intent(in) :: cl_name
  522. end subroutine fstarpu_codelet_set_name
  523. subroutine fstarpu_codelet_add_cpu_func (cl, f_ptr) bind(C)
  524. use iso_c_binding, only: c_ptr, c_funptr
  525. type(c_ptr), value, intent(in) :: cl
  526. type(c_funptr), value, intent(in) :: f_ptr
  527. end subroutine fstarpu_codelet_add_cpu_func
  528. subroutine fstarpu_codelet_add_cuda_func (cl, f_ptr) bind(C)
  529. use iso_c_binding, only: c_ptr, c_funptr
  530. type(c_ptr), value, intent(in) :: cl
  531. type(c_funptr), value, intent(in) :: f_ptr
  532. end subroutine fstarpu_codelet_add_cuda_func
  533. subroutine fstarpu_codelet_add_opencl_func (cl, f_ptr) bind(C)
  534. use iso_c_binding, only: c_ptr, c_funptr
  535. type(c_ptr), value, intent(in) :: cl
  536. type(c_funptr), value, intent(in) :: f_ptr
  537. end subroutine fstarpu_codelet_add_opencl_func
  538. subroutine fstarpu_codelet_add_mic_func (cl, f_ptr) bind(C)
  539. use iso_c_binding, only: c_ptr, c_funptr
  540. type(c_ptr), value, intent(in) :: cl
  541. type(c_funptr), value, intent(in) :: f_ptr
  542. end subroutine fstarpu_codelet_add_mic_func
  543. subroutine fstarpu_codelet_add_scc_func (cl, f_ptr) bind(C)
  544. use iso_c_binding, only: c_ptr, c_funptr
  545. type(c_ptr), value, intent(in) :: cl
  546. type(c_funptr), value, intent(in) :: f_ptr
  547. end subroutine fstarpu_codelet_add_scc_func
  548. subroutine fstarpu_codelet_add_buffer (cl, mode) bind(C)
  549. use iso_c_binding, only: c_ptr
  550. type(c_ptr), value, intent(in) :: cl
  551. type(c_ptr), value, intent(in) :: mode ! C function expects an intptr_t
  552. end subroutine fstarpu_codelet_add_buffer
  553. subroutine fstarpu_codelet_set_nbuffers (cl, nbuffers) bind(C)
  554. use iso_c_binding, only: c_ptr,c_int
  555. type(c_ptr), value, intent(in) :: cl
  556. integer(c_int), value, intent(in) :: nbuffers
  557. end subroutine fstarpu_codelet_set_nbuffers
  558. ! == starpu_data_interface.h ==
  559. ! uintptr_t starpu_malloc_on_node_flags(unsigned dst_node, size_t size, int flags);
  560. ! uintptr_t starpu_malloc_on_node(unsigned dst_node, size_t size);
  561. function fstarpu_malloc_on_node(node,sz) bind(C,name="starpu_malloc_on_node")
  562. use iso_c_binding, only: c_int,c_intptr_t,c_size_t
  563. integer(c_intptr_t) :: fstarpu_malloc_on_node
  564. integer(c_int), value, intent(in) :: node
  565. integer(c_size_t), value, intent(in) :: sz
  566. end function fstarpu_malloc_on_node
  567. ! void starpu_free_on_node_flags(unsigned dst_node, uintptr_t addr, size_t size, int flags);
  568. ! void starpu_free_on_node(unsigned dst_node, uintptr_t addr, size_t size);
  569. subroutine fstarpu_free_on_node(node,addr,sz) bind(C,name="starpu_free_on_node")
  570. use iso_c_binding, only: c_int,c_intptr_t,c_size_t
  571. integer(c_int), value, intent(in) :: node
  572. integer(c_intptr_t), value, intent(in) :: addr
  573. integer(c_size_t), value, intent(in) :: sz
  574. end subroutine fstarpu_free_on_node
  575. ! void starpu_malloc_on_node_set_default_flags(unsigned node, int flags);
  576. ! int starpu_data_interface_get_next_id(void);
  577. ! void starpu_data_register(starpu_data_handle_t *handleptr, unsigned home_node, void *data_interface, struct starpu_data_interface_ops *ops);
  578. ! void starpu_data_ptr_register(starpu_data_handle_t handle, unsigned node);
  579. subroutine fstarpug_data_ptr_register (dh,node) bind(C,name="starpu_data_ptr_register")
  580. use iso_c_binding, only: c_ptr, c_int
  581. type(c_ptr), value, intent(in) :: dh
  582. integer(c_int), value, intent(in) :: node
  583. end subroutine fstarpug_data_ptr_register
  584. ! void starpu_data_register_same(starpu_data_handle_t *handledst, starpu_data_handle_t handlesrc);
  585. subroutine fstarpu_data_register_same (dh_dst,dh_src) bind(C,name="starpu_data_register_same")
  586. use iso_c_binding, only: c_ptr
  587. type(c_ptr), intent(out) :: dh_dst
  588. type(c_ptr), value, intent(in) :: dh_src
  589. end subroutine fstarpu_data_register_same
  590. ! void *starpu_data_handle_to_pointer(starpu_data_handle_t handle, unsigned node);
  591. function fstarpu_data_handle_to_pointer (dh,node) bind(C,name="starpu_data_handle_to_pointer")
  592. use iso_c_binding, only: c_ptr, c_int
  593. type(c_ptr) :: fstarpu_data_handle_to_pointer
  594. type(c_ptr), value, intent(in) :: dh
  595. integer(c_int), value, intent(in) :: node
  596. end function fstarpu_data_handle_to_pointer
  597. ! void *starpu_data_get_local_ptr(starpu_data_handle_t handle);
  598. function fstarpu_data_get_local_ptr (dh) bind(C,name="starpu_data_get_local_ptr")
  599. use iso_c_binding, only: c_ptr, c_int
  600. type(c_ptr) :: fstarpu_data_get_local_ptr
  601. type(c_ptr), value, intent(in) :: dh
  602. end function fstarpu_data_get_local_ptr
  603. ! void *starpu_data_get_interface_on_node(starpu_data_handle_t handle, unsigned memory_node);
  604. ! == starpu_data_interface.h: block ==
  605. ! 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);
  606. subroutine fstarpu_block_data_register(dh, home_node, ptr, ldy, ldz, nx, ny, nz, elt_size) &
  607. bind(C,name="starpu_block_data_register")
  608. use iso_c_binding, only: c_ptr, c_int, c_size_t
  609. type(c_ptr), intent(out) :: dh
  610. integer(c_int), value, intent(in) :: home_node
  611. type(c_ptr), value, intent(in) :: ptr
  612. integer(c_int), value, intent(in) :: ldy
  613. integer(c_int), value, intent(in) :: ldz
  614. integer(c_int), value, intent(in) :: nx
  615. integer(c_int), value, intent(in) :: ny
  616. integer(c_int), value, intent(in) :: nz
  617. integer(c_size_t), value, intent(in) :: elt_size
  618. end subroutine fstarpu_block_data_register
  619. ! 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);
  620. subroutine fstarpu_block_ptr_register(dh, node, ptr, dev_handle, offset, ldy, ldz) &
  621. bind(C,name="starpu_block_ptr_register")
  622. use iso_c_binding, only: c_ptr, c_int, c_size_t
  623. type(c_ptr), intent(out) :: dh
  624. integer(c_int), value, intent(in) :: node
  625. type(c_ptr), value, intent(in) :: ptr
  626. type(c_ptr), value, intent(in) :: dev_handle
  627. integer(c_size_t), value, intent(in) :: offset
  628. integer(c_int), value, intent(in) :: ldy
  629. integer(c_int), value, intent(in) :: ldz
  630. end subroutine fstarpu_block_ptr_register
  631. function fstarpu_block_get_ptr(buffers, i) bind(C)
  632. use iso_c_binding, only: c_ptr, c_int
  633. type(c_ptr) :: fstarpu_block_get_ptr
  634. type(c_ptr), value, intent(in) :: buffers
  635. integer(c_int), value, intent(in) :: i
  636. end function fstarpu_block_get_ptr
  637. function fstarpu_block_get_ldy(buffers, i) bind(C)
  638. use iso_c_binding, only: c_ptr, c_int
  639. integer(c_int) :: fstarpu_block_get_ldy
  640. type(c_ptr), value, intent(in) :: buffers
  641. integer(c_int), value, intent(in) :: i
  642. end function fstarpu_block_get_ldy
  643. function fstarpu_block_get_ldz(buffers, i) bind(C)
  644. use iso_c_binding, only: c_ptr, c_int
  645. integer(c_int) :: fstarpu_block_get_ldz
  646. type(c_ptr), value, intent(in) :: buffers
  647. integer(c_int), value, intent(in) :: i
  648. end function fstarpu_block_get_ldz
  649. function fstarpu_block_get_nx(buffers, i) bind(C)
  650. use iso_c_binding, only: c_ptr, c_int
  651. integer(c_int) :: fstarpu_block_get_nx
  652. type(c_ptr), value, intent(in) :: buffers
  653. integer(c_int), value, intent(in) :: i
  654. end function fstarpu_block_get_nx
  655. function fstarpu_block_get_ny(buffers, i) bind(C)
  656. use iso_c_binding, only: c_ptr, c_int
  657. integer(c_int) :: fstarpu_block_get_ny
  658. type(c_ptr), value, intent(in) :: buffers
  659. integer(c_int), value, intent(in) :: i
  660. end function fstarpu_block_get_ny
  661. function fstarpu_block_get_nz(buffers, i) bind(C)
  662. use iso_c_binding, only: c_ptr, c_int
  663. integer(c_int) :: fstarpu_block_get_nz
  664. type(c_ptr), value, intent(in) :: buffers
  665. integer(c_int), value, intent(in) :: i
  666. end function fstarpu_block_get_nz
  667. ! == starpu_data_interface.h: matrix ==
  668. ! 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);
  669. subroutine fstarpu_matrix_data_register(dh, home_node, ptr, ld, nx, ny, elt_size) &
  670. bind(C,name="starpu_matrix_data_register")
  671. use iso_c_binding, only: c_ptr, c_int, c_size_t
  672. type(c_ptr), intent(out) :: dh
  673. integer(c_int), value, intent(in) :: home_node
  674. type(c_ptr), value, intent(in) :: ptr
  675. integer(c_int), value, intent(in) :: ld
  676. integer(c_int), value, intent(in) :: nx
  677. integer(c_int), value, intent(in) :: ny
  678. integer(c_size_t), value, intent(in) :: elt_size
  679. end subroutine fstarpu_matrix_data_register
  680. ! 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);
  681. subroutine fstarpu_matrix_ptr_register(dh, node, ptr, dev_handle, offset, ld) &
  682. bind(C,name="starpu_matrix_ptr_register")
  683. use iso_c_binding, only: c_ptr, c_int, c_size_t
  684. type(c_ptr), intent(out) :: dh
  685. integer(c_int), value, intent(in) :: node
  686. type(c_ptr), value, intent(in) :: ptr
  687. type(c_ptr), value, intent(in) :: dev_handle
  688. integer(c_size_t), value, intent(in) :: offset
  689. integer(c_int), value, intent(in) :: ld
  690. end subroutine fstarpu_matrix_ptr_register
  691. function fstarpu_matrix_get_ptr(buffers, i) bind(C)
  692. use iso_c_binding, only: c_ptr, c_int
  693. type(c_ptr) :: fstarpu_matrix_get_ptr
  694. type(c_ptr), value, intent(in) :: buffers
  695. integer(c_int), value, intent(in) :: i
  696. end function fstarpu_matrix_get_ptr
  697. function fstarpu_matrix_get_ld(buffers, i) bind(C)
  698. use iso_c_binding, only: c_ptr, c_int
  699. integer(c_int) :: fstarpu_matrix_get_ld
  700. type(c_ptr), value, intent(in) :: buffers
  701. integer(c_int), value, intent(in) :: i
  702. end function fstarpu_matrix_get_ld
  703. function fstarpu_matrix_get_nx(buffers, i) bind(C)
  704. use iso_c_binding, only: c_ptr, c_int
  705. integer(c_int) :: fstarpu_matrix_get_nx
  706. type(c_ptr), value, intent(in) :: buffers
  707. integer(c_int), value, intent(in) :: i
  708. end function fstarpu_matrix_get_nx
  709. function fstarpu_matrix_get_ny(buffers, i) bind(C)
  710. use iso_c_binding, only: c_ptr, c_int
  711. integer(c_int) :: fstarpu_matrix_get_ny
  712. type(c_ptr), value, intent(in) :: buffers
  713. integer(c_int), value, intent(in) :: i
  714. end function fstarpu_matrix_get_ny
  715. ! == starpu_data_interface.h: vector ==
  716. ! void starpu_vector_data_register(starpu_data_handle_t *handle, unsigned home_node, uintptr_t ptr, uint32_t nx, size_t elemsize);
  717. subroutine fstarpu_vector_data_register(dh, home_node, ptr,nx, elt_size) &
  718. bind(C,name="starpu_vector_data_register")
  719. use iso_c_binding, only: c_ptr, c_int, c_size_t
  720. type(c_ptr), intent(out) :: dh
  721. integer(c_int), value, intent(in) :: home_node
  722. type(c_ptr), value, intent(in) :: ptr
  723. integer(c_int), value, intent(in) :: nx
  724. integer(c_size_t), value, intent(in) :: elt_size
  725. end subroutine fstarpu_vector_data_register
  726. ! void starpu_vector_ptr_register(starpu_data_handle_t handle, unsigned node, uintptr_t ptr, uintptr_t dev_handle, size_t offset);
  727. subroutine fstarpu_vector_ptr_register(dh, node, ptr, dev_handle, offset, ld) &
  728. bind(C,name="starpu_vector_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. end subroutine fstarpu_vector_ptr_register
  736. function fstarpu_vector_get_ptr(buffers, i) bind(C)
  737. use iso_c_binding, only: c_ptr, c_int
  738. type(c_ptr) :: fstarpu_vector_get_ptr
  739. type(c_ptr), value, intent(in) :: buffers
  740. integer(c_int), value, intent(in) :: i
  741. end function fstarpu_vector_get_ptr
  742. function fstarpu_vector_get_nx(buffers, i) bind(C)
  743. use iso_c_binding, only: c_ptr, c_int
  744. integer(c_int) :: fstarpu_vector_get_nx
  745. type(c_ptr), value, intent(in) :: buffers
  746. integer(c_int), value, intent(in) :: i
  747. end function fstarpu_vector_get_nx
  748. ! == starpu_data_interface.h: variable ==
  749. ! void starpu_variable_data_register(starpu_data_handle_t *handle, unsigned home_node, uintptr_t ptr, size_t size);
  750. subroutine fstarpu_variable_data_register(dh, home_node, ptr, elt_size) &
  751. bind(C,name="starpu_variable_data_register")
  752. use iso_c_binding, only: c_ptr, c_int, c_size_t
  753. type(c_ptr), intent(out) :: dh
  754. integer(c_int), value, intent(in) :: home_node
  755. type(c_ptr), value, intent(in) :: ptr
  756. integer(c_size_t), value, intent(in) :: elt_size
  757. end subroutine fstarpu_variable_data_register
  758. ! void starpu_variable_ptr_register(starpu_data_handle_t handle, unsigned node, uintptr_t ptr, uintptr_t dev_handle, size_t offset);
  759. subroutine fstarpu_variable_ptr_register(dh, node, ptr, dev_handle, offset, ld) &
  760. bind(C,name="starpu_variable_ptr_register")
  761. use iso_c_binding, only: c_ptr, c_int, c_size_t
  762. type(c_ptr), intent(out) :: dh
  763. integer(c_int), value, intent(in) :: node
  764. type(c_ptr), value, intent(in) :: ptr
  765. type(c_ptr), value, intent(in) :: dev_handle
  766. integer(c_size_t), value, intent(in) :: offset
  767. end subroutine fstarpu_variable_ptr_register
  768. function fstarpu_variable_get_ptr(buffers, i) bind(C)
  769. use iso_c_binding, only: c_ptr, c_int
  770. type(c_ptr) :: fstarpu_variable_get_ptr
  771. type(c_ptr), value, intent(in) :: buffers
  772. integer(c_int), value, intent(in) :: i
  773. end function fstarpu_variable_get_ptr
  774. ! == starpu_data_interface.h: void ==
  775. ! void starpu_void_data_register(starpu_data_handle_t *handle);
  776. subroutine fstarpu_void_data_register(dh) &
  777. bind(C,name="starpu_void_data_register")
  778. use iso_c_binding, only: c_ptr, c_int, c_size_t
  779. type(c_ptr), intent(out) :: dh
  780. end subroutine fstarpu_void_data_register
  781. ! == starpu_data_filter.h ==
  782. ! void starpu_data_partition(starpu_data_handle_t initial_handle, struct starpu_data_filter *f);
  783. subroutine fstarpu_data_partition (dh,filter) bind(C,name="starpu_data_partition")
  784. use iso_c_binding, only: c_ptr
  785. type(c_ptr), value, intent(in) :: dh
  786. type(c_ptr), value, intent(in) :: filter
  787. end subroutine fstarpu_data_partition
  788. ! void starpu_data_unpartition(starpu_data_handle_t root_data, unsigned gathering_node);
  789. subroutine fstarpug_data_data_unpartition (root_dh,gathering_node) bind(C,name="starpu_data_data_unpartition")
  790. use iso_c_binding, only: c_ptr, c_int
  791. type(c_ptr), value, intent(in) :: root_dh
  792. integer(c_int), value, intent(in) :: gathering_node
  793. end subroutine fstarpug_data_data_unpartition
  794. ! void starpu_data_partition_plan(starpu_data_handle_t initial_handle, struct starpu_data_filter *f, starpu_data_handle_t *children);
  795. subroutine fstarpu_data_partition_plan (dh,filter,children) &
  796. bind(C,name="starpu_data_partition_plan")
  797. use iso_c_binding, only: c_ptr
  798. type(c_ptr), value, intent(in) :: dh
  799. type(c_ptr), value, intent(in) :: filter
  800. type(c_ptr), intent(in) :: children(*)
  801. end subroutine fstarpu_data_partition_plan
  802. ! void starpu_data_partition_submit(starpu_data_handle_t initial_handle, unsigned nparts, starpu_data_handle_t *children);
  803. subroutine fstarpu_data_partition_submit (dh,nparts,children) &
  804. bind(C,name="starpu_data_partition_submit")
  805. use iso_c_binding, only: c_ptr, c_int
  806. type(c_ptr), value, intent(in) :: dh
  807. integer(c_int), value, intent(in) :: nparts
  808. type(c_ptr), intent(in) :: children(*)
  809. end subroutine fstarpu_data_partition_submit
  810. ! void starpu_data_partition_readonly_submit(starpu_data_handle_t initial_handle, unsigned nparts, starpu_data_handle_t *children);
  811. subroutine fstarpu_data_partition_readonly_submit (dh,nparts,children) &
  812. bind(C,name="starpu_data_partition_readonly_submit")
  813. use iso_c_binding, only: c_ptr, c_int
  814. type(c_ptr), value, intent(in) :: dh
  815. integer(c_int), value, intent(in) :: nparts
  816. type(c_ptr), intent(in) :: children(*)
  817. end subroutine fstarpu_data_partition_readonly_submit
  818. ! void starpu_data_partition_readwrite_upgrade_submit(starpu_data_handle_t initial_handle, unsigned nparts, starpu_data_handle_t *children);
  819. subroutine fstarpu_data_partition_readwrite_upgrade_submit (dh,nparts,children) &
  820. bind(C,name="starpu_data_partition_readwrite_upgrade_submit")
  821. use iso_c_binding, only: c_ptr, c_int
  822. type(c_ptr), value, intent(in) :: dh
  823. integer(c_int), value, intent(in) :: nparts
  824. type(c_ptr), intent(in) :: children(*)
  825. end subroutine fstarpu_data_partition_readwrite_upgrade_submit
  826. ! void starpu_data_unpartition_submit(starpu_data_handle_t initial_handle, unsigned nparts, starpu_data_handle_t *children, int gathering_node);
  827. subroutine fstarpu_data_unpartition_submit (dh,nparts,children,gathering_node) &
  828. bind(C,name="starpu_data_unpartition_submit")
  829. use iso_c_binding, only: c_ptr, c_int
  830. type(c_ptr), value, intent(in) :: dh
  831. integer(c_int), value, intent(in) :: nparts
  832. type(c_ptr), intent(in) :: children(*)
  833. integer(c_int), value, intent(in) :: gathering_node
  834. end subroutine fstarpu_data_unpartition_submit
  835. ! void starpu_data_unpartition_readonly_submit(starpu_data_handle_t initial_handle, unsigned nparts, starpu_data_handle_t *children, int gathering_node);
  836. subroutine fstarpu_data_unpartition_readonly_submit (dh,nparts,children,gathering_node) &
  837. bind(C,name="starpu_data_unpartition_readonly_submit")
  838. use iso_c_binding, only: c_ptr, c_int
  839. type(c_ptr), value, intent(in) :: dh
  840. integer(c_int), value, intent(in) :: nparts
  841. type(c_ptr), intent(in) :: children(*)
  842. integer(c_int), value, intent(in) :: gathering_node
  843. end subroutine fstarpu_data_unpartition_readonly_submit
  844. ! void starpu_data_partition_clean(starpu_data_handle_t root_data, unsigned nparts, starpu_data_handle_t *children);
  845. subroutine fstarpu_data_partition_clean (dh,nparts,children) &
  846. bind(C,name="starpu_data_partition_clean")
  847. use iso_c_binding, only: c_ptr, c_int
  848. type(c_ptr), value, intent(in) :: dh
  849. integer(c_int), value, intent(in) :: nparts
  850. type(c_ptr), intent(in) :: children(*)
  851. end subroutine fstarpu_data_partition_clean
  852. ! int starpu_data_get_nb_children(starpu_data_handle_t handle);
  853. function fstarpu_data_get_nb_children(dh) bind(C,name="starpu_data_get_nb_children")
  854. use iso_c_binding, only: c_ptr, c_int
  855. integer(c_int) :: fstarpu_data_get_nb_children
  856. type(c_ptr), value, intent(in) :: dh
  857. end function fstarpu_data_get_nb_children
  858. ! starpu_data_handle_t starpu_data_get_child(starpu_data_handle_t handle, unsigned i);
  859. function fstarpu_data_get_child(dh,i) bind(C,name="starpu_data_get_child")
  860. use iso_c_binding, only: c_ptr, c_int
  861. type(c_ptr) :: fstarpu_data_get_child
  862. type(c_ptr), value, intent(in) :: dh
  863. integer(c_int), value, intent(in) :: i
  864. end function fstarpu_data_get_child
  865. ! starpu_data_handle_t starpu_data_get_sub_data(starpu_data_handle_t root_data, unsigned depth, ... );
  866. ! starpu_data_handle_t starpu_data_vget_sub_data(starpu_data_handle_t root_data, unsigned depth, va_list pa);
  867. ! void starpu_matrix_filter_block(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  868. subroutine fstarpu_matrix_filter_block (father_interface,child_interface,filter,id,nparts) &
  869. bind(C,name="starpu_matrix_filter_block")
  870. use iso_c_binding, only: c_ptr
  871. type(c_ptr), value, intent(in) :: father_interface
  872. type(c_ptr), value, intent(in) :: child_interface
  873. type(c_ptr), value, intent(in) :: filter
  874. type(c_ptr), value, intent(in) :: id
  875. type(c_ptr), value, intent(in) :: nparts
  876. end subroutine fstarpu_matrix_filter_block
  877. ! void starpu_matrix_filter_block_shadow(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  878. subroutine fstarpu_matrix_filter_block_shadow (father_interface,child_interface,filter,id,nparts) &
  879. bind(C,name="starpu_matrix_filter_block_shadow")
  880. use iso_c_binding, only: c_ptr
  881. type(c_ptr), value, intent(in) :: father_interface
  882. type(c_ptr), value, intent(in) :: child_interface
  883. type(c_ptr), value, intent(in) :: filter
  884. type(c_ptr), value, intent(in) :: id
  885. type(c_ptr), value, intent(in) :: nparts
  886. end subroutine fstarpu_matrix_filter_block_shadow
  887. ! void starpu_matrix_filter_vertical_block(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  888. subroutine fstarpu_matrix_filter_vertical_block (father_interface,child_interface,filter,id,nparts) &
  889. bind(C,name="starpu_matrix_filter_vertical_block")
  890. use iso_c_binding, only: c_ptr
  891. type(c_ptr), value, intent(in) :: father_interface
  892. type(c_ptr), value, intent(in) :: child_interface
  893. type(c_ptr), value, intent(in) :: filter
  894. type(c_ptr), value, intent(in) :: id
  895. type(c_ptr), value, intent(in) :: nparts
  896. end subroutine fstarpu_matrix_filter_vertical_block
  897. ! void starpu_matrix_filter_vertical_block_shadow(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  898. subroutine fstarpu_matrix_filter_vertical_block_shadow (father_interface,child_interface,filter,id,nparts) &
  899. bind(C,name="starpu_matrix_filter_vertical_block_shadow")
  900. use iso_c_binding, only: c_ptr
  901. type(c_ptr), value, intent(in) :: father_interface
  902. type(c_ptr), value, intent(in) :: child_interface
  903. type(c_ptr), value, intent(in) :: filter
  904. type(c_ptr), value, intent(in) :: id
  905. type(c_ptr), value, intent(in) :: nparts
  906. end subroutine fstarpu_matrix_filter_vertical_block_shadow
  907. ! void starpu_vector_filter_block(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  908. subroutine fstarpu_vector_filter_block (father_interface,child_interface,filter,id,nparts) &
  909. bind(C,name="starpu_vector_filter_block")
  910. use iso_c_binding, only: c_ptr
  911. type(c_ptr), value, intent(in) :: father_interface
  912. type(c_ptr), value, intent(in) :: child_interface
  913. type(c_ptr), value, intent(in) :: filter
  914. type(c_ptr), value, intent(in) :: id
  915. type(c_ptr), value, intent(in) :: nparts
  916. end subroutine fstarpu_vector_filter_block
  917. ! void starpu_vector_filter_block_shadow(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  918. subroutine fstarpu_vector_filter_block_shadow (father_interface,child_interface,filter,id,nparts) &
  919. bind(C,name="starpu_vector_filter_block_shadow")
  920. use iso_c_binding, only: c_ptr
  921. type(c_ptr), value, intent(in) :: father_interface
  922. type(c_ptr), value, intent(in) :: child_interface
  923. type(c_ptr), value, intent(in) :: filter
  924. type(c_ptr), value, intent(in) :: id
  925. type(c_ptr), value, intent(in) :: nparts
  926. end subroutine fstarpu_vector_filter_block_shadow
  927. ! void starpu_vector_filter_list(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  928. subroutine fstarpu_vector_filter_list (father_interface,child_interface,filter,id,nparts) &
  929. bind(C,name="starpu_vector_filter_list")
  930. use iso_c_binding, only: c_ptr
  931. type(c_ptr), value, intent(in) :: father_interface
  932. type(c_ptr), value, intent(in) :: child_interface
  933. type(c_ptr), value, intent(in) :: filter
  934. type(c_ptr), value, intent(in) :: id
  935. type(c_ptr), value, intent(in) :: nparts
  936. end subroutine fstarpu_vector_filter_list
  937. ! void starpu_vector_filter_divide_in_2(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  938. ! void starpu_vector_filter_list(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  939. subroutine fstarpu_vector_divide_in_2 (father_interface,child_interface,filter,id,nparts) &
  940. bind(C,name="starpu_vector_divide_in_2")
  941. use iso_c_binding, only: c_ptr
  942. type(c_ptr), value, intent(in) :: father_interface
  943. type(c_ptr), value, intent(in) :: child_interface
  944. type(c_ptr), value, intent(in) :: filter
  945. type(c_ptr), value, intent(in) :: id
  946. type(c_ptr), value, intent(in) :: nparts
  947. end subroutine fstarpu_vector_divide_in_2
  948. ! void starpu_block_filter_block(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  949. subroutine fstarpu_block_filter_block (father_interface,child_interface,filter,id,nparts) &
  950. bind(C,name="starpu_block_filter_block")
  951. use iso_c_binding, only: c_ptr
  952. type(c_ptr), value, intent(in) :: father_interface
  953. type(c_ptr), value, intent(in) :: child_interface
  954. type(c_ptr), value, intent(in) :: filter
  955. type(c_ptr), value, intent(in) :: id
  956. type(c_ptr), value, intent(in) :: nparts
  957. end subroutine fstarpu_block_filter_block
  958. ! void starpu_block_filter_block_shadow(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  959. subroutine fstarpu_block_filter_block_shadow (father_interface,child_interface,filter,id,nparts) &
  960. bind(C,name="starpu_block_filter_block_shadow")
  961. use iso_c_binding, only: c_ptr
  962. type(c_ptr), value, intent(in) :: father_interface
  963. type(c_ptr), value, intent(in) :: child_interface
  964. type(c_ptr), value, intent(in) :: filter
  965. type(c_ptr), value, intent(in) :: id
  966. type(c_ptr), value, intent(in) :: nparts
  967. end subroutine fstarpu_block_filter_block_shadow
  968. ! void starpu_block_filter_vertical_block(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  969. subroutine fstarpu_block_filter_vertical_block (father_interface,child_interface,filter,id,nparts) &
  970. bind(C,name="starpu_block_filter_vertical_block")
  971. use iso_c_binding, only: c_ptr
  972. type(c_ptr), value, intent(in) :: father_interface
  973. type(c_ptr), value, intent(in) :: child_interface
  974. type(c_ptr), value, intent(in) :: filter
  975. type(c_ptr), value, intent(in) :: id
  976. type(c_ptr), value, intent(in) :: nparts
  977. end subroutine fstarpu_block_filter_vertical_block
  978. ! void starpu_block_filter_vertical_block_shadow(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  979. subroutine fstarpu_block_filter_vertical_block_shadow (father_interface,child_interface,filter,id,nparts) &
  980. bind(C,name="starpu_block_filter_vertical_block_shadow")
  981. use iso_c_binding, only: c_ptr
  982. type(c_ptr), value, intent(in) :: father_interface
  983. type(c_ptr), value, intent(in) :: child_interface
  984. type(c_ptr), value, intent(in) :: filter
  985. type(c_ptr), value, intent(in) :: id
  986. type(c_ptr), value, intent(in) :: nparts
  987. end subroutine fstarpu_block_filter_vertical_block_shadow
  988. ! void starpu_block_filter_depth_block(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  989. subroutine fstarpu_block_filter_depth_block (father_interface,child_interface,filter,id,nparts) &
  990. bind(C,name="starpu_block_filter_depth_block")
  991. use iso_c_binding, only: c_ptr
  992. type(c_ptr), value, intent(in) :: father_interface
  993. type(c_ptr), value, intent(in) :: child_interface
  994. type(c_ptr), value, intent(in) :: filter
  995. type(c_ptr), value, intent(in) :: id
  996. type(c_ptr), value, intent(in) :: nparts
  997. end subroutine fstarpu_block_filter_depth_block
  998. ! void starpu_block_filter_depth_block_shadow(void *father_interface, void *child_interface, struct starpu_data_filter *f, unsigned id, unsigned nparts);
  999. subroutine fstarpu_block_filter_depth_block_shadow (father_interface,child_interface,filter,id,nparts) &
  1000. bind(C,name="starpu_block_filter_depth_block_shadow")
  1001. use iso_c_binding, only: c_ptr
  1002. type(c_ptr), value, intent(in) :: father_interface
  1003. type(c_ptr), value, intent(in) :: child_interface
  1004. type(c_ptr), value, intent(in) :: filter
  1005. type(c_ptr), value, intent(in) :: id
  1006. type(c_ptr), value, intent(in) :: nparts
  1007. end subroutine fstarpu_block_filter_depth_block_shadow
  1008. ! == starpu_data.h ==
  1009. ! void starpu_data_unregister(starpu_data_handle_t handle);
  1010. subroutine fstarpu_data_unregister (dh) bind(C,name="starpu_data_unregister")
  1011. use iso_c_binding, only: c_ptr
  1012. type(c_ptr), value, intent(in) :: dh
  1013. end subroutine fstarpu_data_unregister
  1014. ! void starpu_data_unregister_no_coherency(starpu_data_handle_t handle);
  1015. subroutine fstarpu_data_unregister_no_coherency (dh) bind(C,name="starpu_data_unregister_no_coherency")
  1016. use iso_c_binding, only: c_ptr
  1017. type(c_ptr), value, intent(in) :: dh
  1018. end subroutine fstarpu_data_unregister_no_coherency
  1019. ! void starpu_data_unregister_submit(starpu_data_handle_t handle);
  1020. subroutine fstarpu_data_unregister_submit (dh) bind(C,name="starpu_data_unregister_submit")
  1021. use iso_c_binding, only: c_ptr
  1022. type(c_ptr), value, intent(in) :: dh
  1023. end subroutine fstarpu_data_unregister_submit
  1024. ! void starpu_data_invalidate(starpu_data_handle_t handle);
  1025. subroutine fstarpu_data_invalidate (dh) bind(C,name="starpu_data_invalidate")
  1026. use iso_c_binding, only: c_ptr
  1027. type(c_ptr), value, intent(in) :: dh
  1028. end subroutine fstarpu_data_invalidate
  1029. ! void starpu_data_invalidate_submit(starpu_data_handle_t handle);
  1030. subroutine fstarpu_data_invalidate_submit (dh) bind(C,name="starpu_data_invalidate_submit")
  1031. use iso_c_binding, only: c_ptr
  1032. type(c_ptr), value, intent(in) :: dh
  1033. end subroutine fstarpu_data_invalidate_submit
  1034. ! void starpu_data_advise_as_important(starpu_data_handle_t handle, unsigned is_important);
  1035. subroutine fstarpu_data_advise_as_important (dh,is_important) bind(C,name="starpu_data_advise_as_important")
  1036. use iso_c_binding, only: c_ptr,c_int
  1037. type(c_ptr), value, intent(in) :: dh
  1038. integer(c_int), value, intent(in) :: is_important
  1039. end subroutine fstarpu_data_advise_as_important
  1040. ! starpu_data_acquire: see fstarpu_data_acquire
  1041. subroutine fstarpu_data_acquire (dh, mode) bind(C)
  1042. use iso_c_binding, only: c_ptr
  1043. type(c_ptr), value, intent(in) :: dh
  1044. type(c_ptr), value, intent(in) :: mode ! C function expects an intptr_t
  1045. end subroutine fstarpu_data_acquire
  1046. ! int starpu_data_acquire_on_node(starpu_data_handle_t handle, int node, enum starpu_data_access_mode mode);
  1047. ! int starpu_data_acquire_cb(starpu_data_handle_t handle, enum starpu_data_access_mode mode, void (*callback)(void *), void *arg);
  1048. ! 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);
  1049. ! 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);
  1050. ! 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);
  1051. ! void starpu_data_release(starpu_data_handle_t handle);
  1052. subroutine fstarpu_data_release (dh) bind(C,name="starpu_data_release")
  1053. use iso_c_binding, only: c_ptr
  1054. type(c_ptr), value, intent(in) :: dh
  1055. end subroutine fstarpu_data_release
  1056. ! void starpu_data_release_on_node(starpu_data_handle_t handle, int node);
  1057. subroutine fstarpu_data_release_on_node (dh, node) bind(C,name="starpu_data_release_on_node")
  1058. use iso_c_binding, only: c_ptr, c_int
  1059. type(c_ptr), value, intent(in) :: dh
  1060. integer(c_int), value, intent(in) :: node
  1061. end subroutine fstarpu_data_release_on_node
  1062. ! void starpu_data_assign_arbiter(starpu_data_handle_t handle, starpu_arbiter_t arbiter);
  1063. ! void starpu_arbiter_destroy(starpu_arbiter_t arbiter);
  1064. ! void starpu_data_display_memory_stats();
  1065. subroutine fstarpu_display_memory_stats() bind(C,name="starpu_display_memory_stats")
  1066. end subroutine fstarpu_display_memory_stats
  1067. ! int starpu_data_request_allocation(starpu_data_handle_t handle, unsigned node);
  1068. subroutine fstarpu_data_request_allocation (dh, node) &
  1069. bind(C,name="starpu_data_request_allocation")
  1070. use iso_c_binding, only: c_ptr, c_int
  1071. type(c_ptr), value, intent(in) :: dh
  1072. integer(c_int), value, intent(in) :: node
  1073. end subroutine fstarpu_data_request_allocation
  1074. ! int starpu_data_fetch_on_node(starpu_data_handle_t handle, unsigned node, unsigned async);
  1075. subroutine fstarpu_data_fetch_on_node (dh, node, async) &
  1076. bind(C,name="starpu_data_fetch_on_node")
  1077. use iso_c_binding, only: c_ptr, c_int
  1078. type(c_ptr), value, intent(in) :: dh
  1079. integer(c_int), value, intent(in) :: node
  1080. integer(c_int), value, intent(in) :: async
  1081. end subroutine fstarpu_data_fetch_on_node
  1082. ! int starpu_data_prefetch_on_node(starpu_data_handle_t handle, unsigned node, unsigned async);
  1083. subroutine fstarpu_data_prefetch_on_node (dh, node, async) &
  1084. bind(C,name="starpu_data_prefetch_on_node")
  1085. use iso_c_binding, only: c_ptr, c_int
  1086. type(c_ptr), value, intent(in) :: dh
  1087. integer(c_int), value, intent(in) :: node
  1088. integer(c_int), value, intent(in) :: async
  1089. end subroutine fstarpu_data_prefetch_on_node
  1090. ! int starpu_data_prefetch_on_node_prio(starpu_data_handle_t handle, unsigned node, unsigned async, int prio);
  1091. subroutine fstarpu_data_prefetch_on_node_prio (dh, node, async, prio) &
  1092. bind(C,name="starpu_data_prefetch_on_node_prio")
  1093. use iso_c_binding, only: c_ptr, c_int
  1094. type(c_ptr), value, intent(in) :: dh
  1095. integer(c_int), value, intent(in) :: node
  1096. integer(c_int), value, intent(in) :: async
  1097. integer(c_int), value, intent(in) :: prio
  1098. end subroutine fstarpu_data_prefetch_on_node_prio
  1099. ! int starpu_data_idle_prefetch_on_node(starpu_data_handle_t handle, unsigned node, unsigned async);
  1100. subroutine fstarpu_data_idle_prefetch_on_node (dh, node, async) &
  1101. bind(C,name="starpu_data_idle_prefetch_on_node")
  1102. use iso_c_binding, only: c_ptr, c_int
  1103. type(c_ptr), value, intent(in) :: dh
  1104. integer(c_int), value, intent(in) :: node
  1105. integer(c_int), value, intent(in) :: async
  1106. end subroutine fstarpu_data_idle_prefetch_on_node
  1107. ! int starpu_data_idle_prefetch_on_node_prio(starpu_data_handle_t handle, unsigned node, unsigned async, int prio);
  1108. subroutine fstarpu_data_idle_prefetch_on_node_prio (dh, node, async, prio) &
  1109. bind(C,name="starpu_data_idle_prefetch_on_node_prio")
  1110. use iso_c_binding, only: c_ptr, c_int
  1111. type(c_ptr), value, intent(in) :: dh
  1112. integer(c_int), value, intent(in) :: node
  1113. integer(c_int), value, intent(in) :: async
  1114. integer(c_int), value, intent(in) :: prio
  1115. end subroutine fstarpu_data_idle_prefetch_on_node_prio
  1116. ! void starpu_data_wont_use(starpu_data_handle_t handle);
  1117. subroutine fstarpu_data_wont_use (dh) bind(c,name="starpu_data_wont_use")
  1118. use iso_c_binding, only: c_ptr
  1119. type(c_ptr), value, intent(in) :: dh
  1120. end subroutine fstarpu_data_wont_use
  1121. ! unsigned starpu_worker_get_memory_node(unsigned workerid);
  1122. function fstarpu_worker_get_memory_node(id) bind(C,name="starpu_worker_get_memory_node")
  1123. use iso_c_binding, only: c_int
  1124. integer(c_int) :: fstarpu_worker_get_memory_node
  1125. integer(c_int), value, intent(in) :: id
  1126. end function fstarpu_worker_get_memory_node
  1127. ! unsigned starpu_memory_nodes_get_count(void);
  1128. function fstarpu_memory_nodes_get_count() bind(C,name="starpu_memory_nodes_get_count")
  1129. use iso_c_binding, only: c_int
  1130. integer(c_int) :: fstarpu_memory_nodes_get_count
  1131. end function fstarpu_memory_nodes_get_count
  1132. ! enum starpu_node_kind starpu_node_get_kind(unsigned node);
  1133. ! void starpu_data_set_wt_mask(starpu_data_handle_t handle, uint32_t wt_mask);
  1134. ! void starpu_data_set_sequential_consistency_flag(starpu_data_handle_t handle, unsigned flag);
  1135. ! unsigned starpu_data_get_sequential_consistency_flag(starpu_data_handle_t handle);
  1136. ! unsigned starpu_data_get_default_sequential_consistency_flag(void);
  1137. ! void starpu_data_set_default_sequential_consistency_flag(unsigned flag);
  1138. ! void starpu_data_query_status(starpu_data_handle_t handle, int memory_node, int *is_allocated, int *is_valid, int *is_requested);
  1139. ! void starpu_data_set_reduction_methods(starpu_data_handle_t handle, struct starpu_codelet *redux_cl, struct starpu_codelet *init_cl);
  1140. subroutine fstarpu_data_set_reduction_methods (dh,redux_cl,init_cl) bind(C,name="starpu_data_set_reduction_methods")
  1141. use iso_c_binding, only: c_ptr
  1142. type(c_ptr), value, intent(in) :: dh
  1143. type(c_ptr), value, intent(in) :: redux_cl
  1144. type(c_ptr), value, intent(in) :: init_cl
  1145. end subroutine fstarpu_data_set_reduction_methods
  1146. ! struct starpu_data_interface_ops* starpu_data_get_interface_ops(starpu_data_handle_t handle);
  1147. ! unsigned starpu_data_test_if_allocated_on_node(starpu_data_handle_t handle, unsigned memory_node);
  1148. function fstarpu_data_test_if_allocated_on_node(dh,mem_node) bind(C,name="starpu_data_test_if_allocated_on_node")
  1149. use iso_c_binding, only: c_ptr, c_int
  1150. integer(c_int) :: fstarpu_data_test_if_allocated_on_node
  1151. type(c_ptr), value, intent(in) :: dh
  1152. integer(c_int), value, intent(in) :: mem_node
  1153. end function fstarpu_data_test_if_allocated_on_node
  1154. ! void starpu_memchunk_tidy(unsigned memory_node);
  1155. subroutine fstarpu_memchunk_tidy (mem_node) bind(c,name="starpu_memchunk_tidy")
  1156. use iso_c_binding, only: c_int
  1157. integer(c_int), value, intent(in) :: mem_node
  1158. end subroutine fstarpu_memchunk_tidy
  1159. ! == starpu_task_util.h ==
  1160. ! struct starpu_data_handle *fstarpu_data_handle_array_alloc(int nb);
  1161. function fstarpu_data_handle_array_alloc (nb) bind(C)
  1162. use iso_c_binding, only: c_ptr, c_int
  1163. type(c_ptr) :: fstarpu_data_handle_array_alloc
  1164. integer(c_int), value, intent(in) :: nb
  1165. end function fstarpu_data_handle_array_alloc
  1166. ! void fstarpu_data_handle_array_free(starpu_data_handle_t *handles);
  1167. subroutine fstarpu_data_handle_array_free (handles) bind(C)
  1168. use iso_c_binding, only: c_ptr
  1169. type(c_ptr), value, intent(in) :: handles
  1170. end subroutine fstarpu_data_handle_array_free
  1171. ! void fstarpu_data_handle_array_set(starpu_data_handle_t *handles, int i, starpu_data_handle_t handle);
  1172. subroutine fstarpu_data_handle_array_set (handles, i, handle) bind(C)
  1173. use iso_c_binding, only: c_ptr, c_int
  1174. type(c_ptr), value, intent(in) :: handles
  1175. integer(c_int), value, intent(in) :: i
  1176. type(c_ptr), value, intent(in) :: handle
  1177. end subroutine fstarpu_data_handle_array_set
  1178. ! struct starpu_data_descr *fstarpu_data_descr_array_alloc(int nb);
  1179. function fstarpu_data_descr_array_alloc (nb) bind(C)
  1180. use iso_c_binding, only: c_ptr, c_int
  1181. type(c_ptr) :: fstarpu_data_descr_array_alloc
  1182. integer(c_int), value, intent(in) :: nb
  1183. end function fstarpu_data_descr_array_alloc
  1184. ! struct starpu_data_descr *fstarpu_data_descr_alloc(void);
  1185. function fstarpu_data_descr_alloc (nb) bind(C)
  1186. use iso_c_binding, only: c_ptr
  1187. type(c_ptr) :: fstarpu_data_descr_alloc
  1188. end function fstarpu_data_descr_alloc
  1189. ! void fstarpu_data_descr_array_free(struct starpu_data_descr *descrs);
  1190. subroutine fstarpu_data_descr_array_free (descrs) bind(C)
  1191. use iso_c_binding, only: c_ptr
  1192. type(c_ptr), value, intent(in) :: descrs
  1193. end subroutine fstarpu_data_descr_array_free
  1194. ! void fstarpu_data_descr_free(struct starpu_data_descr *descr);
  1195. subroutine fstarpu_data_descrg_free (descr) bind(C)
  1196. use iso_c_binding, only: c_ptr
  1197. type(c_ptr), value, intent(in) :: descr
  1198. end subroutine fstarpu_data_descrg_free
  1199. ! void fstarpu_data_descr_array_set(struct starpu_data_descr *descrs, int i, starpu_data_handle_t handle, intptr_t mode);
  1200. subroutine fstarpu_data_descr_array_set (descrs, i, handle, mode) bind(C)
  1201. use iso_c_binding, only: c_ptr, c_int, c_intptr_t
  1202. type(c_ptr), value, intent(in) :: descrs
  1203. integer(c_int), value, intent(in) :: i
  1204. type(c_ptr), value, intent(in) :: handle
  1205. type(c_ptr), value, intent(in) :: mode ! C func expects c_intptr_t
  1206. end subroutine fstarpu_data_descr_array_set
  1207. ! void fstarpu_data_descr_set(struct starpu_data_descr *descr, starpu_data_handle_t handle, intptr_t mode);
  1208. subroutine fstarpu_data_descr_set (descr, handle, mode) bind(C)
  1209. use iso_c_binding, only: c_ptr, c_intptr_t
  1210. type(c_ptr), value, intent(in) :: descr
  1211. type(c_ptr), value, intent(in) :: handle
  1212. type(c_ptr), value, intent(in) :: mode ! C func expects c_intptr_t
  1213. end subroutine fstarpu_data_descr_set
  1214. subroutine fstarpu_task_insert(arglist) bind(C)
  1215. use iso_c_binding, only: c_ptr
  1216. type(c_ptr), dimension(:), intent(in) :: arglist
  1217. end subroutine fstarpu_task_insert
  1218. subroutine fstarpu_insert_task(arglist) bind(C,name="fstarpu_task_insert")
  1219. use iso_c_binding, only: c_ptr
  1220. type(c_ptr), dimension(:), intent(in) :: arglist
  1221. end subroutine fstarpu_insert_task
  1222. subroutine fstarpu_unpack_arg(cl_arg,bufferlist) bind(C)
  1223. use iso_c_binding, only: c_ptr
  1224. type(c_ptr), value, intent(in) :: cl_arg
  1225. type(c_ptr), dimension(:), intent(in) :: bufferlist
  1226. end subroutine fstarpu_unpack_arg
  1227. ! == starpu_sched_ctx.h ==
  1228. ! starpu_sched_ctx_create: see fstarpu_sched_ctx_create
  1229. function fstarpu_sched_ctx_create(workers_array,nworkers,ctx_name) bind(C)
  1230. use iso_c_binding, only: c_int, c_char
  1231. integer(c_int) :: fstarpu_sched_ctx_create
  1232. integer(c_int), intent(in) :: workers_array(*)
  1233. integer(c_int), value, intent(in) :: nworkers
  1234. character(c_char), intent(in) :: ctx_name
  1235. end function fstarpu_sched_ctx_create
  1236. ! 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);
  1237. ! void starpu_sched_ctx_register_close_callback(unsigned sched_ctx_id, void (*close_callback)(unsigned sched_ctx_id, void* args), void *args);
  1238. ! void starpu_sched_ctx_add_workers(int *workerids_ctx, int nworkers_ctx, unsigned sched_ctx_id);
  1239. subroutine fstarpu_sched_ctx_add_workers(workerids,nworkers,ctx) bind(C,name="starpu_sched_ctx_add_workers")
  1240. use iso_c_binding, only: c_int
  1241. integer(c_int), intent(in) :: workerids (*)
  1242. integer(c_int), value, intent(in) :: nworkers
  1243. integer(c_int), value, intent(in) :: ctx
  1244. end subroutine fstarpu_sched_ctx_add_workers
  1245. ! void starpu_sched_ctx_remove_workers(int *workerids_ctx, int nworkers_ctx, unsigned sched_ctx_id);
  1246. subroutine fstarpu_sched_ctx_remove_workers(workerids,nworkers,ctx) bind(C,name="starpu_sched_ctx_remove_workers")
  1247. use iso_c_binding, only: c_int
  1248. integer(c_int), intent(in) :: workerids (*)
  1249. integer(c_int), value, intent(in) :: nworkers
  1250. integer(c_int), value, intent(in) :: ctx
  1251. end subroutine fstarpu_sched_ctx_remove_workers
  1252. ! starpu_sched_ctx_display_workers: see fstarpu_sched_ctx_display_workers
  1253. subroutine fstarpu_sched_ctx_display_workers (ctx) bind(C)
  1254. use iso_c_binding, only: c_int
  1255. integer(c_int), value, intent(in) :: ctx
  1256. end subroutine fstarpu_sched_ctx_display_workers
  1257. ! void starpu_sched_ctx_delete(unsigned sched_ctx_id);
  1258. subroutine fstarpu_sched_ctx_delete (ctx) bind(C,name="starpu_sched_ctx_delete")
  1259. use iso_c_binding, only: c_int
  1260. integer(c_int), value, intent(in) :: ctx
  1261. end subroutine fstarpu_sched_ctx_delete
  1262. ! void starpu_sched_ctx_set_inheritor(unsigned sched_ctx_id, unsigned inheritor);
  1263. subroutine fstarpu_sched_ctx_set_inheritor (ctx,inheritor) bind(C,name="starpu_sched_ctx_set_inheritor")
  1264. use iso_c_binding, only: c_int
  1265. integer(c_int), value, intent(in) :: ctx
  1266. integer(c_int), value, intent(in) :: inheritor
  1267. end subroutine fstarpu_sched_ctx_set_inheritor
  1268. ! unsigned starpu_sched_ctx_get_inheritor(unsigned sched_ctx_id);
  1269. function fstarpu_sched_ctx_get_inheritor (ctx) bind(C,name="starpu_sched_ctx_get_inheritor")
  1270. use iso_c_binding, only: c_int
  1271. integer(c_int) :: fstarpu_sched_ctx_get_inheritor
  1272. integer(c_int), value, intent(in) :: ctx
  1273. end function fstarpu_sched_ctx_get_inheritor
  1274. ! unsigned starpu_sched_ctx_get_hierarchy_level(unsigned sched_ctx_id);
  1275. function fstarpu_sched_ctx_get_hierarchy_level (ctx) bind(C,name="starpu_sched_ctx_get_hierarchy_level")
  1276. use iso_c_binding, only: c_int
  1277. integer(c_int) :: fstarpu_sched_ctx_get_hierarchy_level
  1278. integer(c_int), value, intent(in) :: ctx
  1279. end function fstarpu_sched_ctx_get_hierarchy_level
  1280. ! void starpu_sched_ctx_set_context(unsigned *sched_ctx_id);
  1281. subroutine fstarpu_sched_ctx_set_context (ctx_ptr) bind(C,name="starpu_sched_ctx_set_context")
  1282. use iso_c_binding, only: c_ptr
  1283. type(c_ptr), value, intent(in) :: ctx_ptr
  1284. end subroutine fstarpu_sched_ctx_set_context
  1285. ! unsigned starpu_sched_ctx_get_context(void);
  1286. function fstarpu_sched_ctx_get_context () bind(C,name="starpu_sched_ctx_get_context")
  1287. use iso_c_binding, only: c_int
  1288. integer(c_int) :: fstarpu_sched_ctx_get_context
  1289. end function fstarpu_sched_ctx_get_context
  1290. ! == starpu_fxt.h ==
  1291. ! void starpu_fxt_options_init(struct starpu_fxt_options *options);
  1292. subroutine fstarpu_fxt_options_init (fxt_options) bind(C,name="starpu_fxt_options_init")
  1293. use iso_c_binding, only: c_ptr
  1294. type(c_ptr), value, intent(in) :: fxt_options
  1295. end subroutine fstarpu_fxt_options_init
  1296. ! void starpu_fxt_generate_trace(struct starpu_fxt_options *options);
  1297. subroutine fstarpu_fxt_generate_trace (fxt_options) bind(C,name="starpu_fxt_generate_trace")
  1298. use iso_c_binding, only: c_ptr
  1299. type(c_ptr), value, intent(in) :: fxt_options
  1300. end subroutine fstarpu_fxt_generate_trace
  1301. ! void starpu_fxt_autostart_profiling(int autostart);
  1302. subroutine fstarpu_fxt_autostart_profiling (autostart) bind(c,name="starpu_fxt_autostart_profiling")
  1303. use iso_c_binding, only: c_int
  1304. integer(c_int), value, intent(in) :: autostart
  1305. end subroutine fstarpu_fxt_autostart_profiling
  1306. ! void starpu_fxt_start_profiling(void);
  1307. subroutine fstarpu_fxt_start_profiling () bind(c,name="starpu_fxt_start_profiling")
  1308. use iso_c_binding
  1309. end subroutine fstarpu_fxt_start_profiling
  1310. ! void starpu_fxt_stop_profiling(void);
  1311. subroutine fstarpu_fxt_stop_profiling () bind(c,name="starpu_fxt_stop_profiling")
  1312. use iso_c_binding
  1313. end subroutine fstarpu_fxt_stop_profiling
  1314. ! void starpu_fxt_write_data_trace(char *filename_in);
  1315. subroutine fstarpu_fxt_write_data_trace (filename) bind(c,name="starpu_fxt_write_data_trace")
  1316. use iso_c_binding, only: c_char
  1317. character(c_char), intent(in) :: filename
  1318. end subroutine fstarpu_fxt_write_data_trace
  1319. ! void starpu_fxt_trace_user_event(unsigned long code);
  1320. subroutine fstarpu_trace_user_event (code) bind(c,name="starpu_trace_user_event")
  1321. use iso_c_binding, only: c_long
  1322. integer(c_long), value, intent(in) :: code
  1323. end subroutine fstarpu_trace_user_event
  1324. end interface
  1325. contains
  1326. function or_cptrs(op1,op2)
  1327. type(c_ptr) :: or_cptrs
  1328. type(c_ptr),intent(in) :: op1,op2
  1329. integer(c_intptr_t) :: i_op1,i_op2
  1330. i_op1 = transfer(op1,0_c_intptr_t)
  1331. i_op2 = transfer(op2,0_c_intptr_t)
  1332. or_cptrs = transfer(ior(i_op1,i_op2), C_NULL_PTR)
  1333. end function
  1334. function ip_to_p(i) bind(C)
  1335. use iso_c_binding, only: c_ptr,c_intptr_t,C_NULL_PTR
  1336. type(c_ptr) :: ip_to_p
  1337. integer(c_intptr_t), value, intent(in) :: i
  1338. ip_to_p = transfer(i,C_NULL_PTR)
  1339. end function ip_to_p
  1340. function p_to_ip(p) bind(C)
  1341. use iso_c_binding, only: c_ptr,c_intptr_t
  1342. integer(c_intptr_t) :: p_to_ip
  1343. type(c_ptr), value, intent(in) :: p
  1344. p_to_ip = transfer(p,0_c_intptr_t)
  1345. end function p_to_ip
  1346. function sz_to_p(sz) bind(C)
  1347. use iso_c_binding, only: c_ptr,c_size_t,c_intptr_t
  1348. type(c_ptr) :: sz_to_p
  1349. integer(c_size_t), value, intent(in) :: sz
  1350. sz_to_p = ip_to_p(int(sz,kind=c_intptr_t))
  1351. end function sz_to_p
  1352. function fstarpu_init (conf) bind(C)
  1353. use iso_c_binding
  1354. integer(c_int) :: fstarpu_init
  1355. type(c_ptr), value, intent(in) :: conf
  1356. real(c_double) :: FSTARPU_SZ_C_DOUBLE_dummy
  1357. real(c_float) :: FSTARPU_SZ_C_FLOAT_dummy
  1358. integer(c_int) :: FSTARPU_SZ_C_INT_dummy
  1359. integer(c_intptr_t) :: FSTARPU_SZ_C_INTPTR_T_dummy
  1360. type(c_ptr) :: FSTARPU_SZ_C_PTR_dummy
  1361. integer(c_size_t) :: FSTARPU_SZ_C_SIZE_T_dummy
  1362. integer :: FSTARPU_SZ_INTEGER_dummy
  1363. integer(4) :: FSTARPU_SZ_INT4_dummy
  1364. integer(8) :: FSTARPU_SZ_INT8_dummy
  1365. real :: FSTARPU_SZ_REAL_dummy
  1366. real(4) :: FSTARPU_SZ_REAL4_dummy
  1367. real(8) :: FSTARPU_SZ_REAL8_dummy
  1368. double precision :: FSTARPU_SZ_DOUBLE_PRECISION_dummy
  1369. complex :: FSTARPU_SZ_COMPLEX_dummy
  1370. ! Note: Referencing global C constants from Fortran has
  1371. ! been found unreliable on some architectures, notably
  1372. ! on Darwin. The get_integer/get_pointer_constant
  1373. ! scheme is a workaround to that issue.
  1374. interface
  1375. ! These functions are not exported to the end user
  1376. function fstarpu_get_constant(s) bind(C)
  1377. use iso_c_binding, only: c_ptr,c_char
  1378. type(c_ptr) :: fstarpu_get_constant ! C function returns an intptr_t
  1379. character(kind=c_char) :: s
  1380. end function fstarpu_get_constant
  1381. function fstarpu_init_internal (conf) bind(C,name="starpu_init")
  1382. use iso_c_binding, only: c_ptr,c_int
  1383. integer(c_int) :: fstarpu_init_internal
  1384. type(c_ptr), value :: conf
  1385. end function fstarpu_init_internal
  1386. end interface
  1387. ! Initialize Fortran constants from C peers
  1388. FSTARPU_R = fstarpu_get_constant(C_CHAR_"FSTARPU_R"//C_NULL_CHAR)
  1389. FSTARPU_W = fstarpu_get_constant(C_CHAR_"FSTARPU_W"//C_NULL_CHAR)
  1390. FSTARPU_RW = fstarpu_get_constant(C_CHAR_"FSTARPU_RW"//C_NULL_CHAR)
  1391. FSTARPU_SCRATCH = fstarpu_get_constant(C_CHAR_"FSTARPU_SCRATCH"//C_NULL_CHAR)
  1392. FSTARPU_REDUX = fstarpu_get_constant(C_CHAR_"FSTARPU_REDUX"//C_NULL_CHAR)
  1393. FSTARPU_COMMUTE = fstarpu_get_constant(C_CHAR_"FSTARPU_COMMUTE"//C_NULL_CHAR)
  1394. FSTARPU_SSEND = fstarpu_get_constant(C_CHAR_"FSTARPU_SSEND"//C_NULL_CHAR)
  1395. FSTARPU_LOCALITY = fstarpu_get_constant(C_CHAR_"FSTARPU_LOCALITY"//C_NULL_CHAR)
  1396. FSTARPU_DATA_ARRAY = fstarpu_get_constant(C_CHAR_"FSTARPU_DATA_ARRAY"//C_NULL_CHAR)
  1397. FSTARPU_DATA_MODE_ARRAY = fstarpu_get_constant(C_CHAR_"FSTARPU_DATA_MODE_ARRAY"//C_NULL_CHAR)
  1398. FSTARPU_CL_ARGS = fstarpu_get_constant(C_CHAR_"FSTARPU_CL_ARGS"//C_NULL_CHAR)
  1399. FSTARPU_CALLBACK = fstarpu_get_constant(C_CHAR_"FSTARPU_CALLBACK"//C_NULL_CHAR)
  1400. FSTARPU_CALLBACK_WITH_ARG = fstarpu_get_constant(C_CHAR_"FSTARPU_CALLBACK_WITH_ARG"//C_NULL_CHAR)
  1401. FSTARPU_CALLBACK_ARG = fstarpu_get_constant(C_CHAR_"FSTARPU_CALLBACK_ARG"//C_NULL_CHAR)
  1402. FSTARPU_PROLOGUE_CALLBACK = fstarpu_get_constant(C_CHAR_"FSTARPU_PROLOGUE_CALLBACK"//C_NULL_CHAR)
  1403. FSTARPU_PROLOGUE_CALLBACK_ARG = fstarpu_get_constant(C_CHAR_"FSTARPU_PROLOGUE_CALLBACK_ARG"//C_NULL_CHAR)
  1404. FSTARPU_PROLOGUE_CALLBACK_POP = fstarpu_get_constant(C_CHAR_"FSTARPU_PROLOGUE_CALLBACK_POP"//C_NULL_CHAR)
  1405. FSTARPU_PROLOGUE_CALLBACK_POP_ARG = &
  1406. fstarpu_get_constant(C_CHAR_"FSTARPU_PROLOGUE_CALLBACK_POP_ARG"//C_NULL_CHAR)
  1407. FSTARPU_PRIORITY = fstarpu_get_constant(C_CHAR_"FSTARPU_PRIORITY"//C_NULL_CHAR)
  1408. FSTARPU_EXECUTE_ON_NODE = fstarpu_get_constant(C_CHAR_"FSTARPU_EXECUTE_ON_NODE"//C_NULL_CHAR)
  1409. FSTARPU_EXECUTE_ON_DATA = fstarpu_get_constant(C_CHAR_"FSTARPU_EXECUTE_ON_DATA"//C_NULL_CHAR)
  1410. FSTARPU_EXECUTE_ON_WORKER = fstarpu_get_constant(C_CHAR_"FSTARPU_EXECUTE_ON_WORKER"//C_NULL_CHAR)
  1411. FSTARPU_WORKER_ORDER = fstarpu_get_constant(C_CHAR_"FSTARPU_WORKER_ORDER"//C_NULL_CHAR)
  1412. FSTARPU_HYPERVISOR_TAG = fstarpu_get_constant(C_CHAR_"FSTARPU_HYPERVISOR_TAG"//C_NULL_CHAR)
  1413. FSTARPU_POSSIBLY_PARALLEL = fstarpu_get_constant(C_CHAR_"FSTARPU_POSSIBLY_PARALLEL"//C_NULL_CHAR)
  1414. FSTARPU_FLOPS = fstarpu_get_constant(C_CHAR_"FSTARPU_FLOPS"//C_NULL_CHAR)
  1415. FSTARPU_TAG = fstarpu_get_constant(C_CHAR_"FSTARPU_TAG"//C_NULL_CHAR)
  1416. FSTARPU_TAG_ONLY = fstarpu_get_constant(C_CHAR_"FSTARPU_TAG_ONLY"//C_NULL_CHAR)
  1417. FSTARPU_NAME = fstarpu_get_constant(C_CHAR_"FSTARPU_NAME"//C_NULL_CHAR)
  1418. FSTARPU_NODE_SELECTION_POLICY = fstarpu_get_constant(C_CHAR_"FSTARPU_NODE_SELECTION_POLICY"//C_NULL_CHAR)
  1419. FSTARPU_VALUE = fstarpu_get_constant(C_CHAR_"FSTARPU_VALUE"//C_NULL_CHAR)
  1420. FSTARPU_SCHED_CTX = fstarpu_get_constant(C_CHAR_"FSTARPU_SCHED_CTX"//C_NULL_CHAR)
  1421. FSTARPU_CPU_WORKER = fstarpu_get_constant(C_CHAR_"FSTARPU_CPU_WORKER"//C_NULL_CHAR)
  1422. FSTARPU_CUDA_WORKER = fstarpu_get_constant(C_CHAR_"FSTARPU_CUDA_WORKER"//C_NULL_CHAR)
  1423. FSTARPU_OPENCL_WORKER = fstarpu_get_constant(C_CHAR_"FSTARPU_OPENCL_WORKER"//C_NULL_CHAR)
  1424. FSTARPU_MIC_WORKER = fstarpu_get_constant(C_CHAR_"FSTARPU_MIC_WORKER"//C_NULL_CHAR)
  1425. FSTARPU_SCC_WORKER = fstarpu_get_constant(C_CHAR_"FSTARPU_SCC_WORKER"//C_NULL_CHAR)
  1426. FSTARPU_ANY_WORKER = fstarpu_get_constant(C_CHAR_"FSTARPU_ANY_WORKER"//C_NULL_CHAR)
  1427. FSTARPU_NMAXBUFS = int(p_to_ip(fstarpu_get_constant(C_CHAR_"FSTARPU_NMAXBUFS"//C_NULL_CHAR)),c_int)
  1428. ! Initialize size constants as 'c_ptr'
  1429. FSTARPU_SZ_C_DOUBLE = sz_to_p(c_sizeof(FSTARPU_SZ_C_DOUBLE_dummy))
  1430. FSTARPU_SZ_C_FLOAT = sz_to_p(c_sizeof(FSTARPU_SZ_C_FLOAT_dummy))
  1431. FSTARPU_SZ_C_INT = sz_to_p(c_sizeof(FSTARPU_SZ_C_INT_dummy))
  1432. FSTARPU_SZ_C_INTPTR_T = sz_to_p(c_sizeof(FSTARPU_SZ_C_INTPTR_T_dummy))
  1433. FSTARPU_SZ_C_PTR = sz_to_p(c_sizeof(FSTARPU_SZ_C_PTR_dummy))
  1434. FSTARPU_SZ_C_SIZE_T = sz_to_p(c_sizeof(FSTARPU_SZ_C_SIZE_T_dummy))
  1435. FSTARPU_SZ_INTEGER = sz_to_p(c_sizeof(FSTARPU_SZ_INTEGER_dummy))
  1436. FSTARPU_SZ_INT4 = sz_to_p(c_sizeof(FSTARPU_SZ_INT4_dummy))
  1437. FSTARPU_SZ_INT8 = sz_to_p(c_sizeof(FSTARPU_SZ_INT8_dummy))
  1438. FSTARPU_SZ_REAL = sz_to_p(c_sizeof(FSTARPU_SZ_REAL_dummy))
  1439. FSTARPU_SZ_REAL4 = sz_to_p(c_sizeof(FSTARPU_SZ_REAL4_dummy))
  1440. FSTARPU_SZ_REAL8 = sz_to_p(c_sizeof(FSTARPU_SZ_REAL8_dummy))
  1441. FSTARPU_SZ_DOUBLE_PRECISION = sz_to_p(c_sizeof(FSTARPU_SZ_DOUBLE_PRECISION_dummy))
  1442. FSTARPU_SZ_COMPLEX = sz_to_p(c_sizeof(FSTARPU_SZ_COMPLEX_dummy))
  1443. ! Initialize StarPU
  1444. if (c_associated(conf)) then
  1445. fstarpu_init = fstarpu_init_internal(conf)
  1446. else
  1447. fstarpu_init = fstarpu_init_internal(C_NULL_PTR)
  1448. end if
  1449. end function fstarpu_init
  1450. function fstarpu_csizet_to_cptr(i) bind(C)
  1451. use iso_c_binding
  1452. type(c_ptr) :: fstarpu_csizet_to_cptr
  1453. integer(c_size_t) :: i
  1454. fstarpu_csizet_to_cptr = transfer(int(i,kind=c_intptr_t),C_NULL_PTR)
  1455. end function fstarpu_csizet_to_cptr
  1456. function fstarpu_int_to_cptr(i) bind(C)
  1457. use iso_c_binding
  1458. type(c_ptr) :: fstarpu_int_to_cptr
  1459. integer :: i
  1460. fstarpu_int_to_cptr = transfer(int(i,kind=c_intptr_t),C_NULL_PTR)
  1461. end function fstarpu_int_to_cptr
  1462. end module fstarpu_mod