diff --git a/scratchpad/correlated/correlated b/scratchpad/correlated/correlated deleted file mode 100755 index 533ab80..0000000 Binary files a/scratchpad/correlated/correlated and /dev/null differ diff --git a/scratchpad/correlated/correlated.c b/scratchpad/correlated/correlated.c deleted file mode 100644 index cd53eae..0000000 --- a/scratchpad/correlated/correlated.c +++ /dev/null @@ -1,21 +0,0 @@ -// correlated samples - -#include "../../squiggle.h" -#include -#include -#include - -int main() -{ - // set randomness seed - uint32_t* seed = malloc(sizeof(uint32_t)); - *seed = 1000; // xorshift can't start with 0 - - float a = sample_to(1, 10, seed); - float b = 2 * a; - float c = a / b; - - printf("a: %f, b: %f, c: %f\n", a, b, c); - - free(seed); -} diff --git a/scratchpad/correlated/makefile b/scratchpad/correlated/makefile deleted file mode 100644 index 90a3e63..0000000 --- a/scratchpad/correlated/makefile +++ /dev/null @@ -1,53 +0,0 @@ -# Interface: -# make -# make build -# make format -# make run - -# Compiler -CC=gcc -# CC=tcc # <= faster compilation - -# Main file -SRC=correlated.c ../../squiggle.c -OUTPUT=correlated - -## Dependencies -MATH=-lm - -## Flags -DEBUG= #'-g' -STANDARD=-std=c99 -WARNINGS=-Wall -OPTIMIZED=-O3 #-Ofast -# OPENMP=-fopenmp - -## Formatter -STYLE_BLUEPRINT=webkit -FORMATTER=clang-format -i -style=$(STYLE_BLUEPRINT) - -## make build -build: $(SRC) - $(CC) $(OPTIMIZED) $(DEBUG) $(SRC) $(MATH) -o $(OUTPUT) - -format: $(SRC) - $(FORMATTER) $(SRC) - -run: $(SRC) $(OUTPUT) - OMP_NUM_THREADS=1 ./$(OUTPUT) && echo - -time-linux: - @echo "Requires /bin/time, found on GNU/Linux systems" && echo - - @echo "Running 100x and taking avg time $(OUTPUT)" - @t=$$(/usr/bin/time -f "%e" -p bash -c 'for i in {1..100}; do $(OUTPUT); done' 2>&1 >/dev/null | grep real | awk '{print $$2}' ); echo "scale=2; 1000 * $$t / 100" | bc | sed "s|^|Time using 1 thread: |" | sed 's|$$|ms|' && echo - -## Profiling - -profile-linux: - echo "Requires perf, which depends on the kernel version, and might be in linux-tools package or similar" - echo "Must be run as sudo" - $(CC) $(SRC) $(MATH) -o $(OUTPUT) - sudo perf record ./$(OUTPUT) - sudo perf report - rm perf.data diff --git a/scratchpad/uncorrelated/makefile b/scratchpad/uncorrelated/makefile deleted file mode 100644 index bf9f32d..0000000 --- a/scratchpad/uncorrelated/makefile +++ /dev/null @@ -1,53 +0,0 @@ -# Interface: -# make -# make build -# make format -# make run - -# Compiler -CC=gcc -# CC=tcc # <= faster compilation - -# Main file -SRC=uncorrelated.c ../../squiggle.c -OUTPUT=uncorrelated - -## Dependencies -MATH=-lm - -## Flags -DEBUG= #'-g' -STANDARD=-std=c99 -WARNINGS=-Wall -OPTIMIZED=-O3 #-Ofast -# OPENMP=-fopenmp - -## Formatter -STYLE_BLUEPRINT=webkit -FORMATTER=clang-format -i -style=$(STYLE_BLUEPRINT) - -## make build -build: $(SRC) - $(CC) $(OPTIMIZED) $(DEBUG) $(SRC) $(MATH) -o $(OUTPUT) - -format: $(SRC) - $(FORMATTER) $(SRC) - -run: $(SRC) $(OUTPUT) - OMP_NUM_THREADS=1 ./$(OUTPUT) && echo - -time-linux: - @echo "Requires /bin/time, found on GNU/Linux systems" && echo - - @echo "Running 100x and taking avg time $(OUTPUT)" - @t=$$(/usr/bin/time -f "%e" -p bash -c 'for i in {1..100}; do $(OUTPUT); done' 2>&1 >/dev/null | grep real | awk '{print $$2}' ); echo "scale=2; 1000 * $$t / 100" | bc | sed "s|^|Time using 1 thread: |" | sed 's|$$|ms|' && echo - -## Profiling - -profile-linux: - echo "Requires perf, which depends on the kernel version, and might be in linux-tools package or similar" - echo "Must be run as sudo" - $(CC) $(SRC) $(MATH) -o $(OUTPUT) - sudo perf record ./$(OUTPUT) - sudo perf report - rm perf.data diff --git a/scratchpad/uncorrelated/uncorrelated b/scratchpad/uncorrelated/uncorrelated deleted file mode 100755 index 2ba1a2c..0000000 Binary files a/scratchpad/uncorrelated/uncorrelated and /dev/null differ diff --git a/scratchpad/uncorrelated/uncorrelated.c b/scratchpad/uncorrelated/uncorrelated.c deleted file mode 100644 index 4fbe05d..0000000 --- a/scratchpad/uncorrelated/uncorrelated.c +++ /dev/null @@ -1,24 +0,0 @@ -// uncorrelated samples - -#include "../../squiggle.h" -#include -#include -#include - -float draw_xyz(uint32_t* seed){ - // function could also be placed inside main with gcc nested functions extension. - return sample_to(1, 20, seed); -} - -int main(){ - // set randomness seed - uint32_t* seed = malloc(sizeof(uint32_t)); - *seed = 1000; // xorshift can't start with 0 - - float a = draw_xyz(seed); - float b = 2 * draw_xyz(seed); - float c = b / a; - - printf("a: %f, b: %f, c: %f\n", a, b, c); - -}