Skip to content

Commit 10c2580

Browse files
committedNov 11, 2020
Output files for Extra Large input size added
1 parent 7f2ca34 commit 10c2580

27 files changed

+188
-177
lines changed
 
File renamed without changes.

‎README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ To generate OpenMP program for the equation:
2828
./test filename [-o output_filename] [-t data type for variables]
2929
```
3030

31-
The equations in [benchmark/source](./benchmark/source) are some examples of what can be handled by this compiler.
31+
The equations in [benchmark/source](./benchmark/source) are implementations of programs from [PolyBench/C](https://web.cse.ohio-state.edu/~pouchet.2/software/polybench/).
3232

3333
The OpenMP outputs for these equations can be found in [benchmark/output](benchmark/output).
3434

@@ -39,4 +39,4 @@ python3 benchmark.py
3939

4040
Please refer to the [wiki](https://github.com/adharshkamath/Mathy-Compiler/wiki) for the Grammar, Syntax and currently supported features of the project.
4141

42-
This project was done under the guidance of [Dr.Rupesh Nasre](https://www.cse.iitm.ac.in/~rupesh)
42+
This project was done under the guidance of [Dr. Rupesh Nasre](https://www.cse.iitm.ac.in/~rupesh)

‎benchmark/output/2mm.c

+10-10
Original file line numberDiff line numberDiff line change
@@ -16,31 +16,31 @@ double clock()
1616

1717
void kernel()
1818
{
19-
static float c[150 + 2][250 + 2] = { 0 }, d[100 + 2][250 + 2] = { 0 }, a[100 + 2][200 + 2] =
20-
{ 0 }, temp[100 + 2][150 + 2] = { 0 }, beta = { 0 }, b[200 + 2][150 + 2] = { 0 }, alpha = { 0 };
19+
static float c[1800 + 2][2400 + 2] = { 0 }, d[1600 + 2][2400 + 2] = { 0 }, a[1600 - 1 + 2][2200 + 2] =
20+
{ 0 }, temp[1600 - 1 + 2][1800 + 2] = { 0 }, beta = { 0 }, b[2200 + 2][1800 + 2] = { 0 }, alpha = { 0 };
2121
#pragma omp parallel
2222
{
2323

2424
#pragma omp atomic write
25-
alpha = 2;
25+
alpha = 1.500000;
2626
#pragma omp atomic write
27-
beta = 3;
27+
beta = 1.200000;
2828
#pragma omp for
29-
for (int i = 0; i <= 100; i++) {
30-
for (int j = 0; j <= 150; j++) {
31-
for (int k = 0; k <= 200; k++) {
29+
for (int i = 0; i <= 1600 - 1; i++) {
30+
for (int j = 0; j <= 1800; j++) {
31+
for (int k = 0; k <= 2200; k++) {
3232
#pragma omp atomic
3333
temp[i][j] += alpha * a[i][k] * b[k][j];
3434
}
3535

3636
}
3737
}
3838
#pragma omp for
39-
for (int i = 0; i <= 100; i++) {
40-
for (int j = 0; j <= 250; j++) {
39+
for (int i = 0; i <= 1600; i++) {
40+
for (int j = 0; j <= 2400; j++) {
4141
#pragma omp atomic write
4242
d[i][j] = d[i][j] * beta;
43-
for (int k = 0; k <= 150; k++) {
43+
for (int k = 0; k <= 1800; k++) {
4444
#pragma omp atomic
4545
d[i][j] += temp[i][k] * c[k][j];
4646
}

‎benchmark/output/3mm.c

+13-12
Original file line numberDiff line numberDiff line change
@@ -16,36 +16,37 @@ double clock()
1616

1717
void kernel()
1818
{
19-
static float abcd[100 + 2][250 + 2] = { 0 }, c[150 + 2][300 + 2] = { 0 }, cd[150 + 2][250 + 2] =
20-
{ 0 }, b[200 + 2][150 + 2] = { 0 }, d[300 + 2][250 + 2] = { 0 }, a[100 + 2][200 + 2] =
21-
{ 0 }, ab[100 + 2][150 + 2] = { 0 };
19+
static float abcd[1600 - 1 + 2][2200 - 1 + 2] = { 0 }, c[1800 - 1 + 2][2400 - 1 + 2] =
20+
{ 0 }, cd[1800 - 1 + 2][2200 - 1 + 2] = { 0 }, b[2000 - 1 + 2][1800 - 1 + 2] =
21+
{ 0 }, d[2400 - 1 + 2][2200 - 1 + 2] = { 0 }, a[1600 - 1 + 2][2000 - 1 + 2] =
22+
{ 0 }, ab[1600 - 1 + 2][1800 - 1 + 2] = { 0 };
2223
#pragma omp parallel
2324
{
2425

2526
#pragma omp for
26-
for (int i = 0; i <= 100; i++) {
27-
for (int j = 0; j <= 150; j++) {
28-
for (int k = 0; k <= 200; k++) {
27+
for (int i = 0; i <= 1600 - 1; i++) {
28+
for (int j = 0; j <= 1800 - 1; j++) {
29+
for (int k = 0; k <= 2000 - 1; k++) {
2930
#pragma omp atomic
3031
ab[i][j] += a[i][k] * b[k][j];
3132
}
3233

3334
}
3435
}
3536
#pragma omp for
36-
for (int i = 0; i <= 150; i++) {
37-
for (int j = 0; j <= 250; j++) {
38-
for (int k = 0; k <= 300; k++) {
37+
for (int i = 0; i <= 1800 - 1; i++) {
38+
for (int j = 0; j <= 2200 - 1; j++) {
39+
for (int k = 0; k <= 2400 - 1; k++) {
3940
#pragma omp atomic
4041
cd[i][j] += c[i][k] * d[k][j];
4142
}
4243

4344
}
4445
}
4546
#pragma omp for
46-
for (int i = 0; i <= 100; i++) {
47-
for (int j = 0; j <= 250; j++) {
48-
for (int k = 0; k <= 150; k++) {
47+
for (int i = 0; i <= 1600 - 1; i++) {
48+
for (int j = 0; j <= 2200 - 1; j++) {
49+
for (int k = 0; k <= 1800 - 1; k++) {
4950
#pragma omp atomic
5051
abcd[i][j] += ab[i][k] * cd[k][j];
5152
}

‎benchmark/output/atax.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,19 @@ double clock()
1616

1717
void kernel()
1818
{
19-
static float x[24000 - 1 + 2] = { 0 }, y[24000 - 1 + 2] = { 0 }, A[20000 - 1 + 2][24000 - 1 + 2] =
20-
{ 0 }, tmp[20000 - 1 + 2] = { 0 };
19+
static float x[2200 - 1 + 2] = { 0 }, y[2200 - 1 + 2] = { 0 }, A[1800 - 1 + 2][2200 - 1 + 2] =
20+
{ 0 }, tmp[1800 - 1 + 2] = { 0 };
2121
#pragma omp parallel
2222
{
2323

2424
#pragma omp for
25-
for (int i = 0; i <= 20000 - 1; i++) {
26-
for (int j = 0; j <= 24000 - 1; j++) {
25+
for (int i = 0; i <= 1800 - 1; i++) {
26+
for (int j = 0; j <= 2200 - 1; j++) {
2727
#pragma omp atomic
2828
tmp[i] += A[i][j] * x[j];
2929
}
3030

31-
for (int k = 0; k <= 24000 - 1; k++) {
31+
for (int k = 0; k <= 2200 - 1; k++) {
3232
#pragma omp atomic
3333
y[k] += A[i][k] * tmp[i];
3434
}

‎benchmark/output/bicg.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,19 @@ double clock()
1616

1717
void kernel()
1818
{
19-
static float p[150 + 2] = { 0 }, q[200 + 2] = { 0 }, r[200 + 2] = { 0 }, A[200 + 2][150 + 2] = { 0 }, s[150 + 2] =
20-
{ 0 };
19+
static float p[1800 - 1 + 2] = { 0 }, q[2200 - 1 + 2] = { 0 }, r[2200 - 1 + 2] =
20+
{ 0 }, A[2200 - 1 + 2][1800 - 1 + 2] = { 0 }, s[1800 - 1 + 2] = { 0 };
2121
#pragma omp parallel
2222
{
2323

2424
#pragma omp for
25-
for (int i = 0; i <= 200; i++) {
26-
for (int j = 0; j <= 150; j++) {
25+
for (int i = 0; i <= 2200 - 1; i++) {
26+
for (int j = 0; j <= 1800 - 1; j++) {
2727
#pragma omp atomic
2828
s[j] += A[i][j] * r[i];
2929
}
3030

31-
for (int j = 0; j <= 150; j++) {
31+
for (int j = 0; j <= 1800 - 1; j++) {
3232
#pragma omp atomic
3333
q[i] += A[i][j] * p[j];
3434
}

‎benchmark/output/cholesky.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ double clock()
1616

1717
void kernel()
1818
{
19-
static float A[200 - 1 + 2][200 - 1 - 1 + 2] = { 0 };
19+
static float A[4000 - 1 + 2][4000 - 1 - 1 + 2] = { 0 };
2020
#pragma omp parallel
2121
{
2222

2323
#pragma omp for
24-
for (int i = 0; i <= 200 - 1; i++) {
24+
for (int i = 0; i <= 4000 - 1; i++) {
2525
for (int j = 0; j <= i - 1; j++) {
2626
for (int k = 0; k <= j - 1; k++) {
2727
#pragma omp atomic write

‎benchmark/output/correlation.c

+14-13
Original file line numberDiff line numberDiff line change
@@ -16,45 +16,46 @@ double clock()
1616

1717
void kernel()
1818
{
19-
static float corr[100 + 2][100 + 2] = { 0 }, std_dev[100 + 2] = { 0 }, data[100 + 2][100 + 2] =
20-
{ 0 }, cov[100 + 2][100 + 2] = { 0 }, mean[100 + 2] = { 0 };
19+
static float corr[2600 - 1 + 2][2600 - 1 + 2] = { 0 }, std_dev[2600 - 1 + 2] =
20+
{ 0 }, data[3000 - 1 + 2][2600 - 1 + 2] = { 0 }, cov[2600 - 1 + 2][2600 - 1 + 2] = { 0 }, mean[2600 - 1 + 2] =
21+
{ 0 };
2122
#pragma omp parallel
2223
{
2324

2425
#pragma omp for
25-
for (int x = 0; x <= 100; x++) {
26-
for (int k = 0; k <= 100; k++) {
26+
for (int x = 0; x <= 2600 - 1; x++) {
27+
for (int k = 0; k <= 3000 - 1; k++) {
2728
#pragma omp atomic
28-
mean[x] += data[k][x] / 100;
29+
mean[x] += data[k][x] / 3000;
2930
}
3031

3132
}
3233
#pragma omp for
33-
for (int i = 0; i <= 100; i++) {
34-
for (int j = 0; j <= 100; j++) {
35-
for (int k = 0; k <= 100; k++) {
34+
for (int i = 0; i <= 2600 - 1; i++) {
35+
for (int j = 0; j <= 2600 - 1; j++) {
36+
for (int k = 0; k <= 3000 - 1; k++) {
3637
#pragma omp atomic
3738
cov[i][j] += ((data[k][i] - mean[i]) * (data[k][j] - mean[j])) / 99;
3839
}
3940

4041
}
4142
}
4243
#pragma omp for
43-
for (int t = 0; t <= 100; t++) {
44-
for (int k = 0; k <= 100; k++) {
44+
for (int t = 0; t <= 2600 - 1; t++) {
45+
for (int k = 0; k <= 3000 - 1; k++) {
4546
#pragma omp atomic
4647
std_dev[t] += ((data[k][t] - mean[t]) * (data[k][t] - mean[t])) / 99;
4748
}
4849

4950
}
5051
#pragma omp for
51-
for (int p = 0; p <= 100; p++) {
52+
for (int p = 0; p <= 2600 - 1; p++) {
5253
#pragma omp atomic write
5354
std_dev[p] = sqrt(std_dev[p]);
5455
}
5556
#pragma omp for
56-
for (int i = 0; i <= 100; i++) {
57-
for (int j = 0; j <= 100; j++) {
57+
for (int i = 0; i <= 2600 - 1; i++) {
58+
for (int j = 0; j <= 2600 - 1; j++) {
5859
#pragma omp atomic write
5960
corr[i][j] = cov[i][j] / (std_dev[i] * std_dev[j]);
6061
}

‎benchmark/output/covariance.c

+9-8
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,25 @@ double clock()
1616

1717
void kernel()
1818
{
19-
static float data[100 + 2][100 + 2] = { 0 }, cov[100 + 2][100 + 2] = { 0 }, mean[100 + 2] = { 0 };
19+
static float data[3000 - 1 + 2][2600 - 1 + 2] = { 0 }, cov[2600 - 1 + 2][2600 - 1 + 2] = { 0 }, mean[2600 - 1 + 2] =
20+
{ 0 };
2021
#pragma omp parallel
2122
{
2223

2324
#pragma omp for
24-
for (int x = 0; x <= 100; x++) {
25-
for (int k = 0; k <= 100; k++) {
25+
for (int x = 0; x <= 2600 - 1; x++) {
26+
for (int k = 0; k <= 3000 - 1; k++) {
2627
#pragma omp atomic
27-
mean[x] += data[k][x] / 100;
28+
mean[x] += data[k][x] / 3000;
2829
}
2930

3031
}
3132
#pragma omp for
32-
for (int i = 0; i <= 100; i++) {
33-
for (int j = i; j <= 100; j++) {
34-
for (int k = 0; k <= 100; k++) {
33+
for (int i = 0; i <= 2600 - 1; i++) {
34+
for (int j = i; j <= 2600 - 1; j++) {
35+
for (int k = 0; k <= 3000 - 1; k++) {
3536
#pragma omp atomic
36-
cov[i][j] += ((data[k][i] - mean[i]) * (data[k][j] - mean[j])) / 99;
37+
cov[i][j] += ((data[k][i] - mean[i]) * (data[k][j] - mean[j])) / 2999;
3738
}
3839

3940
#pragma omp atomic write

‎benchmark/output/doitgen.c

+7-6
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,22 @@ double clock()
1616

1717
void kernel()
1818
{
19-
static float A[150 + 2][250 + 2][350 + 2] = { 0 }, C4[350 + 2][350 + 2] = { 0 }, sum[350 + 2] = { 0 };
19+
static float A[250 - 1 + 2][220 - 1 + 2][270 - 1 + 2] = { 0 }, C4[270 - 1 + 2][270 - 1 + 2] =
20+
{ 0 }, sum[270 - 1 + 2] = { 0 };
2021
#pragma omp parallel
2122
{
2223

2324
#pragma omp for
24-
for (int i = 0; i <= 150; i++) {
25-
for (int j = 0; j <= 250; j++) {
26-
for (int k = 0; k <= 350; k++) {
27-
for (int h = 0; h <= 350; h++) {
25+
for (int i = 0; i <= 250 - 1; i++) {
26+
for (int j = 0; j <= 220 - 1; j++) {
27+
for (int k = 0; k <= 270 - 1; k++) {
28+
for (int h = 0; h <= 270 - 1; h++) {
2829
#pragma omp atomic
2930
sum[k] += A[i][j][h] * C4[h][k];
3031
}
3132

3233
}
33-
for (int k = 0; k <= 350; k++) {
34+
for (int k = 0; k <= 270 - 1; k++) {
3435
#pragma omp atomic write
3536
A[i][j][k] = sum[k];
3637
}

‎benchmark/output/fdtd-2d.c

+10-10
Original file line numberDiff line numberDiff line change
@@ -16,31 +16,31 @@ double clock()
1616

1717
void kernel()
1818
{
19-
static float hz[150 - 1 + 2][100 - 1 + 2] = { 0 }, _fict_[250 + 2] = { 0 }, ex[150 - 1 + 2][100 - 1 + 2] =
20-
{ 0 }, ey[0 + 2][100 - 1 + 2] = { 0 };
19+
static float hz[60 - 1 + 2][80 - 1 + 2] = { 0 }, _fict_[40 - 1 + 2] = { 0 }, ex[60 - 1 + 2][80 - 1 + 2] =
20+
{ 0 }, ey[0 + 2][80 - 1 + 2] = { 0 };
2121
#pragma omp parallel
2222
{
2323

2424
#pragma omp for
25-
for (int t = 0; t <= 250; t++) {
26-
for (int j = 1; j <= 100 - 1; j++) {
25+
for (int t = 0; t <= 40 - 1; t++) {
26+
for (int j = 1; j <= 80 - 1; j++) {
2727
#pragma omp atomic write
2828
ey[0][j] = _fict_[t];
2929
}
30-
for (int i = 1; i <= 150 - 1; i++) {
31-
for (int j = 0; j <= 100 - 1; j++) {
30+
for (int i = 1; i <= 60 - 1; i++) {
31+
for (int j = 0; j <= 80 - 1; j++) {
3232
#pragma omp atomic write
3333
ey[i][j] = ey[i][j] - 0.500000 * (hz[i][j] - hz[i - 1][j]);
3434
}
3535
}
36-
for (int i = 0; i <= 150 - 1; i++) {
37-
for (int j = 1; j <= 100 - 1; j++) {
36+
for (int i = 0; i <= 60 - 1; i++) {
37+
for (int j = 1; j <= 80 - 1; j++) {
3838
#pragma omp atomic write
3939
ex[i][j] = ex[i][j] - 0.500000 * (hz[i][j] - hz[i][j - 1]);
4040
}
4141
}
42-
for (int i = 0; i <= 149 - 1; i++) {
43-
for (int j = 0; j <= 99 - 1; j++) {
42+
for (int i = 0; i <= 59 - 1; i++) {
43+
for (int j = 0; j <= 79 - 1; j++) {
4444
#pragma omp atomic write
4545
hz[i][j] = hz[i][j] - 0.700000 * (ex[i][j + 1] - ex[i][j] + ey[i + 1][j] - ey[i][j]);
4646
}

‎benchmark/output/gemm.c

+11-10
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,27 @@ double clock()
1616

1717
void kernel()
1818
{
19-
static float B[250 + 2][100 + 2] = { 0 }, A[50 + 2][250 + 2] = { 0 }, C[50 + 2][100 + 2] = { 0 }, beta =
20-
{ 0 }, alpha = { 0 };
19+
static float B[2600 - 1 + 2][2300 - 1 + 2] = { 0 }, A[2000 - 1 + 2][2600 - 1 + 2] =
20+
{ 0 }, C[2000 - 1 + 2][2300 - 1 + 2] = { 0 }, beta = { 0 }, alpha = { 0 };
2121
#pragma omp parallel
2222
{
2323

2424
#pragma omp atomic write
25-
alpha = 10;
25+
alpha = 1.500000;
2626
#pragma omp atomic write
27-
beta = 2;
27+
beta = 1.200000;
2828
#pragma omp for
29-
for (int i = 0; i <= 50; i++) {
30-
for (int j = 0; j <= 100; j++) {
29+
for (int i = 0; i <= 2000 - 1; i++) {
30+
for (int j = 0; j <= 2300 - 1; j++) {
3131
#pragma omp atomic write
3232
C[i][j] = C[i][j] * beta;
3333
}
34-
for (int k = 0; k <= 250; k++) {
35-
for (int j = 0; j <= 100; j++) {
36-
#pragma omp atomic write
37-
C[i][j] = C[i][j] + alpha * A[i][k] * B[k][j];
34+
for (int k = 0; k <= 2600 - 1; k++) {
35+
for (int j = 0; j <= 2300 - 1; j++) {
36+
#pragma omp atomic
37+
C[i][j] += alpha * A[i][k] * B[k][j];
3838
}
39+
3940
}
4041
}
4142
}

0 commit comments

Comments
 (0)
Please sign in to comment.