Neko 1.99.1
A portable framework for high-order spectral element flow simulations
Loading...
Searching...
No Matches
wall_model.hip
Go to the documentation of this file.
1/*
2 Copyright (c) 2025, 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/or other materials
14 provided 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*/
33
34#include <string.h>
35#include <stdlib.h>
36#include <stdio.h>
38#include <device/hip/check.h>
39#include "wall_model_kernel.h"
40
41extern "C" {
43 void *tau_field_d, void *msk_d, int *m) {
44 // Define hip grid and block dimensions
45 const dim3 nthrds(1024, 1, 1);
46 const dim3 nblcks(((*m) + 1024 - 1) / 1024, 1, 1);
47 const hipStream_t stream = (hipStream_t) glb_cmd_queue;
48
49 // Launch the hip kernel
51 <<<nblcks, nthrds, 0, stream>>>((real *) tau_x_d, (real *) tau_y_d, (real *) tau_z_d,
52 (real *) tau_field_d, (int *) msk_d, *m);
53
54 // Check for hip errors
56 }
57}
__global__ void dirichlet_apply_scalar_kernel(const int *__restrict__ msk, T *__restrict__ x, const T g, const int m)
double real
#define HIP_CHECK(err)
Definition check.h:8
void hip_wall_model_compute_mag_field(void *tau_x_d, void *tau_y_d, void *tau_z_d, void *tau_field_d, void *msk_d, int *m)