Neko  0.9.99
A portable framework for high-order spectral element flow simulations
math.cu File Reference
#include "math_kernel.h"
#include <device/device_config.h>
#include <device/cuda/check.h>
#include <stdio.h>
#include <stdlib.h>
#include <math/bcknd/device/device_mpi_reduce.h>
#include <math/bcknd/device/device_mpi_op.h>
Include dependency graph for math.cu:

Go to the source code of this file.

Functions

void cuda_copy (void *a, void *b, int *n)
 
void cuda_masked_copy (void *a, void *b, void *mask, int *n, int *m)
 
void cuda_masked_red_copy (void *a, void *b, void *mask, int *n, int *m)
 
void cuda_cfill_mask (void *a, real *c, int *size, int *mask, int *mask_size)
 
void cuda_rzero (void *a, int *n)
 
void cuda_cmult (void *a, real *c, int *n)
 
void cuda_cmult2 (void *a, void *b, real *c, int *n)
 
void cuda_cadd (void *a, real *c, int *n)
 
void cuda_cadd2 (void *a, void *b, real *c, int *n)
 
void cuda_cfill (void *a, real *c, int *n)
 
void cuda_add2 (void *a, void *b, int *n)
 
void cuda_add3 (void *a, void *b, void *c, int *n)
 
void cuda_add4 (void *a, void *b, void *c, void *d, int *n)
 
void cuda_add2s1 (void *a, void *b, real *c1, int *n)
 
void cuda_add2s2 (void *a, void *b, real *c1, int *n)
 
void cuda_add2s2_many (void *x, void **p, void *alpha, int *j, int *n)
 
void cuda_addsqr2s2 (void *a, void *b, real *c1, int *n)
 
void cuda_add3s2 (void *a, void *b, void *c, real *c1, real *c2, int *n)
 
void cuda_invcol1 (void *a, int *n)
 
void cuda_invcol2 (void *a, void *b, int *n)
 
void cuda_col2 (void *a, void *b, int *n)
 
void cuda_col3 (void *a, void *b, void *c, int *n)
 
void cuda_subcol3 (void *a, void *b, void *c, int *n)
 
void cuda_sub2 (void *a, void *b, int *n)
 
void cuda_sub3 (void *a, void *b, void *c, int *n)
 
void cuda_addcol3 (void *a, void *b, void *c, int *n)
 
void cuda_addcol4 (void *a, void *b, void *c, void *d, int *n)
 
void cuda_vdot3 (void *dot, void *u1, void *u2, void *u3, void *v1, void *v2, void *v3, int *n)
 
void cuda_vcross (void *u1, void *u2, void *u3, void *v1, void *v2, void *v3, void *w1, void *w2, void *w3, int *n)
 
real cuda_vlsc3 (void *u, void *v, void *w, int *n)
 
real cuda_glsc3 (void *a, void *b, void *c, int *n)
 
void cuda_glsc3_many (real *h, void *w, void *v, void *mult, int *j, int *n)
 
real cuda_glsc2 (void *a, void *b, int *n)
 
real cuda_glsum (void *a, int *n)
 
void cuda_absval (void *a, int *n)
 
void cuda_pwmax_vec2 (void *a, void *b, int *n)
 
void cuda_pwmax_vec3 (void *a, void *b, void *c, int *n)
 
void cuda_pwmax_sca2 (void *a, real *c, int *n)
 
void cuda_pwmax_sca3 (void *a, void *b, real *c, int *n)
 
void cuda_pwmin_vec2 (void *a, void *b, int *n)
 
void cuda_pwmin_vec3 (void *a, void *b, void *c, int *n)
 
void cuda_pwmin_sca2 (void *a, real *c, int *n)
 
void cuda_pwmin_sca3 (void *a, void *b, real *c, int *n)
 

Variables

int red_s = 0
 
realbufred = NULL
 
realbufred_d = NULL
 

Function Documentation

