diff options
Diffstat (limited to '')
| -rw-r--r-- | Makefile | 9 | ||||
| -rw-r--r-- | README.md | 14 | ||||
| -rwxr-xr-x | configure.sh | 18 |
3 files changed, 19 insertions, 22 deletions
| @@ -1,11 +1,16 @@ | |||
| 1 | include config.mk | 1 | # Set TYPE="AVX2" manually for advanced vector instructions |
| 2 | CUBETYPE = CUBE_${TYPE} | ||
| 2 | 3 | ||
| 4 | CFLAGS = -std=c99 -pthread -pedantic -Wall -Wextra -Wno-unused-parameter -O3 -mavx2 | ||
| 5 | DBGFLAGS = -DDEBUG -std=c99 -pthread -pedantic -Wall -Wextra -Wno-unused-parameter -Wno-unused-function -g3 -fsanitize=address -fsanitize=undefined -mavx2 | ||
| 6 | |||
| 7 | CC = cc | ||
| 3 | all: cube.o debugcube.o | 8 | all: cube.o debugcube.o |
| 4 | 9 | ||
| 5 | cube.o: clean | 10 | cube.o: clean |
| 6 | ${CC} -D${CUBETYPE} ${CFLAGS} -c -o cube.o src/cube.c | 11 | ${CC} -D${CUBETYPE} ${CFLAGS} -c -o cube.o src/cube.c |
| 7 | 12 | ||
| 8 | debugcube.o: | 13 | debugcube.o: clean |
| 9 | ${CC} -D${CUBETYPE} ${DBGFLAGS} -c -o debugcube.o src/cube.c | 14 | ${CC} -D${CUBETYPE} ${DBGFLAGS} -c -o debugcube.o src/cube.c |
| 10 | 15 | ||
| 11 | clean: | 16 | clean: |
| @@ -4,13 +4,23 @@ Work in progress. There is some documentation at the bottom of this page, | |||
| 4 | but do not believe it. Everything is in a state of flux and can change | 4 | but do not believe it. Everything is in a state of flux and can change |
| 5 | without notice. | 5 | without notice. |
| 6 | 6 | ||
| 7 | ## Running tests | 7 | ## Building and running tests |
| 8 | |||
| 9 | Tests: | ||
| 8 | 10 | ||
| 9 | ``` | 11 | ``` |
| 10 | $ ./configure.sh # Run 'TYPE=AVX2 ./configure.sh' to use AVX2 instead | ||
| 11 | $ make test | 12 | $ make test |
| 12 | ``` | 13 | ``` |
| 13 | 14 | ||
| 15 | Benchmarks: | ||
| 16 | |||
| 17 | ``` | ||
| 18 | $ make benchmark | ||
| 19 | ``` | ||
| 20 | |||
| 21 | Prefix each make instruction with `TYPE=AVX2` to try the AVX2 version | ||
| 22 | (e.g. `TYPE=AVX2 make benchmark`). | ||
| 23 | |||
| 14 | ## TODO: | 24 | ## TODO: |
| 15 | 25 | ||
| 16 | ### Cleanup / refactor | 26 | ### Cleanup / refactor |
diff --git a/configure.sh b/configure.sh deleted file mode 100755 index 17673fc..0000000 --- a/configure.sh +++ /dev/null | |||
| @@ -1,18 +0,0 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | CFLAGS="-std=c99 -pthread -pedantic -Wall -Wextra -Wno-unused-parameter -O3" | ||
| 4 | DBGFLAGS="-DDEBUG -std=c99 -pthread -pedantic -Wall -Wextra -Wno-unused-parameter -Wno-unused-function -g3 -fsanitize=address -fsanitize=undefined" | ||
| 5 | |||
| 6 | if [ "$TYPE" = "AVX2" ]; then | ||
| 7 | CFLAGS="$CFLAGS -mavx2" | ||
| 8 | DBGFLAGS="$DBGFLAGS -mavx2" | ||
| 9 | fi | ||
| 10 | |||
| 11 | { | ||
| 12 | echo "CUBETYPE = CUBE_$TYPE"; | ||
| 13 | echo ""; | ||
| 14 | echo "CFLAGS = $CFLAGS"; | ||
| 15 | echo "DBGFLAGS = $DBGFLAGS"; | ||
| 16 | echo ""; | ||
| 17 | echo "CC = cc" | ||
| 18 | } > config.mk | ||
