-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
60 lines (51 loc) · 1.34 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
58
59
60
CC = gcc
SOURCE = quicksort.c
EXE = quicksort
CFLAGS = -Wall -O3 -ffast-math -march=native -lpthread
N = 100000000 # input size
INPUT_DIR = input
INPUT = $(INPUT_DIR)/$(N)
T = 1 # number of threads
S = 1 # pivot strategy {1, 2, 3}
DIST = 0 # distribution strategy {0, 1, 2, 3}
SEED = 0 # rand seed, 0 = currennt time
DFLAGS =
DEBUG = 0
ifeq ($(DEBUG), 1)
CFLAGS += -g
endif
CHECK_SORTED = 0
ifeq ($(CHECK_SORTED), 1)
DFLAGS += -DCHECK_SORTED
endif
CHECK_COMPLETE = 0
ifeq ($(CHECK_COMPLETE), 1)
DFLAGS += -DCHECK_COMPLETE
endif
$(EXE): $(SOURCE)
$(CC) $(SOURCE) -o $(EXE) $(CFLAGS) $(DFLAGS)
run: $(EXE)
./$(EXE) $(N) $(INPUT) $(T) $(S)
# @echo "N = $(N)"
# @echo "DIST,S,T,t"
time: $(EXE)
@for S in 1 2 3 ; do \
for T in 1 2 4 8 16 32 ; do \
echo -n "$(DIST),$$S,$$T," ; \
./$(EXE) $(N) $(INPUT) $$T $SS; \
echo -n "$(DIST),$$S,$$T," ; \
./$(EXE) $(N) $(INPUT) $$T $SS; \
echo -n "$(DIST),$$S,$$T," ; \
./$(EXE) $(N) $(INPUT) $$T $SS; \
done \
done
vecinfo: $(SOURCE)
$(CC) $(SOURCE) -o $(EXE) $(CFLAGS) $(DFLAGS) -fopt-info-vec
generator: generator.c
$(CC) generator.c -o generator $(CFLAGS)
generate: generator
mkdir -p $(INPUT_DIR)
./generator $(N) $(INPUT_DIR) $(DIST) $(SEED)
clean:
rm -f $(EXE) generator
rm -rf $(INPUT_DIR)