-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
193 lines (170 loc) · 4.41 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
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
TOP=.
TARGETS = test quick dftgen voronenko maple opcount opcounts search moddftgen
.PHONY : all
all : $(TARGETS)
include mk/common.mk
#
# GHC flags
#
GHCFLAGS += \
-hide-all-packages \
-package arithmoi \
-package base \
-package bytestring \
-package containers \
-package directory \
-package exception-mtl \
-package exception-transformers \
-package filepath \
-package hspec \
-package hspec-core \
-package language-c-quote \
-package libltdl \
-package logict \
-package mainland-pretty \
-package modular-arithmetic \
-package mtl \
-package poly \
-package primitive \
-package process \
-package random \
-package ref-fd \
-package semirings \
-package srcloc \
-package symbol \
-package temporary \
-package text \
-package transformers \
-package vector \
-package vector-fftw \
-package HUnit \
-package QuickCheck
#
# Source locations
#
SRC = \
Data/Complex/Cyclotomic.hs \
Data/FlagSet.hs \
Data/Heterogeneous.hs \
Data/Modular/Instances.hs \
Spiral.hs \
Spiral/Array.hs \
Spiral/Array/Base.hs \
Spiral/Array/Computable.hs \
Spiral/Array/Mutable.hs \
Spiral/Array/Operators/Mapping.hs \
Spiral/Array/Operators/Matrix.hs \
Spiral/Array/Operators/Permute.hs \
Spiral/Array/Operators/Reduction.hs \
Spiral/Array/Repr/Complex.hs \
Spiral/Array/Repr/Compute.hs \
Spiral/Array/Repr/Concrete.hs \
Spiral/Array/Repr/Hidden.hs \
Spiral/Array/Repr/Slice.hs \
Spiral/Array/Repr/Transform.hs \
Spiral/Array/Repr/Virtual.hs \
Spiral/Array/Shape.hs \
Spiral/Backend/C.hs \
Spiral/Backend/C/CExp.hs \
Spiral/Backend/C/Code.hs \
Spiral/Backend/C/Monad.hs \
Spiral/Backend/C/Util.hs \
Spiral/Config.hs \
Spiral/Convolution.hs \
Spiral/Convolution/ConvolutionTheorem.hs \
Spiral/Convolution/Core.hs \
Spiral/Convolution/Standard.hs \
Spiral/Convolution/Tensor.hs \
Spiral/Convolution/ToomCook.hs \
Spiral/Convolution/Winograd.hs \
Spiral/Driver.hs \
Spiral/Driver/Monad.hs \
Spiral/Driver/Opts.hs \
Spiral/Exp.hs \
Spiral/FFT/Bluestein.hs \
Spiral/FFT/CooleyTukey.hs \
Spiral/FFT/GoodThomas.hs \
Spiral/FFT/Rader.hs \
Spiral/FFT/Winograd.hs \
Spiral/Globals.hs \
Spiral/Monad.hs \
Spiral/NumberTheory.hs \
Spiral/OpCount.hs \
Spiral/Permutation.hs \
Spiral/Program.hs \
Spiral/Program/Monad.hs \
Spiral/Program/Monad.hs-boot \
Spiral/Program/Syntax.hs \
Spiral/RootOfUnity.hs \
Spiral/SPL.hs \
Spiral/SPL/Run.hs \
Spiral/Search.hs \
Spiral/Search/FFTBreakdowns.hs \
Spiral/Search/Monad.hs \
Spiral/Search/OpCount.hs \
Spiral/Search/SFKT.hs \
Spiral/Util/Name.hs \
Spiral/Util/Pretty.hs \
Spiral/Util/Pretty/Maple.hs \
Spiral/Util/Trace.hs \
Spiral/Util/Uniq.hs
TESTSRC = \
src/test/Test/Codegen.hs \
src/test/Test/Convolution.hs \
src/test/Test/FFTW.hs \
src/test/Test/Factorization.hs \
src/test/Test/Gen.hs \
src/test/Test/Instances.hs \
src/test/Test/Opcount.hs \
src/test/Test/SPL.hs
#
# all, clean, and distclean targets
#
.PHONY : clean
clean :
$(_QUIET)rm -rf $(TARGETS) obj
.PHONY : distclean
distclean : clean
$(_QUIET)rm -rf dist
test : src/test/Main.hs $(SRC) $(TESTSRC)
@mkdir -p obj
$(_QUIET)$(GHC) $(GHCFLAGS) --make $< -isrc/test -odir obj -hidir obj -o $@
quick : src/test/Quick.hs $(SRC) $(TESTSRC)
@mkdir -p obj
$(_QUIET)$(GHC) $(GHCFLAGS) --make $< -isrc/test -odir obj -hidir obj -o $@
dftgen : examples/DFTGen.hs $(SRC)
@mkdir -p obj
$(_QUIET)$(GHC) $(GHCFLAGS) --make $< -odir obj -hidir obj -o $@
dftgen.prof : dftgen
@mkdir -p obj
$(_QUIET)$(GHC) $(GHCFLAGS) --make examples/DFTGen.hs -odir obj -hidir obj \
-prof -auto-all -caf-all -osuf p_o -hisuf p_hi -hcsuf p_hc -o $@
voronenko : examples/Voronenko.hs $(SRC)
@mkdir -p obj
$(_QUIET)$(GHC) $(GHCFLAGS) --make $< -odir obj -hidir obj -o $@
maple : examples/Maple.hs $(SRC)
@mkdir -p obj
$(_QUIET)$(GHC) $(GHCFLAGS) --make $< -odir obj -hidir obj -o $@
opcount : examples/OpCount.hs $(SRC)
@mkdir -p obj
$(_QUIET)$(GHC) $(GHCFLAGS) --make $< -odir obj -hidir obj -o $@
opcounts : examples/OpCounts.hs $(SRC)
@mkdir -p obj
$(_QUIET)$(GHC) $(GHCFLAGS) --make $< -odir obj -hidir obj -o $@
search : examples/Search.hs $(SRC)
@mkdir -p obj
$(_QUIET)$(GHC) $(GHCFLAGS) --make $< -odir obj -hidir obj -o $@
moddftgen : examples/ModDFTGen.hs $(SRC)
@mkdir -p obj
$(_QUIET)$(GHC) $(GHCFLAGS) --make $< -odir obj -hidir obj -o $@
#
# Profiling
#
%.ps : %.hp
hp2ps -c $^ >$@
%.pdf : %.ps
ps2pdf $^ $@
%.folded : %.prof
cat $^ | ghc-prof-flamegraph >$@
%.svg : %.folded
cat $^ | flamegraph.pl >$@