◆ cuda_absval()

void cuda_absval ( void *  a,
int *  n 
)

Fortran wrapper absval Take the abs value of a vector of length n

Definition at line 680 of file math.cu.

◆ cuda_add2()

void cuda_add2 ( void *  a,
void *  b,
int *  n 
)

Fortran wrapper for add2 Vector addition \( a = a + b \)

Definition at line 181 of file math.cu.

◆ cuda_add2s1()

void cuda_add2s1 ( void *  a,
void *  b,
real c1,
int *  n 
)

Fortran wrapper for add2s1 Vector addition with scalar multiplication \( a = c_1 a + b \) (multiplication on first argument)

Definition at line 226 of file math.cu.

◆ cuda_add2s2()

void cuda_add2s2 ( void *  a,
void *  b,
real c1,
int *  n 
)

Fortran wrapper for add2s2 Vector addition with scalar multiplication \( a = a + c_1 b \) (multiplication on second argument)

Definition at line 242 of file math.cu.

◆ cuda_add2s2_many()

void cuda_add2s2_many ( void *  x,
void **  p,
void *  alpha,
int *  j,
int *  n 
)

Fortran wrapper for add2s2 Vector addition with scalar multiplication \( x = x + c_1 p1 + c_2p2 + ... + c_jpj \) (multiplication on second argument)

Definition at line 259 of file math.cu.

◆ cuda_add3()

void cuda_add3 ( void *  a,
void *  b,
void *  c,
int *  n 
)

Fortran wrapper for add3 Vector addition \( a = b + c \)

Definition at line 196 of file math.cu.

◆ cuda_add3s2()

void cuda_add3s2 ( void *  a,
void *  b,
void *  c,
real c1,
real c2,
int *  n 
)

Fortran wrapper for add3s2 Vector addition with scalar multiplication \( a = c_1 b + c_2 c \) (multiplication on second argument)

Definition at line 293 of file math.cu.

◆ cuda_add4()

void cuda_add4 ( void *  a,
void *  b,
void *  c,
void *  d,
int *  n 
)

Fortran wrapper for add4 Vector addition \( a = b + c + d \)

Definition at line 211 of file math.cu.

◆ cuda_addcol3()

void cuda_addcol3 ( void *  a,
void *  b,
void *  c,
int *  n 
)

Fortran wrapper for addcol3 \( a = a + b * c \)

Definition at line 409 of file math.cu.

◆ cuda_addcol4()

void cuda_addcol4 ( void *  a,
void *  b,
void *  c,
void *  d,
int *  n 
)

Fortran wrapper for addcol4 \( a = a + b * c * d\)

Definition at line 424 of file math.cu.

◆ cuda_addsqr2s2()

void cuda_addsqr2s2 ( void *  a,
void *  b,
real c1,
int *  n 
)

Fortran wrapper for addsqr2s2 Vector addition with scalar multiplication \( a = a + c_1 (b * b) \) (multiplication on second argument)

Definition at line 276 of file math.cu.

◆ cuda_cadd()

void cuda_cadd ( void *  a,
real c,
int *  n 
)

Fortran wrapper for cadd Add a scalar to vector \( a_i = a_i + c \)

Definition at line 135 of file math.cu.

◆ cuda_cadd2()

void cuda_cadd2 ( void *  a,
void *  b,
real c,
int *  n 
)

Fortran wrapper for cadd2 Add a scalar to vector \( a_i = b_i + c \)

Definition at line 150 of file math.cu.

◆ cuda_cfill()

void cuda_cfill ( void *  a,
real c,
int *  n 
)

Fortran wrapper for cfill Set all elements to a constant c \( a = c \)

Definition at line 164 of file math.cu.

◆ cuda_cfill_mask()

void cuda_cfill_mask ( void *  a,
real c,
int *  size,
int *  mask,
int *  mask_size 
)

Fortran wrapper for cfill_mask Fill a scalar to vector \( a_i = s, for i \in mask \)

