Neko 1.99.9
A portable framework for high-order spectral element flow simulations
Loading...
Searching...
No Matches
device_dynamic_smagorinsky_nut.F90
Go to the documentation of this file.
1! Copyright (c) 2024, 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!
34 use, intrinsic :: iso_c_binding, only : c_ptr, c_int
35 use num_types, only : rp, c_rp
36 use utils, only : neko_error
38 use mpi_f08, only : mpi_sum, mpi_in_place, mpi_allreduce
39
40 implicit none
41 private
42
43#ifdef HAVE_HIP
44 interface
45 subroutine hip_s_abs_compute(s_abs_d, s11_d, s22_d, s33_d, &
46 s12_d, s13_d, s23_d, &
47 n) &
48 bind(c, name = 'hip_s_abs_compute')
49 use, intrinsic :: iso_c_binding, only : c_ptr, c_int
50 import c_rp
51 type(c_ptr), value :: s_abs_d, s11_d, s22_d, s33_d, &
52 s12_d, s13_d, s23_d
53 integer(c_int) :: n
54 end subroutine hip_s_abs_compute
55 end interface
56 interface
57 subroutine hip_lij_compute_part1(l11_d, l22_d, l33_d, &
58 l12_d, l13_d, l23_d, &
59 u_d, v_d, w_d, &
60 fu_d, fv_d, fw_d, &
61 fuu_d, fvv_d, fww_d, &
62 fuv_d, fuw_d, fvw_d, n) &
63 bind(c, name = 'hip_lij_compute_part1')
64 use, intrinsic :: iso_c_binding, only : c_ptr, c_int
65 import c_rp
66 type(c_ptr), value :: l11_d, l22_d, l33_d, l12_d, l13_d, l23_d, &
67 u_d, v_d, w_d, fu_d, fv_d, fw_d, &
68 fuu_d, fvv_d, fww_d, fuv_d, fuw_d, fvw_d
69 integer(c_int) :: n
70 end subroutine hip_lij_compute_part1
71 end interface
72 interface
73 subroutine hip_lij_compute_part2(l11_d, l22_d, l33_d, &
74 l12_d, l13_d, l23_d, &
75 fuu_d, fvv_d, fww_d, &
76 fuv_d, fuw_d, fvw_d, n) &
77 bind(c, name = 'hip_lij_compute_part2')
78 use, intrinsic :: iso_c_binding, only : c_ptr, c_int
79 import c_rp
80 type(c_ptr), value :: l11_d, l22_d, l33_d, l12_d, l13_d, l23_d, &
81 fuu_d, fvv_d, fww_d, fuv_d, fuw_d, fvw_d
82 integer(c_int) :: n
83 end subroutine hip_lij_compute_part2
84 end interface
85 interface
86 subroutine hip_mij_compute_part1(m11_d, m22_d, m33_d, &
87 m12_d, m13_d, m23_d, &
88 s_abs_d, s11_d, s22_d, s33_d, &
89 s12_d, s13_d, s23_d, &
90 fs_abs_d, fs11_d, fs22_d, fs33_d, &
91 fs12_d, fs13_d, fs23_d, &
92 fsabss11_d, fsabss22_d, fsabss33_d, &
93 fsabss12_d, fsabss13_d, fsabss23_d, &
94 delta_ratio2, n) &
95 bind(c, name = 'hip_mij_compute_part1')
96 use, intrinsic :: iso_c_binding, only : c_ptr, c_int
97 import c_rp
98 type(c_ptr), value :: m11_d, m22_d, m33_d, &
99 m12_d, m13_d, m23_d, &
100 s_abs_d, s11_d, s22_d, s33_d, &
101 s12_d, s13_d, s23_d, &
102 fs_abs_d, fs11_d, fs22_d, fs33_d, &
103 fs12_d, fs13_d, fs23_d, &
104 fsabss11_d, fsabss22_d, fsabss33_d, &
105 fsabss12_d, fsabss13_d, fsabss23_d
106 real(c_rp) :: delta_ratio2
107 integer(c_int) :: n
108 end subroutine hip_mij_compute_part1
109 end interface
110 interface
111 subroutine hip_mij_nut_compute_part2(m11_d, m22_d, m33_d, &
112 m12_d, m13_d, m23_d, &
113 l11_d, l22_d, l33_d, &
114 l12_d, l13_d, l23_d, &
115 fsabss11_d, fsabss22_d, fsabss33_d, &
116 fsabss12_d, fsabss13_d, fsabss23_d, &
117 num_d, den_d, c_dyn_d, delta_d, &
118 s_abs_d, nut_d, alpha, n) &
119 bind(c, name = 'hip_mij_nut_compute_part2')
120 use, intrinsic :: iso_c_binding, only : c_ptr, c_int
121 import c_rp
122 type(c_ptr), value :: m11_d, m22_d, m33_d, &
123 m12_d, m13_d, m23_d, &
124 l11_d, l22_d, l33_d, &
125 l12_d, l13_d, l23_d, &
126 fsabss11_d, fsabss22_d, fsabss33_d, &
127 fsabss12_d, fsabss13_d, fsabss23_d, &
128 num_d, den_d, c_dyn_d, delta_d, s_abs_d, nut_d
129 real(c_rp) :: alpha
130 integer(c_int) :: n
131 end subroutine hip_mij_nut_compute_part2
132 end interface
133#elif HAVE_CUDA
134 interface
135 subroutine cuda_s_abs_compute(s_abs_d, s11_d, s22_d, s33_d, &
136 s12_d, s13_d, s23_d, &
137 n) &
138 bind(c, name = 'cuda_s_abs_compute')
139 use, intrinsic :: iso_c_binding, only : c_ptr, c_int
140 import c_rp
141 type(c_ptr), value :: s_abs_d, s11_d, s22_d, s33_d, &
142 s12_d, s13_d, s23_d
143 integer(c_int) :: n
144 end subroutine cuda_s_abs_compute
145 end interface
146 interface
147 subroutine cuda_lij_compute_part1(l11_d, l22_d, l33_d, &
148 l12_d, l13_d, l23_d, &
149 u_d, v_d, w_d, &
150 fu_d, fv_d, fw_d, &
151 fuu_d, fvv_d, fww_d, &
152 fuv_d, fuw_d, fvw_d, n) &
153 bind(c, name = 'cuda_lij_compute_part1')
154 use, intrinsic :: iso_c_binding, only : c_ptr, c_int
155 import c_rp
156 type(c_ptr), value :: l11_d, l22_d, l33_d, l12_d, l13_d, l23_d, &
157 u_d, v_d, w_d, fu_d, fv_d, fw_d, &
158 fuu_d, fvv_d, fww_d, fuv_d, fuw_d, fvw_d
159 integer(c_int) :: n
160 end subroutine cuda_lij_compute_part1
161 end interface
162 interface
163 subroutine cuda_lij_compute_part2(l11_d, l22_d, l33_d, &
164 l12_d, l13_d, l23_d, &
165 fuu_d, fvv_d, fww_d, &
166 fuv_d, fuw_d, fvw_d, n) &
167 bind(c, name = 'cuda_lij_compute_part2')
168 use, intrinsic :: iso_c_binding, only : c_ptr, c_int
169 import c_rp
170 type(c_ptr), value :: l11_d, l22_d, l33_d, l12_d, l13_d, l23_d, &
171 fuu_d, fvv_d, fww_d, fuv_d, fuw_d, fvw_d
172 integer(c_int) :: n
173 end subroutine cuda_lij_compute_part2
174 end interface
175 interface
176 subroutine cuda_mij_compute_part1(m11_d, m22_d, m33_d, &
177 m12_d, m13_d, m23_d, &
178 s_abs_d, s11_d, s22_d, s33_d, &
179 s12_d, s13_d, s23_d, &
180 fs_abs_d, fs11_d, fs22_d, fs33_d, &
181 fs12_d, fs13_d, fs23_d, &
182 fsabss11_d, fsabss22_d, fsabss33_d, &
183 fsabss12_d, fsabss13_d, fsabss23_d, &
184 delta_ratio2, n) &
185 bind(c, name = 'cuda_mij_compute_part1')
186 use, intrinsic :: iso_c_binding, only : c_ptr, c_int
187 import c_rp
188 type(c_ptr), value :: m11_d, m22_d, m33_d, &
189 m12_d, m13_d, m23_d, &
190 s_abs_d, s11_d, s22_d, s33_d, &
191 s12_d, s13_d, s23_d, &
192 fs_abs_d, fs11_d, fs22_d, fs33_d, &
193 fs12_d, fs13_d, fs23_d, &
194 fsabss11_d, fsabss22_d, fsabss33_d, &
195 fsabss12_d, fsabss13_d, fsabss23_d
196 real(c_rp) :: delta_ratio2
197 integer(c_int) :: n
198 end subroutine cuda_mij_compute_part1
199 end interface
200 interface
201 subroutine cuda_mij_nut_compute_part2(m11_d, m22_d, m33_d, &
202 m12_d, m13_d, m23_d, &
203 l11_d, l22_d, l33_d, &
204 l12_d, l13_d, l23_d, &
205 fsabss11_d, fsabss22_d, fsabss33_d, &
206 fsabss12_d, fsabss13_d, fsabss23_d, &
207 num_d, den_d, c_dyn_d, delta_d, &
208 s_abs_d, nut_d, alpha, n) &
209 bind(c, name = 'cuda_mij_nut_compute_part2')
210 use, intrinsic :: iso_c_binding, only : c_ptr, c_int
211 import c_rp
212 type(c_ptr), value :: m11_d, m22_d, m33_d, &
213 m12_d, m13_d, m23_d, &
214 l11_d, l22_d, l33_d, &
215 l12_d, l13_d, l23_d, &
216 fsabss11_d, fsabss22_d, fsabss33_d, &
217 fsabss12_d, fsabss13_d, fsabss23_d, &
218 num_d, den_d, c_dyn_d, delta_d, s_abs_d, nut_d
219 real(c_rp) :: alpha
220 integer(c_int) :: n
221 end subroutine cuda_mij_nut_compute_part2
222 end interface
223#elif HAVE_OPENCL
224 interface
225 subroutine opencl_s_abs_compute(s_abs_d, s11_d, s22_d, s33_d, &
226 s12_d, s13_d, s23_d, &
227 n) &
228 bind(c, name = 'opencl_s_abs_compute')
229 use, intrinsic :: iso_c_binding, only : c_ptr, c_int
230 import c_rp
231 type(c_ptr), value :: s_abs_d, s11_d, s22_d, s33_d, &
232 s12_d, s13_d, s23_d
233 integer(c_int) :: n
234 end subroutine opencl_s_abs_compute
235 end interface
236 interface
237 subroutine opencl_lij_compute_part1(l11_d, l22_d, l33_d, &
238 l12_d, l13_d, l23_d, &
239 u_d, v_d, w_d, &
240 fu_d, fv_d, fw_d, &
241 fuu_d, fvv_d, fww_d, &
242 fuv_d, fuw_d, fvw_d, n) &
243 bind(c, name = 'opencl_lij_compute_part1')
244 use, intrinsic :: iso_c_binding, only : c_ptr, c_int
245 import c_rp
246 type(c_ptr), value :: l11_d, l22_d, l33_d, l12_d, l13_d, l23_d, &
247 u_d, v_d, w_d, fu_d, fv_d, fw_d, &
248 fuu_d, fvv_d, fww_d, fuv_d, fuw_d, fvw_d
249 integer(c_int) :: n
250 end subroutine opencl_lij_compute_part1
251 end interface
252 interface
253 subroutine opencl_lij_compute_part2(l11_d, l22_d, l33_d, &
254 l12_d, l13_d, l23_d, &
255 fuu_d, fvv_d, fww_d, &
256 fuv_d, fuw_d, fvw_d, n) &
257 bind(c, name = 'opencl_lij_compute_part2')
258 use, intrinsic :: iso_c_binding, only : c_ptr, c_int
259 import c_rp
260 type(c_ptr), value :: l11_d, l22_d, l33_d, l12_d, l13_d, l23_d, &
261 fuu_d, fvv_d, fww_d, fuv_d, fuw_d, fvw_d
262 integer(c_int) :: n
263 end subroutine opencl_lij_compute_part2
264 end interface
265 interface
266 subroutine opencl_mij_compute_part1(m11_d, m22_d, m33_d, &
267 m12_d, m13_d, m23_d, &
268 s_abs_d, s11_d, s22_d, s33_d, &
269 s12_d, s13_d, s23_d, &
270 fs_abs_d, fs11_d, fs22_d, fs33_d, &
271 fs12_d, fs13_d, fs23_d, &
272 fsabss11_d, fsabss22_d, fsabss33_d, &
273 fsabss12_d, fsabss13_d, fsabss23_d, &
274 delta_ratio2, n) &
275 bind(c, name = 'opencl_mij_compute_part1')
276 use, intrinsic :: iso_c_binding, only : c_ptr, c_int
277 import c_rp
278 type(c_ptr), value :: m11_d, m22_d, m33_d, &
279 m12_d, m13_d, m23_d, &
280 s_abs_d, s11_d, s22_d, s33_d, &
281 s12_d, s13_d, s23_d, &
282 fs_abs_d, fs11_d, fs22_d, fs33_d, &
283 fs12_d, fs13_d, fs23_d, &
284 fsabss11_d, fsabss22_d, fsabss33_d, &
285 fsabss12_d, fsabss13_d, fsabss23_d
286 real(c_rp) :: delta_ratio2
287 integer(c_int) :: n
288 end subroutine opencl_mij_compute_part1
289 end interface
290 interface
291 subroutine opencl_mij_nut_compute_part2(m11_d, m22_d, m33_d, &
292 m12_d, m13_d, m23_d, &
293 l11_d, l22_d, l33_d, &
294 l12_d, l13_d, l23_d, &
295 fsabss11_d, fsabss22_d, fsabss33_d, &
296 fsabss12_d, fsabss13_d, fsabss23_d, &
297 num_d, den_d, c_dyn_d, delta_d, &
298 s_abs_d, nut_d, alpha, n) &
299 bind(c, name = 'opencl_mij_nut_compute_part2')
300 use, intrinsic :: iso_c_binding, only : c_ptr, c_int
301 import c_rp
302 type(c_ptr), value :: m11_d, m22_d, m33_d, &
303 m12_d, m13_d, m23_d, &
304 l11_d, l22_d, l33_d, &
305 l12_d, l13_d, l23_d, &
306 fsabss11_d, fsabss22_d, fsabss33_d, &
307 fsabss12_d, fsabss13_d, fsabss23_d, &
308 num_d, den_d, c_dyn_d, delta_d, s_abs_d, nut_d
309 real(c_rp) :: alpha
310 integer(c_int) :: n
311 end subroutine opencl_mij_nut_compute_part2
312 end interface
313#elif HAVE_METAL
314 interface
315 subroutine metal_s_abs_compute(s_abs_d, s11_d, s22_d, s33_d, &
316 s12_d, s13_d, s23_d, &
317 n) &
318 bind(c, name = 'metal_s_abs_compute')
319 use, intrinsic :: iso_c_binding, only : c_ptr, c_int
320 import c_rp
321 type(c_ptr), value :: s_abs_d, s11_d, s22_d, s33_d, &
322 s12_d, s13_d, s23_d
323 integer(c_int) :: n
324 end subroutine metal_s_abs_compute
325 end interface
326 interface
327 subroutine metal_lij_compute_part1(l11_d, l22_d, l33_d, &
328 l12_d, l13_d, l23_d, &
329 u_d, v_d, w_d, &
330 fu_d, fv_d, fw_d, &
331 fuu_d, fvv_d, fww_d, &
332 fuv_d, fuw_d, fvw_d, n) &
333 bind(c, name = 'metal_lij_compute_part1')
334 use, intrinsic :: iso_c_binding, only : c_ptr, c_int
335 import c_rp
336 type(c_ptr), value :: l11_d, l22_d, l33_d, l12_d, l13_d, l23_d, &
337 u_d, v_d, w_d, fu_d, fv_d, fw_d, &
338 fuu_d, fvv_d, fww_d, fuv_d, fuw_d, fvw_d
339 integer(c_int) :: n
340 end subroutine metal_lij_compute_part1
341 end interface
342 interface
343 subroutine metal_lij_compute_part2(l11_d, l22_d, l33_d, &
344 l12_d, l13_d, l23_d, &
345 fuu_d, fvv_d, fww_d, &
346 fuv_d, fuw_d, fvw_d, n) &
347 bind(c, name = 'metal_lij_compute_part2')
348 use, intrinsic :: iso_c_binding, only : c_ptr, c_int
349 import c_rp
350 type(c_ptr), value :: l11_d, l22_d, l33_d, l12_d, l13_d, l23_d, &
351 fuu_d, fvv_d, fww_d, fuv_d, fuw_d, fvw_d
352 integer(c_int) :: n
353 end subroutine metal_lij_compute_part2
354 end interface
355 interface
356 subroutine metal_mij_compute_part1(m11_d, m22_d, m33_d, &
357 m12_d, m13_d, m23_d, &
358 s_abs_d, s11_d, s22_d, s33_d, &
359 s12_d, s13_d, s23_d, &
360 fs_abs_d, fs11_d, fs22_d, fs33_d, &
361 fs12_d, fs13_d, fs23_d, &
362 fsabss11_d, fsabss22_d, fsabss33_d, &
363 fsabss12_d, fsabss13_d, fsabss23_d, &
364 delta_ratio2, n) &
365 bind(c, name = 'metal_mij_compute_part1')
366 use, intrinsic :: iso_c_binding, only : c_ptr, c_int
367 import c_rp
368 type(c_ptr), value :: m11_d, m22_d, m33_d, &
369 m12_d, m13_d, m23_d, &
370 s_abs_d, s11_d, s22_d, s33_d, &
371 s12_d, s13_d, s23_d, &
372 fs_abs_d, fs11_d, fs22_d, fs33_d, &
373 fs12_d, fs13_d, fs23_d, &
374 fsabss11_d, fsabss22_d, fsabss33_d, &
375 fsabss12_d, fsabss13_d, fsabss23_d
376 real(c_rp) :: delta_ratio2
377 integer(c_int) :: n
378 end subroutine metal_mij_compute_part1
379 end interface
380 interface
381 subroutine metal_mij_nut_compute_part2(m11_d, m22_d, m33_d, &
382 m12_d, m13_d, m23_d, &
383 l11_d, l22_d, l33_d, &
384 l12_d, l13_d, l23_d, &
385 fsabss11_d, fsabss22_d, fsabss33_d, &
386 fsabss12_d, fsabss13_d, fsabss23_d, &
387 num_d, den_d, c_dyn_d, delta_d, &
388 s_abs_d, nut_d, alpha, n) &
389 bind(c, name = 'metal_mij_nut_compute_part2')
390 use, intrinsic :: iso_c_binding, only : c_ptr, c_int
391 import c_rp
392 type(c_ptr), value :: m11_d, m22_d, m33_d, &
393 m12_d, m13_d, m23_d, &
394 l11_d, l22_d, l33_d, &
395 l12_d, l13_d, l23_d, &
396 fsabss11_d, fsabss22_d, fsabss33_d, &
397 fsabss12_d, fsabss13_d, fsabss23_d, &
398 num_d, den_d, c_dyn_d, delta_d, s_abs_d, nut_d
399 real(c_rp) :: alpha
400 integer(c_int) :: n
401 end subroutine metal_mij_nut_compute_part2
402 end interface
403#endif
404
408contains
409
411 subroutine device_s_abs_compute(s_abs_d, s11_d, s22_d, s33_d, &
412 s12_d, s13_d, s23_d, &
413 n)
414 type(c_ptr) :: s_abs_d, s11_d, s22_d, s33_d, &
415 s12_d, s13_d, s23_d
416 integer :: n
417#if HAVE_HIP
418 call hip_s_abs_compute(s_abs_d, s11_d, s22_d, s33_d, &
419 s12_d, s13_d, s23_d, &
420 n)
421#elif HAVE_CUDA
422 call cuda_s_abs_compute(s_abs_d, s11_d, s22_d, s33_d, &
423 s12_d, s13_d, s23_d, &
424 n)
425#elif HAVE_OPENCL
426 call opencl_s_abs_compute(s_abs_d, s11_d, s22_d, s33_d, &
427 s12_d, s13_d, s23_d, &
428 n)
429#elif HAVE_METAL
430 call metal_s_abs_compute(s_abs_d, s11_d, s22_d, s33_d, &
431 s12_d, s13_d, s23_d, &
432 n)
433#else
434 call neko_error('no device backend configured')
435#endif
436 end subroutine device_s_abs_compute
437
439 subroutine device_lij_compute_part1(l11_d, l22_d, l33_d, &
440 l12_d, l13_d, l23_d, &
441 u_d, v_d, w_d, &
442 fu_d, fv_d, fw_d, &
443 fuu_d, fvv_d, fww_d, &
444 fuv_d, fuw_d, fvw_d, n)
445 type(c_ptr) :: l11_d, l22_d, l33_d, l12_d, l13_d, l23_d, &
446 u_d, v_d, w_d, fu_d, fv_d, fw_d, &
447 fuu_d, fvv_d, fww_d, fuv_d, fuw_d, fvw_d
448 integer :: n
449#if HAVE_HIP
450 call hip_lij_compute_part1(l11_d, l22_d, l33_d, &
451 l12_d, l13_d, l23_d, &
452 u_d, v_d, w_d, &
453 fu_d, fv_d, fw_d, &
454 fuu_d, fvv_d, fww_d, &
455 fuv_d, fuw_d, fvw_d, n)
456#elif HAVE_CUDA
457 call cuda_lij_compute_part1(l11_d, l22_d, l33_d, &
458 l12_d, l13_d, l23_d, &
459 u_d, v_d, w_d, &
460 fu_d, fv_d, fw_d, &
461 fuu_d, fvv_d, fww_d, &
462 fuv_d, fuw_d, fvw_d, n)
463#elif HAVE_OPENCL
464 call opencl_lij_compute_part1(l11_d, l22_d, l33_d, &
465 l12_d, l13_d, l23_d, &
466 u_d, v_d, w_d, &
467 fu_d, fv_d, fw_d, &
468 fuu_d, fvv_d, fww_d, &
469 fuv_d, fuw_d, fvw_d, n)
470#elif HAVE_METAL
471 call metal_lij_compute_part1(l11_d, l22_d, l33_d, &
472 l12_d, l13_d, l23_d, &
473 u_d, v_d, w_d, &
474 fu_d, fv_d, fw_d, &
475 fuu_d, fvv_d, fww_d, &
476 fuv_d, fuw_d, fvw_d, n)
477#else
478 call neko_error('no device backend configured')
479#endif
480 end subroutine device_lij_compute_part1
481
483 subroutine device_lij_compute_part2(l11_d, l22_d, l33_d, &
484 l12_d, l13_d, l23_d, &
485 fuu_d, fvv_d, fww_d, &
486 fuv_d, fuw_d, fvw_d, n)
487 type(c_ptr) :: l11_d, l22_d, l33_d, l12_d, l13_d, l23_d, &
488 fuu_d, fvv_d, fww_d, fuv_d, fuw_d, fvw_d
489 integer :: n
490#if HAVE_HIP
491 call hip_lij_compute_part2(l11_d, l22_d, l33_d, &
492 l12_d, l13_d, l23_d, &
493 fuu_d, fvv_d, fww_d, &
494 fuv_d, fuw_d, fvw_d, n)
495#elif HAVE_CUDA
496 call cuda_lij_compute_part2(l11_d, l22_d, l33_d, &
497 l12_d, l13_d, l23_d, &
498 fuu_d, fvv_d, fww_d, &
499 fuv_d, fuw_d, fvw_d, n)
500#elif HAVE_OPENCL
501 call opencl_lij_compute_part2(l11_d, l22_d, l33_d, &
502 l12_d, l13_d, l23_d, &
503 fuu_d, fvv_d, fww_d, &
504 fuv_d, fuw_d, fvw_d, n)
505#elif HAVE_METAL
506 call metal_lij_compute_part2(l11_d, l22_d, l33_d, &
507 l12_d, l13_d, l23_d, &
508 fuu_d, fvv_d, fww_d, &
509 fuv_d, fuw_d, fvw_d, n)
510#else
511 call neko_error('no device backend configured')
512#endif
513 end subroutine device_lij_compute_part2
514
516 subroutine device_mij_compute_part1(m11_d, m22_d, m33_d, &
517 m12_d, m13_d, m23_d, &
518 s_abs_d, s11_d, s22_d, s33_d, &
519 s12_d, s13_d, s23_d, &
520 fs_abs_d, fs11_d, fs22_d, fs33_d, &
521 fs12_d, fs13_d, fs23_d, &
522 fsabss11_d, fsabss22_d, fsabss33_d, &
523 fsabss12_d, fsabss13_d, fsabss23_d, &
524 delta_ratio2, n)
525 type(c_ptr) :: m11_d, m22_d, m33_d, &
526 m12_d, m13_d, m23_d, &
527 s_abs_d, s11_d, s22_d, s33_d, &
528 s12_d, s13_d, s23_d, &
529 fs_abs_d, fs11_d, fs22_d, fs33_d, &
530 fs12_d, fs13_d, fs23_d, &
531 fsabss11_d, fsabss22_d, fsabss33_d, &
532 fsabss12_d, fsabss13_d, fsabss23_d
533 real(kind=rp) :: delta_ratio2
534 integer :: n
535
536#if HAVE_HIP
537 call hip_mij_compute_part1(m11_d, m22_d, m33_d, &
538 m12_d, m13_d, m23_d, &
539 s_abs_d, s11_d, s22_d, s33_d, &
540 s12_d, s13_d, s23_d, &
541 fs_abs_d, fs11_d, fs22_d, fs33_d, &
542 fs12_d, fs13_d, fs23_d, &
543 fsabss11_d, fsabss22_d, fsabss33_d, &
544 fsabss12_d, fsabss13_d, fsabss23_d, &
545 delta_ratio2, n)
546#elif HAVE_CUDA
547 call cuda_mij_compute_part1(m11_d, m22_d, m33_d, &
548 m12_d, m13_d, m23_d, &
549 s_abs_d, s11_d, s22_d, s33_d, &
550 s12_d, s13_d, s23_d, &
551 fs_abs_d, fs11_d, fs22_d, fs33_d, &
552 fs12_d, fs13_d, fs23_d, &
553 fsabss11_d, fsabss22_d, fsabss33_d, &
554 fsabss12_d, fsabss13_d, fsabss23_d, &
555 delta_ratio2, n)
556#elif HAVE_OPENCL
557 call opencl_mij_compute_part1(m11_d, m22_d, m33_d, &
558 m12_d, m13_d, m23_d, &
559 s_abs_d, s11_d, s22_d, s33_d, &
560 s12_d, s13_d, s23_d, &
561 fs_abs_d, fs11_d, fs22_d, fs33_d, &
562 fs12_d, fs13_d, fs23_d, &
563 fsabss11_d, fsabss22_d, fsabss33_d, &
564 fsabss12_d, fsabss13_d, fsabss23_d, &
565 delta_ratio2, n)
566#elif HAVE_METAL
567 call metal_mij_compute_part1(m11_d, m22_d, m33_d, &
568 m12_d, m13_d, m23_d, &
569 s_abs_d, s11_d, s22_d, s33_d, &
570 s12_d, s13_d, s23_d, &
571 fs_abs_d, fs11_d, fs22_d, fs33_d, &
572 fs12_d, fs13_d, fs23_d, &
573 fsabss11_d, fsabss22_d, fsabss33_d, &
574 fsabss12_d, fsabss13_d, fsabss23_d, &
575 delta_ratio2, n)
576#else
577 call neko_error('no device backend configured')
578#endif
579 end subroutine device_mij_compute_part1
580
582 subroutine device_mij_nut_compute_part2(m11_d, m22_d, m33_d, &
583 m12_d, m13_d, m23_d, &
584 l11_d, l22_d, l33_d, &
585 l12_d, l13_d, l23_d, &
586 fsabss11_d, fsabss22_d, fsabss33_d, &
587 fsabss12_d, fsabss13_d, fsabss23_d, &
588 num_d, den_d, c_dyn_d, delta_d, &
589 s_abs_d, nut_d, alpha, n)
590 type(c_ptr) :: m11_d, m22_d, m33_d, &
591 m12_d, m13_d, m23_d, &
592 l11_d, l22_d, l33_d, &
593 l12_d, l13_d, l23_d, &
594 fsabss11_d, fsabss22_d, fsabss33_d, &
595 fsabss12_d, fsabss13_d, fsabss23_d, &
596 num_d, den_d, c_dyn_d, delta_d, s_abs_d, nut_d
597 real(kind=rp) :: alpha
598 integer :: n
599
600#if HAVE_HIP
601 call hip_mij_nut_compute_part2(m11_d, m22_d, m33_d, &
602 m12_d, m13_d, m23_d, &
603 l11_d, l22_d, l33_d, &
604 l12_d, l13_d, l23_d, &
605 fsabss11_d, fsabss22_d, fsabss33_d, &
606 fsabss12_d, fsabss13_d, fsabss23_d, &
607 num_d, den_d, c_dyn_d, delta_d, &
608 s_abs_d, nut_d, alpha, n)
609#elif HAVE_CUDA
610 call cuda_mij_nut_compute_part2(m11_d, m22_d, m33_d, &
611 m12_d, m13_d, m23_d, &
612 l11_d, l22_d, l33_d, &
613 l12_d, l13_d, l23_d, &
614 fsabss11_d, fsabss22_d, fsabss33_d, &
615 fsabss12_d, fsabss13_d, fsabss23_d, &
616 num_d, den_d, c_dyn_d, delta_d, &
617 s_abs_d, nut_d, alpha, n)
618#elif HAVE_OPENCL
619 call opencl_mij_nut_compute_part2(m11_d, m22_d, m33_d, &
620 m12_d, m13_d, m23_d, &
621 l11_d, l22_d, l33_d, &
622 l12_d, l13_d, l23_d, &
623 fsabss11_d, fsabss22_d, fsabss33_d, &
624 fsabss12_d, fsabss13_d, fsabss23_d, &
625 num_d, den_d, c_dyn_d, delta_d, &
626 s_abs_d, nut_d, alpha, n)
627#elif HAVE_METAL
628 call metal_mij_nut_compute_part2(m11_d, m22_d, m33_d, &
629 m12_d, m13_d, m23_d, &
630 l11_d, l22_d, l33_d, &
631 l12_d, l13_d, l23_d, &
632 fsabss11_d, fsabss22_d, fsabss33_d, &
633 fsabss12_d, fsabss13_d, fsabss23_d, &
634 num_d, den_d, c_dyn_d, delta_d, &
635 s_abs_d, nut_d, alpha, n)
636#else
637 call neko_error('no device backend configured')
638#endif
639 end subroutine device_mij_nut_compute_part2
640
641
void opencl_lij_compute_part1(void *l11, void *l22, void *l33, void *l12, void *l13, void *l23, void *u, void *v, void *w, void *fu, void *fv, void *fw, void *fuu, void *fvv, void *fww, void *fuv, void *fuw, void *fvw, int *n)
void opencl_s_abs_compute(void *s_abs, void *s11, void *s22, void *s33, void *s12, void *s13, void *s23, int *n)
void opencl_mij_nut_compute_part2(void *m11, void *m22, void *m33, void *m12, void *m13, void *m23, void *l11, void *l22, void *l33, void *l12, void *l13, void *l23, void *fsabss11, void *fsabss22, void *fsabss33, void *fsabss12, void *fsabss13, void *fsabss23, void *num, void *den, void *c_dyn, void *delta, void *s_abs, void *nut, real *alpha, int *n)
void opencl_mij_compute_part1(void *m11, void *m22, void *m33, void *m12, void *m13, void *m23, void *s_abs, void *s11, void *s22, void *s33, void *s12, void *s13, void *s23, void *fs_abs, void *fs11, void *fs22, void *fs33, void *fs12, void *fs13, void *fs23, void *fsabss11, void *fsabss22, void *fsabss33, void *fsabss12, void *fsabss13, void *fsabss23, real *delta_ratio2, int *n)
void opencl_lij_compute_part2(void *l11, void *l22, void *l33, void *l12, void *l13, void *l23, void *fuu, void *fvv, void *fww, void *fuv, void *fuw, void *fvw, int *n)
void cuda_mij_compute_part1(void *m11, void *m22, void *m33, void *m12, void *m13, void *m23, void *s_abs, void *s11, void *s22, void *s33, void *s12, void *s13, void *s23, void *fs_abs, void *fs11, void *fs22, void *fs33, void *fs12, void *fs13, void *fs23, void *fsabss11, void *fsabss22, void *fsabss33, void *fsabss12, void *fsabss13, void *fsabss23, real *delta_ratio2, int *n)
void cuda_s_abs_compute(void *s_abs, void *s11, void *s22, void *s33, void *s12, void *s13, void *s23, int *n)
void cuda_lij_compute_part1(void *l11, void *l22, void *l33, void *l12, void *l13, void *l23, void *u, void *v, void *w, void *fu, void *fv, void *fw, void *fuu, void *fvv, void *fww, void *fuv, void *fuw, void *fvw, int *n)
void cuda_mij_nut_compute_part2(void *m11, void *m22, void *m33, void *m12, void *m13, void *m23, void *l11, void *l22, void *l33, void *l12, void *l13, void *l23, void *fsabss11, void *fsabss22, void *fsabss33, void *fsabss12, void *fsabss13, void *fsabss23, void *num, void *den, void *c_dyn, void *delta, void *s_abs, void *nut, real *alpha, int *n)
void cuda_lij_compute_part2(void *l11, void *l22, void *l33, void *l12, void *l13, void *l23, void *fuu, void *fvv, void *fww, void *fuv, void *fuw, void *fvw, int *n)
Definition comm.F90:1
type(mpi_datatype), public mpi_real_precision
MPI type for working precision of REAL types.
Definition comm.F90:54
integer, public pe_size
MPI size of communicator.
Definition comm.F90:62
type(mpi_comm), public neko_comm
MPI communicator.
Definition comm.F90:46
subroutine, public device_lij_compute_part1(l11_d, l22_d, l33_d, l12_d, l13_d, l23_d, u_d, v_d, w_d, fu_d, fv_d, fw_d, fuu_d, fvv_d, fww_d, fuv_d, fuw_d, fvw_d, n)
part 1 of the computing of the lij field
subroutine, public device_mij_nut_compute_part2(m11_d, m22_d, m33_d, m12_d, m13_d, m23_d, l11_d, l22_d, l33_d, l12_d, l13_d, l23_d, fsabss11_d, fsabss22_d, fsabss33_d, fsabss12_d, fsabss13_d, fsabss23_d, num_d, den_d, c_dyn_d, delta_d, s_abs_d, nut_d, alpha, n)
part 1 of the computing of the mij field
subroutine, public device_mij_compute_part1(m11_d, m22_d, m33_d, m12_d, m13_d, m23_d, s_abs_d, s11_d, s22_d, s33_d, s12_d, s13_d, s23_d, fs_abs_d, fs11_d, fs22_d, fs33_d, fs12_d, fs13_d, fs23_d, fsabss11_d, fsabss22_d, fsabss33_d, fsabss12_d, fsabss13_d, fsabss23_d, delta_ratio2, n)
part 1 of the computing of the mij field
subroutine, public device_s_abs_compute(s_abs_d, s11_d, s22_d, s33_d, s12_d, s13_d, s23_d, n)
Compute the s_abs field for the Sigma model indevice.
subroutine, public device_lij_compute_part2(l11_d, l22_d, l33_d, l12_d, l13_d, l23_d, fuu_d, fvv_d, fww_d, fuv_d, fuw_d, fvw_d, n)
part 2 of the computing of the lij field
integer, parameter, public c_rp
Definition num_types.f90:15
integer, parameter, public rp
Global precision used in computations.
Definition num_types.f90:14
Utilities.
Definition utils.f90:35