-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
144 lines (111 loc) · 4.16 KB
/
Makefile
File metadata and controls
144 lines (111 loc) · 4.16 KB
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
SPECFPRATE=503.bwaves_r 507.cactuBSSN_r 508.namd_r 510.parest_r 511.povray_r 519.lbm_r 521.wrf_r 526.blender_r 527.cam4_r 538.imagick_r 544.nab_r 549.fotonik3d_r 554.roms_r
SPECFPSPEED=603.bwaves_s 607.cactuBSSN_s 619.lbm_s 621.wrf_s 627.cam4_s 628.pop2_s 638.imagick_s 644.nab_s 649.fotonik3d_s 654.roms_s
SPECINTRATE=500.perlbench_r 502.gcc_r 505.mcf_r 520.omnetpp_r 523.xalancbmk_r 525.x264_r 531.deepsjeng_r 541.leela_r 548.exchange2_r 557.xz_r
SPECINTSPEED=600.perlbench_s 602.gcc_s 605.mcf_s 620.omnetpp_s 623.xalancbmk_s 625.x264_s 631.deepsjeng_s 641.leela_s 648.exchange2_s 657.xz_s
VALIDATE ?= 1
REPORT ?= 1
ARCH ?= $(shell uname -m)
export ARCH
SPEC_LITE ?= $(CURDIR)
export SPEC_LITE
create_log_dir = @mkdir -p $*/logs
TIMESTAMP := $(shell date +%Y%m%d_%H%M%S)
copy_fp_%:
@$(MAKE) -s -C $* copy-src
@echo "Copying source files for FP target: $*"
copy_int_%:
@$(MAKE) -s -C $* copy-src
@echo "Copying source files for INT target: $*"
copy_data_fp_%:
@$(MAKE) -s -C $* copy-data
@echo "Copying data files for FP target: $*"
copy_data_int_%:
@$(MAKE) -s -C $* copy-data
@echo "Copying data files for INT target: $*"
build_fp_%:
@$(call create_log_dir)
@$(MAKE) -s -C $* >> $*/logs/build_fp_$*_$(TIMESTAMP).log 2>&1
@echo "Building FP target: $*"
build_int_%:
@$(call create_log_dir)
@$(MAKE) -s -C $* SPECIFIC_FLAG=-ffp-contract=off >> $*/logs/build_fp_$*_$(TIMESTAMP).log 2>&1
@echo "Building INT target: $*"
clean_fp_%:
@$(MAKE) -s -C $* clean
@echo "Cleaning FP target: $*"
clean_int_%:
@$(MAKE) -s -C $* clean
@echo "Cleaning INT target: $*"
clean_src_fp_%:
@$(MAKE) -s -C $* clean-src
@echo "Cleaning source files for FP target: $*"
clean_src_int_%:
@$(MAKE) -s -C $* clean-src
@echo "Cleaning source files for INT target: $*"
clean_logs_fp_%:
@$(MAKE) -s -C $* clean-logs
@echo "Cleaning log files for FP target: $*"
clean_logs_int_%:
@$(MAKE) -s -C $* clean-logs
@echo "Cleaning log files for INT target: $*"
# Define the build and clean targets
build_fps: $(addprefix build_fp_, $(SPECFPSPEED))
build_ints: $(addprefix build_int_, $(SPECINTSPEED))
build_fpr: $(addprefix build_fp_, $(SPECFPRATE))
build_intr: $(addprefix build_int_, $(SPECINTRATE))
build_alls: build_ints build_fps
build_allr: build_intr build_fpr
clean_fps: $(addprefix clean_fp_, $(SPECFPSPEED))
clean_ints: $(addprefix clean_int_, $(SPECINTSPEED))
clean_fpr: $(addprefix clean_fp_, $(SPECFPRATE))
clean_intr: $(addprefix clean_int_, $(SPECINTRATE))
clean_alls: clean_ints clean_fps
clean_allr: clean_intr clean_fpr
clean_src_fpr: $(addprefix clean_src_fp_, $(SPECFPRATE))
clean_src_intr: $(addprefix clean_src_int_, $(SPECINTRATE))
clean_src_allr: clean_src_fpr clean_src_intr
copy_fpr: $(addprefix copy_fp_, $(SPECFPRATE))
copy_intr: $(addprefix copy_int_, $(SPECINTRATE))
copy_allr: copy_fpr copy_intr
copy_data_fp: $(addprefix copy_data_fp_, $(SPECFPRATE))
copy_data_int: $(addprefix copy_data_int_, $(SPECINTRATE))
copy_data_all: copy_data_fp copy_data_int
clean_logs_fpr: $(addprefix clean_logs_fp_, $(SPECFPRATE))
clean_logs_intr: $(addprefix clean_logs_int_, $(SPECINTRATE))
clean_logs_allr: clean_logs_fpr clean_logs_intr
# prototype: cmd_template(size)
define cmd_template
run-int-$(1): $(foreach t,$(SPECINTRATE),runeach-$t-$(1))
ifeq ($(REPORT),1)
echo "\n\n\n"
$(MAKE) report-int-$(1)
endif
validate-int-$(1):
for t in $$(SPECINTRATE); do $(MAKE) -s -C $$$$t $(1)-cmp; done
run-fp-$(1): $(foreach t,$(SPECFPRATE),runeach-$t-$(1))
ifeq ($(REPORT),1)
echo "\n\n\n"
$(MAKE) report-fp-$(1)
endif
run-all-$(1): $(foreach t,$(SPECINTRATE) $(SPECFPRATE),runeach-$t-$(1))
ifeq ($(REPORT),1)
echo "\n\n\n"
$(MAKE) report-int-$(1)
$(MAKE) report-fp-$(1)
endif
validate-fp-$(1):
for t in $$(SPECFPRATE); do $(MAKE) -s -C $$$$t $(1)-cmp; done
runeach-%-$(1):
echo "Running $(1) on $$*"
@$(MAKE) -s -C $$* run TYPE=$(1) > $$*/logs/run-$(1).log
ifeq ($(VALIDATE),1)
$(MAKE) validate-$$*-$(1)
endif
validate-%-$(1):
@$(MAKE) -s -C $$* $(1)-cmp
report-int-$(1):
@python scripts/report.py --input $(1) --spec int --run-tag "$(RUN_TAG)"
report-fp-$(1):
@python scripts/report.py --input $(1) --spec fp --run-tag "$(RUN_TAG)"
endef
$(eval $(foreach size,test train refrate,$(call cmd_template,$(size))))