Neko 1.99.4
A portable framework for high-order spectral element flow simulations
Loading...
Searching...
No Matches
ale_kinematics.hip
Go to the documentation of this file.
1/*
2 Copyright (c) 2026, 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
40
41extern "C" {
43 void *wx, void *wy, void *wz,
44 void *x_ref, void *y_ref, void *z_ref,
45 void *phi, void *x, void *y, void *z,
47 int n)
48 {
49 const dim3 nthrds(1024, 1, 1);
50 const dim3 nblcks((n + 1024 - 1) / 1024, 1, 1);
51
54 nblcks, nthrds, 0, (hipStream_t)glb_cmd_queue,
55 n,
56 (real*)wx, (real*)wy, (real*)wz,
57 (real*)x_ref, (real*)y_ref, (real*)z_ref,
58 (real*)phi, (real*)x, (real*)y, (real*)z,
60
62 }
63
67 void compute_cheap_dist_hip(void *d_d, void *x_d, void *y_d, void *z_d,
68 int lx, int ly, int lz, int nel,
69 int local_iters, void *nchange_d) {
70
71 const dim3 nthrds(256, 1, 1);
72 const dim3 nblcks((nel + 256 - 1) / 256, 1, 1);
73
75 nblcks, nthrds, 0, (hipStream_t)glb_cmd_queue,
76 (real*)d_d, (real*)x_d, (real*)y_d, (real*)z_d,
77 lx, ly, lz, nel, local_iters, (int*)nchange_d);
78
80 }
81
82} // extern "C"
void add_kinematics_to_mesh_velocity_hip(void *wx, void *wy, void *wz, void *x_ref, void *y_ref, void *z_ref, void *phi, void *x, void *y, void *z, kinematics_params_t kin_params, int n)
void compute_cheap_dist_hip(void *d_d, void *x_d, void *y_d, void *z_d, int lx, int ly, int lz, int nel, int local_iters, void *nchange_d)
__global__ void ale_add_kinematics_kernel(const int n, T *__restrict__ wx, T *__restrict__ wy, T *__restrict__ wz, const T *__restrict__ x_ref, const T *__restrict__ y_ref, const T *__restrict__ z_ref, const T *__restrict__ phi, const T *__restrict__ x, const T *__restrict__ y, const T *__restrict__ z, const kinematics_params_t kin_params)
__global__ void const T *__restrict__ x
double real
#define HIP_CHECK(err)
Definition check.h:8