1#ifndef __MATH_MATH_KERNEL_H__
2#define __MATH_MATH_KERNEL_H__
48 for (
int i = idx;
i < n;
i +=
str) {
92 const int ly,
const int lz) {
93 const int idx2 = idx - 1;
94 index[3] =
idx2 / (lx * ly * lz);
95 index[2] = (
idx2 - (lx * ly * lz) * index[3]) / (lx * ly);
96 index[1] = (
idx2 - (lx * ly * lz) * index[3] - (lx * ly) * index[2]) / lx;
97 index[0] = (
idx2 - (lx * ly * lz) * index[3] - (lx * ly) * index[2]) -
107 const int n1,
const int n2,
const int nf) {
108 return ((
i) + (n1) * (((
j) - 1) + (n2) * (((
k) - 1) + (
nf) * (((l) - 1))))) - 1;
114template<
typename T >
130 for (
int m = idx; m <
n_mask; m +=
str) {
131 const int f = facet[m + 1];
155template<
typename T >
173template<
typename T >
192template<
typename T >
202 for (
int i = idx;
i < m;
i +=
str) {
203#if __CUDA_ARCH__ >= 600
212template<
typename T >
235 const int mask_size) {
240 for (
int i = idx;
i < mask_size;
i +=
str) {
a[
mask[
i]] = c; }
246template<
typename T >
255 for (
int i = idx;
i < n;
i +=
str) {
263template<
typename T >
271 for (
int i = idx;
i < n;
i +=
str) {
279template<
typename T >
288 for (
int i = idx;
i < n;
i +=
str) {
296template<
typename T >
304 for (
int i = idx;
i < n;
i +=
str) {
312template<
typename T >
321 for (
int i = idx;
i < n;
i +=
str) {
329template<
typename T >
339 for (
int i = idx;
i < n;
i +=
str) {
347template<
typename T >
355 for (
int i = idx;
i < n;
i +=
str) {
363template<
typename T >
371 for (
int i = idx;
i < n;
i +=
str) {
379template<
typename T >
388 for (
int i = idx;
i < n;
i +=
str) {
396template<
typename T >
406 for (
int i = idx;
i < n;
i +=
str) {
407 a[
i] = b[
i] + c[
i] + d[
i];
414template<
typename T >
423 for (
int i = idx;
i < n;
i +=
str) {
431template<
typename T >
442 for (
int i = idx;
i < n;
i+=
str) {
445 tmp += p[
j][
i]*alpha[
j];
454template<
typename T >
463 for (
int i = idx;
i < n;
i +=
str) {
471template<
typename T >
480 for (
int i = idx;
i < n;
i +=
str) {
488template<
typename T >
499 for (
int i = idx;
i < n;
i +=
str) {
507template<
typename T >
520 for (
int i = idx;
i < n;
i +=
str) {
528template<
typename T >
543 for (
int i = idx;
i < n;
i +=
str) {
551template<
typename T >
559 for (
int i = idx;
i < n;
i +=
str) {
567template<
typename T >
575 for (
int i = idx;
i < n;
i +=
str) {
583template<
typename T >
592 for (
int i = idx;
i < n;
i +=
str) {
600template<
typename T >
608 for (
int i = idx;
i < n;
i +=
str) {
616template<
typename T >
625 for (
int i = idx;
i < n;
i +=
str) {
633template<
typename T >
642 for (
int i = idx;
i < n;
i +=
str) {
643 a[
i] =
a[
i] - b[
i] * c[
i];
650template<
typename T >
658 for (
int i = idx;
i < n;
i +=
str) {
666template<
typename T >
675 for (
int i = idx;
i < n;
i +=
str) {
683template<
typename T >
692 for (
int i = idx;
i < n;
i +=
str) {
693 a[
i] =
a[
i] + b[
i] * c[
i];
701template<
typename T >
711 for (
int i = idx;
i < n;
i +=
str) {
712 a[
i] =
a[
i] + b[
i] * c[
i] * d[
i];
720template<
typename T >
730 for (
int i = idx;
i < n;
i +=
str) {
731 a[
i] =
a[
i] + s * b[
i] * c[
i];
739template<
typename T >
752 for (
int i = idx;
i < n;
i +=
str) {
761template<
typename T >
776 for (
int i = idx;
i < n;
i +=
str) {
779 u3[
i] = v1[
i]*w2[
i] - v2[
i]*w1[
i];
827template<
typename T >
833 for (
int i = idx;
i<n ;
i +=
str)
858template<
typename T >
864 for (
int i = idx;
i<n ;
i +=
str)
889template<
typename T >
895 for (
int i = idx;
i<n ;
i +=
str)
921template<
typename T >
932 for (
int i=idx ;
i<n ;
i+=step)
956template<
typename T >
971 for (
int i = idx;
i < n;
i+=
str) {
991template<
typename T >
1006 for (
int i = idx;
i < n;
i+=
str) {
1032template<
typename T >
1046 for (
int i = idx;
i < n;
i+=
str) {
1067template<
typename T >
1081 for (
int i = idx;
i < n;
i+=
str) {
1102template<
typename T >
1115 for (
int i = idx;
i<n ;
i +=
str)
1137template<
typename T >
1151 for (
int i = idx;
i<n ;
i +=
str)
1173template<
typename T >
1187 for (
int i = idx;
i<n ;
i +=
str)
1209template<
typename T >
1216 for (
int i = idx;
i < n;
i +=
str) {
1228template <
typename T>
1242template <
typename T>
1257template <
typename T>
1270template <
typename T>
1277 for (
int i = idx;
i < n;
i +=
str)
a[
i] =
max(b[
i], c);
1284template <
typename T>
1298template <
typename T>
1313template <
typename T>
1326template <
typename T>
1333 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 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 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 masked_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 *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.