From 3498e3270194093098f9b8275901517fa2f9fa32 Mon Sep 17 00:00:00 2001 From: Joshua Bakita Date: Fri, 23 Oct 2020 16:42:53 -0400 Subject: Squashed commit sd-vbs from Leo: - Fixes SD-VBS build with LITMUS 1 defined - Fixes memory leak in stitch and tracking benchmarks - Adds initial case-study script and configurations --- SD-VBS/benchmarks/stitch/src/c/script_stitch.c | 12 ++++++------ SD-VBS/benchmarks/tracking/src/c/script_tracking.c | 6 ++---- SD-VBS/common/makefiles/Makefile.common | 11 ++++++----- 3 files changed, 14 insertions(+), 15 deletions(-) (limited to 'SD-VBS') diff --git a/SD-VBS/benchmarks/stitch/src/c/script_stitch.c b/SD-VBS/benchmarks/stitch/src/c/script_stitch.c index b7611f1..9310048 100644 --- a/SD-VBS/benchmarks/stitch/src/c/script_stitch.c +++ b/SD-VBS/benchmarks/stitch/src/c/script_stitch.c @@ -23,6 +23,12 @@ int main(int argc, char* argv[]) cols = Icur->width; for_each_job { + iFreeHandle(Icur); + fFreeHandle(v); + fFreeHandle(interestPnts); + fFreeHandle(int1); + fFreeHandle(int2); + fFreeHandle(Fcur); v = harris(Icur); interestPnts = getANMS(v, 24); int1 = fMallocHandle(interestPnts->height, 1); @@ -49,12 +55,6 @@ int main(int argc, char* argv[]) printf("Error in Stitch\n"); } #endif - iFreeHandle(Icur); - fFreeHandle(v); - fFreeHandle(interestPnts); - fFreeHandle(int1); - fFreeHandle(int2); - fFreeHandle(Fcur); WRITE_TO_FILE return 0; } diff --git a/SD-VBS/benchmarks/tracking/src/c/script_tracking.c b/SD-VBS/benchmarks/tracking/src/c/script_tracking.c index 2938126..c0af2d7 100644 --- a/SD-VBS/benchmarks/tracking/src/c/script_tracking.c +++ b/SD-VBS/benchmarks/tracking/src/c/script_tracking.c @@ -93,9 +93,8 @@ int main(int argc, char* argv[]) I2D* images[counter]; /** Read input image **/ - for(count=1; count<=counter; count++) - { - /** Read image **/ + for(count=1; count<=counter; count++){ + /** Read Image **/ scanf("%s", im1); images[count - 1] = readImage(im1); if(count == 1) Ic = readImage(im1); @@ -227,7 +226,6 @@ int main(int argc, char* argv[]) fFreeHandle(newpoints); } } - #ifdef CHECK /* Self checking */ { diff --git a/SD-VBS/common/makefiles/Makefile.common b/SD-VBS/common/makefiles/Makefile.common index 964ece6..ab3a6b4 100644 --- a/SD-VBS/common/makefiles/Makefile.common +++ b/SD-VBS/common/makefiles/Makefile.common @@ -18,7 +18,8 @@ endif endif CC=gcc -override CFLAGS += -DGCC -D$(INPUT) -pthread -I../../../../.. +LIBEXTRA ?= $(TOP_DIR)/../ +override CFLAGS += -DGCC -D$(INPUT) -pthread -I${LIBEXTRA} COMMON_DIR := $(TOP_DIR)/common/c M_COMMON := $(TOP_DIR)/common/matlab M_TOOLBOX=$(TOP_DIR)/common/toolbox @@ -28,8 +29,8 @@ PRELOAD_TIMES_DIR := $(TOP_DIR)/preload-times/$(BMARK) MTIMING_DIR := $(TOP_DIR)/cycles/$(BMARK) BMARK_DIR := $(TOP_DIR)/benchmarks/$(BMARK) TOOL_DIR := $(TOP_DIR)/tools -LIBLITMUS ?= /home/litmus/liblitmus -ifneq ($(shell grep "define LITMUS 1" ../../../../../extra.h),) +LIBLITMUS ?= /playpen/mc2/liblitmus +ifneq ($(shell grep "define LITMUS 1" ${TOP_DIR}/../extra.h),) override CFLAGS += -I${LIBLITMUS}/include -I${LIBLITMUS}/arch/arm/include override LDFLAGS += -L${LIBLITMUS} -llitmus endif @@ -60,7 +61,7 @@ COMMON_SRC := $(wildcard $(COMMON_DIR)/*.c) EXE = INCLUDES = -I$(COMMON_DIR) -I$(C_DIR) -COMPILE_C = $(CC) $(CFLAGS) $(LDFLAGS) $(INCLUDES) -O2 +COMPILE_C = $(CC) $(CFLAGS) $(INCLUDES) -O2 #COMPILE_C = $(CC) $(CFLAGS) -DGENERATE_OUTPUT -lm -O2 $(INCLUDES) COMPILE_G = $(CC) $(CFLAGS) -g -lm $(INCLUDES) COMPILE_PG = $(COMPILE_G) -pg @@ -111,7 +112,7 @@ compile-preload: compile: $(C_SRC) @echo @echo -e "Benchmark\t\t- $(BMARK)" - @$(COMPILE_C) $(COMMON_SRC) $(C_SRC) -lrt -lm -w -o $(BMARK)$(EXE) + @$(COMPILE_C) $(COMMON_SRC) $(C_SRC) -lrt -lm $(LDFLAGS) -w -o $(BMARK)$(EXE) compile-prof: $(C_SRC) @echo -- cgit v1.2.2