initial upload

This commit is contained in:
Jan Laukemann
2017-11-09 20:32:26 +01:00
parent a6f201eb5b
commit ba06552eef
4 changed files with 54 additions and 0 deletions

16
examples/2d-5pt.c Normal file
View 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
View 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
View 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
View 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]);
}