Neko 0.9.99
A portable framework for high-order spectral element flow simulations
Loading...
Searching...
No Matches
math.c File Reference
#include <CL/cl.h>
#include <stdio.h>
#include <stdlib.h>
#include <device/device_config.h>
#include <device/opencl/jit.h>
#include <device/opencl/prgm_lib.h>
#include <device/opencl/check.h>
#include "math_kernel.cl.h"
Include dependency graph for math.c:

Go to the source code of this file.

Functions

void opencl_copy (void *a, void *b, int *n)
 
void opencl_masked_copy (void *a, void *b, void *mask, int *n, int *m)
 
void opencl_cfill_mask (void *a, void *c, int *size, void *mask, int *mask_size)
 
void opencl_rzero (void *a, int *n)
 
void opencl_rone (void *a, int *n)
 
void opencl_cmult2 (void *a, void *b, real *c, int *n)
 
void opencl_cmult (void *a, real *c, int *n)
 
void opencl_cadd (void *a, real *c, int *n)
 
void opencl_cadd2 (void *a, void *b, real *c, int *n)
 
void opencl_cfill (void *a, real *c, int *n)
 
void opencl_add2 (void *a, void *b, int *n)
 
void opencl_add3 (void *a, void *b, void *c, int *n)
 
void opencl_add4 (void *a, void *b, void *c, void *d, int *n)
 
void opencl_add2s1 (void *a, void *b, real *c1, int *n)
 
void opencl_add2s2 (void *a, void *b, real *c1, int *n)
 
void opencl_add2s2_many (void *x, void *p, void *alpha, int *j, int *n)
 
void opencl_addsqr2s2 (void *a, void *b, real *c1, int *n)
 
void opencl_add3s2 (void *a, void *b, void *c, real *c1, real *c2, int *n)
 
void opencl_invcol1 (void *a, int *n)
 
void opencl_invcol2 (void *a, void *b, int *n)
 
void opencl_col2 (void *a, void *b, int *n)
 
void opencl_col3 (void *a, void *b, void *c, int *n)
 
void opencl_subcol3 (void *a, void *b, void *c, int *n)
 
void opencl_sub2 (void *a, void *b, int *n)
 
void opencl_sub3 (void *a, void *b, void *c, int *n)
 
void opencl_addcol3 (void *a, void *b, void *c, int *n)
 
void opencl_addcol4 (void *a, void *b, void *c, void *d, int *n)
 
void opencl_vdot3 (void *dot, void *u1, void *u2, void *u3, void *v1, void *v2, void *v3, int *n)
 
real opencl_glsc3 (void *a, void *b, void *c, int *n)
 
void opencl_glsc3_many (real *h, void *w, void *v, void *mult, int *j, int *n)
 
real opencl_glsc2 (void *a, void *b, int *n)
 
real opencl_glsum (void *a, int *n)
 

Variables

int red_s = 0
 
realbufred = NULL
 
cl_mem bufred_d = NULL
 

Function Documentation

◆ opencl_add2()

void opencl_add2 ( void a,
void b,
int n 
)

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

Definition at line 272 of file math.c.

Here is the call graph for this function:

◆ opencl_add2s1()

void opencl_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 354 of file math.c.

Here is the call graph for this function:

◆ opencl_add2s2()

void opencl_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 382 of file math.c.

Here is the call graph for this function:

◆ opencl_add2s2_many()

void opencl_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 411 of file math.c.

Here is the call graph for this function:

◆ opencl_add3()

void opencl_add3 ( void a,
void b,
void c,
int n 
)

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

Definition at line 298 of file math.c.

Here is the call graph for this function:

◆ opencl_add3s2()

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

Fortran wrapper for add3s2 Vector addition with scalar multiplication \( a = c1 * b + c2 * c \)

Definition at line 468 of file math.c.

Here is the call graph for this function:

◆ opencl_add4()

void opencl_add4 ( void a,
void b,
void c,
void d,
int n 
)

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

Definition at line 325 of file math.c.

Here is the call graph for this function:

◆ opencl_addcol3()

void opencl_addcol3 ( void a,
void b,
void c,
int n 
)

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

Definition at line 680 of file math.c.

Here is the call graph for this function:

◆ opencl_addcol4()

