File: bindgen_regression_array_cu.f90

package info (click to toggle)
gridtools 2.0.0-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 21,728 kB
  • sloc: cpp: 45,263; python: 9,383; javascript: 8,445; ansic: 2,564; sh: 509; f90: 370; makefile: 216
file content (51 lines) | stat: -rw-r--r-- 1,631 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
! This file is generated!
module bindgen_regression_array_cu
implicit none
  interface

    subroutine fill_array_impl(arg0) bind(c, name="fill_array")
      use iso_c_binding
      use bindgen_array_descriptor
      type(bindgen_fortran_array_descriptor) :: arg0
    end subroutine
    subroutine fill_gpu_array_impl(arg0) bind(c, name="fill_gpu_array")
      use iso_c_binding
      use bindgen_array_descriptor
      type(bindgen_fortran_array_descriptor) :: arg0
    end subroutine

  end interface
contains
    subroutine fill_array(arg0)
      use iso_c_binding
      use bindgen_array_descriptor
      real(c_double), dimension(:,:,:), target :: arg0
      type(bindgen_fortran_array_descriptor) :: descriptor0

      descriptor0%rank = 3
      descriptor0%type = 6
      descriptor0%dims = reshape(shape(arg0), &
        shape(descriptor0%dims), (/0/))
      descriptor0%data = c_loc(arg0(lbound(arg0, 1),lbound(arg0, 2),lbound(arg0, 3)))

      call fill_array_impl(descriptor0)
    end subroutine
    subroutine fill_gpu_array(arg0)
      use iso_c_binding
      use bindgen_array_descriptor
      real(c_double), dimension(:,:,:), target :: arg0
      type(bindgen_fortran_array_descriptor) :: descriptor0

      !$acc data present(arg0)
      !$acc host_data use_device(arg0)
      descriptor0%rank = 3
      descriptor0%type = 6
      descriptor0%dims = reshape(shape(arg0), &
        shape(descriptor0%dims), (/0/))
      descriptor0%data = c_loc(arg0(lbound(arg0, 1),lbound(arg0, 2),lbound(arg0, 3)))
      !$acc end host_data
      !$acc end data

      call fill_gpu_array_impl(descriptor0)
    end subroutine
end