From 163c440444c74a4e0bbe0a8db3d1ca725413994b Mon Sep 17 00:00:00 2001 From: Joshua Bakita Date: Thu, 22 Oct 2020 03:17:31 -0400 Subject: Make SD-VBS compatible with run_bench.sh and cleanup SD-VBS: - Run silently - Fix some whitespace errors - Don't duplicate extra.h - Auto-detect if building with LITMUS-RT - Disable result checking - Add helper symlinks Misc: - Remove unused code from libextra - Set some missing rt_param fields in libextra - Disable CSV info dump from computeSMTslowdown.sh - Widen scope of .gitignore on .txt files - Include list of 2MB DIS pair benchmarks and inputs --- .../benchmarks/disparity/src/c/script_disparity.c | 18 +++++++---------- .../localization/src/c/script_localization.c | 20 ++++++++----------- SD-VBS/benchmarks/mser/src/c/script_mser.c | 15 ++++++-------- .../multi_ncut/src/c/script_multi_ncut.c | 10 ++++------ SD-VBS/benchmarks/sift/src/c/script_sift.c | 9 +++------ SD-VBS/benchmarks/stitch/src/c/script_stitch.c | 11 +++-------- SD-VBS/benchmarks/svm/src/c/script_svm.c | 23 +++++++++++----------- .../src/c/script_texture_synthesis.c | 8 +++----- SD-VBS/benchmarks/tracking/src/c/script_tracking.c | 13 +++++------- 9 files changed, 50 insertions(+), 77 deletions(-) (limited to 'SD-VBS/benchmarks') 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[]) int WIN_SZ=8, SHIFT=64; FILE* fp; - printf("Image 1: "); scanf("%s", im1); - printf("Image 2: "); scanf("%s", im2); #ifdef CHECK char checkFile[100] = "./expected_C.txt"; @@ -86,17 +84,15 @@ int main(int argc, char* argv[]) Iright_moved = iSetArray(paddedRows, paddedCols, 0); range = iMallocHandle(1, 2); - printf("starting..\n"); - for_each_job{ - retDisparity = getDisparity(imleft, imright, WIN_SZ, SHIFT, - minSAD, retDisp, halfWin, - IrightPadded, IleftPadded, Iright_moved, - retSAD, SAD, integralImg, - range); + for_each_job { + retDisparity = getDisparity(imleft, imright, WIN_SZ, SHIFT, + minSAD, retDisp, halfWin, + IrightPadded, IleftPadded, Iright_moved, + retSAD, SAD, integralImg, + range); } - printf("ending\n"); -#ifdef CHECK +#ifdef CHECK /** Self checking - use expected.txt from data directory **/ { 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[]) char im1[100]; - printf("Input txt File: "); scanf("%s", im1); fid = readFile(im1); @@ -83,11 +82,10 @@ int main(int argc, char* argv[]) F2D *randn; randn = randWrapper(n,3); - printf("start\n"); - for_each_job{ - fResetArray(pos,n, 3, 0); - fResetArray(vel,n, 3, 0); - fResetArray(ones,n,1,1); + for_each_job { + fResetArray(pos,n, 3, 0); + fResetArray(vel,n, 3, 0); + fResetArray(ones,n,1,1); { int j; @@ -95,7 +93,7 @@ int main(int argc, char* argv[]) for(j=0; j<3; j++) subsref(vel, i, j) += subsref(randn,i,j) * STDDEV_ODOVel; - } + } @@ -486,17 +484,15 @@ int main(int argc, char* argv[]) subsref(resultMat,1,icount) = velOut; subsref(resultMat,2,icount) = posOut; } - + fFreeHandle(sData); - - + if (asubsref(isEOF,0) == 1) break; } } - printf("end..\n"); -#ifdef CHECK +#ifdef CHECK // Self checking - use expected.txt from data directory { 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[]) int ndims, nel, gdl, nmer; - printf("Input Image: "); scanf("%s", im1); I = readImage(im1); @@ -74,19 +73,17 @@ int main(int argc, char* argv[]) out = iMallocHandle(1, nmer); - printf("start\n"); - for_each_job{ + for_each_job { idx = mser(It, 2, subs_pt, nsubs_pt, strides_pt, visited_pt, dims, - joins_pt, + joins_pt, regions_pt, - pairs_pt, + pairs_pt, forest_pt, - acc_pt, ell_pt, + acc_pt, ell_pt, out); } - printf("end..\n"); - -#ifdef CHECK + +#ifdef CHECK /** Self checking - use expected.txt from data directory **/ { 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[]) F2D *imageOut, *tempOut; F2D *edgeWeights, *in; - printf("Input image: "); scanf("%s", im1); im = readImage(im1); @@ -50,13 +49,12 @@ int main(int argc, char* argv[]) u->elts = (uni_elt*)malloc(sizeof(uni_elt)*num_vertices); output = iMallocHandle(height, width); - printf("start\n"); for_each_job{ - seg = segment_image(im, sigma, k, min_size, num_ccs, segments, edges, imageOut, tempOut, kernel, edgeWeights, in, ind, u, output); - out = seg; + seg = segment_image(im, sigma, k, min_size, num_ccs, segments, edges, imageOut, tempOut, kernel, edgeWeights, in, ind, u, output); + out = seg; } - printf("end..\n"); -#ifdef CHECK + +#ifdef CHECK /** Self checking - use expected.txt from data directory **/ { 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[]) unsigned int* startTime, *endTime, *elapsed; char imSrc[100]; - printf("Input image: "); scanf("%s", imSrc); im = readImage(imSrc); image = fiDeepCopy(im); @@ -53,16 +52,14 @@ int main(int argc, char* argv[]) cols = image->width; - printf("start\n"); for_each_job{ image = fiDeepCopy(im); - normalizeImage(image); + normalizeImage(image); /** Extract sift features for the normalized image **/ frames = sift(image); } - printf("end..\n"); - -#ifdef CHECK + +#ifdef CHECK { int ret=0; 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[]) I2D *Icur; int i, j; char im1[100], im2[100]; - - printf("Input image: "); scanf("%s", im1); Icur = readImage(im1); rows = Icur->height; cols = Icur->width; - - printf("start\n"); - for_each_job{ + + for_each_job { v = harris(Icur); interestPnts = getANMS(v, 24); int1 = fMallocHandle(interestPnts->height, 1); @@ -38,10 +35,8 @@ int main(int argc, char* argv[]) Fcur = extractFeatures(Icur, int1, int2); } - printf("end..\n"); - -#ifdef CHECK +#ifdef CHECK /** Self checking - use expected.txt from data directory **/ { 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[]) #endif - printf("trn file 1: "); + // trn file 1 scanf("%s", im1); - trn1 = readFile(im1); + trn1 = readFile(im1); - printf("trn file 2: "); + // trn file 2 scanf("%s", im1); - trn2 = readFile(im1); + trn2 = readFile(im1); - printf("tst file 1: "); + // tst file 1 scanf("%s", im1); - tst1 = readFile(im1); + tst1 = readFile(im1); - printf("tst file 2: "); + // tst file 2 scanf("%s", im1); - tst2 = readFile(im1); + tst2 = readFile(im1); - printf("start.\n"); - for_each_job{ + for_each_job { alpha = getAlphaFromTrainSet(N, trn1, trn2, iter); a_result = alpha->a_result; b_result = alpha->b_result; @@ -135,8 +134,8 @@ int main(int argc, char* argv[]) asubsref(result,n) = maxs; } } - printf("end..\n"); -#ifdef CHECK + +#ifdef CHECK /** Self checking - use expected.txt from data directory **/ { 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) image = fiDeepCopy(im); init_params(data); - printf("start.\n"); - for_each_job{ + for_each_job { create_texture(image, data); } - printf("end..\n"); + #ifdef CHECK { int ret=0; @@ -59,7 +58,6 @@ I2D* parse_flags(int argc, char ** argv) I2D* image; char fileNm[256]; - printf("Input image: "); scanf("%s", fileNm); image = readImage(fileNm); WIDTHin = image->width; @@ -122,7 +120,7 @@ I2D* parse_flags(int argc, char ** argv) localx = 5; localy = 5; #endif - printf("Input size\t\t- (%dx%d)\n", HEIGHTin, WIDTHin); +// printf("Input size\t\t- (%dx%d)\n", HEIGHTin, WIDTHin); // xloopin = malloc(2*WIDTHin*sizeof(int)); // 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[]) for(count=1; count<=counter; count++) { /** Read image **/ - printf("Input image %d: ", count); - scanf("%s", im1); + scanf("%s", im1); images[count - 1] = readImage(im1); - if(count == 1) Ic = readImage(im1); + if(count == 1) Ic = readImage(im1); } rows = Ic->height; cols = Ic->width; - printf("start\n"); - for_each_job{ - + for_each_job { /** IMAGE PRE-PROCESSING **/ /** Blur the image to remove noise - weighted avergae filter **/ @@ -230,8 +227,8 @@ int main(int argc, char* argv[]) fFreeHandle(newpoints); } } - printf("end..\n"); -#ifdef CHECK + +#ifdef CHECK /* Self checking */ { int ret=0; -- cgit v1.2.2