45 use,
intrinsic :: iso_c_binding
55 dx_d, dy_d, dz_d, jacinv_d, nel, lx) &
56 bind(c, name =
'hip_dudxyz')
57 use,
intrinsic :: iso_c_binding
58 type(c_ptr),
value :: du_d, u_d, dr_d, ds_d, dt_d
59 type(c_ptr),
value :: dx_d, dy_d, dz_d, jacinv_d
60 integer(c_int) :: nel, lx
65 subroutine hip_cdtp(dtx_d, x_d, dr_d, ds_d, dt_d, &
66 dxt_d, dyt_d, dzt_d, w3_d, nel, lx) &
67 bind(c, name =
'hip_cdtp')
68 use,
intrinsic :: iso_c_binding
69 type(c_ptr),
value :: dtx_d, x_d, dr_d, ds_d, dt_d
70 type(c_ptr),
value :: dxt_d, dyt_d, dzt_d, w3_d
71 integer(c_int) :: nel, lx
77 dx_d, dy_d, dz_d, drdx_d, dsdx_d, dtdx_d, &
78 drdy_d, dsdy_d, dtdy_d, drdz_d, dsdz_d, dtdz_d, &
79 jacinv_d, nel, gdim, lx) &
80 bind(c, name =
'hip_conv1')
81 use,
intrinsic :: iso_c_binding
82 type(c_ptr),
value :: du_d, u_d, vx_d, vy_d, vz_d
83 type(c_ptr),
value :: dx_d, dy_d, dz_d, drdx_d, dsdx_d, dtdx_d
84 type(c_ptr),
value :: drdy_d, dsdy_d, dtdy_d, drdz_d, dsdz_d, dtdz_d
85 type(c_ptr),
value :: jacinv_d
86 integer(c_int) :: nel, gdim, lx
93 drdx_d, dsdx_d, dtdx_d, &
94 drdy_d, dsdy_d, dtdy_d, &
95 drdz_d, dsdz_d, dtdz_d, w3_d, nel, lx) &
96 bind(c, name =
'hip_opgrad')
97 use,
intrinsic :: iso_c_binding
98 type(c_ptr),
value :: ux_d, uy_d, uz_d, u_d
99 type(c_ptr),
value :: dx_d, dy_d, dz_d
100 type(c_ptr),
value :: drdx_d, dsdx_d, dtdx_d
101 type(c_ptr),
value :: drdy_d, dsdy_d, dtdy_d
102 type(c_ptr),
value :: drdz_d, dsdz_d, dtdz_d
103 type(c_ptr),
value :: w3_d
104 integer(c_int) :: nel, lx
111 drdx_d, dsdx_d, dtdx_d, &
112 drdy_d, dsdy_d, dtdy_d, &
113 drdz_d, dsdz_d, dtdz_d, jacinv_d, nel, lx) &
114 bind(c, name =
'hip_lambda2')
115 use,
intrinsic :: iso_c_binding
116 type(c_ptr),
value :: lambda2_d, u_d, v_d, w_d
117 type(c_ptr),
value :: dx_d, dy_d, dz_d
118 type(c_ptr),
value :: drdx_d, dsdx_d, dtdx_d
119 type(c_ptr),
value :: drdy_d, dsdy_d, dtdy_d
120 type(c_ptr),
value :: drdz_d, dsdz_d, dtdz_d
121 type(c_ptr),
value :: jacinv_d
122 integer(c_int) :: nel, lx
128 drdx_d, dsdx_d, dtdx_d, drdy_d, dsdy_d, dtdy_d, &
129 drdz_d, dsdz_d, dtdz_d, dr_inv_d, ds_inv_d, dt_inv_d, &
131 bind(c, name =
'hip_cfl')
132 use,
intrinsic :: iso_c_binding
134 type(c_ptr),
value :: u_d, v_d, w_d, drdx_d, dsdx_d, dtdx_d
135 type(c_ptr),
value :: drdy_d, dsdy_d, dtdy_d, drdz_d, dsdz_d, dtdz_d
136 type(c_ptr),
value :: dr_inv_d, ds_inv_d, dt_inv_d, jacinv_d
138 integer(c_int) :: nel, lx
143 subroutine cuda_dudxyz(du_d, u_d, dr_d, ds_d, dt_d, &
144 dx_d, dy_d, dz_d, jacinv_d, nel, lx) &
145 bind(c, name =
'cuda_dudxyz')
146 use,
intrinsic :: iso_c_binding
147 type(c_ptr),
value :: du_d, u_d, dr_d, ds_d, dt_d
148 type(c_ptr),
value :: dx_d, dy_d, dz_d, jacinv_d
149 integer(c_int) :: nel, lx
154 subroutine cuda_cdtp(dtx_d, x_d, dr_d, ds_d, dt_d, &
155 dxt_d, dyt_d, dzt_d, w3_d, nel, lx) &
156 bind(c, name =
'cuda_cdtp')
157 use,
intrinsic :: iso_c_binding
158 type(c_ptr),
value :: dtx_d, x_d, dr_d, ds_d, dt_d
159 type(c_ptr),
value :: dxt_d, dyt_d, dzt_d, w3_d
160 integer(c_int) :: nel, lx
165 subroutine cuda_conv1(du_d, u_d, vx_d, vy_d, vz_d, &
166 dx_d, dy_d, dz_d, drdx_d, dsdx_d, dtdx_d, &
167 drdy_d, dsdy_d, dtdy_d, drdz_d, dsdz_d, dtdz_d, &
168 jacinv_d, nel, gdim, lx) &
169 bind(c, name =
'cuda_conv1')
170 use,
intrinsic :: iso_c_binding
171 type(c_ptr),
value :: du_d, u_d, vx_d, vy_d, vz_d
172 type(c_ptr),
value :: dx_d, dy_d, dz_d, drdx_d, dsdx_d, dtdx_d
173 type(c_ptr),
value :: drdy_d, dsdy_d, dtdy_d, drdz_d, dsdz_d, dtdz_d
174 type(c_ptr),
value :: jacinv_d
175 integer(c_int) :: nel, gdim, lx
182 drdx_d, dsdx_d, dtdx_d, &
183 drdy_d, dsdy_d, dtdy_d, &
184 drdz_d, dsdz_d, dtdz_d, w3_d, nel, lx) &
185 bind(c, name =
'cuda_opgrad')
186 use,
intrinsic :: iso_c_binding
187 type(c_ptr),
value :: ux_d, uy_d, uz_d, u_d
188 type(c_ptr),
value :: dx_d, dy_d, dz_d
189 type(c_ptr),
value :: drdx_d, dsdx_d, dtdx_d
190 type(c_ptr),
value :: drdy_d, dsdy_d, dtdy_d
191 type(c_ptr),
value :: drdz_d, dsdz_d, dtdz_d
192 type(c_ptr),
value :: w3_d
193 integer(c_int) :: nel, lx
200 drdx_d, dsdx_d, dtdx_d, &
201 drdy_d, dsdy_d, dtdy_d, &
202 drdz_d, dsdz_d, dtdz_d, jacinv_d, nel, lx) &
203 bind(c, name =
'cuda_lambda2')
204 use,
intrinsic :: iso_c_binding
205 type(c_ptr),
value :: lambda2_d, u_d, v_d, w_d
206 type(c_ptr),
value :: dx_d, dy_d, dz_d
207 type(c_ptr),
value :: drdx_d, dsdx_d, dtdx_d
208 type(c_ptr),
value :: drdy_d, dsdy_d, dtdy_d
209 type(c_ptr),
value :: drdz_d, dsdz_d, dtdz_d
210 type(c_ptr),
value :: jacinv_d
211 integer(c_int) :: nel, lx
217 real(c_rp) function
cuda_cfl(dt, u_d, v_d, w_d, &
218 drdx_d, dsdx_d, dtdx_d, drdy_d, dsdy_d, dtdy_d, &
219 drdz_d, dsdz_d, dtdz_d, dr_inv_d, ds_inv_d, dt_inv_d, &
221 bind(c, name =
'cuda_cfl')
222 use,
intrinsic :: iso_c_binding
224 type(c_ptr),
value :: u_d, v_d, w_d, drdx_d, dsdx_d, dtdx_d
225 type(c_ptr),
value :: drdy_d, dsdy_d, dtdy_d, drdz_d, dsdz_d, dtdz_d
226 type(c_ptr),
value :: dr_inv_d, ds_inv_d, dt_inv_d, jacinv_d
228 integer(c_int) :: nel, lx
234 dx_d, dy_d, dz_d, jacinv_d, nel, lx) &
235 bind(c, name =
'opencl_dudxyz')
236 use,
intrinsic :: iso_c_binding
237 type(c_ptr),
value :: du_d, u_d, dr_d, ds_d, dt_d
238 type(c_ptr),
value :: dx_d, dy_d, dz_d, jacinv_d
239 integer(c_int) :: nel, lx
244 subroutine opencl_cdtp(dtx_d, x_d, dr_d, ds_d, dt_d, &
245 dxt_d, dyt_d, dzt_d, w3_d, nel, lx) &
246 bind(c, name =
'opencl_cdtp')
247 use,
intrinsic :: iso_c_binding
248 type(c_ptr),
value :: dtx_d, x_d, dr_d, ds_d, dt_d
249 type(c_ptr),
value :: dxt_d, dyt_d, dzt_d, w3_d
250 integer(c_int) :: nel, lx
256 dx_d, dy_d, dz_d, drdx_d, dsdx_d, dtdx_d, &
257 drdy_d, dsdy_d, dtdy_d, drdz_d, dsdz_d, dtdz_d, &
258 jacinv_d, nel, gdim, lx) &
259 bind(c, name =
'opencl_conv1')
260 use,
intrinsic :: iso_c_binding
261 type(c_ptr),
value :: du_d, u_d, vx_d, vy_d, vz_d
262 type(c_ptr),
value :: dx_d, dy_d, dz_d, drdx_d, dsdx_d, dtdx_d
263 type(c_ptr),
value :: drdy_d, dsdy_d, dtdy_d, drdz_d, dsdz_d, dtdz_d
264 type(c_ptr),
value :: jacinv_d
265 integer(c_int) :: nel, gdim, lx
272 drdx_d, dsdx_d, dtdx_d, &
273 drdy_d, dsdy_d, dtdy_d, &
274 drdz_d, dsdz_d, dtdz_d, w3_d, nel, lx) &
275 bind(c, name =
'opencl_opgrad')
276 use,
intrinsic :: iso_c_binding
277 type(c_ptr),
value :: ux_d, uy_d, uz_d, u_d
278 type(c_ptr),
value :: dx_d, dy_d, dz_d
279 type(c_ptr),
value :: drdx_d, dsdx_d, dtdx_d
280 type(c_ptr),
value :: drdy_d, dsdy_d, dtdy_d
281 type(c_ptr),
value :: drdz_d, dsdz_d, dtdz_d
282 type(c_ptr),
value :: w3_d
283 integer(c_int) :: nel, lx
288 real(c_rp) function
opencl_cfl(dt, u_d, v_d, w_d, &
289 drdx_d, dsdx_d, dtdx_d, drdy_d, dsdy_d, dtdy_d, &
290 drdz_d, dsdz_d, dtdz_d, dr_inv_d, ds_inv_d, dt_inv_d, &
292 bind(c, name =
'opencl_cfl')
293 use,
intrinsic :: iso_c_binding
295 type(c_ptr),
value :: u_d, v_d, w_d, drdx_d, dsdx_d, dtdx_d
296 type(c_ptr),
value :: drdy_d, dsdy_d, dtdy_d, drdz_d, dsdz_d, dtdz_d
297 type(c_ptr),
value :: dr_inv_d, ds_inv_d, dt_inv_d, jacinv_d
299 integer(c_int) :: nel, lx
306 drdx_d, dsdx_d, dtdx_d, &
307 drdy_d, dsdy_d, dtdy_d, &
308 drdz_d, dsdz_d, dtdz_d, jacinv_d, nel, lx) &
309 bind(c, name =
'opencl_lambda2')
310 use,
intrinsic :: iso_c_binding
311 type(c_ptr),
value :: lambda2_d, u_d, v_d, w_d
312 type(c_ptr),
value :: dx_d, dy_d, dz_d
313 type(c_ptr),
value :: drdx_d, dsdx_d, dtdx_d
314 type(c_ptr),
value :: drdy_d, dsdy_d, dtdy_d
315 type(c_ptr),
value :: drdz_d, dsdz_d, dtdz_d
316 type(c_ptr),
value :: jacinv_d
317 integer(c_int) :: nel, lx
325 type(coef_t),
intent(in),
target :: coef
326 real(kind=rp),
dimension(coef%Xh%lx, coef%Xh%ly, &
coef%Xh%lz, coef%msh%nelv),
intent(inout) :: du
327 real(kind=rp),
dimension(coef%Xh%lx, coef%Xh%ly, &
coef%Xh%lz, coef%msh%nelv),
intent(in) :: u, dr, ds, dt
328 type(c_ptr) :: du_d, u_d, dr_d, ds_d, dt_d
330 du_d = device_get_ptr(du)
331 u_d = device_get_ptr(u)
333 dr_d = device_get_ptr(dr)
334 ds_d = device_get_ptr(ds)
335 dt_d = device_get_ptr(dt)
337 associate(xh => coef%Xh, msh => coef%msh, dof => coef%dof)
339 call hip_dudxyz(du_d, u_d, dr_d, ds_d, dt_d, &
340 xh%dx_d, xh%dy_d, xh%dz_d, coef%jacinv_d, &
344 xh%dx_d, xh%dy_d, xh%dz_d, coef%jacinv_d, &
348 xh%dx_d, xh%dy_d, xh%dz_d, coef%jacinv_d, &
351 call neko_error(
'No device backend configured')
358 type(coef_t),
intent(in) :: coef
359 real(kind=rp),
dimension(coef%Xh%lxyz, coef%msh%nelv),
intent(inout) :: ux
360 real(kind=rp),
dimension(coef%Xh%lxyz, coef%msh%nelv),
intent(inout) :: uy
361 real(kind=rp),
dimension(coef%Xh%lxyz, coef%msh%nelv),
intent(inout) :: uz
362 real(kind=rp),
dimension(coef%Xh%lxyz, coef%msh%nelv),
intent(in) :: u
363 type(c_ptr) :: ux_d, uy_d, uz_d, u_d
365 ux_d = device_get_ptr(ux)
366 uy_d = device_get_ptr(uy)
367 uz_d = device_get_ptr(uz)
369 u_d = device_get_ptr(u)
371 associate(xh => coef%Xh, msh => coef%msh)
374 xh%dx_d, xh%dy_d, xh%dz_d, &
375 coef%drdx_d, coef%dsdx_d, coef%dtdx_d, &
376 coef%drdy_d, coef%dsdy_d, coef%dtdy_d, &
377 coef%drdz_d, coef%dsdz_d, coef%dtdz_d, &
378 xh%w3_d, msh%nelv, xh%lx)
381 xh%dx_d, xh%dy_d, xh%dz_d, &
382 coef%drdx_d, coef%dsdx_d, coef%dtdx_d, &
383 coef%drdy_d, coef%dsdy_d, coef%dtdy_d, &
384 coef%drdz_d, coef%dsdz_d, coef%dtdz_d, &
385 xh%w3_d, msh%nelv, xh%lx)
388 xh%dx_d, xh%dy_d, xh%dz_d, &
389 coef%drdx_d, coef%dsdx_d, coef%dtdx_d, &
390 coef%drdy_d, coef%dsdy_d, coef%dtdy_d, &
391 coef%drdz_d, coef%dsdz_d, coef%dtdz_d, &
392 xh%w3_d, msh%nelv, xh%lx)
394 call neko_error(
'No device backend configured')
400 type(coef_t),
intent(in) :: coef
402 type(field_t),
intent(in) :: u, v, w
405 coef%Xh%dx_d, coef%Xh%dy_d, coef%Xh%dz_d, &
406 coef%drdx_d, coef%dsdx_d, coef%dtdx_d, &
407 coef%drdy_d, coef%dsdy_d, coef%dtdy_d, &
408 coef%drdz_d, coef%dsdz_d, coef%dtdz_d, &
409 coef%jacinv_d, coef%msh%nelv, coef%Xh%lx)
412 coef%Xh%dx_d, coef%Xh%dy_d, coef%Xh%dz_d, &
413 coef%drdx_d, coef%dsdx_d, coef%dtdx_d, &
414 coef%drdy_d, coef%dsdy_d, coef%dtdy_d, &
415 coef%drdz_d, coef%dsdz_d, coef%dtdz_d, &
416 coef%jacinv_d, coef%msh%nelv, coef%Xh%lx)
419 coef%Xh%dx_d, coef%Xh%dy_d, coef%Xh%dz_d, &
420 coef%drdx_d, coef%dsdx_d, coef%dtdx_d, &
421 coef%drdy_d, coef%dsdy_d, coef%dtdy_d, &
422 coef%drdz_d, coef%dsdz_d, coef%dtdz_d, &
423 coef%jacinv_d, coef%msh%nelv, coef%Xh%lx)
425 call neko_error(
'No device backend configured')
430 type(coef_t),
intent(in) :: coef
431 real(kind=rp),
dimension(coef%Xh%lxyz, coef%msh%nelv),
intent(inout) :: dtx
432 real(kind=rp),
dimension(coef%Xh%lxyz, coef%msh%nelv),
intent(inout) :: x
433 real(kind=rp),
dimension(coef%Xh%lxyz, coef%msh%nelv),
intent(in) :: dr
434 real(kind=rp),
dimension(coef%Xh%lxyz, coef%msh%nelv),
intent(in) :: ds
435 real(kind=rp),
dimension(coef%Xh%lxyz, coef%msh%nelv),
intent(in) :: dt
436 type(c_ptr) :: dtx_d, x_d, dr_d, ds_d, dt_d
438 dtx_d = device_get_ptr(dtx)
439 x_d = device_get_ptr(x)
441 dr_d = device_get_ptr(dr)
442 ds_d = device_get_ptr(ds)
443 dt_d = device_get_ptr(dt)
445 associate(xh => coef%Xh, msh => coef%msh, dof => coef%dof)
447 call hip_cdtp(dtx_d, x_d, dr_d, ds_d, dt_d, &
448 xh%dxt_d, xh%dyt_d, xh%dzt_d, xh%w3_d, &
451 call cuda_cdtp(dtx_d, x_d, dr_d, ds_d, dt_d, &
452 xh%dxt_d, xh%dyt_d, xh%dzt_d, xh%w3_d, &
456 xh%dxt_d, xh%dyt_d, xh%dzt_d, xh%w3_d, &
459 call neko_error(
'No device backend configured')
466 type(space_t),
intent(in) :: xh
467 type(coef_t),
intent(in) :: coef
468 integer,
intent(in) :: nelv, gdim
469 real(kind=rp),
intent(inout) :: du(xh%lxyz, nelv)
470 real(kind=rp),
intent(inout),
dimension(Xh%lx, Xh%ly, Xh%lz, nelv) :: u
471 real(kind=rp),
intent(inout),
dimension(Xh%lx, Xh%ly, Xh%lz, nelv) :: vx
472 real(kind=rp),
intent(inout),
dimension(Xh%lx, Xh%ly, Xh%lz, nelv) :: vy
473 real(kind=rp),
intent(inout),
dimension(Xh%lx, Xh%ly, Xh%lz, nelv) :: vz
474 type(c_ptr) :: du_d, u_d, vx_d, vy_d, vz_d
476 du_d = device_get_ptr(du)
477 u_d = device_get_ptr(u)
479 vx_d = device_get_ptr(vx)
480 vy_d = device_get_ptr(vy)
481 vz_d = device_get_ptr(vz)
483 associate(xh => coef%Xh, msh => coef%msh, dof => coef%dof)
485 call hip_conv1(du_d, u_d, vx_d, vy_d, vz_d, &
486 xh%dx_d, xh%dy_d, xh%dz_d, &
487 coef%drdx_d, coef%dsdx_d, coef%dtdx_d, &
488 coef%drdy_d, coef%dsdy_d, coef%dtdy_d, &
489 coef%drdz_d, coef%dsdz_d, coef%dtdz_d, &
490 coef%jacinv_d, msh%nelv, msh%gdim, xh%lx)
492 call cuda_conv1(du_d, u_d, vx_d, vy_d, vz_d, &
493 xh%dx_d, xh%dy_d, xh%dz_d, &
494 coef%drdx_d, coef%dsdx_d, coef%dtdx_d, &
495 coef%drdy_d, coef%dsdy_d, coef%dtdy_d, &
496 coef%drdz_d, coef%dsdz_d, coef%dtdz_d, &
497 coef%jacinv_d, msh%nelv, msh%gdim, xh%lx)
500 xh%dx_d, xh%dy_d, xh%dz_d, &
501 coef%drdx_d, coef%dsdx_d, coef%dtdx_d, &
502 coef%drdy_d, coef%dsdy_d, coef%dtdy_d, &
503 coef%drdz_d, coef%dsdz_d, coef%dtdz_d, &
504 coef%jacinv_d, msh%nelv, msh%gdim, xh%lx)
506 call neko_error(
'No device backend configured')
513 type(field_t),
intent(inout) :: w1
514 type(field_t),
intent(inout) :: w2
515 type(field_t),
intent(inout) :: w3
516 type(field_t),
intent(in) :: u1
517 type(field_t),
intent(in) :: u2
518 type(field_t),
intent(in) :: u3
519 type(field_t),
intent(inout) :: work1
520 type(field_t),
intent(inout) :: work2
521 type(coef_t),
intent(in) :: c_xh
522 integer :: gdim, n, nelv
529#if defined(HAVE_HIP) || defined(HAVE_CUDA) || defined(HAVE_OPENCL)
532 c_xh%drdy_d, c_xh%dsdy_d, c_xh%dtdy_d,&
533 c_xh%Xh%dx_d, c_xh%Xh%dy_d, c_xh%Xh%dz_d, &
534 c_xh%jacinv_d, nelv, c_xh%Xh%lx)
537 c_xh%drdy_d, c_xh%dsdy_d, c_xh%dtdy_d,&
538 c_xh%Xh%dx_d, c_xh%Xh%dy_d, c_xh%Xh%dz_d, &
539 c_xh%jacinv_d, nelv, c_xh%Xh%lx)
542 c_xh%drdy_d, c_xh%dsdy_d, c_xh%dtdy_d,&
543 c_xh%Xh%dx_d, c_xh%Xh%dy_d, c_xh%Xh%dz_d, &
544 c_xh%jacinv_d, nelv, c_xh%Xh%lx)
546 if (gdim .eq. 3)
then
549 c_xh%drdz_d, c_xh%dsdz_d, c_xh%dtdz_d,&
550 c_xh%Xh%dx_d, c_xh%Xh%dy_d, c_xh%Xh%dz_d, &
551 c_xh%jacinv_d, nelv, c_xh%Xh%lx)
554 c_xh%drdz_d, c_xh%dsdz_d, c_xh%dtdz_d,&
555 c_xh%Xh%dx_d, c_xh%Xh%dy_d, c_xh%Xh%dz_d, &
556 c_xh%jacinv_d, nelv, c_xh%Xh%lx)
559 c_xh%drdz_d, c_xh%dsdz_d, c_xh%dtdz_d,&
560 c_xh%Xh%dx_d, c_xh%Xh%dy_d, c_xh%Xh%dz_d, &
561 c_xh%jacinv_d, nelv, c_xh%Xh%lx)
563 call device_sub3(w1%x_d, work1%x_d, work2%x_d, n)
565 call device_copy(w1%x_d, work1%x_d, n)
568 if (gdim .eq. 3)
then
571 c_xh%drdz_d, c_xh%dsdz_d, c_xh%dtdz_d,&
572 c_xh%Xh%dx_d, c_xh%Xh%dy_d, c_xh%Xh%dz_d, &
573 c_xh%jacinv_d, nelv, c_xh%Xh%lx)
575 c_xh%drdx_d, c_xh%dsdx_d, c_xh%dtdx_d,&
576 c_xh%Xh%dx_d, c_xh%Xh%dy_d, c_xh%Xh%dz_d, &
577 c_xh%jacinv_d, nelv, c_xh%Xh%lx)
580 c_xh%drdz_d, c_xh%dsdz_d, c_xh%dtdz_d,&
581 c_xh%Xh%dx_d, c_xh%Xh%dy_d, c_xh%Xh%dz_d, &
582 c_xh%jacinv_d, nelv, c_xh%Xh%lx)
584 c_xh%drdx_d, c_xh%dsdx_d, c_xh%dtdx_d,&
585 c_xh%Xh%dx_d, c_xh%Xh%dy_d, c_xh%Xh%dz_d, &
586 c_xh%jacinv_d, nelv, c_xh%Xh%lx)
589 c_xh%drdz_d, c_xh%dsdz_d, c_xh%dtdz_d,&
590 c_xh%Xh%dx_d, c_xh%Xh%dy_d, c_xh%Xh%dz_d, &
591 c_xh%jacinv_d, nelv, c_xh%Xh%lx)
593 c_xh%drdx_d, c_xh%dsdx_d, c_xh%dtdx_d,&
594 c_xh%Xh%dx_d, c_xh%Xh%dy_d, c_xh%Xh%dz_d, &
595 c_xh%jacinv_d, nelv, c_xh%Xh%lx)
597 call device_sub3(w2%x_d, work1%x_d, work2%x_d, n)
599 call device_rzero (work1%x_d, n)
602 c_xh%drdx_d, c_xh%dsdx_d, c_xh%dtdx_d,&
603 c_xh%Xh%dx_d, c_xh%Xh%dy_d, c_xh%Xh%dz_d, &
604 c_xh%jacinv_d, nelv, c_xh%Xh%lx)
607 c_xh%drdx_d, c_xh%dsdx_d, c_xh%dtdx_d,&
608 c_xh%Xh%dx_d, c_xh%Xh%dy_d, c_xh%Xh%dz_d, &
609 c_xh%jacinv_d, nelv, c_xh%Xh%lx)
612 c_xh%drdx_d, c_xh%dsdx_d, c_xh%dtdx_d,&
613 c_xh%Xh%dx_d, c_xh%Xh%dy_d, c_xh%Xh%dz_d, &
614 c_xh%jacinv_d, nelv, c_xh%Xh%lx)
616 call device_sub3(w2%x_d, work1%x_d, work2%x_d, n)
621 c_xh%drdx_d, c_xh%dsdx_d, c_xh%dtdx_d,&
622 c_xh%Xh%dx_d, c_xh%Xh%dy_d, c_xh%Xh%dz_d, &
623 c_xh%jacinv_d, nelv, c_xh%Xh%lx)
625 c_xh%drdy_d, c_xh%dsdy_d, c_xh%dtdy_d,&
626 c_xh%Xh%dx_d, c_xh%Xh%dy_d, c_xh%Xh%dz_d, &
627 c_xh%jacinv_d, nelv, c_xh%Xh%lx)
630 c_xh%drdx_d, c_xh%dsdx_d, c_xh%dtdx_d,&
631 c_xh%Xh%dx_d, c_xh%Xh%dy_d, c_xh%Xh%dz_d, &
632 c_xh%jacinv_d, nelv, c_xh%Xh%lx)
634 c_xh%drdy_d, c_xh%dsdy_d, c_xh%dtdy_d,&
635 c_xh%Xh%dx_d, c_xh%Xh%dy_d, c_xh%Xh%dz_d, &
636 c_xh%jacinv_d, nelv, c_xh%Xh%lx)
639 c_xh%drdx_d, c_xh%dsdx_d, c_xh%dtdx_d,&
640 c_xh%Xh%dx_d, c_xh%Xh%dy_d, c_xh%Xh%dz_d, &
641 c_xh%jacinv_d, nelv, c_xh%Xh%lx)
643 c_xh%drdy_d, c_xh%dsdy_d, c_xh%dtdy_d,&
644 c_xh%Xh%dx_d, c_xh%Xh%dy_d, c_xh%Xh%dz_d, &
645 c_xh%jacinv_d, nelv, c_xh%Xh%lx)
647 call device_sub3(w3%x_d, work1%x_d, work2%x_d, n)
650 call device_opcolv(w1%x_d, w2%x_d, w3%x_d, c_xh%B_d, gdim, n)
651 call c_xh%gs_h%op(w1, gs_op_add)
652 call c_xh%gs_h%op(w2, gs_op_add)
653 call c_xh%gs_h%op(w3, gs_op_add)
654 call device_opcolv(w1%x_d, w2%x_d, w3%x_d, c_xh%Binv_d, gdim, n)
657 call neko_error(
'No device backend configured')
662 function opr_device_cfl(dt, u, v, w, Xh, coef, nelv, gdim)
result(cfl)
665 integer :: nelv, gdim
667 real(kind=rp),
dimension(Xh%lx, Xh%ly, Xh%lz, nelv) :: u, v, w
669 type(c_ptr) :: u_d, v_d, w_d
671 u_d = device_get_ptr(u)
672 v_d = device_get_ptr(v)
673 w_d = device_get_ptr(w)
676 cfl =
hip_cfl(dt, u_d, v_d, w_d, &
677 coef%drdx_d, coef%dsdx_d, coef%dtdx_d, &
678 coef%drdy_d, coef%dsdy_d, coef%dtdy_d, &
679 coef%drdz_d, coef%dsdz_d, coef%dtdz_d, &
680 xh%dr_inv_d, xh%ds_inv_d, xh%dt_inv_d, &
681 coef%jacinv_d, nelv, xh%lx)
684 coef%drdx_d, coef%dsdx_d, coef%dtdx_d, &
685 coef%drdy_d, coef%dsdy_d, coef%dtdy_d, &
686 coef%drdz_d, coef%dsdz_d, coef%dtdz_d, &
687 xh%dr_inv_d, xh%ds_inv_d, xh%dt_inv_d, &
688 coef%jacinv_d, nelv, xh%lx)
691 coef%drdx_d, coef%dsdx_d, coef%dtdx_d, &
692 coef%drdy_d, coef%dsdy_d, coef%dtdy_d, &
693 coef%drdz_d, coef%dsdz_d, coef%dtdz_d, &
694 xh%dr_inv_d, xh%ds_inv_d, xh%dt_inv_d, &
695 coef%jacinv_d, nelv, xh%lx)
698 call neko_error(
'No device backend configured')
Return the device pointer for an associated Fortran array.
subroutine, public device_rzero(a_d, n)
Zero a real vector.
subroutine, public device_sub3(a_d, b_d, c_d, n)
Vector subtraction .
subroutine, public device_copy(a_d, b_d, n)
Copy a vector .
subroutine, public device_opcolv(a1_d, a2_d, a3_d, c_d, gdim, n)
Device abstraction, common interface for various accelerators.
A simulation component that computes lambda2 The values are stored in the field registry under the na...
integer, parameter, public c_rp
integer, parameter, public rp
Global precision used in computations.
Operators accelerator backends.
subroutine, public opr_device_curl(w1, w2, w3, u1, u2, u3, work1, work2, c_xh)
subroutine, public opr_device_cdtp(dtx, x, dr, ds, dt, coef)
real(kind=rp) function, public opr_device_cfl(dt, u, v, w, xh, coef, nelv, gdim)
subroutine, public opr_device_dudxyz(du, u, dr, ds, dt, coef)
subroutine, public opr_device_opgrad(ux, uy, uz, u, coef)
subroutine, public opr_device_conv1(du, u, vx, vy, vz, xh, coef, nelv, gdim)
subroutine, public opr_device_lambda2(lambda2, u, v, w, coef)
Defines a function space.
void opencl_cdtp(void *dtx, void *x, void *dr, void *ds, void *dt, void *dxt, void *dyt, void *dzt, void *w3, int *nel, int *lx)
void cuda_cdtp(void *dtx, void *x, void *dr, void *ds, void *dt, void *dxt, void *dyt, void *dzt, void *w3, int *nel, int *lx)
real opencl_cfl(real *dt, void *u, void *v, void *w, void *drdx, void *dsdx, void *dtdx, void *drdy, void *dsdy, void *dtdy, void *drdz, void *dsdz, void *dtdz, void *dr_inv, void *ds_inv, void *dt_inv, void *jacinv, int *nel, int *lx)
real cuda_cfl(real *dt, void *u, void *v, void *w, void *drdx, void *dsdx, void *dtdx, void *drdy, void *dsdy, void *dtdy, void *drdz, void *dsdz, void *dtdz, void *dr_inv, void *ds_inv, void *dt_inv, void *jacinv, int *nel, int *lx)
void opencl_conv1(void *du, void *u, void *vx, void *vy, void *vz, void *dx, void *dy, void *dz, void *drdx, void *dsdx, void *dtdx, void *drdy, void *dsdy, void *dtdy, void *drdz, void *dsdz, void *dtdz, void *jacinv, int *nel, int *gdim, int *lx)
void cuda_conv1(void *du, void *u, void *vx, void *vy, void *vz, void *dx, void *dy, void *dz, void *drdx, void *dsdx, void *dtdx, void *drdy, void *dsdy, void *dtdy, void *drdz, void *dsdz, void *dtdz, void *jacinv, int *nel, int *gdim, int *lx)
void opencl_dudxyz(void *du, void *u, void *dr, void *ds, void *dt, void *dx, void *dy, void *dz, void *jacinv, int *nel, int *lx)
void cuda_dudxyz(void *du, void *u, void *dr, void *ds, void *dt, void *dx, void *dy, void *dz, void *jacinv, int *nel, int *lx)
void opencl_lambda2(void *lambda2, void *u, void *v, void *w, void *dx, void *dy, void *dz, void *drdx, void *dsdx, void *dtdx, void *drdy, void *dsdy, void *dtdy, void *drdz, void *dsdz, void *dtdz, void *jacinv, int *nel, int *lx)
void cuda_lambda2(void *lambda2, void *u, void *v, void *w, void *dx, void *dy, void *dz, void *drdx, void *dsdx, void *dtdx, void *drdy, void *dsdy, void *dtdy, void *drdz, void *dsdz, void *dtdz, void *jacinv, int *nel, int *lx)
void opencl_opgrad(void *ux, void *uy, void *uz, void *u, void *dx, void *dy, void *dz, void *drdx, void *dsdx, void *dtdx, void *drdy, void *dsdy, void *dtdy, void *drdz, void *dsdz, void *dtdz, void *w3, int *nel, int *lx)
void cuda_opgrad(void *ux, void *uy, void *uz, void *u, void *dx, void *dy, void *dz, void *drdx, void *dsdx, void *dtdx, void *drdy, void *dsdy, void *dtdy, void *drdz, void *dsdz, void *dtdz, void *w3, int *nel, int *lx)
Coefficients defined on a given (mesh, ) tuple. Arrays use indices (i,j,k,e): element e,...
The function space for the SEM solution fields.