fstarpu_mod.f90 151 KB

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