-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
90 lines (73 loc) · 2.13 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# Compilation options
CXX = g++
CXXFLAGS = -std=c++11 -Wall -Wextra -Wpedantic -pedantic -O3
LDLIBS =
INCLUDES = -I. -I./libs
TARGET = lbmcl
# User defined options for tests
PLATFORM = 0
DEVICE = 0
DIM = 8
VISCOSITY = 0.0089
VELOCITY = 0.05
ITERATIONS = 10
EVERY = 1
LWS = 8,8,8
STRIDE = 8
PRECISION = single # single or double
OPTIMIZE = true
DUMP_PATH = ./results
DUMP_MAP = false
DUMP_F = false
RESULTS = ./results
TARGET_RES = ./target_results
ifeq ($(PRECISION),SINGLE)
MORE_FLAGS += -F
endif
ifeq ($(OPTIMIZE),true)
MORE_FLAGS += -o
endif
ifneq ($(DUMP_PATH),)
MORE_FLAGS += -p $(DUMP_PATH)
endif
ifeq ($(DUMP_MAP),true)
MORE_FLAGS += -m
endif
ifeq ($(DUMP_F),true)
MORE_FLAGS += -f
endif
ifeq ($(shell uname -s), Darwin)
PLATFORM = 0
DEVICE = 2
CXXFLAGS += -Wc++11-extensions -DCL_SILENCE_DEPRECATION
LDLIBS += -framework OpenCL
RESULTS = /Volumes/RamDisk
else
LDLIBS += -lOpenCL
endif
$(TARGET): main.cpp
$(CXX) -o $@ $^ $(LDLIBS) $(CXXFLAGS) $(INCLUDES)
test: $(TARGET)
@ $(RM) $(RESULTS)/map.dump
@ $(RM) $(RESULTS)/f_*.dump
@ $(RM) $(RESULTS)/lbmcl.*.vti
@ ./lbmcl -P$(PLATFORM) -D$(DEVICE) -d$(DIM) -n$(VISCOSITY) -u$(VELOCITY) -i$(ITERATIONS) -e$(EVERY) -w$(LWS) -s$(STRIDE) -v $(RESULTS) $(MORE_FLAGS)
testall: $(TARGET)
@ $(RM) $(RESULTS)/map.dump
@ $(RM) $(RESULTS)/f_*.dump
@ $(RM) $(RESULTS)/lbmcl.*.vti
@ ./lbmcl -P$(PLATFORM) -D$(DEVICE) -d$(DIM) -n$(VISCOSITY) -u$(VELOCITY) -i$(ITERATIONS) -e$(EVERY) -w$(LWS) -s$(STRIDE) -o -v $(RESULTS) -p $(RESULTS) -f -m
test8: $(TARGET)
@ $(RM) $(RESULTS)/map.dump
@ $(RM) $(RESULTS)/f_*.dump
@ $(RM) $(RESULTS)/lbmcl.*.vti
@ ./lbmcl -P$(PLATFORM) -D$(DEVICE) -d 8 -n 0.0089 -u 0.05 -i 10 -e 1 -w 8,8,8 -s 8 -v $(RESULTS) $(MORE_FLAGS)
@ python3 verify.py -i 10 -e 1 -t $(TARGET_RES)/8 -p $(RESULTS)
test32: $(TARGET)
@ $(RM) $(RESULTS)/map.dump
@ $(RM) $(RESULTS)/f_*.dump
@ $(RM) $(RESULTS)/lbmcl.*.vti
@ ./lbmcl -P$(PLATFORM) -D$(DEVICE) -d 32 -n 0.0089 -u 0.05 -i 500 -e 20 -w 32,32,1 -s 32 -v $(RESULTS) $(MORE_FLAGS)
@ python3 verify.py -i500 -e20 -t $(TARGET_RES)/32 -p $(RESULTS)
clean:
$(RM) $(TARGET) *.o *~ $(RESULTS)/*.dump $(RESULTS)/*.vti