fstarpu_mod.f90 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. ! StarPU --- Runtime system for heterogeneous multicore architectures.
  2. !
  3. ! Copyright (C) 2016 Inria
  4. !
  5. ! StarPU is free software; you can redistribute it and/or modify
  6. ! it under the terms of the GNU Lesser General Public License as published by
  7. ! the Free Software Foundation; either version 2.1 of the License, or (at
  8. ! your option) any later version.
  9. !
  10. ! StarPU is distributed in the hope that it will be useful, but
  11. ! WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. !
  14. ! See the GNU Lesser General Public License in COPYING.LGPL for more details.
  15. module fstarpu_mod
  16. use iso_c_binding
  17. integer(c_int), bind(C, name="fstarpu_r") :: FSTARPU_R
  18. integer(c_int), bind(C, name="fstarpu_w") :: FSTARPU_W
  19. integer(c_int), bind(C, name="fstarpu_rw") :: FSTARPU_RW
  20. integer(c_int), bind(C, name="fstarpu_scratch") :: FSTARPU_SCRATCH
  21. integer(c_int), bind(C, name="fstarpu_redux") :: FSTARPU_REDUX
  22. type(c_ptr), bind(C, name="fstarpu_data") :: FSTARPU_DATA
  23. interface
  24. subroutine fstarpu_init () bind(C)
  25. end subroutine fstarpu_init
  26. subroutine fstarpu_shutdown () bind(C,name="starpu_shutdown")
  27. end subroutine fstarpu_shutdown
  28. function fstarpu_codelet_allocate () bind(C)
  29. use iso_c_binding, only: c_ptr
  30. type(c_ptr) :: fstarpu_codelet_allocate
  31. end function fstarpu_codelet_allocate
  32. subroutine fstarpu_codelet_free (cl) bind(C)
  33. use iso_c_binding, only: c_ptr
  34. type(c_ptr), value, intent(in) :: cl
  35. end subroutine fstarpu_codelet_free
  36. subroutine fstarpu_codelet_add_cpu_func (cl, f_ptr) bind(C)
  37. use iso_c_binding, only: c_ptr, c_funptr
  38. type(c_ptr), value, intent(in) :: cl
  39. type(c_funptr), value, intent(in) :: f_ptr
  40. end subroutine fstarpu_codelet_add_cpu_func
  41. subroutine fstarpu_codelet_add_cuda_func (cl, f_ptr) bind(C)
  42. use iso_c_binding, only: c_ptr, c_funptr
  43. type(c_ptr), value, intent(in) :: cl
  44. type(c_funptr), value, intent(in) :: f_ptr
  45. end subroutine fstarpu_codelet_add_cuda_func
  46. subroutine fstarpu_codelet_add_opencl_func (cl, f_ptr) bind(C)
  47. use iso_c_binding, only: c_ptr, c_funptr
  48. type(c_ptr), value, intent(in) :: cl
  49. type(c_funptr), value, intent(in) :: f_ptr
  50. end subroutine fstarpu_codelet_add_opencl_func
  51. subroutine fstarpu_codelet_add_buffer (cl, mode) bind(C)
  52. use iso_c_binding, only: c_ptr, c_int
  53. type(c_ptr), value, intent(in) :: cl
  54. integer(c_int), value, intent(in) :: mode
  55. end subroutine fstarpu_codelet_add_buffer
  56. function fstarpu_vector_data_register(vector, nx, elt_size, ram) bind(C)
  57. use iso_c_binding
  58. type(c_ptr) :: fstarpu_vector_data_register
  59. type(c_ptr), value, intent(in) :: vector
  60. integer(c_int), value, intent(in) :: nx
  61. integer(c_size_t), value, intent(in) :: elt_size
  62. integer(c_int), value, intent(in) :: ram
  63. end function fstarpu_vector_data_register
  64. function fstarpu_vector_get_ptr(buffers, i) bind(C)
  65. use iso_c_binding
  66. type(c_ptr) :: fstarpu_vector_get_ptr
  67. type(c_ptr), value, intent(in) :: buffers
  68. integer(c_int), value, intent(in) :: i
  69. end function fstarpu_vector_get_ptr
  70. function fstarpu_vector_get_nx(buffers, i) bind(C)
  71. use iso_c_binding
  72. integer(c_int) :: fstarpu_vector_get_nx
  73. type(c_ptr), value, intent(in) :: buffers
  74. integer(c_int), value, intent(in) :: i
  75. end function fstarpu_vector_get_nx
  76. subroutine fstarpu_data_unregister (dh) bind(C)
  77. use iso_c_binding, only: c_ptr
  78. type(c_ptr), value, intent(in) :: dh
  79. end subroutine fstarpu_data_unregister
  80. subroutine fstarpu_insert_task(arglist) bind(C)
  81. use iso_c_binding, only: c_ptr
  82. type(c_ptr), dimension(:), intent(in) :: arglist
  83. end subroutine fstarpu_insert_task
  84. subroutine fstarpu_task_wait_for_all () bind(C,name="starpu_task_wait_for_all")
  85. end subroutine fstarpu_task_wait_for_all
  86. end interface
  87. ! contains
  88. end module fstarpu_mod