From d17b33131c14864bd1eae275f49a3f148e21cf29 Mon Sep 17 00:00:00 2001 From: Leo Chan Date: Thu, 22 Oct 2020 01:53:21 -0400 Subject: Squashed commit of the sb-vbs branch. Includes the SD-VBS benchmarks modified to: - Use libextra to loop as realtime jobs - Preallocate memory before starting their main computation - Accept input via stdin instead of via argc Does not include the SD-VBS matlab code. Fixes libextra execution in LITMUS^RT. --- SD-VBS/benchmarks/multi_ncut/src/c/segment.h | 46 ++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 SD-VBS/benchmarks/multi_ncut/src/c/segment.h (limited to 'SD-VBS/benchmarks/multi_ncut/src/c/segment.h') diff --git a/SD-VBS/benchmarks/multi_ncut/src/c/segment.h b/SD-VBS/benchmarks/multi_ncut/src/c/segment.h new file mode 100644 index 0000000..73ed8de --- /dev/null +++ b/SD-VBS/benchmarks/multi_ncut/src/c/segment.h @@ -0,0 +1,46 @@ +/******************************** +Author: Sravanthi Kota Venkata +********************************/ + +#ifndef SEGMENT +#define SEGMENT + +#include "sdvbs_common.h" + +typedef struct +{ + float w; + int a, b; +} edge; + +typedef struct +{ + int rank; + int p; + int size; +} uni_elt; + +typedef struct +{ + uni_elt *elts; + int num; +}universe; + +/* use imRef to access image data. */ +#define imRef(im, x, y) (im->data[y*im->width+x]) + +I2D *segment_image(I2D *im, float sigma, float c, int min_size, int *num_ccs, + int* segments, edge* edges, + F2D* imageOut, F2D* tempOut, I2D* kernel, F2D* edgeWeights, F2D* in, I2D* ind, + universe* u, + I2D* output); +universe *segment_graph(int num_vertices, int num_edges, edge *edges, float c, F2D* edgeWeights, F2D* in, I2D* ind, + universe* u); +void join(universe* u, int x, int y); +int find(universe* u, int x); +float diff(F2D *r, int x1, int y1, int x2, int y2); + + +#endif + + -- cgit v1.2.2