Neko-TOP
A portable framework for high-order spectral element flow toplogy optimization.
Loading...
Searching...
No Matches
Borrvall_Petersson_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
55void cuda_Borrvall_Petersson_mapping_apply(real* f_min, real* f_max, real* q,
56 void* X_out_d, void* X_in_d, int* n) {
57
58 const dim3 nthrds(1024, 1, 1);
59 const dim3 nblcks(((*n) + 1024 - 1) / 1024, 1, 1);
60
63 (*f_min, *f_max, *q, (real*)X_out_d, (real*)X_in_d, *n);
65}
66
70 real* q, void* sens_out_d, void* sens_in_d, void* X_in_d, int* n) {
71
72 const dim3 nthrds(1024, 1, 1);
73 const dim3 nblcks(((*n) + 1024 - 1) / 1024, 1, 1);
74
77 (*f_min, *f_max, *q, (real*)sens_out_d, (real*)sens_in_d,
78 (real*)X_in_d, *n);
80}
81}
void cuda_Borrvall_Petersson_mapping_apply_backward(real *f_min, real *f_max, real *q, void *sens_out_d, void *sens_in_d, void *X_in_d, int *n)
void cuda_Borrvall_Petersson_mapping_apply(real *f_min, real *f_max, real *q, void *X_out_d, void *X_in_d, int *n)
__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)