Neko 0.9.99
A portable framework for high-order spectral element flow simulations
Loading...
Searching...
No Matches
dynamic_smagorinsky_nut.hip
Go to the documentation of this file.
1/*
2 Copyright (c) 2024, The Neko Authors
3 All rights reserved.
4
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions
7 are met:
8
9 * Redistributions of source code must retain the above copyright
10 notice, this list of conditions and the following disclaimer.
11
12 * Redistributions in binary form must reproduce the above
13 copyright notice, this list of conditions and the following
14 disclaimer in the documentation and/or other materials provided
15 with the distribution.
16
17 * Neither the name of the authors nor the names of its
18 contributors may be used to endorse or promote products derived
19 from this software without specific prior written permission.
20
21 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 POSSIBILITY OF SUCH DAMAGE.
33*/
34
35#include <hip/hip_runtime.h>
37#include <device/hip/check.h>
39
40extern "C" {
41 void hip_s_abs_compute(void *s_abs, void *s11, void *s22, void *s33,
42 void *s12, void *s13, void *s23,
43 void *mult, int * n){
44
45 const dim3 nthrds(1024, 1, 1);
46 const dim3 nblcks(((*n)+1024 - 1)/ 1024, 1, 1);
48 nblcks, nthrds, 0, (hipStream_t) glb_cmd_queue,
49 (real *) s_abs,
50 (real *) s11, (real *) s22, (real *) s33,
51 (real *) s12, (real *) s13, (real *) s23,
52 (real *) mult, * n);
54 }
55
56 void hip_lij_compute_part1(void *l11, void *l22, void *l33,
57 void *l12, void *l13, void *l23,
58 void *u, void *v, void *w,
59 void *fu, void *fv, void *fw,
60 void *fuu, void *fvv, void *fww,
61 void *fuv, void *fuw, void *fvw,
62 int * n){
63
64 const dim3 nthrds(1024, 1, 1);
65 const dim3 nblcks(((*n)+1024 - 1)/ 1024, 1, 1);
67 nblcks, nthrds, 0, (hipStream_t) glb_cmd_queue,
68 (real *) l11, (real *) l22, (real *) l33,
69 (real *) l12, (real *) l13, (real *) l23,
70 (real *) u, (real *) v, (real *) w,
71 (real *) fu, (real *) fv, (real *) fw,
72 (real *) fuu, (real *) fvv, (real *) fww,
73 (real *) fuv, (real *) fuw, (real *) fvw,
74 * n);
76 }
77
78 void hip_lij_compute_part2(void *l11, void *l22, void *l33,
79 void *l12, void *l13, void *l23,
80 void *fuu, void *fvv, void *fww,
81 void *fuv, void *fuw, void *fvw,
82 int * n){
83
84 const dim3 nthrds(1024, 1, 1);
85 const dim3 nblcks(((*n)+1024 - 1)/ 1024, 1, 1);
87 nblcks, nthrds, 0, (hipStream_t) glb_cmd_queue,
88 (real *) l11, (real *) l22, (real *) l33,
89 (real *) l12, (real *) l13, (real *) l23,
90 (real *) fuu, (real *) fvv, (real *) fww,
91 (real *) fuv, (real *) fuw, (real *) fvw,
92 * n);
94 }
95
96 void hip_mij_compute_part1(void *m11, void *m22, void *m33,
97 void *m12, void *m13, void *m23,
98 void *s_abs, void *s11, void *s22, void *s33,
99 void *s12, void *s13, void *s23,
100 void *fs_abs, void *fs11, void *fs22, void *fs33,
101 void *fs12, void *fs13, void *fs23,
102 void *fsabss11, void *fsabss22, void *fsabss33,
103 void *fsabss12, void *fsabss13, void *fsabss23,
104 real * delta_ratio2, int * n){
105
106 const dim3 nthrds(1024, 1, 1);
107 const dim3 nblcks(((*n)+1024 - 1)/ 1024, 1, 1);
109 nblcks, nthrds, 0, (hipStream_t) glb_cmd_queue,
110 (real *) m11, (real *) m22, (real *) m33,
111 (real *) m12, (real *) m13, (real *) m23,
112 (real *) s_abs, (real *) s11, (real *) s22,
113 (real *) s33, (real *) s12, (real *) s13, (real *) s23,
114 (real *) fs_abs, (real *) fs11, (real *) fs22,
115 (real *) fs33, (real *) fs12, (real *) fs13, (real *) fs23,
116 (real *) fsabss11, (real *) fsabss22, (real *) fsabss33,
117 (real *) fsabss12, (real *) fsabss13, (real *) fsabss23,
118 * delta_ratio2, * n);
120 }
121
122 void hip_mij_nut_compute_part2(void *m11, void *m22, void *m33,
123 void *m12, void *m13, void *m23,
124 void *l11, void *l22, void *l33,
125 void *l12, void *l13, void *l23,
126 void *fsabss11, void *fsabss22, void *fsabss33,
127 void *fsabss12, void *fsabss13, void *fsabss23,
128 void *num, void *den, void *c_dyn, void *delta,
129 void *s_abs, void *nut,
130 real * alpha, int * n){
131
132 const dim3 nthrds(1024, 1, 1);
133 const dim3 nblcks(((*n)+1024 - 1)/ 1024, 1, 1);
135 nblcks, nthrds, 0, (hipStream_t) glb_cmd_queue,
136 (real *) m11, (real *) m22, (real *) m33,
137 (real *) m12, (real *) m13, (real *) m23,
138 (real *) l11, (real *) l22, (real *) l33,
139 (real *) l12, (real *) l13, (real *) l23,
140 (real *) fsabss11, (real *) fsabss22, (real *) fsabss33,
141 (real *) fsabss12, (real *) fsabss13, (real *) fsabss23,
142 (real *) num, (real *) den, (real *) c_dyn,
143 (real *) delta, (real *) s_abs, (real *) nut,
144 * alpha, * n);
146 }
147}
__global__ void T *__restrict__ T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ w
__global__ void T *__restrict__ T *__restrict__ const T *__restrict__ u
__global__ void T *__restrict__ T *__restrict__ const T *__restrict__ const T *__restrict__ v
__global__ void dirichlet_apply_scalar_kernel(const int *__restrict__ msk, T *__restrict__ x, const T g, const int m)
double real
void hip_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 hip_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 hip_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 hip_s_abs_compute(void *s_abs, void *s11, void *s22, void *s33, void *s12, void *s13, void *s23, void *mult, int *n)
void hip_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)
#define HIP_CHECK(err)
Definition check.h:8