void opencl_addcol4 ( void a,
void b,
void c,
void d,
int n 
)

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

Definition at line 707 of file math.c.

Here is the call graph for this function:

◆ opencl_addsqr2s2()

void opencl_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 441 of file math.c.

Here is the call graph for this function:

◆ opencl_cadd()

void opencl_cadd ( void a,
real c,
int n 
)

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

Definition at line 195 of file math.c.

Here is the call graph for this function:

◆ opencl_cadd2()

void opencl_cadd2 ( void a,
void b,
real c,
int n 
)

Fortran wrapper for cadd Add a scalar to vector \( a = b + s \)

Definition at line 220 of file math.c.

Here is the call graph for this function:

◆ opencl_cfill()

void opencl_cfill ( void a,
real c,
int n 
)

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

Definition at line 246 of file math.c.

Here is the call graph for this function:

◆ opencl_cfill_mask()

void opencl_cfill_mask ( void a,
void c,
int size,
void mask,
int mask_size 
)

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

Definition at line 90 of file math.c.

Here is the call graph for this function:

◆ opencl_cmult()

void opencl_cmult ( void a,
real c,
int n 
)

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

Definition at line 170 of file math.c.

Here is the call graph for this function:

◆ opencl_cmult2()

void opencl_cmult2 ( void a,
void b,
real c,
int n 
)

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

Definition at line 143 of file math.c.

Here is the call graph for this function:

◆ opencl_col2()

void opencl_col2 ( void a,
void b,
int n 
)

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

Definition at line 547 of file math.c.

Here is the call graph for this function:

◆ opencl_col3()

void opencl_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 573 of file math.c.

Here is the call graph for this function:

◆ opencl_copy()

void opencl_copy ( void a,
void b,
int n 
)

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

Definition at line 53 of file math.c.

Here is the call graph for this function:

◆ opencl_glsc2()

real opencl_glsc2 ( void a,
void b,
int n 
)

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

Definition at line 891 of file math.c.

Here is the call graph for this function:

◆ opencl_glsc3()

real opencl_glsc3 ( void a,
void b,
void c,
int n 
)

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

Definition at line 773 of file math.c.

Here is the call graph for this function:

◆ opencl_glsc3_many()

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

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

Definition at line 827 of file math.c.

Here is the call graph for this function:

◆ opencl_glsum()

real opencl_glsum ( void a,
int n 
)

Fortran wrapper glsum Sum a vector of length n

Definition at line 940 of file math.c.

Here is the call graph for this function:

◆ opencl_invcol1()

void opencl_invcol1 ( void a,
int n 
)

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

Definition at line 497 of file math.c.

Here is the call graph for this function:

◆ opencl_invcol2()

void opencl_invcol2 ( void a,
void b,
int n 
)

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

Definition at line 521 of file math.c.

Here is the call graph for this function:

◆ opencl_masked_copy()

void opencl_masked_copy ( void a,
void b,
void mask,
int n,
int m 
)

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

Definition at line 62 of file math.c.

Here is the call graph for this function:

◆ opencl_rone()

void opencl_rone ( void a,
int n 
)

Fortran wrapper for rone Set all elements to one

Definition at line 130 of file math.c.

Here is the call graph for this function:

◆ opencl_rzero()

void opencl_rzero ( void a,
int n 
)

Fortran wrapper for rzero Zero a real vector

Definition at line 117 of file math.c.

Here is the call graph for this function:

◆ opencl_sub2()

void opencl_sub2 ( void a,
void b,
int n 
)

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

Definition at line 627 of file math.c.

Here is the call graph for this function:

◆ opencl_sub3()

void opencl_sub3 ( void a,
void b,
void c,
int n 
)

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

Definition at line 653 of file math.c.

Here is the call graph for this function:

◆ opencl_subcol3()

void opencl_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 600 of file math.c.

Here is the call graph for this function:

◆ opencl_vdot3()

void opencl_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 736 of file math.c.

Here is the call graph for this function:

Variable Documentation

◆ bufred

real* bufred = NULL

Definition at line 766 of file math.c.

◆ bufred_d

cl_mem bufred_d = NULL

Definition at line 767 of file math.c.

◆ red_s

int red_s = 0
Todo:
cleanup this mess

Definition at line 765 of file math.c.