Neko 1.99.9
A portable framework for high-order spectral element flow simulations
Loading...
Searching...
No Matches
rough_log_law_device.F90
Go to the documentation of this file.
1
3 use num_types, only : rp, c_rp
4 use, intrinsic :: iso_c_binding, only : c_ptr
5 use utils, only : neko_error
6 implicit none
7 private
8
9#ifdef HAVE_HIP
10 interface
11 subroutine hip_rough_log_law_compute(u_d, v_d, w_d, &
12 n_x_d, n_y_d, n_z_d, h_d, &
13 tau_x_d, tau_y_d, tau_z_d, n_nodes, &
14 kappa, rho_w_d, B, z0, tstep) &
15 bind(c, name = 'hip_rough_log_law_compute')
16 use, intrinsic :: iso_c_binding, only : c_ptr, c_int
17 use num_types, only : c_rp
18 implicit none
19 type(c_ptr), value :: u_d, v_d, w_d
20 type(c_ptr), value :: n_x_d, n_y_d, n_z_d, h_d
21 real(c_rp) :: kappa, B, z0
22 type(c_ptr), value :: rho_w_d
23 type(c_ptr), value :: tau_x_d, tau_y_d, tau_z_d
24 integer(c_int) :: n_nodes, tstep
25 end subroutine hip_rough_log_law_compute
26 end interface
27#elif HAVE_CUDA
28 interface
29 subroutine cuda_rough_log_law_compute(u_d, v_d, w_d, &
30 n_x_d, n_y_d, n_z_d, h_d, &
31 tau_x_d, tau_y_d, tau_z_d, n_nodes, &
32 kappa, rho_w_d, B, z0, tstep) &
33 bind(c, name = 'cuda_rough_log_law_compute')
34 use, intrinsic :: iso_c_binding, only : c_ptr, c_int
35 use num_types, only : c_rp
36 implicit none
37 type(c_ptr), value :: u_d, v_d, w_d
38 type(c_ptr), value :: n_x_d, n_y_d, n_z_d, h_d
39 real(c_rp) :: kappa, B, z0
40 type(c_ptr), value :: rho_w_d
41 type(c_ptr), value :: tau_x_d, tau_y_d, tau_z_d
42 integer(c_int) :: n_nodes, tstep
43 end subroutine cuda_rough_log_law_compute
44 end interface
45#elif HAVE_OPENCL
46 interface
47 subroutine opencl_rough_log_law_compute(u_d, v_d, w_d, &
48 n_x_d, n_y_d, n_z_d, h_d, &
49 tau_x_d, tau_y_d, tau_z_d, n_nodes, &
50 kappa, rho_w_d, B, z0, tstep) &
51 bind(c, name = 'opencl_rough_log_law_compute')
52 use, intrinsic :: iso_c_binding, only : c_ptr, c_int
53 use num_types, only : c_rp
54 implicit none
55 type(c_ptr), value :: u_d, v_d, w_d
56 type(c_ptr), value :: n_x_d, n_y_d, n_z_d, h_d
57 real(c_rp) :: kappa, B, z0
58 type(c_ptr), value :: rho_w_d
59 type(c_ptr), value :: tau_x_d, tau_y_d, tau_z_d
60 integer(c_int) :: n_nodes, tstep
61 end subroutine opencl_rough_log_law_compute
62 end interface
63#elif HAVE_METAL
64 interface
65 subroutine metal_rough_log_law_compute(u_d, v_d, w_d, &
66 n_x_d, n_y_d, n_z_d, h_d, &
67 tau_x_d, tau_y_d, tau_z_d, n_nodes, &
68 kappa, rho_w_d, B, z0, tstep) &
69 bind(c, name = 'metal_rough_log_law_compute')
70 use, intrinsic :: iso_c_binding, only : c_ptr, c_int
71 use num_types, only : c_rp
72 implicit none
73 type(c_ptr), value :: u_d, v_d, w_d
74 type(c_ptr), value :: n_x_d, n_y_d, n_z_d, h_d
75 real(c_rp) :: kappa, B, z0
76 type(c_ptr), value :: rho_w_d
77 type(c_ptr), value :: tau_x_d, tau_y_d, tau_z_d
78 integer(c_int) :: n_nodes, tstep
79 end subroutine metal_rough_log_law_compute
80 end interface
81#endif
83
84contains
88 subroutine rough_log_law_compute_device(u_d, v_d, w_d, &
89 n_x_d, n_y_d, n_z_d, h_d, tau_x_d, tau_y_d, tau_z_d, &
90 n_nodes, kappa, rho_w_d, B, z0, tstep)
91 integer, intent(in) :: n_nodes, tstep
92 type(c_ptr), intent(in) :: u_d, v_d, w_d
93 type(c_ptr), intent(in) :: n_x_d, n_y_d, n_z_d, h_d
94 type(c_ptr), intent(inout) :: tau_x_d, tau_y_d, tau_z_d
95 type(c_ptr), intent(in) :: rho_w_d
96 real(kind=rp), intent(in) :: kappa, b, z0
97
98#if HAVE_HIP
99 call hip_rough_log_law_compute(u_d, v_d, w_d, &
100 n_x_d, n_y_d, n_z_d, h_d, &
101 tau_x_d, tau_y_d, tau_z_d, n_nodes, &
102 kappa, rho_w_d, b, z0, tstep)
103#elif HAVE_CUDA
104 call cuda_rough_log_law_compute(u_d, v_d, w_d, &
105 n_x_d, n_y_d, n_z_d, h_d, &
106 tau_x_d, tau_y_d, tau_z_d, n_nodes, &
107 kappa, rho_w_d, b, z0, tstep)
108#elif HAVE_OPENCL
109 call opencl_rough_log_law_compute(u_d, v_d, w_d, &
110 n_x_d, n_y_d, n_z_d, h_d, &
111 tau_x_d, tau_y_d, tau_z_d, n_nodes, &
112 kappa, rho_w_d, b, z0, tstep)
113#elif HAVE_METAL
114 call metal_rough_log_law_compute(u_d, v_d, w_d, &
115 n_x_d, n_y_d, n_z_d, h_d, &
116 tau_x_d, tau_y_d, tau_z_d, n_nodes, &
117 kappa, rho_w_d, b, z0, tstep)
118#else
119 call neko_error('No device backend configured')
120#endif
121
122 end subroutine rough_log_law_compute_device
123end module rough_log_law_device
integer, parameter, public c_rp
Definition num_types.f90:15
integer, parameter, public rp
Global precision used in computations.
Definition num_types.f90:14
Implements the device kernel for the rough_log_law_t type.
subroutine, public rough_log_law_compute_device(u_d, v_d, w_d, n_x_d, n_y_d, n_z_d, h_d, tau_x_d, tau_y_d, tau_z_d, n_nodes, kappa, rho_w_d, b, z0, tstep)
Compute the wall shear stress on device using the rough log-law model.
Utilities.
Definition utils.f90:35
void opencl_rough_log_law_compute(void *u_d, void *v_d, void *w_d, void *n_x_d, void *n_y_d, void *n_z_d, void *h_d, void *tau_x_d, void *tau_y_d, void *tau_z_d, int *n_nodes, real *kappa, void *rho_w_d, real *B, real *z0, int *tstep)
void cuda_rough_log_law_compute(void *u_d, void *v_d, void *w_d, void *n_x_d, void *n_y_d, void *n_z_d, void *h_d, void *tau_x_d, void *tau_y_d, void *tau_z_d, int *n_nodes, real *kappa, void *rho_w_d, real *B, real *z0, int *tstep)