Definition at line 86 of file math.cu.

◆ cuda_cmult()

void cuda_cmult ( void *  a,
real c,
int *  n 
)

Fortran wrapper for cmult Multiplication by constant c \( a = c \cdot a \)

Definition at line 107 of file math.cu.

◆ cuda_cmult2()

void cuda_cmult2 ( void *  a,
void *  b,
real c,
int *  n 
)

Fortran wrapper for cmult2 Multiplication by constant c \( a = c \cdot b \)

Definition at line 121 of file math.cu.

◆ cuda_col2()

void cuda_col2 ( void *  a,
void *  b,
int *  n 
)

Fortran wrapper for col2 Vector multiplication with 2 vectors \( a = a \cdot b \)

Definition at line 337 of file math.cu.

◆ cuda_col3()

void cuda_col3 ( void *  a,
void *  b,
void *  c,
int *  n 
)

Fortran wrapper for col3 Vector multiplication with 3 vectors \( a = b \cdot c \)

Definition at line 351 of file math.cu.

◆ cuda_copy()

void cuda_copy ( void *  a,
void *  b,
int *  n 
)

Fortran wrapper for copy Copy a vector \( a = b \)

Definition at line 49 of file math.cu.

◆ cuda_glsc2()

real cuda_glsc2 ( void *  a,
void *  b,
int *  n 
)

Fortran wrapper glsc2 Weighted inner product \( a^T b c \)

Definition at line 601 of file math.cu.

Here is the call graph for this function:

◆ cuda_glsc3()

real cuda_glsc3 ( void *  a,
void *  b,
void *  c,
int *  n 
)

Fortran wrapper glsc3 Weighted inner product \( a^T b c \)

Definition at line 520 of file math.cu.

Here is the call graph for this function:

◆ cuda_glsc3_many()

void cuda_glsc3_many ( real h,
void *  w,
void *  v,
void *  mult,
int *  j,
int *  n 
)

Fortran wrapper for doing an reduction to an array Weighted inner product \( w^T v(n,1:j) c \)

Definition at line 559 of file math.cu.

Here is the call graph for this function:

◆ cuda_glsum()

real cuda_glsum ( void *  a,
int *  n 
)

Fortran wrapper glsum Sum a vector of length n

Definition at line 642 of file math.cu.

Here is the call graph for this function:

◆ cuda_invcol1()

void cuda_invcol1 ( void *  a,
int *  n 
)

Fortran wrapper for invcol1 Invert a vector \( a = 1 / a \)

Definition at line 309 of file math.cu.

◆ cuda_invcol2()

void cuda_invcol2 ( void *  a,
void *  b,
int *  n 
)

Fortran wrapper for invcol2 Vector division \( a = a / b \)

Definition at line 323 of file math.cu.

◆ cuda_masked_copy()

void cuda_masked_copy ( void *  a,
void *  b,
void *  mask,
int *  n,
int *  m 
)

Fortran wrapper for masked copy Copy a vector \( a(mask) = b(mask) \)

Definition at line 58 of file math.cu.

◆ cuda_masked_red_copy()

void cuda_masked_red_copy ( void *  a,
void *  b,
void *  mask,
int *  n,
int *  m 
)

Fortran wrapper for masked copy Copy a vector \( a(mask) = b(mask) \)

Definition at line 72 of file math.cu.

◆ cuda_pwmax_sca2()

void cuda_pwmax_sca2 ( void *  a,
real c,
int *  n 
)

Fortran wrapper for pwmax_sca2

Compute the maximum of vector and scalar \( a = \max(a, c) \)

Definition at line 729 of file math.cu.

◆ cuda_pwmax_sca3()

void cuda_pwmax_sca3 ( void *  a,
void *  b,
real c,
int *  n 
)

Fortran wrapper for pwmax_sca3

Compute the maximum of vector and scalar \( a = \max(b, c) \)

