fstarpu_mod.f90 154 KB

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