1#ifndef __MATH_MATH_KERNEL_H__
2#define __MATH_MATH_KERNEL_H__
50 for (
int i = idx;
i < n;
i +=
str) {
93 const int ly,
const int lz) {
94 const int idx2 = idx - 1;
95 index[3] =
idx2 / (lx * ly * lz);
96 index[2] = (
idx2 - (lx * ly * lz) * index[3]) / (lx * ly);
97 index[1] = (
idx2 - (lx * ly * lz) * index[3] - (lx * ly) * index[2]) / lx;
98 index[0] = (
idx2 - (lx * ly * lz) * index[3] - (lx * ly) * index[2]) -
108 const int n1,
const int n2,
const int nf) {
109 return ((
i) + (n1) * (((
j) - 1) + (n2) * (((
k) - 1) + (
nf) * (((l) - 1))))) - 1;
115template<
typename T >
131 for (
int m = idx; m <
n_mask; m +=
str) {
132 const int f = facet[m + 1];
155template<
typename T >
173template<
typename T >
191template<
typename T >
210template<
typename T >
228template<
typename T >
246template<
typename T >
262template<
typename T >
271 for (
int i = idx;
i < n;
i +=
str) {
279template<
typename T >
287 for (
int i = idx;
i < n;
i +=
str) {
295template<
typename T >
304 for (
int i = idx;
i < n;
i +=
str) {
312template<
typename T >
320 for (
int i = idx;
i < n;
i +=
str) {
328template<
typename T >
337 for (
int i = idx;
i < n;
i +=
str) {
345template<
typename T >
355 for (
int i = idx;
i < n;
i +=
str) {
363template<
typename T >
370 for (
int i = idx;
i < n;
i +=
str) {
378template<
typename T >
387 for (
int i = idx;
i < n;
i +=
str) {
395template<
typename T >
403 for (
int i = idx;
i < n;
i +=
str) {
411template<
typename T >
419 for (
int i = idx;
i < n;
i +=
str) {
427template<
typename T >
435 for (
int i = idx;
i < n;
i +=
str) {
443template<
typename T >
452 for (
int i = idx;
i < n;
i +=
str) {
460template<
typename T >
470 for (
int i = idx;
i < n;
i +=
str) {
471 a[
i] = b[
i] + c[
i] + d[
i];
478template<
typename T >
487 for (
int i = idx;
i < n;
i +=
str) {
495template<
typename T >
506 for (
int i = idx;
i < n;
i+=
str) {
509 tmp += p[
j][
i]*alpha[
j];
518template<
typename T >
527 for (
int i = idx;
i < n;
i +=
str) {
535template<
typename T >
544 for (
int i = idx;
i < n;
i +=
str) {
552template<
typename T >
563 for (
int i = idx;
i < n;
i +=
str) {
571template<
typename T >
584 for (
int i = idx;
i < n;
i +=
str) {
592template<
typename T >
607 for (
int i = idx;
i < n;
i +=
str) {
615template<
typename T >
623 for (
int i = idx;
i < n;
i +=
str) {
631template<
typename T >
639 for (
int i = idx;
i < n;
i +=
str) {
647template<
typename T >
656 for (
int i = idx;
i < n;
i +=
str) {
664template<
typename T >
672 for (
int i = idx;
i < n;
i +=
str) {
680template<
typename T >
689 for (
int i = idx;
i < n;
i +=
str) {
697template<
typename T >
706 for (
int i = idx;
i < n;
i +=
str) {
707 a[
i] =
a[
i] - b[
i] * c[
i];
714template<
typename T >
722 for (
int i = idx;
i < n;
i +=
str) {
730template<
typename T >
739 for (
int i = idx;
i < n;
i +=
str) {
747template<
typename T >
756 for (
int i = idx;
i < n;
i +=
str) {
757 a[
i] =
a[
i] + b[
i] * c[
i];
765template<
typename T >
775 for (
int i = idx;
i < n;
i +=
str) {
776 a[
i] =
a[
i] + b[
i] * c[
i] * d[
i];
784template<
typename T >
794 for (
int i = idx;
i < n;
i +=
str) {
795 a[
i] =
a[
i] + s * b[
i] * c[
i];
803template<
typename T >
816 for (
int i = idx;
i < n;
i +=
str) {
825template<
typename T >
840 for (
int i = idx;
i < n;
i +=
str) {
843 u3[
i] = v1[
i]*w2[
i] - v2[
i]*w1[
i];
858#if NEKO_WAVE_SIZE == 64
874#if NEKO_WAVE_SIZE == 64
890#if NEKO_WAVE_SIZE == 64
904template<
typename T >
910 for (
int i = idx;
i<n ;
i +=
str)
935template<
typename T >
941 for (
int i = idx;
i<n ;
i +=
str)
966template<
typename T >
972 for (
int i = idx;
i<n ;
i +=
str)
998template<
typename T_acc >
1009 for (
int i=idx ;
i<n ;
i+=step)
1032template<
typename T >
1047 for (
int i = idx;
i < n;
i+=
str) {
1067template<
typename T,
typename T_acc >
1082 for (
int i = idx;
i < n;
i+=
str) {
1102template<
typename T,
typename T_acc >
1117 for (
int i = idx;
i < n;
i+=
str) {
1143template<
typename T,
typename T_acc >
1157 for (
int i = idx;
i < n;
i+=
str) {
1178template<
typename T,
typename T_acc >
1192 for (
int i = idx;
i < n;
i+=
str) {
1213template<
typename T,
typename T_acc >
1226 for (
int i = idx;
i<n ;
i +=
str)
1248template<
typename T >
1262 for (
int i = idx;
i<n ;
i +=
str)
1284template<
typename T >
1298 for (
int i = idx;
i<n ;
i +=
str)
1320template<
typename T >
1327 for (
int i = idx;
i < n;
i +=
str) {
1339template <
typename T>
1353template <
typename T>
1368template <
typename T>
1381template <
typename T>
1388 for (
int i = idx;
i < n;
i +=
str)
a[
i] =
max(b[
i], c);
1395template <
typename T>
1409template <
typename T>
1424template <
typename T>
1437template <
typename T>
1444 for (
int i = idx;
i < n;
i +=
str)
a[
i] =
min(b[
i], c);
__global__ void ale_add_kinematics_kernel(const int n, T *__restrict__ wx, T *__restrict__ wy, T *__restrict__ wz, const T *__restrict__ x_ref, const T *__restrict__ y_ref, const T *__restrict__ z_ref, const T *__restrict__ phi, const T *__restrict__ x, const T *__restrict__ y, const T *__restrict__ z, const kinematics_params_t kin_params)
__global__ void const T *__restrict__ x
__global__ void const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ const T *__restrict__ w3
__global__ void addcol4_kernel(T *__restrict__ a, const T *__restrict__ b, const T *__restrict__ c, const T *__restrict__ d, const int n)
__global__ void cwrap_kernel(T *__restrict__ a, const T min_val, const T max_val, const int n)
__global__ void pwmin_vec3_kernel(T *__restrict__ a, const T *__restrict__ b, const T *__restrict__ c, const int n)
__global__ void reduce_kernel(T *bufred, const int n)
__global__ void cdiv2_kernel(T *__restrict__ a, T *__restrict__ b, const T c, const int n)
__global__ void invcol2_kernel(T *__restrict__ a, const T *__restrict__ b, const int n)
__global__ void add2_kernel(T *__restrict__ a, const T *__restrict__ b, const int n)
__global__ void add4s3_kernel(T *__restrict__ a, const T *__restrict__ b, const T *__restrict__ c, const T *__restrict__ d, const T c1, const T c2, const T c3, const int n)
__inline__ __device__ T reduce_warp(T val)
__global__ void masked_scatter_copy_aligned_kernel(T *__restrict__ a, T *__restrict__ b, int *__restrict__ mask, const int n, const int n_mask)
__global__ void masked_atomic_reduction_kernel(T *__restrict__ a, T *__restrict__ b, int *__restrict__ mask, const int n, const int m)
__global__ void pwmax_vec3_kernel(T *__restrict__ a, const T *__restrict__ b, const T *__restrict__ c, const int n)
__global__ void glsc2_kernel(const T *a, const T *b, T_acc *buf_h, const int n)
__global__ void addcol3s2_kernel(T *__restrict__ a, const T *__restrict__ b, const T *__restrict__ c, const T s, const int n)
__global__ void cfill_mask_kernel(T *__restrict__ a, const T c, const int size, int *__restrict__ mask, const int mask_size)
__global__ void cdiv_kernel(T *__restrict__ a, const T c, const int n)
__global__ void masked_copy_kernel_aligned(T *__restrict__ a, T *__restrict__ b, int *__restrict__ mask, const int n, const int n_mask)
__global__ void face_masked_gather_copy_kernel(T *__restrict__ a, const T *__restrict__ b, const int *__restrict__ mask, const int *__restrict__ facet, const int n1, const int n2, const int lx, const int ly, const int lz, const int n_mask)
__global__ void masked_gather_copy_aligned_kernel(T *__restrict__ a, T *__restrict__ b, int *__restrict__ mask, const int n, const int n_mask)
__global__ void pwmax_sca2_kernel(T *__restrict__ a, const T c, const int n)
__device__ __forceinline__ void face_gather_nonlinear_index(int *index, const int idx, const int lx, const int ly, const int lz)
__global__ void reduce_max_kernel(T *bufred, const T ninf, const int n)
__global__ void pwmin_vec2_kernel(T *__restrict__ a, const T *__restrict__ b, const int n)
__global__ void add3s2_kernel(T *__restrict__ a, const T *__restrict__ b, const T *__restrict__ c, const T c1, const T c2, const int n)
__inline__ __device__ T reduce_max_warp(T val)
__global__ void glsum_kernel(const T *a, T_acc *buf_h, const int n)
__global__ void add2s1_kernel(T *__restrict__ a, const T *__restrict__ b, const T c1, const int n)
__device__ __forceinline__ int face_gather_idx(const int i, const int j, const int k, const int l, const int n1, const int n2, const int nf)
__global__ void add5s4_kernel(T *__restrict__ a, const T *__restrict__ b, const T *__restrict__ c, const T *__restrict__ d, const T *__restrict__ e, const T c1, const T c2, const T c3, const T c4, const int n)
__global__ void masked_gather_copy_kernel(T *__restrict__ a, T *__restrict__ b, int *__restrict__ mask, const int n, const int n_mask)
__global__ void add2s2_many_kernel(T *__restrict__ x, const T **p, const T *alpha, const int p_cur, const int n)
__global__ void glsc3_many_kernel(const T *a, const T **b, const T *c, T_acc *buf_h, const int j, const int n)
__global__ void pwmax_vec2_kernel(T *__restrict__ a, const T *__restrict__ b, const int n)
__global__ void cmult_kernel(T *__restrict__ a, const T c, const int n)
__global__ void addcol3_kernel(T *__restrict__ a, const T *__restrict__ b, const T *__restrict__ c, const int n)
__global__ void pwmin_sca3_kernel(T *__restrict__ a, const T *__restrict b, const T c, const int n)
__global__ void pwmax_sca3_kernel(T *__restrict__ a, const T *__restrict b, const T c, const int n)
__global__ void power_kernel(T *__restrict__ ap, const T *__restrict__ a, const T p, const int n)
__global__ void col2_kernel(T *__restrict__ a, const T *__restrict__ b, const int n)
__global__ void masked_copy_kernel_0(T *__restrict__ a, T *__restrict__ b, int *__restrict__ mask, const int n, const int n_mask)
__global__ void sqrt_inplace_kernel(T *__restrict__ a, const int n)
__global__ void col3_kernel(T *__restrict__ a, const T *__restrict__ b, const T *__restrict__ c, const int n)
__global__ void sub2_kernel(T *__restrict__ a, const T *__restrict__ b, const int n)
__global__ void glmin_kernel(const T *a, const T pinf, T *buf_h, const int n)
__global__ void cmult2_kernel(T *__restrict__ a, T *__restrict__ b, const T c, const int n)
__global__ void pwmin_sca2_kernel(T *__restrict__ a, const T c, const int n)
__global__ void sub3_kernel(T *__restrict__ a, const T *__restrict__ b, const T *__restrict__ c, const int n)
__global__ void glsubnorm2_kernel(const T *a, const T *b, T_acc *buf_h, const int n)
__global__ void glsc3_reduce_kernel(T_acc *bufred, const int n, const int j)
__global__ void add2s2_kernel(T *__restrict__ a, const T *__restrict__ b, const T c1, const int n)
__global__ void vdot3_kernel(T *__restrict__ dot, const T *__restrict__ u1, const T *__restrict__ u2, const T *__restrict__ u3, const T *__restrict__ v1, const T *__restrict__ v2, const T *__restrict__ v3, const int n)
__global__ void invcol1_kernel(T *__restrict__ a, const int n)
__global__ void add3_kernel(T *__restrict__ a, const T *__restrict__ b, const T *__restrict__ c, const int n)
__global__ void glmax_kernel(const T *a, const T ninf, T *buf_h, const int n)
__global__ void vlsc3_kernel(const T *a, const T *b, const T *c, T *buf_h, const int n)
__global__ void add4_kernel(T *__restrict__ a, const T *__restrict__ b, const T *__restrict__ c, const T *__restrict__ d, const int n)
__global__ void cfill_kernel(T *__restrict__ a, const T c, const int n)
__global__ void masked_scatter_copy_kernel(T *__restrict__ a, T *__restrict__ b, int *__restrict__ mask, const int n, const int n_mask)
__global__ void glsc3_kernel(const T *a, const T *b, const T *c, T_acc *buf_h, const int n)
__global__ void reduce_min_kernel(T *bufred, const T pinf, const int n)
__global__ void vcross_kernel(T *__restrict__ u1, T *__restrict__ u2, T *__restrict__ u3, const T *__restrict__ v1, const T *__restrict__ v2, const T *__restrict__ v3, const T *__restrict__ w1, const T *__restrict__ w2, const T *__restrict__ w3, const int n)
__global__ void addsqr2s2_kernel(T *__restrict__ a, const T *__restrict__ b, const T c1, const int n)
__global__ void cadd2_kernel(T *__restrict__ a, T *__restrict__ b, const T c, const int n)
__global__ void absval_kernel(T *__restrict__ a, const int n)
__global__ void invcol3_kernel(T *__restrict__ a, const T *__restrict__ b, const T *__restrict__ c, const int n)
__global__ void subcol3_kernel(T *__restrict__ a, const T *__restrict__ b, const T *__restrict__ c, const int n)
__global__ void cadd_kernel(T *__restrict__ a, const T c, const int n)
__inline__ __device__ T reduce_min_warp(T val)
__global__ void copy_kernel(T *__restrict__ a, const T *__restrict__ b, const int n)
Object for handling masks in Neko.