42 use,
intrinsic :: iso_c_binding, only : c_ptr, c_int
55 dx_d, dy_d, dz_d, dxt_d, dyt_d, dzt_d, &
56 h1_d, g11_d, g22_d, g33_d, g12_d, g13_d, g23_d, nelv, lx) &
57 bind(c, name=
'hip_ax_helm')
58 use,
intrinsic :: iso_c_binding
59 type(c_ptr),
value :: w_d, u_d
60 type(c_ptr),
value :: dx_d, dy_d, dz_d
61 type(c_ptr),
value :: dxt_d, dyt_d, dzt_d
62 type(c_ptr),
value :: h1_d, g11_d, g22_d, g33_d, g12_d, g13_d, g23_d
63 integer(c_int) :: nelv, lx
69 dx_d, dy_d, dz_d, dxt_d, dyt_d, dzt_d,&
70 h1_d, g11_d, g22_d, g33_d, g12_d, g13_d, g23_d, nelv, lx) &
71 bind(c, name=
'hip_ax_helm_vector')
72 use,
intrinsic :: iso_c_binding
73 type(c_ptr),
value :: au_d, av_d, aw_d
74 type(c_ptr),
value :: u_d, v_d, w_d
75 type(c_ptr),
value :: dx_d, dy_d, dz_d
76 type(c_ptr),
value :: dxt_d, dyt_d, dzt_d
77 type(c_ptr),
value :: h1_d, g11_d, g22_d, g33_d, g12_d, g13_d, g23_d
78 integer(c_int) :: nelv, lx
84 h2_d, B_d, n) bind(c, name='hip_ax_helm_vector_part2')
85 use,
intrinsic :: iso_c_binding
86 type(c_ptr),
value :: au_d, av_d, aw_d
87 type(c_ptr),
value :: u_d, v_d, w_d
88 type(c_ptr),
value :: h2_d, B_d
95 dx_d, dy_d, dz_d, dxt_d, dyt_d, dzt_d,&
96 h1_d, g11_d, g22_d, g33_d, g12_d, g13_d, g23_d, nelv, lx) &
97 bind(c, name=
'cuda_ax_helm')
98 use,
intrinsic :: iso_c_binding
99 type(c_ptr),
value :: w_d, u_d
100 type(c_ptr),
value :: dx_d, dy_d, dz_d
101 type(c_ptr),
value :: dxt_d, dyt_d, dzt_d
102 type(c_ptr),
value :: h1_d, g11_d, g22_d, g33_d, g12_d, g13_d, g23_d
103 integer(c_int) :: nelv, lx
109 dx_d, dy_d, dz_d, dxt_d, dyt_d, dzt_d,&
110 h1_d, g11_d, g22_d, g33_d, g12_d, g13_d, g23_d, nelv, lx) &
111 bind(c, name=
'cuda_ax_helm_vector')
112 use,
intrinsic :: iso_c_binding
113 type(c_ptr),
value :: au_d, av_d, aw_d
114 type(c_ptr),
value :: u_d, v_d, w_d
115 type(c_ptr),
value :: dx_d, dy_d, dz_d
116 type(c_ptr),
value :: dxt_d, dyt_d, dzt_d
117 type(c_ptr),
value :: h1_d, g11_d, g22_d, g33_d, g12_d, g13_d, g23_d
118 integer(c_int) :: nelv, lx
124 h2_d, B_d, n) bind(c, name='cuda_ax_helm_vector_part2')
125 use,
intrinsic :: iso_c_binding
126 type(c_ptr),
value :: au_d, av_d, aw_d
127 type(c_ptr),
value :: u_d, v_d, w_d
128 type(c_ptr),
value :: h2_d, B_d
135 dx_d, dy_d, dz_d, dxt_d, dyt_d, dzt_d, &
136 h1_d, g11_d, g22_d, g33_d, g12_d, g13_d, g23_d, nelv, lx) &
137 bind(c, name=
'opencl_ax_helm')
138 use,
intrinsic :: iso_c_binding
139 type(c_ptr),
value :: w_d, u_d
140 type(c_ptr),
value :: dx_d, dy_d, dz_d
141 type(c_ptr),
value :: dxt_d, dyt_d, dzt_d
142 type(c_ptr),
value :: h1_d, g11_d, g22_d, g33_d, g12_d, g13_d, g23_d
143 integer(c_int) :: nelv, lx
149 dx_d, dy_d, dz_d, dxt_d, dyt_d, dzt_d,&
150 h1_d, g11_d, g22_d, g33_d, g12_d, g13_d, g23_d, nelv, lx) &
151 bind(c, name=
'opencl_ax_helm_vector')
152 use,
intrinsic :: iso_c_binding
153 type(c_ptr),
value :: au_d, av_d, aw_d
154 type(c_ptr),
value :: u_d, v_d, w_d
155 type(c_ptr),
value :: dx_d, dy_d, dz_d
156 type(c_ptr),
value :: dxt_d, dyt_d, dzt_d
157 type(c_ptr),
value :: h1_d, g11_d, g22_d, g33_d, g12_d, g13_d, g23_d
158 integer(c_int) :: nelv, lx
163 subroutine opencl_ax_helm_vector_part2(au_d, av_d, aw_d, u_d, v_d, w_d, &
164 h2_d, B_d, n) bind(c, name='opencl_ax_helm_vector_part2')
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 :: h2_d, B_d
170 end subroutine opencl_ax_helm_vector_part2
174 subroutine metal_ax_helm(w_d, u_d, &
175 dx_d, dy_d, dz_d, dxt_d, dyt_d, dzt_d, &
176 h1_d, g11_d, g22_d, g33_d, g12_d, g13_d, g23_d, nelv, lx) &
177 bind(c, name=
'metal_ax_helm')
178 use,
intrinsic :: iso_c_binding
179 type(c_ptr),
value :: w_d, u_d
180 type(c_ptr),
value :: dx_d, dy_d, dz_d
181 type(c_ptr),
value :: dxt_d, dyt_d, dzt_d
182 type(c_ptr),
value :: h1_d, g11_d, g22_d, g33_d, g12_d, g13_d, g23_d
183 integer(c_int) :: nelv, lx
184 end subroutine metal_ax_helm
188 subroutine metal_ax_helm_vector(au_d, av_d, aw_d, u_d, v_d, w_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, nelv, lx) &
191 bind(c, name=
'metal_ax_helm_vector')
192 use,
intrinsic :: iso_c_binding
193 type(c_ptr),
value :: au_d, av_d, aw_d
194 type(c_ptr),
value :: u_d, v_d, w_d
195 type(c_ptr),
value :: dx_d, dy_d, dz_d
196 type(c_ptr),
value :: dxt_d, dyt_d, dzt_d
197 type(c_ptr),
value :: h1_d, g11_d, g22_d, g33_d, g12_d, g13_d, g23_d
198 integer(c_int) :: nelv, lx
199 end subroutine metal_ax_helm_vector
203 subroutine metal_ax_helm_vector_part2(au_d, av_d, aw_d, u_d, v_d, w_d, &
204 h2_d, B_d, n) bind(c, name='metal_ax_helm_vector_part2')
205 use,
intrinsic :: iso_c_binding
206 type(c_ptr),
value :: au_d, av_d, aw_d
207 type(c_ptr),
value :: u_d, v_d, w_d
208 type(c_ptr),
value :: h2_d, B_d
210 end subroutine metal_ax_helm_vector_part2
217 type(
mesh_t),
intent(in) :: msh
218 type(
space_t),
intent(in) :: Xh
219 type(
coef_t),
intent(in) :: coef
220 real(kind=
rp),
intent(inout) :: w(xh%lx, xh%ly, xh%lz, msh%nelv)
221 real(kind=
rp),
intent(in) :: u(xh%lx, xh%ly, xh%lz, msh%nelv)
222 type(c_ptr) :: u_d, w_d
228 call hip_ax_helm(w_d, u_d, xh%dx_d, xh%dy_d, xh%dz_d, &
229 xh%dxt_d, xh%dyt_d, xh%dzt_d, coef%h1_d, &
230 coef%G11_d, coef%G22_d, coef%G33_d, &
231 coef%G12_d, coef%G13_d, coef%G23_d, &
234 call cuda_ax_helm(w_d, u_d, xh%dx_d, xh%dy_d, xh%dz_d, &
235 xh%dxt_d, xh%dyt_d, xh%dzt_d, coef%h1_d, &
236 coef%G11_d, coef%G22_d, coef%G33_d, &
237 coef%G12_d, coef%G13_d, coef%G23_d, &
241 xh%dxt_d, xh%dyt_d, xh%dzt_d, coef%h1_d, &
242 coef%G11_d, coef%G22_d, coef%G33_d, &
243 coef%G12_d, coef%G13_d, coef%G23_d, &
246 call metal_ax_helm(w_d, u_d, xh%dx_d, xh%dy_d, xh%dz_d, &
247 xh%dxt_d, xh%dyt_d, xh%dzt_d, coef%h1_d, &
248 coef%G11_d, coef%G22_d, coef%G33_d, &
249 coef%G12_d, coef%G13_d, coef%G23_d, &
254 call device_addcol4(w_d ,coef%h2_d, coef%B_d, u_d, coef%dof%size())
260 u, v, w, coef, msh, Xh)
262 type(
space_t),
intent(in) :: Xh
263 type(
mesh_t),
intent(in) :: msh
264 type(
coef_t),
intent(in) :: coef
265 real(kind=
rp),
intent(inout) :: au(xh%lx, xh%ly, xh%lz, msh%nelv)
266 real(kind=
rp),
intent(inout) :: av(xh%lx, xh%ly, xh%lz, msh%nelv)
267 real(kind=
rp),
intent(inout) :: aw(xh%lx, xh%ly, xh%lz, msh%nelv)
268 real(kind=
rp),
intent(in) :: u(xh%lx, xh%ly, xh%lz, msh%nelv)
269 real(kind=
rp),
intent(in) :: v(xh%lx, xh%ly, xh%lz, msh%nelv)
270 real(kind=
rp),
intent(in) :: w(xh%lx, xh%ly, xh%lz, msh%nelv)
271 type(c_ptr) :: u_d, v_d, w_d
272 type(c_ptr) :: au_d, av_d, aw_d
284 xh%dx_d, xh%dy_d, xh%dz_d, xh%dxt_d, xh%dyt_d, xh%dzt_d, coef%h1_d, &
285 coef%G11_d, coef%G22_d, coef%G33_d, &
286 coef%G12_d, coef%G13_d, coef%G23_d, &
290 xh%dx_d, xh%dy_d, xh%dz_d, xh%dxt_d, xh%dyt_d, xh%dzt_d, coef%h1_d, &
291 coef%G11_d, coef%G22_d, coef%G33_d, &
292 coef%G12_d, coef%G13_d, coef%G23_d, &
296 xh%dx_d, xh%dy_d, xh%dz_d, xh%dxt_d, xh%dyt_d, xh%dzt_d, coef%h1_d, &
297 coef%G11_d, coef%G22_d, coef%G33_d, &
298 coef%G12_d, coef%G13_d, coef%G23_d, &
301 call metal_ax_helm_vector(au_d, av_d, aw_d, u_d, v_d, w_d, &
302 xh%dx_d, xh%dy_d, xh%dz_d, xh%dxt_d, xh%dyt_d, xh%dzt_d, coef%h1_d, &
303 coef%G11_d, coef%G22_d, coef%G33_d, &
304 coef%G12_d, coef%G13_d, coef%G23_d, &
311 coef%h2_d, coef%B_d, coef%dof%size())
314 coef%h2_d, coef%B_d, coef%dof%size())
316 call metal_ax_helm_vector_part2(au_d, av_d, aw_d, u_d, v_d, w_d, &
317 coef%h2_d, coef%B_d, coef%dof%size())
319 call device_addcol4(au_d ,coef%h2_d, coef%B_d, u_d, coef%dof%size())
320 call device_addcol4(av_d ,coef%h2_d, coef%B_d, v_d, coef%dof%size())
321 call device_addcol4(aw_d ,coef%h2_d, coef%B_d, w_d, coef%dof%size())
void opencl_ax_helm_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, int *nelv, int *lx)
void opencl_ax_helm(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, int *nelv, int *lx)
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 cuda_ax_helm(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, int *nelv, int *lx)
void cuda_ax_helm_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, int *nelv, int *lx)
Return the device pointer for an associated Fortran array.
subroutine ax_helm_device_compute(w, u, coef, msh, xh)
subroutine ax_helm_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.
Matrix-vector product for a Helmholtz problem.
Coefficients defined on a given (mesh, ) tuple. Arrays use indices (i,j,k,e): element e,...
The function space for the SEM solution fields.