From a3886552003d031acb9039e920b7c9ddce946ad6 Mon Sep 17 00:00:00 2001 From: Joshua Bakita Date: Sat, 17 Oct 2020 14:43:46 -0400 Subject: DIS fixes used for (rejected) RTSS'20 submission - All: Output times to stderr and nothing to stdout - Field, Update, Pointer: change definition of a job to match other stressmark execution times more closely - Matrix: move all allocations into main() - Update: Use volatile to prevent computations from being optimized out - Transitive: Use volatile to prevent computations from being optimized out - Neighborhood: Use working version of drawLineSegment from original DIS sample code --- dis/Neighborhood/neighborhood.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'dis/Neighborhood/neighborhood.c') diff --git a/dis/Neighborhood/neighborhood.c b/dis/Neighborhood/neighborhood.c index 1736d38..23f3a8e 100644 --- a/dis/Neighborhood/neighborhood.c +++ b/dis/Neighborhood/neighborhood.c @@ -11,6 +11,10 @@ * read the Benchmark Analysis and Specifications Document Version 1.0 * before going on since the detailed comments are given in this documents. * the comments are not repeated here. + * + * Change log: + * ------- ---------------- --------------------------------------------------- + * 06/2020 Joshua Bakita Include image creation time in timing */ #include @@ -58,12 +62,14 @@ int main(int argc, char** argv) randInit(seed); maxPixel = (1 << bitDepth) - 1; - image = createImage(dimension, maxPixel, numberLines, - minThickness, maxThickness); - assert (image != NULL); + image = malloc(sizeof(Pixel) * dimension * dimension); + assert(image != NULL); beginTime = time(NULL); START_LOOP + createImage(image, dimension, maxPixel, numberLines, + minThickness, maxThickness); + neighborhoodCalculation(image, dimension, distanceShort, distanceLong, &values, maxPixel); STOP_LOOP @@ -91,7 +97,7 @@ int main(int argc, char** argv) values.distLong.deg135.entropy, values.distLong.deg135.energy); - fprintf(stderr, "time for neghborhood stressmark = %f\n", + fprintf(stderr, "time for neghborhood stressmark = %f seconds.\n", difftime(endTime, beginTime)); free((Pixel *)image); -- cgit v1.2.2