Neko-TOP
A portable framework for high-order spectral element flow toplogy optimization.
Loading...
Searching...
No Matches
heaviside_mapping.cu
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 <cuda_runtime.h>
43
44// Neko includes
45#include <neko/device/cuda/check.h>
46#include <neko/device/device_config.h>
47
48// Local includes
50
51extern "C" {
52
56void cuda_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
64 (*beta, *eta, (real*)X_out_d, (real*)X_in_d, *n);
66}
67
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
79 (*beta, *eta, (real*)sens_out_d, (real*)sens_in_d, (real*)X_in_d, *n);
81}
82
83}
__global__ void heaviside_mapping_apply_kernel(const T beta, const T eta, T *__restrict__ X_out_d, T *__restrict__ X_in_d, const int n)
void cuda_heaviside_mapping_apply_backward(real *beta, real *eta, void *sens_out_d, void *sens_in_d, void *X_in_d, int *n)
void cuda_heaviside_mapping_apply(real *beta, real *eta, void *X_out_d, void *X_in_d, int *n)