mirror of
https://github.com/RRZE-HPC/OSACA.git
synced 2026-01-09 04:30:05 +01:00
initial upload
This commit is contained in:
16
examples/2d-5pt.c
Normal file
16
examples/2d-5pt.c
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
void jacobi2D5pt(int N, int M){
|
||||
void dummy(double*, double*);
|
||||
double a[M][N];
|
||||
double b[M][N];
|
||||
double s;
|
||||
|
||||
for(int j=1; j<M-1; ++j){
|
||||
#pragma vector aligned
|
||||
//STARTLOOP
|
||||
for(int i=1; i<N-1; ++i){
|
||||
b[j][i] = ( a[j][i-1] + a[j][i+1] + a[j-1][i] + a[j+1][i]) * s;
|
||||
}
|
||||
}
|
||||
dummy(&a[1][1], &b[1][1]);
|
||||
}
|
||||
13
examples/daxpy.c
Normal file
13
examples/daxpy.c
Normal file
@@ -0,0 +1,13 @@
|
||||
|
||||
void daxpy(int N){
|
||||
void dummy(double*, double*);
|
||||
double a[N], b[N];
|
||||
double s;
|
||||
|
||||
//STARTLOOP
|
||||
for(int i=0; i<N; ++i)
|
||||
a[i] = a[i] + s * b[i];
|
||||
|
||||
dummy(&a[1], &b[1]);
|
||||
}
|
||||
|
||||
13
examples/scale.c
Normal file
13
examples/scale.c
Normal file
@@ -0,0 +1,13 @@
|
||||
|
||||
void scale(int N){
|
||||
void dummy(double*, double*);
|
||||
double a[N], b[N];
|
||||
double s;
|
||||
|
||||
//STARTLOOP
|
||||
for(int i=0; i<N; ++i){
|
||||
a[i] = s * b[i];
|
||||
}
|
||||
|
||||
dummy(&a[1],&b[1]);
|
||||
}
|
||||
12
examples/triad.c
Normal file
12
examples/triad.c
Normal file
@@ -0,0 +1,12 @@
|
||||
|
||||
void triad(int N){
|
||||
void dummy(dobule*);
|
||||
double a[N], b[N], c[N], d[N];
|
||||
double s;
|
||||
|
||||
//STARTLOOP
|
||||
for(int i=0; i<N; ++i)
|
||||
a[i] = b[i] + c[i] * d[i];
|
||||
|
||||
dummy(&a[1]);
|
||||
}
|
||||
Reference in New Issue
Block a user