-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathMakefile
57 lines (43 loc) · 1.58 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
.SUFFIXES:
.PHONY: all clean
FLAGS=-std=c++11 -mbmi2 -Wall -pedantic -Wextra
FLAGS_AVX512=$(FLAGS) -mavx512f -DHAVE_AVX512F_INSTRUCTIONS -DHAVE_AVX2_INSTRUCTIONS
FLAGS_AVX2=$(FLAGS) -mavx2 -DHAVE_AVX2_INSTRUCTIONS
DEPS_SORT=partition.cpp \
avx2-partition.cpp \
avx2-quicksort.cpp \
avx2-altquicksort.h \
avx2-natenodutch-quicksort.h \
avx2-nate-quicksort.cpp \
avx512-swap.cpp \
avx512-partition.cpp \
avx512-auxbuffer-partition.cpp \
avx512-bmi2-partition.cpp \
avx512-popcnt-partition.cpp \
avx512-quicksort.cpp \
avx512-sort-register.cpp \
avx512-partition-register.cpp \
quicksort.cpp
SPEED_DEPS=$(DEPS_SORT) speed.cpp gettime.cpp rdtsc.cpp runtime_stats.cpp
SPEED_FLAGS=-O3 -DNDEBUG
ALL=test speed test_avx2 speed_avx2 speed_stats speed_avx2_stats
all: $(ALL)
test: test.cpp input_data.cpp $(DEPS_SORT)
$(CXX) $(FLAGS_AVX512) -fsanitize=address test.cpp -o $@
test_avx2: test.cpp input_data.cpp $(DEPS_SORT)
#$(CXX) $(FLAGS_AVX2) -fsanitize=address test.cpp -o $@
$(CXX) $(FLAGS_AVX2) test.cpp -o $@
speed: $(SPEED_DEPS)
$(CXX) $(FLAGS_AVX512) $(SPEED_FLAGS) speed.cpp -o $@
speed_avx2: $(SPEED_DEPS)
$(CXX) $(FLAGS_AVX2) $(SPEED_FLAGS) speed.cpp -o $@
speed_stats: $(SPEED_DEPS)
$(CXX) $(FLAGS_AVX512) $(SPEED_FLAGS) -DWITH_RUNTIME_STATS speed.cpp -o $@
speed_avx2_stats: $(SPEED_DEPS)
$(CXX) $(FLAGS_AVX2) $(SPEED_FLAGS) -DWITH_RUNTIME_STATS speed.cpp -o $@
run: test
sde -cnl -- ./$^
run_avx2: test_avx2
sde -cnl -- ./$^
clean:
rm -f $(ALL)