Neko
1.99.11
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>
37
#include <
device/device_config.h
>
38
#include <
device/hip/check.h
>
39
#include "
wall_model_kernel.h
"
40
41
extern
"C"
{
42
void
hip_wall_model_compute_mag_field
(
void
*tau_x_d,
void
*tau_y_d,
void
*tau_z_d,
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
48
// Launch the hip kernel
49
hipLaunchKernelGGL(HIP_KERNEL_NAME(
wall_model_compute_mag_field<real>
),
50
nblcks, nthrds, 0, (hipStream_t)
glb_cmd_queue
,
51
(
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
55
HIP_CHECK
(hipGetLastError());
56
}
57
}
wall_model_compute_mag_field
__global__ void wall_model_compute_mag_field(const T *__restrict__ tau_x_d, const T *__restrict__ tau_y_d, const T *__restrict__ tau_z_d, T *__restrict__ tau_field_d, const int *__restrict__ msk_d, const int m)
Definition
wall_model_kernel.h:43
device_config.h
real
double real
Definition
device_config.h:12
glb_cmd_queue
void * glb_cmd_queue
check.h
HIP_CHECK
#define HIP_CHECK(err)
Definition
check.h:8
wall_model_kernel.h
hip_wall_model_compute_mag_field
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)
Definition
wall_model.hip:42
src
wall_models
bcknd
device
hip
wall_model.hip
Generated on
for Neko by
1.15.0