From 76cc82994c1fbb969ec61d3aede6bd42fda09005 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Thu, 12 Sep 2024 09:58:04 +0200 Subject: Cleanup gendata tools --- tools/001_gendata_h48h0k4/gendata_h48h0k4.c | 41 +++-------------------------- 1 file changed, 3 insertions(+), 38 deletions(-) (limited to 'tools/001_gendata_h48h0k4') diff --git a/tools/001_gendata_h48h0k4/gendata_h48h0k4.c b/tools/001_gendata_h48h0k4/gendata_h48h0k4.c index a9993b8..ff34bb9 100644 --- a/tools/001_gendata_h48h0k4/gendata_h48h0k4.c +++ b/tools/001_gendata_h48h0k4/gendata_h48h0k4.c @@ -1,14 +1,6 @@ #include "../tool.h" -#define MAXDEPTH 20 -#define HVALUE 0 -#define OPTIONS "0;4;20" -#define LONGOPTIONS "h = 0, k = 4, max depth = 20" - -#define COCSEPSIZE 1119792 -#define ETABLESIZE(h) (((3393 * 495 * 70) >> 1) << (size_t)(h)) - -uint32_t expected[21] = { +uint64_t expected[21] = { [0] = 1, [1] = 1, [2] = 4, @@ -24,41 +16,14 @@ uint32_t expected[21] = { [12] = 1673, }; -char *buf; - void run(void) { - int64_t s; - - s = nissy_gendata("h48", OPTIONS, buf); - - if (s == -1) { - printf("Error generating table\n"); - } else { - nissy_datainfo(buf, write_stdout); - printf("\n"); - printf("Succesfully generated %" PRId64 " bytes. " - "See above for details on the tables.\n", s); - - /* TODO: check that the table is correct */ - } + gendata_run("h48", "0;4;20", "tables/h48h0k4", expected); } int main(void) { - int64_t size; - nissy_setlogger(log_stderr); - size = nissy_datasize("h48", OPTIONS); - if (size == -1) { - printf("gendata_h48 benchmark: error in datasize\n"); - return 1; - } - - buf = malloc(size); - - timerun(run, "benchmark gendata_h48 " LONGOPTIONS); - - free(buf); + timerun(run, "benchmark gendata_h48 h = 0, k = 4"); return 0; } -- cgit v1.3