aboutsummaryrefslogtreecommitdiff
path: root/benchmark/00_gendata_h48
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2024-06-13 22:28:49 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2024-06-13 22:28:49 +0200
commitc04a283a7ab97903683f5f7268068aef69f5bddf (patch)
tree9809c4a71c2ad1a5123371c32c34f03b1b703ecf /benchmark/00_gendata_h48
parent7812684339d03f6993882358b0045c1bc2d5032c (diff)
downloadnissy-core-c04a283a7ab97903683f5f7268068aef69f5bddf.tar.gz
nissy-core-c04a283a7ab97903683f5f7268068aef69f5bddf.zip
Added benchmark; removed old folder
Diffstat (limited to 'benchmark/00_gendata_h48')
-rw-r--r--benchmark/00_gendata_h48/gendata_h48_benchmark.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/benchmark/00_gendata_h48/gendata_h48_benchmark.c b/benchmark/00_gendata_h48/gendata_h48_benchmark.c
new file mode 100644
index 0000000..1dc7c57
--- /dev/null
+++ b/benchmark/00_gendata_h48/gendata_h48_benchmark.c
@@ -0,0 +1,42 @@
1#include "../benchmark.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
9char *buf;
10
11void run(void) {
12 uint32_t *buf32;
13 int i;
14 int64_t s;
15
16 s = nissy_gendata("H48", OPTIONS, buf);
17
18 if (s == -1) {
19 printf("Error generating table\n");
20 } else {
21 printf("Succesfully generated %" PRId64 " bytes. Table:\n", s);
22 buf32 = (uint32_t *)&buf[s-sizeof(uint32_t)*(MAXDEPTH+1)];
23 for (i = 0; i <= MAXDEPTH; i++)
24 printf("%d:\t%" PRId32 "\n", i, buf32[i]);
25 }
26}
27
28int main() {
29 int64_t size;
30
31 size = nissy_datasize("H48", OPTIONS);
32 if (size == -1) {
33 printf("gendata_h48 benchmark: error in datasize\n");
34 return 1;
35 }
36
37 buf = malloc(size);
38
39 time_benchmark(run, "gendata_h48 " LONGOPTIONS);
40
41 return 0;
42}

Generated with cgit - Back to sebastiano.tronto.net