-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile.am
More file actions
251 lines (210 loc) · 7.43 KB
/
Makefile.am
File metadata and controls
251 lines (210 loc) · 7.43 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
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
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
ACLOCAL_AMFLAGS = -I m4
AM_CPPFLAGS = -I$(srcdir)/include
EXTRA_DIST = README.md LICENSE pkgconfig/simple_gpu-cpu.pc.in pkgconfig/simple_gpu-nvidia.pc.in pkgconfig/simple_gpu-amd.pc.in
include_HEADERS = include/simple_gpu.h include/simple_gpu.F90
# pkgconfig files
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = pkgconfig/simple_gpu-cpu.pc
if BUILD_NVIDIA
pkgconfig_DATA += pkgconfig/simple_gpu-nvidia.pc
endif
if BUILD_AMD
pkgconfig_DATA += pkgconfig/simple_gpu-amd.pc
endif
# ===== Source library section (from src/Makefile.am) =====
lib_LTLIBRARIES = libsimple_gpu-cpu.la
# CPU version library
libsimple_gpu_cpu_la_SOURCES = src/gpu_cpu.c include/simple_gpu.F90
libsimple_gpu_cpu_la_CFLAGS = -I$(top_srcdir)/include
libsimple_gpu_cpu_la_FCFLAGS =
libsimple_gpu_cpu_la_LIBADD = $(BLAS_LIBS)
libsimple_gpu_cpu_la_LDFLAGS = -version-info 1:0:0
# NVIDIA GPU version library (conditional)
if BUILD_NVIDIA
lib_LTLIBRARIES += libsimple_gpu-nvidia.la
libsimple_gpu_nvidia_la_SOURCES = src/gpu_nvidia.c include/simple_gpu.F90
libsimple_gpu_nvidia_la_CFLAGS = -I$(top_srcdir)/include $(CUDA_CFLAGS)
libsimple_gpu_nvidia_la_FCFLAGS =
libsimple_gpu_nvidia_la_LIBADD = $(CUDA_LIBS)
libsimple_gpu_nvidia_la_LDFLAGS = -version-info 1:0:0 $(CUDA_LDFLAGS)
endif
# AMD GPU version library (conditional)
if BUILD_AMD
lib_LTLIBRARIES += libsimple_gpu-amd.la
libsimple_gpu_amd_la_SOURCES = src/gpu_amd.c include/simple_gpu.F90
libsimple_gpu_amd_la_CFLAGS = -I$(top_srcdir)/include $(ROCM_CFLAGS)
libsimple_gpu_amd_la_FCFLAGS =
libsimple_gpu_amd_la_LIBADD = $(ROCM_LIBS)
libsimple_gpu_amd_la_LDFLAGS = -version-info 1:0:0 $(ROCM_LDFLAGS)
endif
# ===== Tests section (from tests/Makefile.am) =====
# CPU tests (always built)
TESTS = \
tests/test_ddot_cpu \
tests/test_sdot_cpu \
tests/test_dgemv_cpu \
tests/test_sgemv_cpu \
tests/test_dgemm_cpu \
tests/test_sgemm_cpu \
tests/test_dgeam_cpu \
tests/test_sgeam_cpu
check_PROGRAMS = $(TESTS)
# DDOT tests
tests_test_ddot_cpu_SOURCES = tests/test_ddot.F90
tests_test_ddot_cpu_FCFLAGS = -I$(top_builddir)
tests_test_ddot_cpu_LDADD = libsimple_gpu-cpu.la
# SDOT tests
tests_test_sdot_cpu_SOURCES = tests/test_sdot.F90
tests_test_sdot_cpu_FCFLAGS = -I$(top_builddir)
tests_test_sdot_cpu_LDADD = libsimple_gpu-cpu.la
# DGEMV tests
tests_test_dgemv_cpu_SOURCES = tests/test_dgemv.F90
tests_test_dgemv_cpu_FCFLAGS = -I$(top_builddir)
tests_test_dgemv_cpu_LDADD = libsimple_gpu-cpu.la
# SGEMV tests
tests_test_sgemv_cpu_SOURCES = tests/test_sgemv.F90
tests_test_sgemv_cpu_FCFLAGS = -I$(top_builddir)
tests_test_sgemv_cpu_LDADD = libsimple_gpu-cpu.la
# DGEMM tests
tests_test_dgemm_cpu_SOURCES = tests/test_dgemm.F90
tests_test_dgemm_cpu_FCFLAGS = -I$(top_builddir)
tests_test_dgemm_cpu_LDADD = libsimple_gpu-cpu.la
# SGEMM tests
tests_test_sgemm_cpu_SOURCES = tests/test_sgemm.F90
tests_test_sgemm_cpu_FCFLAGS = -I$(top_builddir)
tests_test_sgemm_cpu_LDADD = libsimple_gpu-cpu.la
# DGEAM tests
tests_test_dgeam_cpu_SOURCES = tests/test_dgeam.F90
tests_test_dgeam_cpu_FCFLAGS = -I$(top_builddir)
tests_test_dgeam_cpu_LDADD = libsimple_gpu-cpu.la
# SGEAM tests
tests_test_sgeam_cpu_SOURCES = tests/test_sgeam.F90
tests_test_sgeam_cpu_FCFLAGS = -I$(top_builddir)
tests_test_sgeam_cpu_LDADD = libsimple_gpu-cpu.la
# GPU tests (only when NVIDIA is available)
if BUILD_NVIDIA
TESTS += \
tests/test_ddot_gpu \
tests/test_sdot_gpu \
tests/test_dgemv_gpu \
tests/test_sgemv_gpu \
tests/test_dgemm_gpu \
tests/test_sgemm_gpu \
tests/test_dgeam_gpu \
tests/test_sgeam_gpu
check_PROGRAMS += \
tests/test_ddot_gpu \
tests/test_sdot_gpu \
tests/test_dgemv_gpu \
tests/test_sgemv_gpu \
tests/test_dgemm_gpu \
tests/test_sgemm_gpu \
tests/test_dgeam_gpu \
tests/test_sgeam_gpu
# DDOT GPU test
tests_test_ddot_gpu_SOURCES = tests/test_ddot.F90
tests_test_ddot_gpu_FCFLAGS = -I$(top_builddir)
tests_test_ddot_gpu_LDADD = libsimple_gpu-nvidia.la
tests_test_ddot_gpu_LDFLAGS = -ldl
# SDOT GPU test
tests_test_sdot_gpu_SOURCES = tests/test_sdot.F90
tests_test_sdot_gpu_FCFLAGS = -I$(top_builddir)
tests_test_sdot_gpu_LDADD = libsimple_gpu-nvidia.la
tests_test_sdot_gpu_LDFLAGS = -ldl
# DGEMV GPU test
tests_test_dgemv_gpu_SOURCES = tests/test_dgemv.F90
tests_test_dgemv_gpu_FCFLAGS = -I$(top_builddir)
tests_test_dgemv_gpu_LDADD = libsimple_gpu-nvidia.la
tests_test_dgemv_gpu_LDFLAGS = -ldl
# SGEMV GPU test
tests_test_sgemv_gpu_SOURCES = tests/test_sgemv.F90
tests_test_sgemv_gpu_FCFLAGS = -I$(top_builddir)
tests_test_sgemv_gpu_LDADD = libsimple_gpu-nvidia.la
tests_test_sgemv_gpu_LDFLAGS = -ldl
# DGEMM GPU test
tests_test_dgemm_gpu_SOURCES = tests/test_dgemm.F90
tests_test_dgemm_gpu_FCFLAGS = -I$(top_builddir)
tests_test_dgemm_gpu_LDADD = libsimple_gpu-nvidia.la
tests_test_dgemm_gpu_LDFLAGS = -ldl
# SGEMM GPU test
tests_test_sgemm_gpu_SOURCES = tests/test_sgemm.F90
tests_test_sgemm_gpu_FCFLAGS = -I$(top_builddir)
tests_test_sgemm_gpu_LDADD = libsimple_gpu-nvidia.la
tests_test_sgemm_gpu_LDFLAGS = -ldl
# DGEAM GPU test
tests_test_dgeam_gpu_SOURCES = tests/test_dgeam.F90
tests_test_dgeam_gpu_FCFLAGS = -I$(top_builddir)
tests_test_dgeam_gpu_LDADD = libsimple_gpu-nvidia.la
tests_test_dgeam_gpu_LDFLAGS = -ldl
# SGEAM GPU test
tests_test_sgeam_gpu_SOURCES = tests/test_sgeam.F90
tests_test_sgeam_gpu_FCFLAGS = -I$(top_builddir)
tests_test_sgeam_gpu_LDADD = libsimple_gpu-nvidia.la
tests_test_sgeam_gpu_LDFLAGS = -ldl
endif
# AMD GPU tests (only when AMD is available)
if BUILD_AMD
TESTS += \
tests/test_ddot_amd \
tests/test_sdot_amd \
tests/test_dgemv_amd \
tests/test_sgemv_amd \
tests/test_dgemm_amd \
tests/test_sgemm_amd \
tests/test_dgeam_amd \
tests/test_sgeam_amd
check_PROGRAMS += \
tests/test_ddot_amd \
tests/test_sdot_amd \
tests/test_dgemv_amd \
tests/test_sgemv_amd \
tests/test_dgemm_amd \
tests/test_sgemm_amd \
tests/test_dgeam_amd \
tests/test_sgeam_amd
# DDOT AMD test
tests_test_ddot_amd_SOURCES = tests/test_ddot.F90
tests_test_ddot_amd_FCFLAGS = -I$(top_builddir)
tests_test_ddot_amd_LDADD = libsimple_gpu-amd.la
tests_test_ddot_amd_LDFLAGS = -ldl
# SDOT AMD test
tests_test_sdot_amd_SOURCES = tests/test_sdot.F90
tests_test_sdot_amd_FCFLAGS = -I$(top_builddir)
tests_test_sdot_amd_LDADD = libsimple_gpu-amd.la
tests_test_sdot_amd_LDFLAGS = -ldl
# DGEMV AMD test
tests_test_dgemv_amd_SOURCES = tests/test_dgemv.F90
tests_test_dgemv_amd_FCFLAGS = -I$(top_builddir)
tests_test_dgemv_amd_LDADD = libsimple_gpu-amd.la
tests_test_dgemv_amd_LDFLAGS = -ldl
# SGEMV AMD test
tests_test_sgemv_amd_SOURCES = tests/test_sgemv.F90
tests_test_sgemv_amd_FCFLAGS = -I$(top_builddir)
tests_test_sgemv_amd_LDADD = libsimple_gpu-amd.la
tests_test_sgemv_amd_LDFLAGS = -ldl
# DGEMM AMD test
tests_test_dgemm_amd_SOURCES = tests/test_dgemm.F90
tests_test_dgemm_amd_FCFLAGS = -I$(top_builddir)
tests_test_dgemm_amd_LDADD = libsimple_gpu-amd.la
tests_test_dgemm_amd_LDFLAGS = -ldl
# SGEMM AMD test
tests_test_sgemm_amd_SOURCES = tests/test_sgemm.F90
tests_test_sgemm_amd_FCFLAGS = -I$(top_builddir)
tests_test_sgemm_amd_LDADD = libsimple_gpu-amd.la
tests_test_sgemm_amd_LDFLAGS = -ldl
# DGEAM AMD test
tests_test_dgeam_amd_SOURCES = tests/test_dgeam.F90
tests_test_dgeam_amd_FCFLAGS = -I$(top_builddir)
tests_test_dgeam_amd_LDADD = libsimple_gpu-amd.la
tests_test_dgeam_amd_LDFLAGS = -ldl
# SGEAM AMD test
tests_test_sgeam_amd_SOURCES = tests/test_sgeam.F90
tests_test_sgeam_amd_FCFLAGS = -I$(top_builddir)
tests_test_sgeam_amd_LDADD = libsimple_gpu-amd.la
tests_test_sgeam_amd_LDFLAGS = -ldl
endif
# Clean up Fortran module files
CLEANFILES = *.mod
.PHONY: check-verbose
check-verbose:
$(MAKE) check VERBOSE=1