fstarpu_mod.f90 146 KB

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