aboutsummaryrefslogtreecommitdiff
path: root/tools/benchmark_gendata_h48
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tools/benchmark_gendata_h48/benchmark_gendata_h48.c (renamed from benchmark/00_gendata_h48/gendata_h48_benchmark.c)17
1 files changed, 11 insertions, 6 deletions
diff --git a/benchmark/00_gendata_h48/gendata_h48_benchmark.c b/tools/benchmark_gendata_h48/benchmark_gendata_h48.c
index 1dc7c57..efb6f6f 100644
--- a/benchmark/00_gendata_h48/gendata_h48_benchmark.c
+++ b/tools/benchmark_gendata_h48/benchmark_gendata_h48.c
@@ -1,4 +1,4 @@
1#include "../benchmark.h" 1#include "../timerun.h"
2#include "../../src/cube.h" 2#include "../../src/cube.h"
3 3
4#define MAXDEPTH 10 4#define MAXDEPTH 10
@@ -6,10 +6,13 @@
6#define OPTIONS "2;10" 6#define OPTIONS "2;10"
7#define LONGOPTIONS "h = 2, max depth = 10" 7#define LONGOPTIONS "h = 2, max depth = 10"
8 8
9#define COCSEPSIZE 1119792
10#define ETABLESIZE(h) (((3393 * 495 * 70) >> 1) << (size_t)(h))
11
9char *buf; 12char *buf;
10 13
11void run(void) { 14void run(void) {
12 uint32_t *buf32; 15 uint32_t *h48info;
13 int i; 16 int i;
14 int64_t s; 17 int64_t s;
15 18
@@ -19,9 +22,9 @@ void run(void) {
19 printf("Error generating table\n"); 22 printf("Error generating table\n");
20 } else { 23 } else {
21 printf("Succesfully generated %" PRId64 " bytes. Table:\n", s); 24 printf("Succesfully generated %" PRId64 " bytes. Table:\n", s);
22 buf32 = (uint32_t *)&buf[s-sizeof(uint32_t)*(MAXDEPTH+1)]; 25 h48info = (uint32_t *)buf + (ETABLESIZE(HVALUE) + COCSEPSIZE) / 4;
23 for (i = 0; i <= MAXDEPTH; i++) 26 for (i = 0; i < MAXDEPTH+1; i++)
24 printf("%d:\t%" PRId32 "\n", i, buf32[i]); 27 printf("%d:\t%" PRIu32 "\n", i, h48info[i+1]);
25 } 28 }
26} 29}
27 30
@@ -36,7 +39,9 @@ int main() {
36 39
37 buf = malloc(size); 40 buf = malloc(size);
38 41
39 time_benchmark(run, "gendata_h48 " LONGOPTIONS); 42 timerun(run, "benchmark gendata_h48 " LONGOPTIONS);
43
44 free(buf);
40 45
41 return 0; 46 return 0;
42} 47}

Generated with cgit - Back to sebastiano.tronto.net