38 use,
intrinsic :: iso_c_binding, only : c_ptr
54 subroutine gs_cpu_init(this, nlocal, nshared, nlcl_blks, nshrd_blks)
55 class(
gs_cpu_t),
intent(inout) :: this
56 integer,
intent(in) :: nlocal
57 integer,
intent(in) :: nshared
58 integer,
intent(in) :: nlcl_blks
59 integer,
intent(in) :: nshrd_blks
64 class(
gs_cpu_t),
intent(inout) :: this
68 subroutine gs_gather_cpu(this, v, m, o, dg, u, n, gd, nb, b, op, shrd)
69 integer,
intent(in) :: m
70 integer,
intent(in) :: n
71 integer,
intent(in) :: nb
72 class(
gs_cpu_t),
intent(inout) :: this
73 real(kind=
rp),
dimension(m),
intent(inout) :: v
74 integer,
dimension(m),
intent(inout) :: dg
75 real(kind=
rp),
dimension(n),
intent(inout) :: u
76 integer,
dimension(m),
intent(inout) :: gd
77 integer,
dimension(nb),
intent(inout) :: b
78 integer,
intent(in) :: o
79 integer,
intent(in) :: op
80 logical,
intent(in) :: shrd
98 integer,
intent(in) :: m
99 integer,
intent(in) :: n
100 integer,
intent(in) :: nb
101 real(kind=
rp),
dimension(m),
intent(inout) :: v
102 integer,
dimension(m),
intent(inout) :: dg
103 real(kind=
rp),
dimension(n),
intent(inout) :: u
104 integer,
dimension(m),
intent(inout) :: gd
105 integer,
dimension(nb),
intent(inout) :: b
106 integer,
intent(in) :: o
107 integer :: i, j, k, blk_len
115 tmp = tmp + u(gd(k + j))
127 tmp = u(gd(i)) + u(gd(i+1))
137 integer,
intent(in) :: m
138 integer,
intent(in) :: n
139 integer,
intent(in) :: nb
140 real(kind=
rp),
dimension(m),
intent(inout) :: v
141 integer,
dimension(m),
intent(inout) :: dg
142 real(kind=
rp),
dimension(n),
intent(inout) :: u
143 integer,
dimension(m),
intent(inout) :: gd
144 integer,
dimension(nb),
intent(inout) :: b
145 integer,
intent(in) :: o
146 integer :: i, j, k, blk_len
154 tmp = tmp * u(gd(k + j))
166 tmp = u(gd(i)) * u(gd(i+1))
176 integer,
intent(in) :: m
177 integer,
intent(in) :: n
178 integer,
intent(in) :: nb
179 real(kind=
rp),
dimension(m),
intent(inout) :: v
180 integer,
dimension(m),
intent(inout) :: dg
181 real(kind=
rp),
dimension(n),
intent(inout) :: u
182 integer,
dimension(m),
intent(inout) :: gd
183 integer,
dimension(nb),
intent(inout) :: b
184 integer,
intent(in) :: o
185 integer :: i, j, k, blk_len
193 tmp = min(tmp, u(gd(k + j)))
205 tmp = min(u(gd(i)), u(gd(i+1)))
215 integer,
intent(in) :: m
216 integer,
intent(in) :: n
217 integer,
intent(in) :: nb
218 real(kind=
rp),
dimension(m),
intent(inout) :: v
219 integer,
dimension(m),
intent(inout) :: dg
220 real(kind=
rp),
dimension(n),
intent(inout) :: u
221 integer,
dimension(m),
intent(inout) :: gd
222 integer,
dimension(nb),
intent(inout) :: b
223 integer,
intent(in) :: o
224 integer :: i, j, k, blk_len
232 tmp =
max(tmp, u(gd(k + j)))
244 tmp =
max(u(gd(i)), u(gd(i+1)))
252 subroutine gs_scatter_cpu(this, v, m, dg, u, n, gd, nb, b, shrd, event)
253 integer,
intent(in) :: m
254 integer,
intent(in) :: n
255 integer,
intent(in) :: nb
256 class(
gs_cpu_t),
intent(inout) :: this
257 real(kind=
rp),
dimension(m),
intent(inout) :: v
258 integer,
dimension(m),
intent(inout) :: dg
259 real(kind=
rp),
dimension(n),
intent(inout) :: u
260 integer,
dimension(m),
intent(inout) :: gd
261 integer,
dimension(nb),
intent(inout) :: b
262 logical,
intent(in) :: shrd
271 integer,
intent(in) :: m
272 integer,
intent(in) :: n
273 integer,
intent(in) :: nb
274 real(kind=
rp),
dimension(m),
intent(inout) :: v
275 integer,
dimension(m),
intent(inout) :: dg
276 real(kind=
rp),
dimension(n),
intent(inout) :: u
277 integer,
dimension(m),
intent(inout) :: gd
278 integer,
dimension(nb),
intent(inout) :: b
279 integer :: i, j, k, blk_len
Defines a gather-scatter backend.
Generic Gather-scatter backend for CPUs.
subroutine gs_gather_kernel_add(v, m, o, dg, u, n, gd, nb, b)
Gather kernel for addition of data .
subroutine gs_scatter_kernel(v, m, dg, u, n, gd, nb, b)
Scatter kernel .
subroutine gs_cpu_init(this, nlocal, nshared, nlcl_blks, nshrd_blks)
Dummy backend initialisation.
subroutine gs_scatter_cpu(this, v, m, dg, u, n, gd, nb, b, shrd, event)
Scatter kernel.
subroutine gs_gather_kernel_mul(v, m, o, dg, u, n, gd, nb, b)
Gather kernel for multiplication of data .
subroutine gs_gather_cpu(this, v, m, o, dg, u, n, gd, nb, b, op, shrd)
Gather kernel.
subroutine gs_cpu_free(this)
Dummy backend deallocation.
subroutine gs_gather_kernel_min(v, m, o, dg, u, n, gd, nb, b)
Gather kernel for minimum of data .
subroutine gs_gather_kernel_max(v, m, o, dg, u, n, gd, nb, b)
Gather kernel for maximum of data .
Defines Gather-scatter operations.
integer, parameter, public gs_op_add
integer, parameter, public gs_op_max
integer, parameter, public gs_op_min
integer, parameter, public gs_op_mul
integer, parameter, public rp
Global precision used in computations.
Gather-scatter backend for CPUs.