Neko 1.99.3
A portable framework for high-order spectral element flow simulations
Loading...
Searching...
No Matches
cai_sagaut_model_ii_device.F90
Go to the documentation of this file.
1! Copyright (c) 2026, The Neko Authors
2! All rights reserved.
3!
4! Redistribution and use in source and binary forms, with or without
5! modification, are permitted provided that the following conditions
6! are met:
7!
8! * Redistributions of source code must retain the above copyright
9! notice, this list of conditions and the following disclaimer.
10!
11! * Redistributions in binary form must reproduce the above
12! copyright notice, this list of conditions and the following
13! disclaimer in the documentation and/or other materials provided
14! with the distribution.
15!
16! * Neither the name of the authors nor the names of its
17! contributors may be used to endorse or promote products derived
18! from this software without specific prior written permission.
19!
20! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21! "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22! LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23! FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
24! COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
25! INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
26! BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28! CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29! LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
30! ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31! POSSIBILITY OF SUCH DAMAGE.
32!
35 use num_types, only : rp, c_rp
36 use, intrinsic :: iso_c_binding, only : c_ptr
37 use utils, only : neko_error
38 implicit none
39 private
40
41#ifdef HAVE_HIP
42 interface
43 subroutine hip_cai_sagaut_model_ii_compute(u_d, v_d, w_d, ind_r_d, &
44 ind_s_d, ind_t_d, ind_e_d, n_x_d, n_y_d, n_z_d, nu_d, rho_w_d, &
45 h_d, tau_x_d, tau_y_d, tau_z_d, n_nodes, lx, kappa, B, p, s) &
46 bind(c, name = 'hip_cai_sagaut_model_ii_compute')
47 use, intrinsic :: iso_c_binding, only : c_ptr, c_int
48 use num_types, only : c_rp
49 implicit none
50 type(c_ptr), value :: u_d, v_d, w_d, rho_w_d
51 type(c_ptr), value :: ind_r_d, ind_s_d, ind_t_d, ind_e_d
52 type(c_ptr), value :: n_x_d, n_y_d, n_z_d, h_d, nu_d
53 type(c_ptr), value :: tau_x_d, tau_y_d, tau_z_d
54 real(c_rp) :: kappa, B, p, s
55 integer(c_int) :: n_nodes, lx
57 end interface
58#elif HAVE_CUDA
59 interface
60 subroutine cuda_cai_sagaut_model_ii_compute(u_d, v_d, w_d, ind_r_d, &
61 ind_s_d, ind_t_d, ind_e_d, n_x_d, n_y_d, n_z_d, nu_d, rho_w_d, &
62 h_d, tau_x_d, tau_y_d, tau_z_d, n_nodes, lx, kappa, B, p, s) &
63 bind(c, name = 'cuda_cai_sagaut_model_ii_compute')
64 use, intrinsic :: iso_c_binding, only : c_ptr, c_int
65 use num_types, only : c_rp
66 implicit none
67 type(c_ptr), value :: u_d, v_d, w_d, rho_w_d
68 type(c_ptr), value :: ind_r_d, ind_s_d, ind_t_d, ind_e_d
69 type(c_ptr), value :: n_x_d, n_y_d, n_z_d, h_d, nu_d
70 type(c_ptr), value :: tau_x_d, tau_y_d, tau_z_d
71 real(c_rp) :: kappa, B, p, s
72 integer(c_int) :: n_nodes, lx
74 end interface
75#elif HAVE_OPENCL
76 interface
77 subroutine opencl_cai_sagaut_model_ii_compute(u_d, v_d, w_d, ind_r_d, &
78 ind_s_d, ind_t_d, ind_e_d, n_x_d, n_y_d, n_z_d, nu_d, rho_w_d, &
79 h_d, tau_x_d, tau_y_d, tau_z_d, n_nodes, lx, kappa, B, p, s) &
80 bind(c, name = 'opencl_cai_sagaut_model_ii_compute')
81 use, intrinsic :: iso_c_binding, only : c_ptr, c_int
82 use num_types, only : c_rp
83 implicit none
84 type(c_ptr), value :: u_d, v_d, w_d, rho_w_d
85 type(c_ptr), value :: ind_r_d, ind_s_d, ind_t_d, ind_e_d
86 type(c_ptr), value :: n_x_d, n_y_d, n_z_d, h_d, nu_d
87 type(c_ptr), value :: tau_x_d, tau_y_d, tau_z_d
88 real(c_rp) :: kappa, B, p, s
89 integer(c_int) :: n_nodes, lx
91 end interface
92#endif
94
95contains
119 subroutine cai_sagaut_model_ii_compute_device(u_d, v_d, w_d, ind_r_d, &
120 ind_s_d, ind_t_d, ind_e_d, n_x_d, n_y_d, n_z_d, nu_d, rho_w_d, h_d, &
121 tau_x_d, tau_y_d, tau_z_d, n_nodes, lx, kappa, B, p, s)
122 integer, intent(in) :: n_nodes, lx
123 type(c_ptr), intent(in) :: u_d, v_d, w_d, rho_w_d
124 type(c_ptr), intent(in) :: ind_r_d, ind_s_d, ind_t_d, ind_e_d
125 type(c_ptr), intent(in) :: n_x_d, n_y_d, n_z_d, h_d, nu_d
126 type(c_ptr), intent(inout) :: tau_x_d, tau_y_d, tau_z_d
127 real(kind=rp), intent(in) :: kappa, b, p, s
128
129#if HAVE_HIP
130 call hip_cai_sagaut_model_ii_compute(u_d, v_d, w_d, ind_r_d, ind_s_d, &
131 ind_t_d, ind_e_d, n_x_d, n_y_d, n_z_d, nu_d, rho_w_d, h_d, &
132 tau_x_d, tau_y_d, tau_z_d, n_nodes, lx, kappa, b, p, s)
133#elif HAVE_CUDA
134 call cuda_cai_sagaut_model_ii_compute(u_d, v_d, w_d, ind_r_d, ind_s_d, &
135 ind_t_d, ind_e_d, n_x_d, n_y_d, n_z_d, nu_d, rho_w_d, h_d, &
136 tau_x_d, tau_y_d, tau_z_d, n_nodes, lx, kappa, b, p, s)
137#elif HAVE_OPENCL
138 call opencl_cai_sagaut_model_ii_compute(u_d, v_d, w_d, ind_r_d, ind_s_d, &
139 ind_t_d, ind_e_d, n_x_d, n_y_d, n_z_d, nu_d, rho_w_d, h_d, &
140 tau_x_d, tau_y_d, tau_z_d, n_nodes, lx, kappa, b, p, s)
141#else
142 call neko_error('No device backend configured')
143#endif
void opencl_cai_sagaut_model_ii_compute(void *u_d, void *v_d, void *w_d, void *ind_r_d, void *ind_s_d, void *ind_t_d, void *ind_e_d, void *n_x_d, void *n_y_d, void *n_z_d, void *nu_d, void *rho_w_d, void *h_d, void *tau_x_d, void *tau_y_d, void *tau_z_d, int *n_nodes, int *lx, real *kappa, real *B, real *p, real *s)
void cuda_cai_sagaut_model_ii_compute(void *u_d, void *v_d, void *w_d, void *ind_r_d, void *ind_s_d, void *ind_t_d, void *ind_e_d, void *n_x_d, void *n_y_d, void *n_z_d, void *nu_d, void *rho_w_d, void *h_d, void *tau_x_d, void *tau_y_d, void *tau_z_d, int *n_nodes, int *lx, real *kappa, real *B, real *p, real *s)
Device dispatch for cai_sagaut_model_ii_t.
subroutine, public cai_sagaut_model_ii_compute_device(u_d, v_d, w_d, ind_r_d, ind_s_d, ind_t_d, ind_e_d, n_x_d, n_y_d, n_z_d, nu_d, rho_w_d, h_d, tau_x_d, tau_y_d, tau_z_d, n_nodes, lx, kappa, b, p, s)
Evaluate the device wall-model kernel for Model-II.
integer, parameter, public c_rp
Definition num_types.f90:13
integer, parameter, public rp
Global precision used in computations.
Definition num_types.f90:12
Utilities.
Definition utils.f90:35