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, bo, 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,
dimension(nb),
intent(inout) :: bo
79 integer,
intent(in) :: o
80 integer,
intent(in) :: op
81 logical,
intent(in) :: shrd
99 integer,
intent(in) :: m
100 integer,
intent(in) :: n
101 integer,
intent(in) :: nb
102 real(kind=
rp),
dimension(m),
intent(inout) :: v
103 integer,
dimension(m),
intent(inout) :: dg
104 real(kind=
rp),
dimension(n),
intent(inout) :: u
105 integer,
dimension(m),
intent(inout) :: gd
106 integer,
dimension(nb),
intent(inout) :: b
107 integer,
dimension(nb),
intent(inout) :: bo
108 integer,
intent(in) :: o
109 integer :: i, j, k, blk_len
112 do concurrent(i = 1:nb)
117 tmp = tmp + u(gd(k + j))
123 do concurrent(i = abs(o):m)
127 do concurrent(i = o:m:2)
128 v(dg(i)) = 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,
dimension(nb),
intent(inout) :: bo
146 integer,
intent(in) :: o
147 integer :: i, j, k, blk_len
150 do concurrent(i = 1:nb)
155 tmp = tmp * u(gd(k + j))
161 do concurrent(i = abs(o):m)
165 do concurrent(i = o:m:2)
166 v(dg(i)) = u(gd(i)) * u(gd(i+1))
175 integer,
intent(in) :: m
176 integer,
intent(in) :: n
177 integer,
intent(in) :: nb
178 real(kind=
rp),
dimension(m),
intent(inout) :: v
179 integer,
dimension(m),
intent(inout) :: dg
180 real(kind=
rp),
dimension(n),
intent(inout) :: u
181 integer,
dimension(m),
intent(inout) :: gd
182 integer,
dimension(nb),
intent(inout) :: b
183 integer,
dimension(nb),
intent(inout) :: bo
184 integer,
intent(in) :: o
185 integer :: i, j, k, blk_len
188 do concurrent(i = 1:nb)
193 tmp = min(tmp, u(gd(k + j)))
199 do concurrent(i = abs(o):m)
203 do concurrent(i = o:m:2)
204 v(dg(i)) = min(u(gd(i)), u(gd(i+1)))
213 integer,
intent(in) :: m
214 integer,
intent(in) :: n
215 integer,
intent(in) :: nb
216 real(kind=
rp),
dimension(m),
intent(inout) :: v
217 integer,
dimension(m),
intent(inout) :: dg
218 real(kind=
rp),
dimension(n),
intent(inout) :: u
219 integer,
dimension(m),
intent(inout) :: gd
220 integer,
dimension(nb),
intent(inout) :: b
221 integer,
dimension(nb),
intent(inout) :: bo
222 integer,
intent(in) :: o
223 integer :: i, j, k, blk_len
226 do concurrent(i = 1:nb)
231 tmp =
max(tmp, u(gd(k + j)))
237 do concurrent(i = abs(o):m)
241 do concurrent(i = o:m:2)
242 v(dg(i)) =
max(u(gd(i)), u(gd(i+1)))
249 subroutine gs_scatter_cpu(this, v, m, dg, u, n, gd, nb, b, bo, shrd, event)
250 integer,
intent(in) :: m
251 integer,
intent(in) :: n
252 integer,
intent(in) :: nb
253 class(
gs_cpu_t),
intent(inout) :: this
254 real(kind=
rp),
dimension(m),
intent(inout) :: v
255 integer,
dimension(m),
intent(inout) :: dg
256 real(kind=
rp),
dimension(n),
intent(inout) :: u
257 integer,
dimension(m),
intent(inout) :: gd
258 integer,
dimension(nb),
intent(inout) :: b
259 integer,
dimension(nb),
intent(inout) :: bo
260 logical,
intent(in) :: shrd
269 integer,
intent(in) :: m
270 integer,
intent(in) :: n
271 integer,
intent(in) :: nb
272 real(kind=
rp),
dimension(m),
intent(inout) :: v
273 integer,
dimension(m),
intent(inout) :: dg
274 real(kind=
rp),
dimension(n),
intent(inout) :: u
275 integer,
dimension(m),
intent(inout) :: gd
276 integer,
dimension(nb),
intent(inout) :: b
277 integer,
dimension(nb),
intent(inout) :: bo
278 integer :: i, j, k, blk_len
281 do concurrent(i = 1:nb)
290 do concurrent(i = (bo(nb) + b(nb) + 1):m)
Defines a gather-scatter backend.
Generic Gather-scatter backend for CPUs.
subroutine gs_scatter_kernel(v, m, dg, u, n, gd, nb, b, bo)
Scatter kernel .
subroutine gs_cpu_init(this, nlocal, nshared, nlcl_blks, nshrd_blks)
Dummy backend initialisation.
subroutine gs_gather_kernel_add(v, m, o, dg, u, n, gd, nb, b, bo)
Gather kernel for addition of data .
subroutine gs_gather_kernel_mul(v, m, o, dg, u, n, gd, nb, b, bo)
Gather kernel for multiplication of data .
subroutine gs_cpu_free(this)
Dummy backend deallocation.
subroutine gs_scatter_cpu(this, v, m, dg, u, n, gd, nb, b, bo, shrd, event)
Scatter kernel.
subroutine gs_gather_cpu(this, v, m, o, dg, u, n, gd, nb, b, bo, op, shrd)
Gather kernel.
subroutine gs_gather_kernel_min(v, m, o, dg, u, n, gd, nb, b, bo)
Gather kernel for minimum of data .
subroutine gs_gather_kernel_max(v, m, o, dg, u, n, gd, nb, b, bo)
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.