squiggle.c/makefile

36 lines
1.2 KiB
Makefile
Raw Normal View History

MAKEFLAGS += --no-print-directory
2023-07-23 10:44:16 +00:00
## Formatter
STYLE_BLUEPRINT=webkit
FORMATTER=clang-format -i -style=$(STYLE_BLUEPRINT)
2024-01-12 19:41:06 +00:00
## Time to botec
TTB=./examples/more/12_time_to_botec_parallel/example
2023-11-18 21:07:12 +00:00
build-examples:
2023-11-19 14:48:16 +00:00
cd examples/core && make all
cd examples/more && make all
2023-11-18 21:07:12 +00:00
format-examples:
2023-11-19 14:48:16 +00:00
cd examples/core && make format-all
cd examples/more && make format-all
2023-07-23 10:44:16 +00:00
format: squiggle.c squiggle.h
$(FORMATTER) squiggle.c squiggle.h
$(FORMATTER) squiggle_more.c squiggle_more.h
2023-07-23 10:44:16 +00:00
lint:
clang-tidy squiggle.c -- -lm
2023-11-30 00:00:11 +00:00
clang-tidy squiggle_more.c -- -lm
2024-01-12 18:02:41 +00:00
profile:
2024-01-13 00:05:44 +00:00
sudo perf record -g ./examples/more/12_time_to_botec_parallel/example
2024-01-12 18:02:41 +00:00
sudo perf report
rm perf.data
2024-01-13 00:05:44 +00:00
sudo perf stat ./examples/more/12_time_to_botec_parallel/example
2024-01-12 18:02:41 +00:00
2024-01-12 19:41:06 +00:00
time-linux:
2024-01-13 00:05:44 +00:00
gcc -O3 -Wall -Wextra -Wdouble-promotion -Wconversion examples/more/12_time_to_botec_parallel/example.c squiggle.c squiggle_more.c -lm -fopenmp -o examples/more/12_time_to_botec_parallel/example
2024-01-12 19:41:06 +00:00
@echo "Running 100x and taking avg time: $(TTB)"
2024-01-13 00:05:44 +00:00
@t=$$(/usr/bin/time -f "%e" -p bash -c 'for i in {1..100}; do OMP_PROC_BIND=TRUE $(TTB); done' 2>&1 >/dev/null | grep real | awk '{print $$2}' ); echo "scale=2; 1000 * $$t / 100" | bc | sed "s|^|Time using 16 threads: |" | sed 's|$$|ms|' && echo