43 use,
intrinsic :: iso_c_binding, only : c_ptr, c_int
56 procedure, pass(this) :: compute_vector => &
63 dx_d, dy_d, dz_d, dxt_d, dyt_d, dzt_d, &
64 h1_d, g11_d, g22_d, g33_d, g12_d, g13_d, g23_d, ind_d, nelv, lx) &
65 bind(c, name=
'hip_ax_helm_compr')
66 use,
intrinsic :: iso_c_binding
67 type(c_ptr),
value :: w_d, u_d
68 type(c_ptr),
value :: dx_d, dy_d, dz_d
69 type(c_ptr),
value :: dxt_d, dyt_d, dzt_d
70 type(c_ptr),
value :: h1_d, g11_d, g22_d, g33_d, g12_d, g13_d, g23_d
71 type(c_ptr),
value :: ind_d
72 integer(c_int) :: nelv, lx
78 dx_d, dy_d, dz_d, dxt_d, dyt_d, dzt_d, &
79 h1_d, g11_d, g22_d, g33_d, g12_d, g13_d, g23_d, ind_d, nelv, lx) &
80 bind(c, name=
'hip_ax_helm_compr_vector')
81 use,
intrinsic :: iso_c_binding
82 type(c_ptr),
value :: au_d, av_d, aw_d
83 type(c_ptr),
value :: u_d, v_d, w_d
84 type(c_ptr),
value :: dx_d, dy_d, dz_d
85 type(c_ptr),
value :: dxt_d, dyt_d, dzt_d
86 type(c_ptr),
value :: h1_d, g11_d, g22_d, g33_d, g12_d, g13_d, g23_d
87 type(c_ptr),
value :: ind_d
88 integer(c_int) :: nelv, lx
94 h2_d, B_d, n) bind(c, name='hip_ax_helm_vector_part2')
95 use,
intrinsic :: iso_c_binding
96 type(c_ptr),
value :: au_d, av_d, aw_d
97 type(c_ptr),
value :: u_d, v_d, w_d
98 type(c_ptr),
value :: h2_d, B_d
105 dx_d, dy_d, dz_d, dxt_d, dyt_d, dzt_d, &
106 h1_d, g11_d, g22_d, g33_d, g12_d, g13_d, g23_d, ind_d, nelv, lx) &
107 bind(c, name=
'cuda_ax_helm_compr')
108 use,
intrinsic :: iso_c_binding
109 type(c_ptr),
value :: w_d, u_d
110 type(c_ptr),
value :: dx_d, dy_d, dz_d
111 type(c_ptr),
value :: dxt_d, dyt_d, dzt_d
112 type(c_ptr),
value :: h1_d, g11_d, g22_d, g33_d, g12_d, g13_d, g23_d
113 type(c_ptr),
value :: ind_d
114 integer(c_int) :: nelv, lx
120 dx_d, dy_d, dz_d, dxt_d, dyt_d, dzt_d, &
121 h1_d, g11_d, g22_d, g33_d, g12_d, g13_d, g23_d, ind_d, nelv, lx) &
122 bind(c, name=
'cuda_ax_helm_compr_vector')
123 use,
intrinsic :: iso_c_binding
124 type(c_ptr),
value :: au_d, av_d, aw_d
125 type(c_ptr),
value :: u_d, v_d, w_d
126 type(c_ptr),
value :: dx_d, dy_d, dz_d
127 type(c_ptr),
value :: dxt_d, dyt_d, dzt_d
128 type(c_ptr),
value :: h1_d, g11_d, g22_d, g33_d, g12_d, g13_d, g23_d
129 type(c_ptr),
value :: ind_d
130 integer(c_int) :: nelv, lx
136 h2_d, B_d, n) bind(c, name='cuda_ax_helm_vector_part2')
137 use,
intrinsic :: iso_c_binding
138 type(c_ptr),
value :: au_d, av_d, aw_d
139 type(c_ptr),
value :: u_d, v_d, w_d
140 type(c_ptr),
value :: h2_d, B_d
147 dx_d, dy_d, dz_d, dxt_d, dyt_d, dzt_d, &
148 h1_d, g11_d, g22_d, g33_d, g12_d, g13_d, g23_d, ind_d, nelv, lx) &
149 bind(c, name=
'opencl_ax_helm_compr')
150 use,
intrinsic :: iso_c_binding
151 type(c_ptr),
value :: w_d, u_d
152 type(c_ptr),
value :: dx_d, dy_d, dz_d
153 type(c_ptr),
value :: dxt_d, dyt_d, dzt_d
154 type(c_ptr),
value :: h1_d, g11_d, g22_d, g33_d, g12_d, g13_d, g23_d
155 type(c_ptr),
value :: ind_d
156 integer(c_int) :: nelv, lx
162 dx_d, dy_d, dz_d, dxt_d, dyt_d, dzt_d, &
163 h1_d, g11_d, g22_d, g33_d, g12_d, g13_d, g23_d, ind_d, nelv, lx) &
164 bind(c, name=
'opencl_ax_helm_compr_vector')
165 use,
intrinsic :: iso_c_binding
166 type(c_ptr),
value :: au_d, av_d, aw_d
167 type(c_ptr),
value :: u_d, v_d, w_d
168 type(c_ptr),
value :: dx_d, dy_d, dz_d
169 type(c_ptr),
value :: dxt_d, dyt_d, dzt_d
170 type(c_ptr),
value :: h1_d, g11_d, g22_d, g33_d, g12_d, g13_d, g23_d
171 type(c_ptr),
value :: ind_d
172 integer(c_int) :: nelv, lx
178 h2_d, B_d, n) bind(c, name='opencl_ax_helm_vector_part2')
179 use,
intrinsic :: iso_c_binding
180 type(c_ptr),
value :: au_d, av_d, aw_d
181 type(c_ptr),
value :: u_d, v_d, w_d
182 type(c_ptr),
value :: h2_d, B_d
188 subroutine metal_ax_helm_compr(w_d, u_d, &
189 dx_d, dy_d, dz_d, dxt_d, dyt_d, dzt_d, &
190 h1_d, g11_d, g22_d, g33_d, g12_d, g13_d, g23_d, ind_d, nelv, lx) &
191 bind(c, name=
'metal_ax_helm_compr')
192 use,
intrinsic :: iso_c_binding
193 type(c_ptr),
value :: w_d, u_d
194 type(c_ptr),
value :: dx_d, dy_d, dz_d
195 type(c_ptr),
value :: dxt_d, dyt_d, dzt_d
196 type(c_ptr),
value :: h1_d, g11_d, g22_d, g33_d, g12_d, g13_d, g23_d
197 type(c_ptr),
value :: ind_d
198 integer(c_int) :: nelv, lx
199 end subroutine metal_ax_helm_compr
203 subroutine metal_ax_helm_compr_vector(au_d, av_d, aw_d, u_d, v_d, w_d, &
204 dx_d, dy_d, dz_d, dxt_d, dyt_d, dzt_d, &
205 h1_d, g11_d, g22_d, g33_d, g12_d, g13_d, g23_d, ind_d, nelv, lx) &
206 bind(c, name=
'metal_ax_helm_compr_vector')
207 use,
intrinsic :: iso_c_binding
208 type(c_ptr),
value :: au_d, av_d, aw_d
209 type(c_ptr),
value :: u_d, v_d, w_d
210 type(c_ptr),
value :: dx_d, dy_d, dz_d
211 type(c_ptr),
value :: dxt_d, dyt_d, dzt_d
212 type(c_ptr),
value :: h1_d, g11_d, g22_d, g33_d, g12_d, g13_d, g23_d
213 type(c_ptr),
value :: ind_d
214 integer(c_int) :: nelv, lx
215 end subroutine metal_ax_helm_compr_vector
219 subroutine metal_ax_helm_vector_part2(au_d, av_d, aw_d, u_d, v_d, w_d, &
220 h2_d, B_d, n) bind(c, name='metal_ax_helm_vector_part2')
221 use,
intrinsic :: iso_c_binding
222 type(c_ptr),
value :: au_d, av_d, aw_d
223 type(c_ptr),
value :: u_d, v_d, w_d
224 type(c_ptr),
value :: h2_d, B_d
226 end subroutine metal_ax_helm_vector_part2
234 type(
mesh_t),
intent(in) :: msh
235 type(
space_t),
intent(in) :: Xh
236 type(
coef_t),
intent(in) :: coef
237 real(kind=
rp),
intent(inout) :: w(xh%lx, xh%ly, xh%lz, msh%nelv)
238 real(kind=
rp),
intent(in) :: u(xh%lx, xh%ly, xh%lz, msh%nelv)
239 type(c_ptr) :: u_d, w_d
241 if (.not.
allocated(coef%compression_inds))
then
242 call this%ax_helm_device_t%compute(w, u, coef, msh, xh)
246 if (
size(coef%compression_inds) .ne. msh%nelv)
then
247 call neko_error(
'Compressed geometric factors do not match the mesh')
255 xh%dxt_d, xh%dyt_d, xh%dzt_d, coef%h1_d, &
256 coef%G11_compr_d, coef%G22_compr_d, coef%G33_compr_d, &
257 coef%G12_compr_d, coef%G13_compr_d, coef%G23_compr_d, &
258 coef%compression_inds_d, msh%nelv, xh%lx)
261 xh%dxt_d, xh%dyt_d, xh%dzt_d, coef%h1_d, &
262 coef%G11_compr_d, coef%G22_compr_d, coef%G33_compr_d, &
263 coef%G12_compr_d, coef%G13_compr_d, coef%G23_compr_d, &
264 coef%compression_inds_d, msh%nelv, xh%lx)
267 xh%dxt_d, xh%dyt_d, xh%dzt_d, coef%h1_d, &
268 coef%G11_compr_d, coef%G22_compr_d, coef%G33_compr_d, &
269 coef%G12_compr_d, coef%G13_compr_d, coef%G23_compr_d, &
270 coef%compression_inds_d, msh%nelv, xh%lx)
272 call metal_ax_helm_compr(w_d, u_d, xh%dx_d, xh%dy_d, xh%dz_d, &
273 xh%dxt_d, xh%dyt_d, xh%dzt_d, coef%h1_d, &
274 coef%G11_compr_d, coef%G22_compr_d, coef%G33_compr_d, &
275 coef%G12_compr_d, coef%G13_compr_d, coef%G23_compr_d, &
276 coef%compression_inds_d, msh%nelv, xh%lx)
280 call device_addcol4(w_d, coef%h2_d, coef%B_d, u_d, coef%dof%size())
286 u, v, w, coef, msh, Xh)
288 type(
space_t),
intent(in) :: Xh
289 type(
mesh_t),
intent(in) :: msh
290 type(
coef_t),
intent(in) :: coef
291 real(kind=
rp),
intent(inout) :: au(xh%lx, xh%ly, xh%lz, msh%nelv)
292 real(kind=
rp),
intent(inout) :: av(xh%lx, xh%ly, xh%lz, msh%nelv)
293 real(kind=
rp),
intent(inout) :: aw(xh%lx, xh%ly, xh%lz, msh%nelv)
294 real(kind=
rp),
intent(in) :: u(xh%lx, xh%ly, xh%lz, msh%nelv)
295 real(kind=
rp),
intent(in) :: v(xh%lx, xh%ly, xh%lz, msh%nelv)
296 real(kind=
rp),
intent(in) :: w(xh%lx, xh%ly, xh%lz, msh%nelv)
297 type(c_ptr) :: u_d, v_d, w_d
298 type(c_ptr) :: au_d, av_d, aw_d
300 if (.not.
allocated(coef%compression_inds))
then
301 call this%ax_helm_device_t%compute_vector(au, av, aw, u, v, w, &
306 if (
size(coef%compression_inds) .ne. msh%nelv)
then
307 call neko_error(
'Compressed geometric factors do not match the mesh')
320 xh%dx_d, xh%dy_d, xh%dz_d, xh%dxt_d, xh%dyt_d, xh%dzt_d, coef%h1_d, &
321 coef%G11_compr_d, coef%G22_compr_d, coef%G33_compr_d, &
322 coef%G12_compr_d, coef%G13_compr_d, coef%G23_compr_d, &
323 coef%compression_inds_d, msh%nelv, xh%lx)
326 xh%dx_d, xh%dy_d, xh%dz_d, xh%dxt_d, xh%dyt_d, xh%dzt_d, coef%h1_d, &
327 coef%G11_compr_d, coef%G22_compr_d, coef%G33_compr_d, &
328 coef%G12_compr_d, coef%G13_compr_d, coef%G23_compr_d, &
329 coef%compression_inds_d, msh%nelv, xh%lx)
332 xh%dx_d, xh%dy_d, xh%dz_d, xh%dxt_d, xh%dyt_d, xh%dzt_d, coef%h1_d, &
333 coef%G11_compr_d, coef%G22_compr_d, coef%G33_compr_d, &
334 coef%G12_compr_d, coef%G13_compr_d, coef%G23_compr_d, &
335 coef%compression_inds_d, msh%nelv, xh%lx)
337 call metal_ax_helm_compr_vector(au_d, av_d, aw_d, u_d, v_d, w_d, &
338 xh%dx_d, xh%dy_d, xh%dz_d, xh%dxt_d, xh%dyt_d, xh%dzt_d, coef%h1_d, &
339 coef%G11_compr_d, coef%G22_compr_d, coef%G33_compr_d, &
340 coef%G12_compr_d, coef%G13_compr_d, coef%G23_compr_d, &
341 coef%compression_inds_d, msh%nelv, xh%lx)
347 coef%h2_d, coef%B_d, coef%dof%size())
350 coef%h2_d, coef%B_d, coef%dof%size())
353 coef%h2_d, coef%B_d, coef%dof%size())
355 call metal_ax_helm_vector_part2(au_d, av_d, aw_d, u_d, v_d, w_d, &
356 coef%h2_d, coef%B_d, coef%dof%size())
void opencl_ax_helm_vector_part2(void *au, void *av, void *aw, void *u, void *v, void *w, void *h2, void *B, int *n)
void cuda_ax_helm_vector_part2(void *au, void *av, void *aw, void *u, void *v, void *w, void *h2, void *B, int *n)
void opencl_ax_helm_compr(void *w, void *u, void *dx, void *dy, void *dz, void *dxt, void *dyt, void *dzt, void *h1, void *g11, void *g22, void *g33, void *g12, void *g13, void *g23, void *ind, int *nelv, int *lx)
void opencl_ax_helm_compr_vector(void *au, void *av, void *aw, void *u, void *v, void *w, void *dx, void *dy, void *dz, void *dxt, void *dyt, void *dzt, void *h1, void *g11, void *g22, void *g33, void *g12, void *g13, void *g23, void *ind, int *nelv, int *lx)
void cuda_ax_helm_compr_vector(void *au, void *av, void *aw, void *u, void *v, void *w, void *dx, void *dy, void *dz, void *dxt, void *dyt, void *dzt, void *h1, void *g11, void *g22, void *g33, void *g12, void *g13, void *g23, void *ind, int *nelv, int *lx)
void cuda_ax_helm_compr(void *w, void *u, void *dx, void *dy, void *dz, void *dxt, void *dyt, void *dzt, void *h1, void *g11, void *g22, void *g33, void *g12, void *g13, void *g23, void *ind, int *nelv, int *lx)
Return the device pointer for an associated Fortran array.
Device Helmholtz matrix-vector product on compressed geometric factors.
subroutine ax_helm_compr_device_compute(this, w, u, coef, msh, xh)
subroutine ax_helm_compr_device_compute_vector(this, au, av, aw, u, v, w, coef, msh, xh)
subroutine, public device_addcol4(a_d, b_d, c_d, d_d, n, strm)
Returns .
Device abstraction, common interface for various accelerators.
integer, parameter, public rp
Global precision used in computations.
Defines a function space.
Device matrix-vector product for a Helmholtz problem, reading the geometric factors from their compr...
Coefficients defined on a given (mesh, ) tuple. Arrays use indices (i,j,k,e): element e,...
The function space for the SEM solution fields.