fstarpu_mod.f90 154 KB

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