aboutsummaryrefslogtreecommitdiff
path: root/include/cnn1986_cache.h
diff options
context:
space:
mode:
authortslil clingman <tslil@posteo.de>2021-01-22 13:36:32 -0500
committertslil <tslil@posteo.de>2026-08-28 19:37:41 +0100
commite6a5b63bbeb36ff9d9d5f2c002395012a0d41fdf (patch)
tree36419c24a19ea6a7ec511cd67a54d9229d67ae1c /include/cnn1986_cache.h
parent703c875144bb365e6448b41493aa0d6615e10520 (diff)
Trying caching to speed things up
Diffstat (limited to 'include/cnn1986_cache.h')
-rw-r--r--include/cnn1986_cache.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/cnn1986_cache.h b/include/cnn1986_cache.h
new file mode 100644
index 0000000..8d82ee9
--- /dev/null
+++ b/include/cnn1986_cache.h
@@ -0,0 +1,18 @@
+#include <stdlib.h>
+#include <tak.h>
+
+#define MAX_NUM_CACHED 123
+
+extern uint32_t cnn1986_num_cached, cnn1986_max_num_cached;
+
+typedef struct node_s {
+ struct node_s *next, *prev;
+ uint16_t data[25], white_count, black_count;
+ float result;
+} node_t;
+
+int cnn1986_cache_init(void);
+void cnn1986_cache_free(void);
+
+int cnn1986_cache_seek(float *out_result);
+int cnn1986_cache_insert(float in_result);