1#ifndef __MATH_MATH_KERNEL_H__
2#define __MATH_MATH_KERNEL_H__
48 for (
int i = idx;
i < n;
i +=
str) {
91 const int ly,
const int lz) {
92 const int idx2 = idx - 1;
93 index[3] =
idx2 / (lx * ly * lz);
94 index[2] = (
idx2 - (lx * ly * lz) * index[3]) / (lx * ly);
95 index[1] = (
idx2 - (lx * ly * lz) * index[3] - (lx * ly) * index[2]) / lx;
96 index[0] = (
idx2 - (lx * ly * lz) * index[3] - (lx * ly) * index[2]) -
106 const int n1,
const int n2,
const int nf) {
107 return ((
i) + (n1) * (((
j) - 1) + (n2) * (((
k) - 1) + (
nf) * (((l) - 1))))) - 1;
113template<
typename T >
129 for (
int m = idx; m <
n_mask; m +=
str) {
130 const int f = facet[m + 1];
153template<
typename T >
171template<
typename T >
189template<
typename T >
208template<
typename T >
226template<
typename T >
244template<
typename T >
260template<
typename T >
269 for (
int i = idx;
i < n;
i +=
str) {
277template<
typename T >
285 for (
int i = idx;
i < n;
i +=
str) {
293template<
typename T >
302 for (
int i = idx;
i < n;
i +=
str) {
310template<
typename T >
318 for (
int i = idx;
i < n;
i +=
str) {
326template<
typename T >
335 for (
int i = idx;
i < n;
i +=
str) {
343template<
typename T >
353 for (
int i = idx;
i < n;
i +=
str) {
361template<
typename T >
369 for (
int i = idx;
i < n;
i +=
str) {
377template<
typename T >
385 for (
int i = idx;
i < n;
i +=
str) {
393template<
typename T >
402 for (
int i = idx;
i < n;
i +=
str) {
410template<
typename T >
420 for (
int i = idx;
i < n;
i +=
str) {
421 a[
i] = b[
i] + c[
i] + d[
i];
428template<
typename T >
437 for (
int i = idx;
i < n;
i +=
str) {
445template<
typename T >
456 for (
int i = idx;
i < n;
i+=
str) {
459 tmp += p[
j][
i]*alpha[
j];
468template<
typename T >
477 for (
int i = idx;
i < n;
i +=
str) {
485template<
typename T >
494 for (
int i = idx;
i < n;
i +=
str) {
502template<
typename T >
513 for (
int i = idx;
i < n;
i +=
str) {
521template<
typename T >
534 for (
int i = idx;
i < n;
i +=
str) {
542template<
typename T >
557 for (
int i = idx;
i < n;
i +=
str) {
565template<
typename T >
573 for (
int i = idx;
i < n;
i +=
str) {
581template<
typename T >
589 for (
int i = idx;
i < n;
i +=
str) {
597template<
typename T >
606 for (
int i = idx;
i < n;
i +=
str) {
614template<
typename T >
622 for (
int i = idx;
i < n;
i +=
str) {
630template<
typename T >
639 for (
int i = idx;
i < n;
i +=
str) {
647template<
typename T >
656 for (
int i = idx;
i < n;
i +=
str) {
657 a[
i] =
a[
i] - b[
i] * c[
i];
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];
715template<
typename T >
725 for (
int i = idx;
i < n;
i +=
str) {
726 a[
i] =
a[
i] + b[
i] * c[
i] * d[
i];
734template<
typename T >
744 for (
int i = idx;
i < n;
i +=
str) {
745 a[
i] =
a[
i] + s * b[
i] * c[
i];
753template<
typename T >
766 for (
int i = idx;
i < n;
i +=
str) {
775template<
typename T >
790 for (
int i = idx;
i < n;
i +=
str) {
793 u3[
i] = v1[
i]*w2[
i] - v2[
i]*w1[
i];
842template<
typename T >
848 for (
int i = idx;
i<n ;
i +=
str)
873template<
typename T >
879 for (
int i = idx;
i<n ;
i +=
str)
904template<
typename T >
910 for (
int i = idx;
i<n ;
i +=
str)
936template<
typename T >
947 for (
int i=idx ;
i<n ;
i+=step)
970template<
typename T >
985 for (
int i = idx;
i < n;
i+=
str) {
1005template<
typename T >
1020 for (
int i = idx;
i < n;
i+=
str) {
1046template<
typename T >
1060 for (
int i = idx;
i < n;
i+=
str) {
1081template<
typename T >
1095 for (
int i = idx;
i < n;
i+=
str) {
1116template<
typename T >
1129 for (
int i = idx;
i<n ;
i +=
str)
1151template<
typename T >
1165 for (
int i = idx;
i<n ;
i +=
str)
1187template<
typename T >
1201 for (
int i = idx;
i<n ;
i +=
str)
1223template<
typename T >
1230 for (
int i = idx;
i < n;
i +=
str) {
1242template <
typename T>
1256template <
typename T>
1271template <
typename T>
1284template <
typename T>
1291 for (
int i = idx;
i < n;
i +=
str)
a[
i] =
max(b[
i], c);
1298template <
typename T>
1312template <
typename T>
1327template <
typename T>
1340template <
typename T>
1347 for (
int i = idx;
i < n;
i +=
str)
a[
i] =
min(b[
i], c);
__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 dirichlet_apply_scalar_kernel(const int *__restrict__ msk, T *__restrict__ x, const T g, const int m)
__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 glsc3_many_kernel(const T *a, const T **b, const T *c, T *buf_h, const int j, 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 glsc3_reduce_kernel(T *bufred, const int n, const int j)
__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 glsubnorm2_kernel(const T *a, const T *b, T *buf_h, 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 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 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 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 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 glsc2_kernel(const T *a, const T *b, 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 glsum_kernel(const T *a, T *buf_h, const int n)
__global__ void glsc3_kernel(const T *a, const T *b, const T *c, T *buf_h, const int n)
__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 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 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)
Object for handling masks in Neko.