commit bc2e6b8a8d5a6eccd2c2ac433e8a307ee356f14e
parent 80ec600701aae54350679bbf5e0ce874c915506e
Author: Sebastiano Tronto <sebastiano@tronto.net>
Date: Tue, 31 Oct 2023 19:01:46 +0100
Small change to benchmark script + TODO comments
Diffstat:
3 files changed, 32 insertions(+), 4 deletions(-)
diff --git a/.gitignore b/.gitignore
@@ -1,5 +1,5 @@
config.mk
-benchmark/results.txt
+benchmark/results
benchmark/run
test/*/runtest
test/run
diff --git a/README.md b/README.md
@@ -16,6 +16,32 @@ $ make test
* inverse_move
* inverse_trans
+### Simple additions
+
+* Write to AVX2-src format
+* move() that takes a string (alg) as input
+
+### Changes
+
+* write one function (static inline or public?) for each move (and trans)
+* only call the specific functions in performance-critical steps (i.e. solve
+ - if the functions are static inline, all performance-critical steps must
+ be internal to cube.c)
+* this also enables skipping some unnecessary work (e.g. flip edges, twist
+ corners) for many moves (and mirror transformations)
+* add benchmarks with moves / trans called directly instead of via the
+ generic function
+* keep generic move and trans functions with big switch case
+* bring back constants into cube.c, and maybe also moves (TBD: what to
+ do with architecture-specific code? leave in separate files like now,
+ use just one file for each architecture...)
+
+### Documentation and interface
+
+* remove the constant #define's from cube.h (write a comment instead)
+* reconsider content of cube.h, remove some stuff
+* remove doc folder, inline documentation as comments in cube.h or cube.c
+
### AVX2
* fix base get_ and set_ macros (constant arguments?)
diff --git a/benchmark/bench.sh b/benchmark/bench.sh
@@ -1,14 +1,16 @@
#!/bin/sh
BENCHBIN="benchmark/run"
-BENCHOUT="benchmark/results.txt"
+BENCHDIR="benchmark/results"
CUBEOBJ="cube.o"
cc -std=c99 -pthread -O3 -o $BENCHBIN benchmark/bench.c $CUBEOBJ || exit 1;
-$BENCHBIN | tee $BENCHOUT
+d="$(date +'%Y-%m-%d-%H-%M-%S')"
+mkdir -p "$BENCHDIR"
+$BENCHBIN | tee "$BENCHDIR/results-$d.txt" "$BENCHDIR/results.txt"
echo ""
-echo "Results saved to $BENCHOUT"
+echo "Results saved to $BENCHDIR/results.txt"
rm -rf $BENCHBIN $CUBEOBJ