aboutsummaryrefslogtreecommitdiff
path: root/tools/002_gendata_h48h0k2
diff options
context:
space:
mode:
Diffstat (limited to 'tools/002_gendata_h48h0k2')
-rw-r--r--tools/002_gendata_h48h0k2/gendata_h48h0k2.c38
1 files changed, 3 insertions, 35 deletions
diff --git a/tools/002_gendata_h48h0k2/gendata_h48h0k2.c b/tools/002_gendata_h48h0k2/gendata_h48h0k2.c
index 271d339..14f99ee 100644
--- a/tools/002_gendata_h48h0k2/gendata_h48h0k2.c
+++ b/tools/002_gendata_h48h0k2/gendata_h48h0k2.c
@@ -1,11 +1,6 @@
1#include "../tool.h" 1#include "../tool.h"
2 2
3#define MAXDEPTH 20 3uint64_t expected[21] = {
4#define HVALUE 0
5#define OPTIONS "0;2;20"
6#define LONGOPTIONS "h = 0, k = 2, max depth = 20"
7
8uint32_t expected[21] = {
9 /* Base value is 8 */ 4 /* Base value is 8 */
10 [0] = 5473562, 5 [0] = 5473562,
11 [1] = 34776317, 6 [1] = 34776317,
@@ -13,41 +8,14 @@ uint32_t expected[21] = {
13 [3] = 8750867, 8 [3] = 8750867,
14}; 9};
15 10
16char *buf;
17
18void run(void) { 11void run(void) {
19 int64_t s; 12 gendata_run("h48", "0;2;20", "tables/h48h0k2", expected);
20
21 s = nissy_gendata("h48", OPTIONS, buf);
22
23 if (s == -1) {
24 printf("Error generating table\n");
25 } else {
26 nissy_datainfo(buf, write_stdout);
27 printf("\n");
28 printf("Succesfully generated %" PRId64 " bytes. "
29 "See above for details on the tables.\n", s);
30
31 /* TODO: check that the table is correct */
32 }
33} 13}
34 14
35int main(void) { 15int main(void) {
36 int64_t size;
37
38 nissy_setlogger(log_stderr); 16 nissy_setlogger(log_stderr);
39 17
40 size = nissy_datasize("h48", OPTIONS); 18 timerun(run, "benchmark gendata_h48 h = 0, k = 2");
41 if (size == -1) {
42 printf("gendata_h48 benchmark: error in datasize\n");
43 return 1;
44 }
45
46 buf = malloc(size);
47
48 timerun(run, "benchmark gendata_h48 " LONGOPTIONS);
49
50 free(buf);
51 19
52 return 0; 20 return 0;
53} 21}

Generated with cgit - Back to sebastiano.tronto.net