Definition at line 744 of file math.cu.

◆ cuda_pwmax_vec2()

void cuda_pwmax_vec2 ( void *  a,
void *  b,
int *  n 
)

Fortran wrapper for pwmax_vec2

Compute the maximum of two vectors \( a = \max(a, b) \)

Definition at line 699 of file math.cu.

◆ cuda_pwmax_vec3()

void cuda_pwmax_vec3 ( void *  a,
void *  b,
void *  c,
int *  n 
)

Fortran wrapper for pwmax_vec3

Compute the maximum of two vectors \( a = \max(b, c) \)

Definition at line 714 of file math.cu.

◆ cuda_pwmin_sca2()

void cuda_pwmin_sca2 ( void *  a,
real c,
int *  n 
)

Fortran wrapper for pwmin_sca2

Compute the minimum of vector and scalar \( a = \min(a, c) \)

Definition at line 789 of file math.cu.

◆ cuda_pwmin_sca3()

void cuda_pwmin_sca3 ( void *  a,
void *  b,
real c,
int *  n 
)

Fortran wrapper for pwmin_sca3

Compute the minimum of vector and scalar \( a = \min(b, c) \)

Definition at line 804 of file math.cu.

◆ cuda_pwmin_vec2()

void cuda_pwmin_vec2 ( void *  a,
void *  b,
int *  n 
)

Fortran wrapper for pwmin_vec2

Compute the minimum of two vectors \( a = \min(a, b) \)

Definition at line 759 of file math.cu.

◆ cuda_pwmin_vec3()

void cuda_pwmin_vec3 ( void *  a,
void *  b,
void *  c,
int *  n 
)

Fortran wrapper for pwmin_vec3

Compute the minimum of two vectors \( a = \min(b, c) \)

Definition at line 774 of file math.cu.

◆ cuda_rzero()

void cuda_rzero ( void *  a,
int *  n 
)

Fortran wrapper for rzero Zero a real vector

Definition at line 99 of file math.cu.

◆ cuda_sub2()

void cuda_sub2 ( void *  a,
void *  b,
int *  n 
)

Fortran wrapper for sub2 Vector subtraction \( a = a - b \)

Definition at line 380 of file math.cu.

◆ cuda_sub3()

void cuda_sub3 ( void *  a,
void *  b,
void *  c,
int *  n 
)

Fortran wrapper for sub3 Vector subtraction \( a = b - c \)

Definition at line 394 of file math.cu.

◆ cuda_subcol3()

void cuda_subcol3 ( void *  a,
void *  b,
void *  c,
int *  n 
)

Fortran wrapper for subcol3 Vector multiplication with 3 vectors \( a = a - b \cdot c \)

Definition at line 365 of file math.cu.

◆ cuda_vcross()

void cuda_vcross ( void *  u1,
void *  u2,
void *  u3,
void *  v1,
void *  v2,
void *  v3,
void *  w1,
void *  w2,
void *  w3,
int *  n 
)

Fortran wrapper for vcross \( u = v \times w \)

Definition at line 457 of file math.cu.

◆ cuda_vdot3()

void cuda_vdot3 ( void *  dot,
void *  u1,
void *  u2,
void *  u3,
void *  v1,
void *  v2,
void *  v3,
int *  n 
)

Fortran wrapper for vdot3 \( dot = u \cdot v \)

Definition at line 439 of file math.cu.

◆ cuda_vlsc3()

real cuda_vlsc3 ( void *  u,
void *  v,
void *  w,
int *  n 
)

Fortran wrapper vlsc3 Compute multiplication sum \( dot = u \cdot v \cdot w \)

Definition at line 486 of file math.cu.

Variable Documentation

◆ bufred

real* bufred = NULL

Definition at line 479 of file math.cu.

◆ bufred_d

real* bufred_d = NULL

Definition at line 480 of file math.cu.

◆ red_s

int red_s = 0

Definition at line 478 of file math.cu.