diff options
25 files changed, 99 insertions, 583 deletions
@@ -3,6 +3,9 @@ | |||
3 | *.txt.clean | 3 | *.txt.clean |
4 | # But not benchmark lists | 4 | # But not benchmark lists |
5 | !*Names.txt | 5 | !*Names.txt |
6 | # Special-case .txt handling for SD-VBS | ||
7 | **/12345.txt | ||
8 | !SD-VBS/benchmarks/**/*.txt | ||
6 | 9 | ||
7 | # Ignore DIS benchmark binaries | 10 | # Ignore DIS benchmark binaries |
8 | **/field | 11 | **/field |
@@ -40,12 +43,7 @@ | |||
40 | **/statemate | 43 | **/statemate |
41 | **/susan | 44 | **/susan |
42 | 45 | ||
43 | # Ignore random walk benchmark | 46 | # Ignore SD-VBS binaries |
44 | **/random_walk | ||
45 | |||
46 | # Ignore misc debug and build outputs | ||
47 | **/.gdb_history | ||
48 | |||
49 | **/mser | 47 | **/mser |
50 | **/multi_ncut | 48 | **/multi_ncut |
51 | **/stitch | 49 | **/stitch |
@@ -56,5 +54,10 @@ | |||
56 | **/sift | 54 | **/sift |
57 | **/localization | 55 | **/localization |
58 | **/disparity | 56 | **/disparity |
59 | **/12345.txt | 57 | |
60 | !SD-VBS/**/*.txt | 58 | # Ignore random walk benchmark |
59 | **/random_walk | ||
60 | |||
61 | # Ignore misc temporary files | ||
62 | **/.gdb_history | ||
63 | *.swp | ||
diff --git a/SD-VBS/benchmarks/disparity/src/c/script_disparity.c b/SD-VBS/benchmarks/disparity/src/c/script_disparity.c index 431c02c..7d45ada 100644 --- a/SD-VBS/benchmarks/disparity/src/c/script_disparity.c +++ b/SD-VBS/benchmarks/disparity/src/c/script_disparity.c | |||
@@ -28,9 +28,7 @@ int main(int argc, char* argv[]) | |||
28 | int WIN_SZ=8, SHIFT=64; | 28 | int WIN_SZ=8, SHIFT=64; |
29 | FILE* fp; | 29 | FILE* fp; |
30 | 30 | ||
31 | printf("Image 1: "); | ||
32 | scanf("%s", im1); | 31 | scanf("%s", im1); |
33 | printf("Image 2: "); | ||
34 | scanf("%s", im2); | 32 | scanf("%s", im2); |
35 | #ifdef CHECK | 33 | #ifdef CHECK |
36 | char checkFile[100] = "./expected_C.txt"; | 34 | char checkFile[100] = "./expected_C.txt"; |
@@ -86,17 +84,15 @@ int main(int argc, char* argv[]) | |||
86 | Iright_moved = iSetArray(paddedRows, paddedCols, 0); | 84 | Iright_moved = iSetArray(paddedRows, paddedCols, 0); |
87 | 85 | ||
88 | range = iMallocHandle(1, 2); | 86 | range = iMallocHandle(1, 2); |
89 | printf("starting..\n"); | 87 | for_each_job { |
90 | for_each_job{ | 88 | retDisparity = getDisparity(imleft, imright, WIN_SZ, SHIFT, |
91 | retDisparity = getDisparity(imleft, imright, WIN_SZ, SHIFT, | 89 | minSAD, retDisp, halfWin, |
92 | minSAD, retDisp, halfWin, | 90 | IrightPadded, IleftPadded, Iright_moved, |
93 | IrightPadded, IleftPadded, Iright_moved, | 91 | retSAD, SAD, integralImg, |
94 | retSAD, SAD, integralImg, | 92 | range); |
95 | range); | ||
96 | } | 93 | } |
97 | printf("ending\n"); | ||
98 | 94 | ||
99 | #ifdef CHECK | 95 | #ifdef CHECK |
100 | /** Self checking - use expected.txt from data directory **/ | 96 | /** Self checking - use expected.txt from data directory **/ |
101 | { | 97 | { |
102 | int tol, ret=0; | 98 | int tol, ret=0; |
diff --git a/SD-VBS/benchmarks/localization/src/c/script_localization.c b/SD-VBS/benchmarks/localization/src/c/script_localization.c index 3392320..ed37132 100644 --- a/SD-VBS/benchmarks/localization/src/c/script_localization.c +++ b/SD-VBS/benchmarks/localization/src/c/script_localization.c | |||
@@ -41,7 +41,6 @@ int main(int argc, char* argv[]) | |||
41 | 41 | ||
42 | char im1[100]; | 42 | char im1[100]; |
43 | 43 | ||
44 | printf("Input txt File: "); | ||
45 | scanf("%s", im1); | 44 | scanf("%s", im1); |
46 | 45 | ||
47 | fid = readFile(im1); | 46 | fid = readFile(im1); |
@@ -83,11 +82,10 @@ int main(int argc, char* argv[]) | |||
83 | F2D *randn; | 82 | F2D *randn; |
84 | 83 | ||
85 | randn = randWrapper(n,3); | 84 | randn = randWrapper(n,3); |
86 | printf("start\n"); | 85 | for_each_job { |
87 | for_each_job{ | 86 | fResetArray(pos,n, 3, 0); |
88 | fResetArray(pos,n, 3, 0); | 87 | fResetArray(vel,n, 3, 0); |
89 | fResetArray(vel,n, 3, 0); | 88 | fResetArray(ones,n,1,1); |
90 | fResetArray(ones,n,1,1); | ||
91 | 89 | ||
92 | { | 90 | { |
93 | int j; | 91 | int j; |
@@ -95,7 +93,7 @@ int main(int argc, char* argv[]) | |||
95 | for(j=0; j<3; j++) | 93 | for(j=0; j<3; j++) |
96 | subsref(vel, i, j) += subsref(randn,i,j) * STDDEV_ODOVel; | 94 | subsref(vel, i, j) += subsref(randn,i,j) * STDDEV_ODOVel; |
97 | 95 | ||
98 | } | 96 | } |
99 | 97 | ||
100 | 98 | ||
101 | 99 | ||
@@ -486,17 +484,15 @@ int main(int argc, char* argv[]) | |||
486 | subsref(resultMat,1,icount) = velOut; | 484 | subsref(resultMat,1,icount) = velOut; |
487 | subsref(resultMat,2,icount) = posOut; | 485 | subsref(resultMat,2,icount) = posOut; |
488 | } | 486 | } |
489 | 487 | ||
490 | fFreeHandle(sData); | 488 | fFreeHandle(sData); |
491 | 489 | ||
492 | |||
493 | if (asubsref(isEOF,0) == 1) | 490 | if (asubsref(isEOF,0) == 1) |
494 | break; | 491 | break; |
495 | } | 492 | } |
496 | } | 493 | } |
497 | printf("end..\n"); | ||
498 | 494 | ||
499 | #ifdef CHECK | 495 | #ifdef CHECK |
500 | 496 | ||
501 | // Self checking - use expected.txt from data directory | 497 | // Self checking - use expected.txt from data directory |
502 | { | 498 | { |
diff --git a/SD-VBS/benchmarks/mser/src/c/script_mser.c b/SD-VBS/benchmarks/mser/src/c/script_mser.c index d4a98cd..3e98f86 100644 --- a/SD-VBS/benchmarks/mser/src/c/script_mser.c +++ b/SD-VBS/benchmarks/mser/src/c/script_mser.c | |||
@@ -33,7 +33,6 @@ int main(int argc, char* argv[]) | |||
33 | 33 | ||
34 | int ndims, nel, gdl, nmer; | 34 | int ndims, nel, gdl, nmer; |
35 | 35 | ||
36 | printf("Input Image: "); | ||
37 | scanf("%s", im1); | 36 | scanf("%s", im1); |
38 | 37 | ||
39 | I = readImage(im1); | 38 | I = readImage(im1); |
@@ -74,19 +73,17 @@ int main(int argc, char* argv[]) | |||
74 | 73 | ||
75 | 74 | ||
76 | out = iMallocHandle(1, nmer); | 75 | out = iMallocHandle(1, nmer); |
77 | printf("start\n"); | 76 | for_each_job { |
78 | for_each_job{ | ||
79 | idx = mser(It, 2, subs_pt, nsubs_pt, strides_pt, visited_pt, dims, | 77 | idx = mser(It, 2, subs_pt, nsubs_pt, strides_pt, visited_pt, dims, |
80 | joins_pt, | 78 | joins_pt, |
81 | regions_pt, | 79 | regions_pt, |
82 | pairs_pt, | 80 | pairs_pt, |
83 | forest_pt, | 81 | forest_pt, |
84 | acc_pt, ell_pt, | 82 | acc_pt, ell_pt, |
85 | out); | 83 | out); |
86 | } | 84 | } |
87 | printf("end..\n"); | 85 | |
88 | 86 | #ifdef CHECK | |
89 | #ifdef CHECK | ||
90 | /** Self checking - use expected.txt from data directory **/ | 87 | /** Self checking - use expected.txt from data directory **/ |
91 | { | 88 | { |
92 | int tol, ret=0; | 89 | int tol, ret=0; |
diff --git a/SD-VBS/benchmarks/multi_ncut/src/c/script_multi_ncut.c b/SD-VBS/benchmarks/multi_ncut/src/c/script_multi_ncut.c index e4f7912..77c6b71 100644 --- a/SD-VBS/benchmarks/multi_ncut/src/c/script_multi_ncut.c +++ b/SD-VBS/benchmarks/multi_ncut/src/c/script_multi_ncut.c | |||
@@ -28,7 +28,6 @@ int main(int argc, char* argv[]) | |||
28 | 28 | ||
29 | F2D *imageOut, *tempOut; | 29 | F2D *imageOut, *tempOut; |
30 | F2D *edgeWeights, *in; | 30 | F2D *edgeWeights, *in; |
31 | printf("Input image: "); | ||
32 | scanf("%s", im1); | 31 | scanf("%s", im1); |
33 | im = readImage(im1); | 32 | im = readImage(im1); |
34 | 33 | ||
@@ -50,13 +49,12 @@ int main(int argc, char* argv[]) | |||
50 | u->elts = (uni_elt*)malloc(sizeof(uni_elt)*num_vertices); | 49 | u->elts = (uni_elt*)malloc(sizeof(uni_elt)*num_vertices); |
51 | output = iMallocHandle(height, width); | 50 | output = iMallocHandle(height, width); |
52 | 51 | ||
53 | printf("start\n"); | ||
54 | for_each_job{ | 52 | for_each_job{ |
55 | seg = segment_image(im, sigma, k, min_size, num_ccs, segments, edges, imageOut, tempOut, kernel, edgeWeights, in, ind, u, output); | 53 | seg = segment_image(im, sigma, k, min_size, num_ccs, segments, edges, imageOut, tempOut, kernel, edgeWeights, in, ind, u, output); |
56 | out = seg; | 54 | out = seg; |
57 | } | 55 | } |
58 | printf("end..\n"); | 56 | |
59 | #ifdef CHECK | 57 | #ifdef CHECK |
60 | /** Self checking - use expected.txt from data directory **/ | 58 | /** Self checking - use expected.txt from data directory **/ |
61 | { | 59 | { |
62 | int ret=0; | 60 | int ret=0; |
diff --git a/SD-VBS/benchmarks/sift/src/c/script_sift.c b/SD-VBS/benchmarks/sift/src/c/script_sift.c index 0b2f106..ab39ae3 100644 --- a/SD-VBS/benchmarks/sift/src/c/script_sift.c +++ b/SD-VBS/benchmarks/sift/src/c/script_sift.c | |||
@@ -45,7 +45,6 @@ int main(int argc, char* argv[]) | |||
45 | unsigned int* startTime, *endTime, *elapsed; | 45 | unsigned int* startTime, *endTime, *elapsed; |
46 | 46 | ||
47 | char imSrc[100]; | 47 | char imSrc[100]; |
48 | printf("Input image: "); | ||
49 | scanf("%s", imSrc); | 48 | scanf("%s", imSrc); |
50 | im = readImage(imSrc); | 49 | im = readImage(imSrc); |
51 | image = fiDeepCopy(im); | 50 | image = fiDeepCopy(im); |
@@ -53,16 +52,14 @@ int main(int argc, char* argv[]) | |||
53 | cols = image->width; | 52 | cols = image->width; |
54 | 53 | ||
55 | 54 | ||
56 | printf("start\n"); | ||
57 | for_each_job{ | 55 | for_each_job{ |
58 | image = fiDeepCopy(im); | 56 | image = fiDeepCopy(im); |
59 | normalizeImage(image); | 57 | normalizeImage(image); |
60 | /** Extract sift features for the normalized image **/ | 58 | /** Extract sift features for the normalized image **/ |
61 | frames = sift(image); | 59 | frames = sift(image); |
62 | } | 60 | } |
63 | printf("end..\n"); | 61 | |
64 | 62 | #ifdef CHECK | |
65 | #ifdef CHECK | ||
66 | { | 63 | { |
67 | int ret=0; | 64 | int ret=0; |
68 | float tol = 0.2; | 65 | float tol = 0.2; |
diff --git a/SD-VBS/benchmarks/stitch/src/c/script_stitch.c b/SD-VBS/benchmarks/stitch/src/c/script_stitch.c index 00c9a93..b7611f1 100644 --- a/SD-VBS/benchmarks/stitch/src/c/script_stitch.c +++ b/SD-VBS/benchmarks/stitch/src/c/script_stitch.c | |||
@@ -16,16 +16,13 @@ int main(int argc, char* argv[]) | |||
16 | I2D *Icur; | 16 | I2D *Icur; |
17 | int i, j; | 17 | int i, j; |
18 | char im1[100], im2[100]; | 18 | char im1[100], im2[100]; |
19 | |||
20 | 19 | ||
21 | printf("Input image: "); | ||
22 | scanf("%s", im1); | 20 | scanf("%s", im1); |
23 | Icur = readImage(im1); | 21 | Icur = readImage(im1); |
24 | rows = Icur->height; | 22 | rows = Icur->height; |
25 | cols = Icur->width; | 23 | cols = Icur->width; |
26 | 24 | ||
27 | printf("start\n"); | 25 | for_each_job { |
28 | for_each_job{ | ||
29 | v = harris(Icur); | 26 | v = harris(Icur); |
30 | interestPnts = getANMS(v, 24); | 27 | interestPnts = getANMS(v, 24); |
31 | int1 = fMallocHandle(interestPnts->height, 1); | 28 | int1 = fMallocHandle(interestPnts->height, 1); |
@@ -38,10 +35,8 @@ int main(int argc, char* argv[]) | |||
38 | 35 | ||
39 | Fcur = extractFeatures(Icur, int1, int2); | 36 | Fcur = extractFeatures(Icur, int1, int2); |
40 | } | 37 | } |
41 | printf("end..\n"); | ||
42 | |||
43 | 38 | ||
44 | #ifdef CHECK | 39 | #ifdef CHECK |
45 | /** Self checking - use expected.txt from data directory **/ | 40 | /** Self checking - use expected.txt from data directory **/ |
46 | { | 41 | { |
47 | int ret=0; | 42 | int ret=0; |
diff --git a/SD-VBS/benchmarks/svm/src/c/script_svm.c b/SD-VBS/benchmarks/svm/src/c/script_svm.c index 62a264d..f1ce963 100644 --- a/SD-VBS/benchmarks/svm/src/c/script_svm.c +++ b/SD-VBS/benchmarks/svm/src/c/script_svm.c | |||
@@ -70,24 +70,23 @@ int main(int argc, char* argv[]) | |||
70 | #endif | 70 | #endif |
71 | 71 | ||
72 | 72 | ||
73 | printf("trn file 1: "); | 73 | // trn file 1 |
74 | scanf("%s", im1); | 74 | scanf("%s", im1); |
75 | trn1 = readFile(im1); | 75 | trn1 = readFile(im1); |
76 | 76 | ||
77 | printf("trn file 2: "); | 77 | // trn file 2 |
78 | scanf("%s", im1); | 78 | scanf("%s", im1); |
79 | trn2 = readFile(im1); | 79 | trn2 = readFile(im1); |
80 | 80 | ||
81 | printf("tst file 1: "); | 81 | // tst file 1 |
82 | scanf("%s", im1); | 82 | scanf("%s", im1); |
83 | tst1 = readFile(im1); | 83 | tst1 = readFile(im1); |
84 | 84 | ||
85 | printf("tst file 2: "); | 85 | // tst file 2 |
86 | scanf("%s", im1); | 86 | scanf("%s", im1); |
87 | tst2 = readFile(im1); | 87 | tst2 = readFile(im1); |
88 | 88 | ||
89 | printf("start.\n"); | 89 | for_each_job { |
90 | for_each_job{ | ||
91 | alpha = getAlphaFromTrainSet(N, trn1, trn2, iter); | 90 | alpha = getAlphaFromTrainSet(N, trn1, trn2, iter); |
92 | a_result = alpha->a_result; | 91 | a_result = alpha->a_result; |
93 | b_result = alpha->b_result; | 92 | b_result = alpha->b_result; |
@@ -135,8 +134,8 @@ int main(int argc, char* argv[]) | |||
135 | asubsref(result,n) = maxs; | 134 | asubsref(result,n) = maxs; |
136 | } | 135 | } |
137 | } | 136 | } |
138 | printf("end..\n"); | 137 | |
139 | #ifdef CHECK | 138 | #ifdef CHECK |
140 | /** Self checking - use expected.txt from data directory **/ | 139 | /** Self checking - use expected.txt from data directory **/ |
141 | { | 140 | { |
142 | int ret=0; | 141 | int ret=0; |
diff --git a/SD-VBS/benchmarks/texture_synthesis/src/c/script_texture_synthesis.c b/SD-VBS/benchmarks/texture_synthesis/src/c/script_texture_synthesis.c index 01ddefd..2ebb423 100644 --- a/SD-VBS/benchmarks/texture_synthesis/src/c/script_texture_synthesis.c +++ b/SD-VBS/benchmarks/texture_synthesis/src/c/script_texture_synthesis.c | |||
@@ -27,11 +27,10 @@ int main(int argc, char **argv) | |||
27 | image = fiDeepCopy(im); | 27 | image = fiDeepCopy(im); |
28 | init_params(data); | 28 | init_params(data); |
29 | 29 | ||
30 | printf("start.\n"); | 30 | for_each_job { |
31 | for_each_job{ | ||
32 | create_texture(image, data); | 31 | create_texture(image, data); |
33 | } | 32 | } |
34 | printf("end..\n"); | 33 | |
35 | #ifdef CHECK | 34 | #ifdef CHECK |
36 | { | 35 | { |
37 | int ret=0; | 36 | int ret=0; |
@@ -59,7 +58,6 @@ I2D* parse_flags(int argc, char ** argv) | |||
59 | I2D* image; | 58 | I2D* image; |
60 | char fileNm[256]; | 59 | char fileNm[256]; |
61 | 60 | ||
62 | printf("Input image: "); | ||
63 | scanf("%s", fileNm); | 61 | scanf("%s", fileNm); |
64 | image = readImage(fileNm); | 62 | image = readImage(fileNm); |
65 | WIDTHin = image->width; | 63 | WIDTHin = image->width; |
@@ -122,7 +120,7 @@ I2D* parse_flags(int argc, char ** argv) | |||
122 | localx = 5; | 120 | localx = 5; |
123 | localy = 5; | 121 | localy = 5; |
124 | #endif | 122 | #endif |
125 | printf("Input size\t\t- (%dx%d)\n", HEIGHTin, WIDTHin); | 123 | // printf("Input size\t\t- (%dx%d)\n", HEIGHTin, WIDTHin); |
126 | 124 | ||
127 | // xloopin = malloc(2*WIDTHin*sizeof(int)); | 125 | // xloopin = malloc(2*WIDTHin*sizeof(int)); |
128 | // yloopin = malloc(2*HEIGHTin*sizeof(int)); | 126 | // yloopin = malloc(2*HEIGHTin*sizeof(int)); |
diff --git a/SD-VBS/benchmarks/tracking/src/c/script_tracking.c b/SD-VBS/benchmarks/tracking/src/c/script_tracking.c index bb48ace..2938126 100644 --- a/SD-VBS/benchmarks/tracking/src/c/script_tracking.c +++ b/SD-VBS/benchmarks/tracking/src/c/script_tracking.c | |||
@@ -96,19 +96,16 @@ int main(int argc, char* argv[]) | |||
96 | for(count=1; count<=counter; count++) | 96 | for(count=1; count<=counter; count++) |
97 | { | 97 | { |
98 | /** Read image **/ | 98 | /** Read image **/ |
99 | printf("Input image %d: ", count); | 99 | scanf("%s", im1); |
100 | scanf("%s", im1); | ||
101 | images[count - 1] = readImage(im1); | 100 | images[count - 1] = readImage(im1); |
102 | if(count == 1) Ic = readImage(im1); | 101 | if(count == 1) Ic = readImage(im1); |
103 | } | 102 | } |
104 | 103 | ||
105 | 104 | ||
106 | rows = Ic->height; | 105 | rows = Ic->height; |
107 | cols = Ic->width; | 106 | cols = Ic->width; |
108 | 107 | ||
109 | printf("start\n"); | 108 | for_each_job { |
110 | for_each_job{ | ||
111 | |||
112 | /** IMAGE PRE-PROCESSING **/ | 109 | /** IMAGE PRE-PROCESSING **/ |
113 | 110 | ||
114 | /** Blur the image to remove noise - weighted avergae filter **/ | 111 | /** Blur the image to remove noise - weighted avergae filter **/ |
@@ -230,8 +227,8 @@ int main(int argc, char* argv[]) | |||
230 | fFreeHandle(newpoints); | 227 | fFreeHandle(newpoints); |
231 | } | 228 | } |
232 | } | 229 | } |
233 | printf("end..\n"); | 230 | |
234 | #ifdef CHECK | 231 | #ifdef CHECK |
235 | /* Self checking */ | 232 | /* Self checking */ |
236 | { | 233 | { |
237 | int ret=0; | 234 | int ret=0; |
diff --git a/SD-VBS/common/c/extra.h b/SD-VBS/common/c/extra.h deleted file mode 100644 index 8c67b33..0000000 --- a/SD-VBS/common/c/extra.h +++ /dev/null | |||
@@ -1,479 +0,0 @@ | |||
1 | /** | ||
2 | * Copyright 2019 Sims Hill Osborne and 2020 Joshua Bakita | ||
3 | * | ||
4 | * This header provides facilities by which to separably run and time TACLeBench | ||
5 | * To use this for paired task timing, define PAIRED (pass CFLAGS=-DPAIRED to make) | ||
6 | **/ | ||
7 | #define _GNU_SOURCE | ||
8 | #include <fcntl.h> // For O_CREAT and O_RDWR | ||
9 | #include <sched.h> // For sched_yield() | ||
10 | #include <semaphore.h> // For sem_{open, post, wait}() | ||
11 | #include <stdio.h> | ||
12 | #include <stdlib.h> // For exit() | ||
13 | #include <string.h> // For strlen() | ||
14 | #include <sys/mman.h> // For mlockall() | ||
15 | #include <unistd.h> // For ftruncate() | ||
16 | #include <time.h> | ||
17 | |||
18 | // This is only visible if _GNU_SOURCE is defined, and that define does not | ||
19 | // come along to places where this file is included. Address this by manually | ||
20 | // forcing it into the global namespace. | ||
21 | extern int sched_getcpu(); | ||
22 | |||
23 | // These constants correspond to the imx6q-sabredb platform | ||
24 | #define LINE_SIZE 32 | ||
25 | #define L2_SIZE 16*2048*32 | ||
26 | |||
27 | #if __arm__ | ||
28 | #include <unistd.h> | ||
29 | #include <sys/syscall.h> | ||
30 | #endif | ||
31 | |||
32 | #define LITMUS 1 | ||
33 | #define MC2 0 | ||
34 | #define MMDC_PROF 0 | ||
35 | |||
36 | #if LITMUS | ||
37 | #include <litmus.h> | ||
38 | #endif | ||
39 | |||
40 | #if MMDC_PROF | ||
41 | #include "/media/speedy/litmus/tools/mmdc/mmdc.h" | ||
42 | #endif | ||
43 | |||
44 | #if LITMUS | ||
45 | #define SET_UP LOAD_PARAMS SETUP_LITMUS | ||
46 | #else | ||
47 | #define SET_UP LOAD_PARAMS | ||
48 | #endif | ||
49 | |||
50 | #if MMDC_PROF | ||
51 | #define LOAD_PARAMS LOAD_PARAMS_ITRL SETUP_MMDC | ||
52 | #else | ||
53 | #define LOAD_PARAMS LOAD_PARAMS_ITRL | ||
54 | #endif | ||
55 | |||
56 | // Store state globally so that the job can be outside main() | ||
57 | // Arrays use float as a comprimise between overflow and size | ||
58 | // Paired arrays use long longs as precision is more important for those times | ||
59 | #ifdef PAIRED | ||
60 | long long *_rt_start_time; | ||
61 | long long *_rt_end_time; | ||
62 | #else | ||
63 | float *_rt_exec_time; | ||
64 | #endif | ||
65 | #if MMDC_PERF | ||
66 | float *_rt_mmdc_read; | ||
67 | float *_rt_mmdc_write; | ||
68 | #endif | ||
69 | long _rt_jobs_complete; | ||
70 | long _rt_max_jobs; | ||
71 | int _rt_core; | ||
72 | int _rt_will_output; | ||
73 | struct timespec _rt_start, _rt_end; | ||
74 | |||
75 | char *_rt_run_id; | ||
76 | char *_rt_our_prog_name; | ||
77 | char *_rt_other_prog_name; | ||
78 | char *_rt_other_core; | ||
79 | #define _RT_FILENAME_LEN 64 | ||
80 | #define _BILLION (1000*1000*1000) | ||
81 | #ifdef PAIRED | ||
82 | char *_rt_barrier; | ||
83 | sem_t *_rt_first_sem, *_rt_second_sem; | ||
84 | int _rt_lock_id; | ||
85 | #endif | ||
86 | |||
87 | static void _rt_load_params_itrl(int argc, char **argv) { | ||
88 | #ifdef PAIRED | ||
89 | if (argc != 8) { | ||
90 | fprintf(stderr, "Usage: %s <name> <loops> <my core> <other core> <other name> <runID> <lockID>", argv[0]); | ||
91 | fprintf(stderr, " <name> string for logging. Name of this task.\n"); | ||
92 | fprintf(stderr, " <loops> integer number of iterations. -1 for infinite.\n"); | ||
93 | fprintf(stderr, " <my core> UNUSED. Core is now auto-detected.\n"); | ||
94 | fprintf(stderr, " <other core> integer for logging. Core of paired task.\n"); | ||
95 | fprintf(stderr, " <other name> string for logging. Name of paired task.\n"); | ||
96 | fprintf(stderr, " <runID> string to append with .txt to yield output file name.\n"); | ||
97 | fprintf(stderr, " <lockID> 1 to indicate this is pair member 1, otherwise pair member 2.\n"); | ||
98 | exit(1); | ||
99 | } | ||
100 | #else | ||
101 | if (argc != 6) { | ||
102 | fprintf(stderr, "Usage: %s <name> <loops> <my core> <runID> <save results?>\n", argv[0]); | ||
103 | fprintf(stderr, " <name> string for logging. Name of this task.\n"); | ||
104 | fprintf(stderr, " <loops> integer number of iterations. -1 for infinite.\n"); | ||
105 | fprintf(stderr, " <my core> UNUSED. Core is now auto-detected.\n"); | ||
106 | fprintf(stderr, " <runID> string to append with .txt to yield output file name.\n"); | ||
107 | fprintf(stderr, " <save results?> 1 to save results, 0 to discard.\n"); | ||
108 | exit(1); | ||
109 | } | ||
110 | #endif | ||
111 | _rt_our_prog_name = argv[1]; | ||
112 | _rt_max_jobs = atol(argv[2]); | ||
113 | _rt_core = sched_getcpu(); | ||
114 | #ifdef PAIRED | ||
115 | _rt_other_core = argv[4]; | ||
116 | _rt_other_prog_name = argv[5]; | ||
117 | _rt_run_id = argv[6]; | ||
118 | _rt_lock_id = atoi(argv[7]); | ||
119 | // The paired version doesn't support disabling output (legacy compatibility) | ||
120 | _rt_will_output = 1; | ||
121 | #else | ||
122 | _rt_other_core = "none"; | ||
123 | _rt_other_prog_name = "none"; | ||
124 | _rt_run_id = argv[4]; | ||
125 | _rt_will_output = atoi(argv[5]); | ||
126 | #endif /* PAIRED */ | ||
127 | if (_rt_max_jobs < 0 && _rt_will_output != 0) { | ||
128 | fprintf(stderr, "Infinite loops only supported when _rt_will_output is disabled!\n"); | ||
129 | exit(1); | ||
130 | } | ||
131 | if (strlen(_rt_run_id) + 5 > _RT_FILENAME_LEN) { | ||
132 | fprintf(stderr, "Run ID is too large! Keep it to less than %d characters.\n", _RT_FILENAME_LEN); | ||
133 | exit(1); | ||
134 | } | ||
135 | #ifdef PAIRED | ||
136 | _rt_start_time = calloc(_rt_max_jobs * _rt_will_output, sizeof(long long)); | ||
137 | _rt_end_time = calloc(_rt_max_jobs * _rt_will_output, sizeof(long long)); | ||
138 | if (!_rt_end_time || !_rt_start_time) { | ||
139 | perror("Unable to allocate buffers for execution times"); | ||
140 | exit(1); | ||
141 | } | ||
142 | _rt_first_sem = sem_open("/_libextra_first_sem", O_CREAT, 644, 0); | ||
143 | _rt_second_sem = sem_open("/_libextra_second_sem", O_CREAT, 644, 0); | ||
144 | if (_rt_first_sem == SEM_FAILED || _rt_second_sem == SEM_FAILED) { | ||
145 | perror("Error while creating semaphores"); | ||
146 | exit(1); | ||
147 | } | ||
148 | int barrier_file = shm_open("/_libextra_barrier", O_CREAT | O_RDWR, 644); | ||
149 | if (barrier_file == -1) { | ||
150 | perror("Error while creating shared memory for barrier synchronization"); | ||
151 | exit(1); | ||
152 | } | ||
153 | if (ftruncate(barrier_file, 1) == -1) { | ||
154 | perror("Error while setting size of shared memory for barrier synchronization"); | ||
155 | exit(1); | ||
156 | } | ||
157 | _rt_barrier = mmap(NULL, 1, PROT_WRITE, MAP_SHARED, barrier_file, 0); | ||
158 | if (_rt_barrier == MAP_FAILED) { | ||
159 | perror("Error while mapping shared memory for barrier synchronization"); | ||
160 | exit(1); | ||
161 | } | ||
162 | *_rt_barrier = 0; | ||
163 | #else | ||
164 | _rt_exec_time = calloc(_rt_max_jobs * _rt_will_output, sizeof(float)); | ||
165 | if (!_rt_exec_time) { | ||
166 | perror("Unable to allocate buffer for execution times"); | ||
167 | exit(1); | ||
168 | } | ||
169 | #endif /* PAIRED */ | ||
170 | _rt_jobs_complete = 0; | ||
171 | mlockall(MCL_CURRENT || MCL_FUTURE); | ||
172 | } | ||
173 | #define LOAD_PARAMS_ITRL _rt_load_params_itrl(argc, argv); | ||
174 | |||
175 | #define SETUP_MMDC \ | ||
176 | _rt_mmdc_read = calloc(_rt_max_jobs * _rt_will_output, sizeof(float));\ | ||
177 | _rt_mmdc_write = calloc(_rt_max_jobs * _rt_will_output, sizeof(float));\ | ||
178 | if (!_rt_mmdc_read || !_rt_mmdc_write) {\ | ||
179 | perror("Unable to allocate buffer for MMDC data");\ | ||
180 | exit(1);\ | ||
181 | }\ | ||
182 | MMDC_PROFILE_RES_t mmdc_res;\ | ||
183 | memset(&mmdc_res, 0, sizeof(MMDC_PROFILE_RES_t));\ | ||
184 | int fd = open("/dev/mem", O_RDWR, 0);\ | ||
185 | if (fd < 0) {\ | ||
186 | perror("Unable to open /dev/mem");\ | ||
187 | exit(1);\ | ||
188 | }\ | ||
189 | pMMDC_t mmdc = mmap(NULL, 0x4000, PROT_READ | PROT_WRITE, MAP_SHARED, fd, MMDC_P0_IPS_BASE_ADDR);\ | ||
190 | if (mmdc == MAP_FAILED) {\ | ||
191 | perror("Unable to map MMDC address space");\ | ||
192 | exit(1);\ | ||
193 | }\ | ||
194 | mmdc->madpcr1 = axi_arm1;\ | ||
195 | msync(&(mmdc->madpcr1),4,MS_SYNC); | ||
196 | |||
197 | #define SETUP_LITMUS \ | ||
198 | unsigned int wait = 0; \ | ||
199 | if (be_migrate_to_domain(_rt_core) < 0) { \ | ||
200 | perror("Unable to migrate to specified CPU"); \ | ||
201 | exit(1); \ | ||
202 | } \ | ||
203 | struct rt_task rt_param; \ | ||
204 | init_rt_task_param(&rt_param); \ | ||
205 | /* Supposedly the next two parameters are irrelevant when reservations are enabled, but I'm leaving them anyway... */ \ | ||
206 | rt_param.exec_cost = ms2ns(999); \ | ||
207 | rt_param.period = ms2ns(1000); \ | ||
208 | rt_param.priority = LITMUS_HIGHEST_PRIORITY; \ | ||
209 | rt_param.cls = RT_CLASS_HARD; \ | ||
210 | rt_param.release_policy = TASK_PERIODIC; \ | ||
211 | rt_param.budget_policy = NO_ENFORCEMENT; \ | ||
212 | rt_param.cpu = _rt_core; \ | ||
213 | if (set_rt_task_param(gettid(), &rt_param) < 0) { \ | ||
214 | perror("Unable to set real-time parameters"); \ | ||
215 | exit(1); \ | ||
216 | } \ | ||
217 | if (init_litmus() != 0) { \ | ||
218 | perror("init_litmus failed"); \ | ||
219 | exit(1); \ | ||
220 | } \ | ||
221 | MC2_SETUP \ | ||
222 | if (task_mode(LITMUS_RT_TASK) != 0) { \ | ||
223 | perror("Unable to become real-time task"); \ | ||
224 | exit(1); \ | ||
225 | } \ | ||
226 | if (wait && wait_for_ts_release() != 0) { \ | ||
227 | perror("Unable to wait for taskset release"); \ | ||
228 | exit(1); \ | ||
229 | } | ||
230 | |||
231 | #if MC2 | ||
232 | #define MC2_SETUP \ | ||
233 | |||
234 | set_page_color(rt_param.cpu); | ||
235 | #else | ||
236 | #define MC2_SETUP | ||
237 | #endif | ||
238 | |||
239 | #define CLEANUP_LITMUS \ | ||
240 | if (task_mode(BACKGROUND_TASK) != 0) { \ | ||
241 | perror("Unable to become a real-time task"); \ | ||
242 | exit(1); \ | ||
243 | } \ | ||
244 | |||
245 | #if __arm__ | ||
246 | // On ARM, manually flush the cache | ||
247 | #define FLUSH_CACHES \ | ||
248 | volatile uint8_t buffer[L2_SIZE * 4]; \ | ||
249 | for (uint32_t j = 0; j < 4; j++) \ | ||
250 | for (uint32_t i = 0; i < L2_SIZE * 4; i += LINE_SIZE) \ | ||
251 | buffer[i]++; | ||
252 | #else | ||
253 | // On x86 call the wbinvld instruction (it's in a kernel module due to it being ring-0) | ||
254 | #define FLUSH_CACHES \ | ||
255 | FILE *fp = fopen("/proc/wbinvd", "r");\ | ||
256 | if (fp == NULL) {\ | ||
257 | perror("Cache flush module interface cannot be opened");\ | ||
258 | exit(1);\ | ||
259 | }\ | ||
260 | char dummy;\ | ||
261 | if (fread(&dummy, 1, 1, fp) == 0) {\ | ||
262 | perror("Unable to access cache flush module interface");\ | ||
263 | exit(1);\ | ||
264 | }\ | ||
265 | fclose(fp); | ||
266 | #endif | ||
267 | |||
268 | // This semaphore-based synchronization is from Sims | ||
269 | #define FIRST_UNLOCK \ | ||
270 | if (_rt_lock_id == 1) {\ | ||
271 | if (sem_post(_rt_second_sem) != 0) {\ | ||
272 | perror("Unable to unlock second semaphore");\ | ||
273 | exit(1);\ | ||
274 | }\ | ||
275 | } \ | ||
276 | else {\ | ||
277 | if (sem_post(_rt_first_sem) != 0) {\ | ||
278 | perror("Unable to unlock first semaphore");\ | ||
279 | exit(1);\ | ||
280 | }\ | ||
281 | } \ | ||
282 | |||
283 | #define FIRST_LOCK \ | ||
284 | if (_rt_lock_id == 1) {\ | ||
285 | if (sem_wait(_rt_first_sem) != 0) {\ | ||
286 | perror("Unable to wait on first semaphore");\ | ||
287 | exit(1);\ | ||
288 | }\ | ||
289 | }\ | ||
290 | else {\ | ||
291 | if (sem_wait(_rt_second_sem) != 0) {\ | ||
292 | perror("Unable to wait on second semaphore");\ | ||
293 | exit(1);\ | ||
294 | }\ | ||
295 | } | ||
296 | |||
297 | // This ensures a very low difference between pair member start times | ||
298 | #define BARRIER_SYNC \ | ||
299 | if (__sync_bool_compare_and_swap(_rt_barrier, 0, 1)) {\ | ||
300 | while (!__sync_bool_compare_and_swap(_rt_barrier, 0, 0)) {};\ | ||
301 | }\ | ||
302 | else {\ | ||
303 | __sync_bool_compare_and_swap(_rt_barrier, 1, 0);\ | ||
304 | } | ||
305 | |||
306 | // Buffer timing result from a single job | ||
307 | static void _rt_save_job_result() { | ||
308 | if (_rt_jobs_complete >= _rt_max_jobs) { | ||
309 | fprintf(stderr, "Max jobs setting too small! Trying to record job #%ld when we only have space for %ld jobs. Exiting...\n", _rt_jobs_complete, _rt_max_jobs); | ||
310 | exit(1); | ||
311 | } | ||
312 | if (_rt_jobs_complete > -1 && _rt_will_output) { | ||
313 | #ifdef PAIRED | ||
314 | _rt_start_time[_rt_jobs_complete] = _rt_start.tv_sec; | ||
315 | _rt_start_time[_rt_jobs_complete] *= _BILLION; | ||
316 | _rt_start_time[_rt_jobs_complete] += _rt_start.tv_nsec; | ||
317 | _rt_end_time[_rt_jobs_complete] = _rt_end.tv_sec; | ||
318 | _rt_end_time[_rt_jobs_complete] *= _BILLION; | ||
319 | _rt_end_time[_rt_jobs_complete] += _rt_end.tv_nsec; | ||
320 | #else | ||
321 | _rt_exec_time[_rt_jobs_complete] = _rt_end.tv_sec - _rt_start.tv_sec; | ||
322 | _rt_exec_time[_rt_jobs_complete] *= _BILLION; | ||
323 | _rt_exec_time[_rt_jobs_complete] += _rt_end.tv_nsec - _rt_start.tv_nsec; | ||
324 | #endif /* PAIRED */ | ||
325 | #if MMDC_PROF | ||
326 | _rt_mmdc_read[_rt_jobs_complete] = mmdc_res.read_bytes; | ||
327 | _rt_mmdc_write[_rt_jobs_complete] = mmdc_res.write_bytes; | ||
328 | #endif | ||
329 | } | ||
330 | } | ||
331 | |||
332 | // Save all buffered timing results to disk | ||
333 | static void _rt_write_to_file() { | ||
334 | char fileName[_RT_FILENAME_LEN]; | ||
335 | FILE *fp; | ||
336 | munlockall(); | ||
337 | if (!_rt_will_output) | ||
338 | goto out; | ||
339 | strcpy(fileName, _rt_run_id); | ||
340 | strcat(fileName, ".txt"); | ||
341 | fp = fopen(fileName, "a"); | ||
342 | if (fp == NULL) { | ||
343 | perror("Unable to open output file"); | ||
344 | exit(1); | ||
345 | } | ||
346 | // Baseline output uses a similar format with "none" for unused fields | ||
347 | for (int i = 0; i < _rt_jobs_complete; i++){ | ||
348 | fprintf(fp, "%s %s %u %s %ld", _rt_our_prog_name, _rt_other_prog_name, | ||
349 | _rt_core, _rt_other_core, _rt_max_jobs); | ||
350 | #ifdef PAIRED | ||
351 | // For unclear legacy reasons, paired tasks emit sec and ns separately | ||
352 | fprintf(fp, " %lld %lld %lld %lld", | ||
353 | _rt_start_time[i] / _BILLION, _rt_start_time[i] % _BILLION, | ||
354 | _rt_end_time[i] / _BILLION, _rt_end_time[i] % _BILLION); | ||
355 | #else | ||
356 | fprintf(fp, " %.f", _rt_exec_time[i]); | ||
357 | #endif /* PAIRED */ | ||
358 | fprintf(fp, " %s %d %.f %.f\n", _rt_run_id, i, | ||
359 | #if MMDC_PROF | ||
360 | _rt_mmdc_read[i], _rt_mmdc_write[i]); | ||
361 | #else | ||
362 | 0.0, 0.0); | ||
363 | #endif /* MMDC_PROF */ | ||
364 | } | ||
365 | fclose(fp); | ||
366 | out: | ||
367 | #if LITMUS | ||
368 | CLEANUP_LITMUS | ||
369 | #endif /* LITMUS */ | ||
370 | #ifdef PAIRED | ||
371 | munmap(_rt_barrier, 1); | ||
372 | shm_unlink("/_libextra_barrier"); | ||
373 | sem_unlink("/_libextra_first_sem"); | ||
374 | sem_unlink("/_libextra_second_sem"); | ||
375 | free(_rt_start_time); | ||
376 | free(_rt_end_time); | ||
377 | #else | ||
378 | free(_rt_exec_time); | ||
379 | #endif /* PAIRED */ | ||
380 | #if MMDC_PROF | ||
381 | free(_rt_mmdc_read); | ||
382 | free(_rt_mmdc_write); | ||
383 | #endif /* MMDC_PROF */ | ||
384 | } | ||
385 | |||
386 | // Start a job | ||
387 | static void _rt_start_loop() { | ||
388 | #if LITMUS | ||
389 | if (sleep_next_period() != 0) { | ||
390 | perror("Unable to sleep for next period"); | ||
391 | } | ||
392 | #else | ||
393 | sched_yield(); | ||
394 | #endif /* LITMUS */ | ||
395 | #ifdef PAIRED | ||
396 | FIRST_UNLOCK | ||
397 | FIRST_LOCK | ||
398 | #endif /* PAIRED */ | ||
399 | FLUSH_CACHES | ||
400 | #ifdef PAIRED | ||
401 | BARRIER_SYNC | ||
402 | #endif /* PAIRED */ | ||
403 | #if MMDC_PROF | ||
404 | /* This disables profiling, resets the counters, clears the overflow bit, and enables profiling */ | ||
405 | start_mmdc_profiling(mmdc); | ||
406 | #endif /* MMDC_PROF */ | ||
407 | clock_gettime(CLOCK_MONOTONIC, &_rt_start); | ||
408 | } | ||
409 | |||
410 | // Complete a job | ||
411 | static void _rt_stop_loop() { | ||
412 | clock_gettime(CLOCK_MONOTONIC, &_rt_end); | ||
413 | #if MMDC_PROF | ||
414 | /* This freezes the profiling and makes results available */ | ||
415 | pause_mmdc_profiling(mmdc); | ||
416 | get_mmdc_profiling_results(mmdc, &mmdc_res); | ||
417 | #endif /* MMDC_PROF */ | ||
418 | _rt_save_job_result(); | ||
419 | _rt_jobs_complete++; | ||
420 | } | ||
421 | |||
422 | /****** New API ****** | ||
423 | * Intended structure: | ||
424 | * | ||
425 | * |int main(int argc, char **argv) { | ||
426 | * | SET_UP | ||
427 | * | ... | ||
428 | * | for_each_job { | ||
429 | * | tacleInit(); | ||
430 | * | tacleMain(); | ||
431 | * | } | ||
432 | * | WRITE_TO_FILE | ||
433 | * |} | ||
434 | * | ||
435 | * The main() function must call its parameters argc and argv for SET_UP to be | ||
436 | * able to read them. | ||
437 | * Only SET_UP necessarily has to be in main(). | ||
438 | * | ||
439 | * We use some niche C features, here's a quick explaination: | ||
440 | * 1. The && operator doesn't evaluate the right-hand side of the expression | ||
441 | * unless the left side evaluated to true. We use this to only execute | ||
442 | * _rt_start_loop() when the loop will actually run. | ||
443 | * 2. The comma operator executes the first expression and then throws away the | ||
444 | * result. We use this to call our void function from inside a comparison. | ||
445 | */ | ||
446 | #define for_each_job \ | ||
447 | for (; _rt_jobs_complete < _rt_max_jobs && (_rt_start_loop(),1); \ | ||
448 | _rt_stop_loop()) | ||
449 | |||
450 | /****** Legacy API ****** | ||
451 | * Intended structure: | ||
452 | * | ||
453 | * |int main(int argc, char **argv) { | ||
454 | * | SET_UP | ||
455 | * | for (jobsComplete=0; jobsComplete<maxJobs; jobsComplete++){ | ||
456 | * | START_LOOP | ||
457 | * | tacleInit(); | ||
458 | * | tacleMain(); | ||
459 | * | STOP_LOOP | ||
460 | * | } | ||
461 | * | WRITE_TO_FILE | ||
462 | * | tacleReturn | ||
463 | * |} | ||
464 | * | ||
465 | * The main() function must call its parameters argc and argv for SET_UP to be | ||
466 | * able to read them. | ||
467 | */ | ||
468 | static int jobsComplete = 0; | ||
469 | #define START_LOOP _rt_start_loop(); | ||
470 | #define STOP_LOOP _rt_stop_loop(); | ||
471 | #define WRITE_TO_FILE _rt_write_to_file(); | ||
472 | #define maxJobs _rt_max_jobs | ||
473 | // Has been part of STOP_LOOP for quite some time | ||
474 | #define SAVE_RESULTS \ | ||
475 | #warning "The SAVE_RESULTS macro is deprecated and will soon be removed!"; | ||
476 | // Unclear if SLEEP is used anywhere. | ||
477 | #define SLEEP \ | ||
478 | #warning "The SLEEP macro is deprecated and may be removed!" \ | ||
479 | nanosleep((const struct timespec[]){{0, 1000000}}, NULL); | ||
diff --git a/SD-VBS/common/makefiles/Makefile.common b/SD-VBS/common/makefiles/Makefile.common index 144adb2..9c28cfc 100644 --- a/SD-VBS/common/makefiles/Makefile.common +++ b/SD-VBS/common/makefiles/Makefile.common | |||
@@ -18,7 +18,7 @@ endif | |||
18 | endif | 18 | endif |
19 | 19 | ||
20 | CC=gcc | 20 | CC=gcc |
21 | override CFLAGS += -DGCC -D$(INPUT) -pthread -DCHECK | 21 | override CFLAGS += -DGCC -D$(INPUT) -pthread -I../../../../.. |
22 | COMMON_DIR := $(TOP_DIR)/common/c | 22 | COMMON_DIR := $(TOP_DIR)/common/c |
23 | M_COMMON := $(TOP_DIR)/common/matlab | 23 | M_COMMON := $(TOP_DIR)/common/matlab |
24 | M_TOOLBOX=$(TOP_DIR)/common/toolbox | 24 | M_TOOLBOX=$(TOP_DIR)/common/toolbox |
@@ -28,7 +28,11 @@ PRELOAD_TIMES_DIR := $(TOP_DIR)/preload-times/$(BMARK) | |||
28 | MTIMING_DIR := $(TOP_DIR)/cycles/$(BMARK) | 28 | MTIMING_DIR := $(TOP_DIR)/cycles/$(BMARK) |
29 | BMARK_DIR := $(TOP_DIR)/benchmarks/$(BMARK) | 29 | BMARK_DIR := $(TOP_DIR)/benchmarks/$(BMARK) |
30 | TOOL_DIR := $(TOP_DIR)/tools | 30 | TOOL_DIR := $(TOP_DIR)/tools |
31 | LIBLITMUS := /home/litmus/liblitmus | 31 | LIBLITMUS ?= /home/litmus/liblitmus |
32 | ifneq ($(shell grep "define LITMUS 1" ../../../../../extra.h),) | ||
33 | CFLAGS += -I${LIBLITMUS}/include | ||
34 | LDFLAGS += -L${LIBLITMUS} -llitmus | ||
35 | endif | ||
32 | #The options set below and specific to each benchmark. Disparity takes 2 input images, whereas Tracking can take any >1 input images =. | 36 | #The options set below and specific to each benchmark. Disparity takes 2 input images, whereas Tracking can take any >1 input images =. |
33 | 37 | ||
34 | # Variables exported from the benchmark specific Makefiles: | 38 | # Variables exported from the benchmark specific Makefiles: |
@@ -55,8 +59,8 @@ COMMON_SRC := $(wildcard $(COMMON_DIR)/*.c) | |||
55 | # RULES | 59 | # RULES |
56 | 60 | ||
57 | EXE = | 61 | EXE = |
58 | INCLUDES = -I$(COMMON_DIR) -I$(C_DIR) -I${LIBLITMUS}/include -I${LIBLITMUS}/arch/arm/include | 62 | INCLUDES = -I$(COMMON_DIR) -I$(C_DIR) |
59 | COMPILE_C = $(CC) $(CFLAGS) $(INCLUDES) -O2 | 63 | COMPILE_C = $(CC) $(CFLAGS) $(LDFLAGS) $(INCLUDES) -O2 |
60 | #COMPILE_C = $(CC) $(CFLAGS) -DGENERATE_OUTPUT -lm -O2 $(INCLUDES) | 64 | #COMPILE_C = $(CC) $(CFLAGS) -DGENERATE_OUTPUT -lm -O2 $(INCLUDES) |
61 | COMPILE_G = $(CC) $(CFLAGS) -g -lm $(INCLUDES) | 65 | COMPILE_G = $(CC) $(CFLAGS) -g -lm $(INCLUDES) |
62 | COMPILE_PG = $(COMPILE_G) -pg | 66 | COMPILE_PG = $(COMPILE_G) -pg |
@@ -107,7 +111,7 @@ compile-preload: | |||
107 | compile: $(C_SRC) | 111 | compile: $(C_SRC) |
108 | @echo | 112 | @echo |
109 | @echo -e "Benchmark\t\t- $(BMARK)" | 113 | @echo -e "Benchmark\t\t- $(BMARK)" |
110 | @$(COMPILE_C) $(COMMON_SRC) $(C_SRC) -lrt -L$(LIBLITMUS) -llitmus -lm -w -o $(BMARK)$(EXE) | 114 | @$(COMPILE_C) $(COMMON_SRC) $(C_SRC) -lrt -lm -w -o $(BMARK)$(EXE) |
111 | 115 | ||
112 | compile-prof: $(C_SRC) | 116 | compile-prof: $(C_SRC) |
113 | @echo | 117 | @echo |
diff --git a/SD-VBS/disparity_qcif b/SD-VBS/disparity_qcif new file mode 120000 index 0000000..9874fe6 --- /dev/null +++ b/SD-VBS/disparity_qcif | |||
@@ -0,0 +1 @@ | |||
benchmarks/disparity/data/qcif/disparity \ No newline at end of file | |||
diff --git a/SD-VBS/localization_qcif b/SD-VBS/localization_qcif new file mode 120000 index 0000000..d81d27e --- /dev/null +++ b/SD-VBS/localization_qcif | |||
@@ -0,0 +1 @@ | |||
benchmarks/localization/data/qcif/localization \ No newline at end of file | |||
diff --git a/SD-VBS/mser_qcif b/SD-VBS/mser_qcif new file mode 120000 index 0000000..8121c92 --- /dev/null +++ b/SD-VBS/mser_qcif | |||
@@ -0,0 +1 @@ | |||
benchmarks/mser/data/qcif/mser \ No newline at end of file | |||
diff --git a/SD-VBS/multi_ncut_qcif b/SD-VBS/multi_ncut_qcif new file mode 120000 index 0000000..e3f755f --- /dev/null +++ b/SD-VBS/multi_ncut_qcif | |||
@@ -0,0 +1 @@ | |||
benchmarks/multi_ncut/data/qcif/multi_ncut \ No newline at end of file | |||
diff --git a/SD-VBS/sd-vbsNames.txt b/SD-VBS/sd-vbsNames.txt new file mode 100644 index 0000000..23b168d --- /dev/null +++ b/SD-VBS/sd-vbsNames.txt | |||
@@ -0,0 +1,9 @@ | |||
1 | disparity_qcif echo -e "./benchmarks/disparity/data/qcif/1.bmp\\n./benchmarks/disparity/data/qcif/2.bmp" | ||
2 | localization_qcif echo "./benchmarks/localization/data/qcif/1.txt" | ||
3 | mser_qcif echo "./benchmarks/mser/data/qcif/1.bmp" | ||
4 | multi_ncut_qcif echo "./benchmarks/multi_ncut/data/qcif/1.bmp" | ||
5 | sift_qcif echo "./benchmarks/sift/data/qcif/1.bmp" | ||
6 | stitch_qcif echo "./benchmarks/stitch/data/qcif/1.bmp" | ||
7 | svm_qcif echo -e "./benchmarks/svm/data/qcif/d16trn_1.txt\\n./benchmarks/svm/data/qcif/d16trn_2.txt\\n./benchmarks/svm/data/qcif/d16tst_1.txt\\n./benchmarks/svm/data/qcif/d16tst_2.txt" | ||
8 | texture_synthesis_qcif echo "./benchmarks/texture_synthesis/data/qcif/1.bmp" | ||
9 | tracking_qcif echo -e "./benchmarks/tracking/data/qcif/1.bmp\\n./benchmarks/tracking/data/qcif/2.bmp\\n./benchmarks/tracking/data/qcif/3.bmp\\n./benchmarks/tracking/data/qcif/4.bmp" | ||
diff --git a/SD-VBS/sift_qcif b/SD-VBS/sift_qcif new file mode 120000 index 0000000..724930b --- /dev/null +++ b/SD-VBS/sift_qcif | |||
@@ -0,0 +1 @@ | |||
benchmarks/sift/data/qcif/sift \ No newline at end of file | |||
diff --git a/SD-VBS/stitch_qcif b/SD-VBS/stitch_qcif new file mode 120000 index 0000000..0b05a84 --- /dev/null +++ b/SD-VBS/stitch_qcif | |||
@@ -0,0 +1 @@ | |||
benchmarks/stitch/data/qcif/stitch \ No newline at end of file | |||
diff --git a/SD-VBS/svm_qcif b/SD-VBS/svm_qcif new file mode 120000 index 0000000..a8dc348 --- /dev/null +++ b/SD-VBS/svm_qcif | |||
@@ -0,0 +1 @@ | |||
benchmarks/svm/data/qcif/svm \ No newline at end of file | |||
diff --git a/SD-VBS/texture_synthesis_qcif b/SD-VBS/texture_synthesis_qcif new file mode 120000 index 0000000..e198a53 --- /dev/null +++ b/SD-VBS/texture_synthesis_qcif | |||
@@ -0,0 +1 @@ | |||
benchmarks/texture_synthesis/data/qcif/texture_synthesis \ No newline at end of file | |||
diff --git a/SD-VBS/tracking_qcif b/SD-VBS/tracking_qcif new file mode 120000 index 0000000..683191e --- /dev/null +++ b/SD-VBS/tracking_qcif | |||
@@ -0,0 +1 @@ | |||
benchmarks/tracking/data/qcif/tracking \ No newline at end of file | |||
diff --git a/dis/disPairs2MbInNames.txt b/dis/disPairs2MbInNames.txt new file mode 100644 index 0000000..a45ead4 --- /dev/null +++ b/dis/disPairs2MbInNames.txt | |||
@@ -0,0 +1,6 @@ | |||
1 | field_all ./gen_input.py field inputs/Field/in0 2097152 | ||
2 | matrix_all ./gen_input.py matrix inputs/Matrix/in0 2097152 | ||
3 | neighborhood_all ./gen_input.py neighborhood inputs/Neighborhood/in0 2097152 | ||
4 | pointer_all ./gen_input.py pointer inputs/Pointer/in0 2097152 | ||
5 | transitive_all ./gen_input.py transitive inputs/Transitive/in0 2097152 | ||
6 | update_all ./gen_input.py update inputs/Update/in0 2097152 | ||
@@ -29,8 +29,7 @@ extern int sched_getcpu(); | |||
29 | #include <sys/syscall.h> | 29 | #include <sys/syscall.h> |
30 | #endif | 30 | #endif |
31 | 31 | ||
32 | #define LITMUS 1 | 32 | #define LITMUS 0 |
33 | #define MC2 0 | ||
34 | #define MMDC_PROF 0 | 33 | #define MMDC_PROF 0 |
35 | 34 | ||
36 | #if LITMUS | 35 | #if LITMUS |
@@ -202,10 +201,11 @@ static void _rt_load_params_itrl(int argc, char **argv) { | |||
202 | } \ | 201 | } \ |
203 | struct rt_task rt_param; \ | 202 | struct rt_task rt_param; \ |
204 | init_rt_task_param(&rt_param); \ | 203 | init_rt_task_param(&rt_param); \ |
205 | /* Supposedly the next two parameters are irrelevant when reservations are enabled, but I'm leaving them anyway... */ \ | ||
206 | rt_param.exec_cost = ms2ns(999); \ | 204 | rt_param.exec_cost = ms2ns(999); \ |
207 | rt_param.period = ms2ns(1000); \ | 205 | rt_param.period = ms2ns(1000); \ |
208 | rt_param.priority = LITMUS_HIGHEST_PRIORITY; \ | 206 | rt_param.deadline = 0; \ |
207 | rt_param.phase = 0; \ | ||
208 | rt_param.priority = LITMUS_LOWEST_PRIORITY; \ | ||
209 | rt_param.cls = RT_CLASS_HARD; \ | 209 | rt_param.cls = RT_CLASS_HARD; \ |
210 | rt_param.release_policy = TASK_PERIODIC; \ | 210 | rt_param.release_policy = TASK_PERIODIC; \ |
211 | rt_param.budget_policy = NO_ENFORCEMENT; \ | 211 | rt_param.budget_policy = NO_ENFORCEMENT; \ |
@@ -218,7 +218,6 @@ static void _rt_load_params_itrl(int argc, char **argv) { | |||
218 | perror("init_litmus failed"); \ | 218 | perror("init_litmus failed"); \ |
219 | exit(1); \ | 219 | exit(1); \ |
220 | } \ | 220 | } \ |
221 | MC2_SETUP \ | ||
222 | if (task_mode(LITMUS_RT_TASK) != 0) { \ | 221 | if (task_mode(LITMUS_RT_TASK) != 0) { \ |
223 | perror("Unable to become real-time task"); \ | 222 | perror("Unable to become real-time task"); \ |
224 | exit(1); \ | 223 | exit(1); \ |
@@ -228,14 +227,6 @@ static void _rt_load_params_itrl(int argc, char **argv) { | |||
228 | exit(1); \ | 227 | exit(1); \ |
229 | } | 228 | } |
230 | 229 | ||
231 | #if MC2 | ||
232 | #define MC2_SETUP \ | ||
233 | |||
234 | set_page_color(rt_param.cpu); | ||
235 | #else | ||
236 | #define MC2_SETUP | ||
237 | #endif | ||
238 | |||
239 | #define CLEANUP_LITMUS \ | 230 | #define CLEANUP_LITMUS \ |
240 | if (task_mode(BACKGROUND_TASK) != 0) { \ | 231 | if (task_mode(BACKGROUND_TASK) != 0) { \ |
241 | perror("Unable to become a real-time task"); \ | 232 | perror("Unable to become a real-time task"); \ |
diff --git a/smt_analysis/computeSMTslowdown.py b/smt_analysis/computeSMTslowdown.py index 2cf58ac..aa7aa21 100755 --- a/smt_analysis/computeSMTslowdown.py +++ b/smt_analysis/computeSMTslowdown.py | |||
@@ -247,7 +247,7 @@ print(plt.hist(M_vals_to_plot, bins=10)) | |||
247 | ##### BELOW TEXT IS OLD OFFSET CODE (patched) ##### | 247 | ##### BELOW TEXT IS OLD OFFSET CODE (patched) ##### |
248 | ## This still works, but is hacky and deprecated ## | 248 | ## This still works, but is hacky and deprecated ## |
249 | ## PearsonR doesn't work though ## | 249 | ## PearsonR doesn't work though ## |
250 | if not LEVEL_C_ANALYSIS: | 250 | if not LEVEL_C_ANALYSIS and False: |
251 | benchmarkNames = idx_to_name | 251 | benchmarkNames = idx_to_name |
252 | benchmarkCount = len(benchmarkNames) | 252 | benchmarkCount = len(benchmarkNames) |
253 | numJobs = len(paired_times[0][0]) | 253 | numJobs = len(paired_times[0][0]) |