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

Generated with cgit - Back to sebastiano.tronto.net