nf_dynbuf_cl.f90 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. ! StarPU --- Runtime system for heterogeneous multicore architectures.
  2. !
  3. ! Copyright (C) 2017 CNRS
  4. ! Copyright (C) 2016 Inria
  5. !
  6. ! StarPU is free software; you can redistribute it and/or modify
  7. ! it under the terms of the GNU Lesser General Public License as published by
  8. ! the Free Software Foundation; either version 2.1 of the License, or (at
  9. ! your option) any later version.
  10. !
  11. ! StarPU is distributed in the hope that it will be useful, but
  12. ! WITHOUT ANY WARRANTY; without even the implied warranty of
  13. ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  14. !
  15. ! See the GNU Lesser General Public License in COPYING.LGPL for more details.
  16. !
  17. module nf_dynbuf_cl
  18. contains
  19. recursive subroutine cl_cpu_func_dynbuf_big (buffers, cl_args) bind(C)
  20. use iso_c_binding ! C interfacing module
  21. use fstarpu_mod ! StarPU interfacing module
  22. implicit none
  23. type(c_ptr), value, intent(in) :: buffers, cl_args ! cl_args is unused
  24. integer(c_int),target :: nb_data
  25. integer(c_int),pointer :: val
  26. integer(c_int) :: i
  27. call fstarpu_unpack_arg(cl_args,(/ c_loc(nb_data) /))
  28. write(*,*) "number of data:", nb_data
  29. do i=0,nb_data-1
  30. call c_f_pointer(fstarpu_variable_get_ptr(buffers, i), val)
  31. write(*,*) "i:", i, ", val:", val
  32. if (val /= 42) then
  33. stop 1
  34. end if
  35. end do
  36. end subroutine cl_cpu_func_dynbuf_big
  37. end module nf_dynbuf_cl