Neko-TOP
A portable framework for high-order spectral element flow toplogy optimization.
Loading...
Searching...
No Matches
heaviside_mapping.hip
Go to the documentation of this file.
1
37
// System includes
38
#include <stdio.h>
39
#include <stdlib.h>
40
41
// Device includes
42
#include <hip/hip_runtime.h>
43
44
// Neko includes
45
#include <neko/device/device_config.h>
46
#include <neko/device/hip/check.h>
47
48
// Local includes
49
#include "
heaviside_mapping_kernel.h
"
50
51
extern
"C"
{
52
56
void
hip_heaviside_mapping_apply
(
real
* beta,
real
* eta,
57
void
*
X_out_d
,
void
*
X_in_d
,
int
* n) {
58
59
const
dim3
nthrds
(1024, 1, 1);
60
const
dim3
nblcks
(((*n) + 1024 - 1) / 1024, 1, 1);
61
62
hipLaunchKernelGGL
(
HIP_KERNEL_NAME
(
heaviside_mapping_apply_kernel<real>
),
63
nblcks
,
nthrds
, 0, (
hipStream_t
)
glb_cmd_queue
,
64
*beta, *eta, (
real
*)
X_out_d
, (
real
*)
X_in_d
, *n);
65
HIP_CHECK
(
hipGetLastError
());
66
}
67
71
void
hip_heaviside_mapping_apply_backward
(
real
* beta,
real
* eta,
72
void
*
sens_out_d
,
void
*
sens_in_d
,
void
*
X_in_d
,
int
* n) {
73
74
const
dim3
nthrds
(1024, 1, 1);
75
const
dim3
nblcks
(((*n) + 1024 - 1) / 1024, 1, 1);
76
77
hipLaunchKernelGGL
(
HIP_KERNEL_NAME
(
heaviside_mapping_apply_backward_kernel<real>
),
78
nblcks
,
nthrds
, 0, (
hipStream_t
)
glb_cmd_queue
,
79
*beta, *eta, (
real
*)
sens_out_d
, (
real
*)
sens_in_d
, (
real
*)
X_in_d
, *n);
80
HIP_CHECK
(
hipGetLastError
());
81
}
82
83
}
Borrvall_Petersson_mapping_apply_kernel
__global__ void Borrvall_Petersson_mapping_apply_kernel(const T f_min, const T f_max, const T q, T *__restrict__ X_out_d, T *__restrict__ X_in_d, const int n)
Definition
Borrvall_Petersson_mapping_kernel.h:44
hip_heaviside_mapping_apply_backward
void hip_heaviside_mapping_apply_backward(real *beta, real *eta, void *sens_out_d, void *sens_in_d, void *X_in_d, int *n)
Definition
heaviside_mapping.hip:71
hip_heaviside_mapping_apply
void hip_heaviside_mapping_apply(real *beta, real *eta, void *X_out_d, void *X_in_d, int *n)
Definition
heaviside_mapping.hip:56
heaviside_mapping_kernel.h
sources
mapping_functions
bcknd
device
hip
heaviside_mapping.hip
Generated by
1.9.8