forked from vtsynergy/OpenDwarfs
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile.am
executable file
·208 lines (174 loc) · 5.64 KB
/
Makefile.am
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
#
# Copyright 2010 by Virginia Polytechnic Institute and State
# University. All rights reserved. Virginia Polytechnic Institute and
# State University (Virginia Tech) owns the software and its
# associated documentation.
#
AUTOMAKE_OPTIONS = subdir-objects
ACLOCAL_AMFLAGS = -I m4
#AM_CPPFLAGS = -Werror
bin_PROGRAMS =
all_local =
exec_local =
testruns =
platform_n = 0
device_n = 0
device_t = 0
bin_PROGRAMS += ocd
ocd_SOURCES = include/common_args.c include/rdtsc.c include/lsb.h include/portable_memory.h include/portable_memory.c
ocd_LINK = true
noinst_LIBRARIES = libopts.a
libopts_a_SOURCES = opts/opts.c
LDADD = include/common_args.o include/rdtsc.o include/portable_memory.o libopts.a
#to use libscibench for timing:
#build libscibench from the git repository:
##git clone https://github.com/SalvatoreDiGirolamo/liblsb.git
##cd liblsb
##./configure --prefix=$(pwd)/build/ --without-mpi --without-papi
#and rename the build directory to libscibench and place it in the top level of
#the OpenDwarf directory
#finally configure with the following argument:
##../configure --enable-libscibench
if libscibench
DUMMY=dummy
else
ocd_SOURCES += include/lsb.c
LDADD += include/lsb.o
endif
if build_gem
include n-body-methods/gem/Makefile.mk
testruns += gem
endif
if build_nw
include dynamic-programming/nw/Makefile.mk
testruns += nw
endif
if build_swat
include dynamic-programming/swat/Makefile.mk
testruns += swat
endif
if build_srad
include structured-grids/srad/Makefile.mk
testruns += srad
endif
if build_lud
include dense-linear-algebra/lud/Makefile.mk
testruns += lud
endif
if build_kmeans
include mapreduce/kmeans/Makefile.mk
testruns += kmeans
endif
if build_samplecl
include samplecl/Makefile.mk
testruns += samplecl
endif
if build_fft
include spectral-methods/fft/Makefile.mk
testruns += fft
endif
if build_openclfft
include spectral-methods/OpenCLfft2/Makefile.mk
testruns += openclfft
endif
if build_dwt2d
include spectral-methods/dwt2d/Makefile.mk
testruns += dwt2d
endif
if build_csr
include sparse-linear-algebra/SPMV/Makefile.mk
testruns += csr
endif
if build_crc
include combinational-logic/crc/Makefile.mk
testruns += crc
endif
if build_cfd
include unstructured-grids/cfd/Makefile.mk
testruns += cfd
endif
if build_bfs
include graph-traversal/bfs/Makefile.mk
testruns += bfs
endif
#if build_bsort
#include graph-traversal/bitonic-sort/Makefile.mk
#endif
#if build_oesort
#include graph-traversal/oddeven-sort/Makefile.mk
#endif
if build_tdm
include finite-state-machine/tdm/Makefile.mk
testruns += tdm
endif
if build_nqueens
include branch-and-bound/nqueens/Makefile.mk
testruns += nqueens
endif
if build_bwa_hmm
include graphical-models/hmm/Makefile.mk
testruns += bwa_hmm
endif
all-local: $(all_local)
install-exec-local: $(exec_local)
test-run:
@if [ $(device_t) -gt 3 ]; then \
##NO CHECKING FOR PLATFORM_ID and DEVICE_ID.
echo "Wrong device type number. Enter make run-test platform_n=<PLATFORM_ID> device_n=<DEVICE_ID> device_t=<DEVICE_TYPE>, where:"; \
echo "PLATFORM_ID and DEVICE_ID must be valid OpenCL platform and device IDs and DEVICE_TYPE can be:"; \
echo "0 => CPU"; \
echo "1 => GPU"; \
echo "2 => MIC"; \
echo "3 => FPGA"; \
echo "(Values for omitted options are set to zero.)"; \
exit 9; \
fi
@echo "Running tests for the following dwarfs: $(testruns)";
@$(foreach dwarf_test,$(testruns),$(call run_dwarf_test, $(dwarf_test)))
define run_dwarf_test
if [ $(1) = "gem" ]; then \
echo "Running gem..."; \
./gemnoui -p $(platform_n) -d $(device_n) -t $(device_t) -- ../test/n-body-methods/gem/nucleosome 80 1 0; \
elif [ $(1) = "nw" ]; then \
echo "Running nw..."; \
./needle -p $(platform_n) -d $(device_n) -t $(device_t) -- 2048 10; \
elif [ $(1) = "swat" ]; then \
echo "Running swat..."; \
./swat -p $(platform_n) -d $(device_n) -t $(device_t) -- ../test/dynamic-programming/swat/query1K1 ../test/dynamic-programming/swat/sampledb1K1; \
elif [ $(1) = "srad" ]; then \
echo "Running srad..."; \
./srad -p $(platform_n) -d $(device_n) -t $(device_t) -- 256 256 0 127 0 127 0.5 2; \
elif [ $(1) = "lud" ]; then \
echo "Running lud..."; \
./lud -p $(platform_n) -d $(device_n) -t $(device_t) -- -i ../test/dense-linear-algebra/lud/3072.dat; \
elif [ $(1) = "kmeans" ]; then \
echo "Running kmeans..."; \
./kmeans -p $(platform_n) -d $(device_n) -t $(device_t) -- -i ../test/dense-linear-algebra/kmeans/204800.txt; \
elif [ $(1) = "fft" ]; then \
echo "Running fft..."; \
./clfft -p $(platform_n) -d $(device_n) -t $(device_t) -- --pts 1; \
elif [ $(1) = "csr" ]; then \
echo "Running csr..."; \
./csr -p $(platform_n) -d $(device_n) -t $(device_t) -- -i ../test/sparse-linear-algebra/SPMV/csr_65536.txt; \
elif [ $(1) = "crc" ]; then \
echo "Running crc..."; \
./crc -p $(platform_n) -d $(device_n) -t $(device_t) -- -i ../test/combinational-logic/crc/crc_1000x8192.txt; \
elif [ $(1) = "cfd" ]; then \
echo "Running cfd..."; \
./cfd -p $(platform_n) -d $(device_n) -t $(device_t) -- ../test/unstructured-grids/cfd/fvcorr.domn.097K; \
elif [ $(1) = "bfs" ]; then \
echo "Running bfs..."; \
./bfs -p $(platform_n) -d $(device_n) -t $(device_t) -- ../test/graph-traversal/bfs/graph65536.txt; \
elif [ $(1) = "tdm" ]; then \
echo "Running tdm..."; \
./tdm -p $(platform_n) -d $(device_n) -t $(device_t) -- ../test/finite-state-machine/tdm/sim-64-size200.csv ../test/finite-state-machine/tdm/ivl.txt ../test/finite-state-machine/tdm/30-episodes.txt 128; \
elif [ $(1) = "nqueens" ]; then \
echo "Running nqueens..."; \
./nqueens -p $(platform_n) -d $(device_n) -t $(device_t) -- 16; \
elif [ $(1) = "bwa_hmm" ]; then \
echo "Running bwa_hmm..."; \
./bwa_hmm -p $(platform_n) -d $(device_n) -t $(device_t) -- -n 30 -v n; \
fi
endef
clean-local:
rm -f *.cl