forked from kokkos/kokkos-kernels
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.kokkos-kernels
426 lines (347 loc) · 23.9 KB
/
Makefile.kokkos-kernels
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
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
# Path settings
KOKKOSKERNELS_PATH ?= ${HOME}/Kokkos/kokkos-kernels
KOKKOS_PATH ?= ${KOKKOSKERNELS_PATH}/../kokkos
KOKKOSKERNELS_INSTALL_PATH ?= ${CURDIR}/install
# What to instantiate
# double, float, complex<double>, complex<float>
KOKKOSKERNELS_SCALARS ?= double
KOKKOSKERNELS_LAYOUTS ?= LayoutLeft,LayoutRight
KOKKOSKERNELS_SPACES ?= $(KOKKOS_DEVICES),HostSpace
KOKKOSKERNELS_ORDINALS ?= int,int64_t
KOKKOSKERNELS_OFFSETS ?= int,size_t
# mkl, blas
KOKKOSKERNELS_ENABLE_TPLS ?= ""
# eti-only
KOKKOSKERNELS_OPTIONS ?= ""
KOKKOSKERNELS_INTERNAL_ENABLE_BLAS := $(strip $(shell echo $(KOKKOSKERNELS_ENABLE_TPLS) | grep "blas" | wc -l))
KOKKOSKERNELS_INTERNAL_ENABLE_MKL := $(strip $(shell echo $(KOKKOSKERNELS_ENABLE_TPLS) | grep "mkl" | wc -l))
KOKKOSKERNELS_INTERNAL_ENABLE_CUSPARSE := $(strip $(shell echo $(KOKKOSKERNELS_ENABLE_TPLS) | grep "cusparse" | wc -l))
KOKKOSKERNELS_INTERNAL_ENABLE_CUBLAS := $(strip $(shell echo $(KOKKOSKERNELS_ENABLE_TPLS) | grep "cublas" | wc -l))
BLAS_PATH ?= /usr
BLAS_LIBS ?= -L${BLAS_PATH}/lib64 -lblas
MKL_PATH ?= ${SEMS_INTEL_ROOT}/mkl
MKL_LIBS ?= -L${MKL_PATH}/lib/intel64 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -liomp5 -lpthread -lm -ldl -L${MKL_PATH}/../compiler/lib/intel64
default-kokkos-kernels: kokkoskernels-build-lib
echo "Start Build"
CXXFLAGS ?= -g -O3
LINKFLAGS ?= -g -O3
KOKKOSKERNELS_INTERNAL_LIBRARY = libkokkos_kernels.a
KOKKOSKERNELS_LIBS = -lkokkos_kernels
KOKKOSKERNELS_LDFLAGS = -L./
KOKKOSKERNELSCOMMON_CPPFLAGS= -I$(KOKKOSKERNELS_PATH)/src/common
KOKKOSBLAS_CPPFLAGS= -I$(KOKKOSKERNELS_PATH)/src/blas -I$(KOKKOSKERNELS_PATH)/src/blas/impl
KOKKOSSPARSE_CPPFLAGS= -I$(KOKKOSKERNELS_PATH)/src/sparse -I$(KOKKOSKERNELS_PATH)/src/sparse/impl
KOKKOSGRAPH_CPPFLAGS= -I$(KOKKOSKERNELS_PATH)/src/graph -I$(KOKKOSKERNELS_PATH)/src/graph/impl
KOKKOSBATCHED_CPPFLAGS= -I$(KOKKOSKERNELS_PATH)/src/batched
KOKKOSKERNELS_CPPFLAGS = -I$(KOKKOSKERNELS_PATH)/src -I$(KOKKOSKERNELS_PATH)/src/impl -I$(KOKKOSKERNELS_PATH)/src/impl/tpls $(KOKKOSSPARSE_CPPFLAGS) $(KOKKOSGRAPH_CPPFLAGS) $(KOKKOSKERNELUTILS_CPPFLAGS) $(KOKKOSBLAS_CPPFLAGS) $(KOKKOSBATCHED_CPPFLAGS) $(KOKKOSKERNELSCOMMON_CPPFLAGS)
KOKKOSKERNELS_LINK_DEPENDS = $(KOKKOSKERNELS_INTERNAL_LIBRARY)
LINK ?= ${CXX}
ifndef KOKKOS_CXXFLAGS
include $(KOKKOS_PATH)/Makefile.kokkos
endif
#=========================================================================
#==== Generate KokkosKernels_config.h ====================================
#=========================================================================
tmp := $(shell echo "/* ---------------------------------------------" > KokkosKernels_config.tmp)
tmp := $(shell echo "Makefile constructed configuration:" >> KokkosKernels_config.tmp)
tmp := $(shell date >> KokkosKernels_config.tmp)
tmp := $(shell echo "----------------------------------------------*/" >> KokkosKernels_config.tmp)
tmp := $(shell echo "\#ifndef KOKKOSKERNELS_CONFIG_H_" >> KokkosKernels_config.tmp)
tmp := $(shell echo "\#define KOKKOSKERNELS_CONFIG_H_" >> KokkosKernels_config.tmp)
#==== ETI Macros Scalars =================================================
KOKKOSKERNELS_INTERNAL_INST_SCALARS =
KOKKOSKERNELS_INTERNAL_INST_DOUBLE=$(strip $(shell echo "$(KOKKOSKERNELS_SCALARS)" | grep "double" | wc -l))
KOKKOSKERNELS_INTERNAL_INST_FLOAT=$(strip $(shell echo "$(KOKKOSKERNELS_SCALARS)" | grep "float" | wc -l))
KOKKOSKERNELS_INTERNAL_INST_COMPLEX_DOUBLE_=$(strip $(shell echo "$(KOKKOSKERNELS_SCALARS)" | grep "complex<double>" | wc -l))
KOKKOSKERNELS_INTERNAL_INST_COMPLEX_FLOAT_=$(strip $(shell echo "$(KOKKOSKERNELS_SCALARS)" | grep "complex<float>" | wc -l))
tmp := $(shell echo "" >> KokkosKernels_config.tmp)
tmp := $(shell echo "/* ---------------------------------------------" >> KokkosKernels_config.tmp)
tmp := $(shell echo "ETI Scalar Types:" >> KokkosKernels_config.tmp)
tmp := $(shell echo " ---------------------------------------------*/" >> KokkosKernels_config.tmp)
ifeq ($(KOKKOSKERNELS_INTERNAL_INST_DOUBLE), 1)
tmp := $(shell echo "\#define KOKKOSKERNELS_INST_DOUBLE" >> KokkosKernels_config.tmp )
KOKKOSKERNELS_INTERNAL_INST_SCALARS += "double"
endif
ifeq ($(KOKKOSKERNELS_INTERNAL_INST_FLOAT), 1)
tmp := $(shell echo "\#define KOKKOSKERNELS_INST_FLOAT" >> KokkosKernels_config.tmp )
KOKKOSKERNELS_INTERNAL_INST_SCALARS += "float"
endif
ifeq ($(KOKKOSKERNELS_INTERNAL_INST_COMPLEX_DOUBLE_), 1)
tmp := $(shell echo "\#define KOKKOSKERNELS_INST_COMPLEX_DOUBLE" >> KokkosKernels_config.tmp )
KOKKOSKERNELS_INTERNAL_INST_SCALARS += "Kokkos::complex<double>"
endif
ifeq ($(KOKKOSKERNELS_INTERNAL_INST_COMPLEX_FLOAT_), 1)
tmp := $(shell echo "\#define KOKKOSKERNELS_INST_COMPLEX_FLOAT" >> KokkosKernels_config.tmp )
KOKKOSKERNELS_INTERNAL_INST_SCALARS += "Kokkos::complex<float>"
endif
tmp := $(shell echo "\#if defined(KOKKOSKERNELS_INST_COMPLEX_DOUBLE)" >> KokkosKernels_config.tmp )
tmp := $(shell echo "\#define KOKKOSKERNELS_INST_KOKKOS_COMPLEX_DOUBLE_" >> KokkosKernels_config.tmp )
tmp := $(shell echo "\#endif" >> KokkosKernels_config.tmp )
tmp := $(shell echo "\#if defined(KOKKOSKERNELS_INST_COMPLEX_FLOAT)" >> KokkosKernels_config.tmp )
tmp := $(shell echo "\#define KOKKOSKERNELS_INST_KOKKOS_COMPLEX_FLOAT_" >> KokkosKernels_config.tmp )
tmp := $(shell echo "\#endif" >> KokkosKernels_config.tmp )
#==== ETI Macros ORDINALS =================================================
KOKKOSKERNELS_INTERNAL_INST_ORDINALS =
KOKKOSKERNELS_INTERNAL_INST_ORDINAL_INT=$(strip $(shell echo "$(KOKKOSKERNELS_ORDINALS)" | grep "int" | wc -l))
KOKKOSKERNELS_INTERNAL_INST_ORDINAL_INT64_T=$(strip $(shell echo "$(KOKKOSKERNELS_ORDINALS)" | grep "int64_t" | wc -l))
tmp := $(shell echo "" >> KokkosKernels_config.tmp)
tmp := $(shell echo "/* ---------------------------------------------" >> KokkosKernels_config.tmp)
tmp := $(shell echo "ETI Ordinal Types:" >> KokkosKernels_config.tmp)
tmp := $(shell echo " ---------------------------------------------*/" >> KokkosKernels_config.tmp)
ifeq ($(KOKKOSKERNELS_INTERNAL_INST_ORDINAL_INT), 1)
tmp := $(shell echo "\#define KOKKOSKERNELS_INST_ORDINAL_INT" >> KokkosKernels_config.tmp )
KOKKOSKERNELS_INTERNAL_INST_ORDINALS += "int"
endif
ifeq ($(KOKKOSKERNELS_INTERNAL_INST_ORDINAL_INT64_T), 1)
tmp := $(shell echo "\#define KOKKOSKERNELS_INST_ORDINAL_INT64_T" >> KokkosKernels_config.tmp )
KOKKOSKERNELS_INTERNAL_INST_ORDINALS += "int64_t"
endif
#==== ETI Macros OFFSETS =================================================
KOKKOSKERNELS_INTERNAL_INST_OFFSETS =
KOKKOSKERNELS_INTERNAL_INST_OFFSET_INT=$(strip $(shell echo "$(KOKKOSKERNELS_OFFSETS)" | grep "int" | wc -l))
KOKKOSKERNELS_INTERNAL_INST_OFFSET_SIZE_T=$(strip $(shell echo "$(KOKKOSKERNELS_OFFSETS)" | grep "size_t" | wc -l))
tmp := $(shell echo "" >> KokkosKernels_config.tmp)
tmp := $(shell echo "/* ---------------------------------------------" >> KokkosKernels_config.tmp)
tmp := $(shell echo "ETI Offset Types:" >> KokkosKernels_config.tmp)
tmp := $(shell echo " ---------------------------------------------*/" >> KokkosKernels_config.tmp)
ifeq ($(KOKKOSKERNELS_INTERNAL_INST_OFFSET_INT), 1)
tmp := $(shell echo "\#define KOKKOSKERNELS_INST_OFFSET_INT" >> KokkosKernels_config.tmp )
KOKKOSKERNELS_INTERNAL_INST_OFFSETS += "int"
endif
ifeq ($(KOKKOSKERNELS_INTERNAL_INST_OFFSET_SIZE_T), 1)
tmp := $(shell echo "\#define KOKKOSKERNELS_INST_OFFSET_SIZE_T" >> KokkosKernels_config.tmp )
KOKKOSKERNELS_INTERNAL_INST_OFFSETS += "size_t"
endif
#==== ETI Macros Layouts =================================================
KOKKOSKERNELS_INTERNAL_INST_LAYOUTLEFT=$(strip $(shell echo $(KOKKOSKERNELS_LAYOUTS) | grep "LayoutLeft" | wc -l))
KOKKOSKERNELS_INTERNAL_INST_LAYOUTRIGHT=$(strip $(shell echo $(KOKKOSKERNELS_LAYOUTS) | grep "LayoutRight" | wc -l))
tmp := $(shell echo "" >> KokkosKernels_config.tmp)
tmp := $(shell echo "/* ---------------------------------------------" >> KokkosKernels_config.tmp)
tmp := $(shell echo "ETI Layout Types:" >> KokkosKernels_config.tmp)
tmp := $(shell echo " ---------------------------------------------*/" >> KokkosKernels_config.tmp)
ifeq ($(KOKKOSKERNELS_INTERNAL_INST_LAYOUTLEFT), 1)
tmp := $(shell echo "\#define KOKKOSKERNELS_INST_LAYOUTLEFT" >> KokkosKernels_config.tmp )
endif
ifeq ($(KOKKOSKERNELS_INTERNAL_INST_LAYOUTRIGHT), 1)
tmp := $(shell echo "\#define KOKKOSKERNELS_INST_LAYOUTRIGHT" >> KokkosKernels_config.tmp )
endif
#==== ETI Macros ExecutionSpaces =================================================
KOKKOSKERNELS_INTERNAL_INST_EXECSPACE_SERIAL=$(strip $(shell echo $(KOKKOSKERNELS_SPACES) | grep "Serial" | wc -l))
KOKKOSKERNELS_INTERNAL_INST_EXECSPACE_OPENMP=$(strip $(shell echo $(KOKKOSKERNELS_SPACES) | grep "OpenMP" | wc -l))
KOKKOSKERNELS_INTERNAL_INST_EXECSPACE_THREADS=$(strip $(shell echo $(KOKKOSKERNELS_SPACES) | grep "Pthread" | wc -l))
KOKKOSKERNELS_INTERNAL_INST_EXECSPACE_CUDA=$(strip $(shell echo $(KOKKOSKERNELS_SPACES) | grep "Cuda" | wc -l))
tmp := $(shell echo "" >> KokkosKernels_config.tmp)
tmp := $(shell echo "/* ---------------------------------------------" >> KokkosKernels_config.tmp)
tmp := $(shell echo "ETI ExecutionSpace Types:" >> KokkosKernels_config.tmp)
tmp := $(shell echo " ---------------------------------------------*/" >> KokkosKernels_config.tmp)
ifeq ($(KOKKOSKERNELS_INTERNAL_INST_EXECSPACE_SERIAL), 1)
tmp := $(shell echo "\#define KOKKOSKERNELS_INST_EXECSPACE_SERIAL" >> KokkosKernels_config.tmp )
endif
ifeq ($(KOKKOSKERNELS_INTERNAL_INST_EXECSPACE_OPENMP), 1)
tmp := $(shell echo "\#define KOKKOSKERNELS_INST_EXECSPACE_OPENMP" >> KokkosKernels_config.tmp )
endif
ifeq ($(KOKKOSKERNELS_INTERNAL_INST_EXECSPACE_THREADS), 1)
tmp := $(shell echo "\#define KOKKOSKERNELS_INST_EXECSPACE_THREADS" >> KokkosKernels_config.tmp )
endif
ifeq ($(KOKKOSKERNELS_INTERNAL_INST_EXECSPACE_CUDA), 1)
tmp := $(shell echo "\#define KOKKOSKERNELS_INST_EXECSPACE_CUDA" >> KokkosKernels_config.tmp )
endif
#==== ETI Macros MemorySpaces =================================================
KOKKOSKERNELS_INTERNAL_INST_MEMSPACE_HOSTSPACE=$(strip $(shell echo $(KOKKOSKERNELS_SPACES) | grep "HostSpace" | wc -l))
KOKKOSKERNELS_INTERNAL_INST_MEMSPACE_HBWSPACE=$(strip $(shell echo $(KOKKOSKERNELS_SPACES) | grep "HBWSpace" | wc -l))
KOKKOSKERNELS_INTERNAL_INST_MEMSPACE_CUDASPACE=$(strip $(shell echo $(KOKKOSKERNELS_SPACES) | grep "CudaSpace" | wc -l))
KOKKOSKERNELS_INTERNAL_INST_MEMSPACE_CUDAUVMSPACE=$(strip $(shell echo $(KOKKOSKERNELS_SPACES) | grep "CudaUVMSpace" | wc -l))
tmp := $(shell echo "" >> KokkosKernels_config.tmp)
tmp := $(shell echo "/* ---------------------------------------------" >> KokkosKernels_config.tmp)
tmp := $(shell echo "ETI Memory Space Types:" >> KokkosKernels_config.tmp)
tmp := $(shell echo " ---------------------------------------------*/" >> KokkosKernels_config.tmp)
ifeq ($(KOKKOSKERNELS_INTERNAL_INST_MEMSPACE_HOSTSPACE), 1)
tmp := $(shell echo "\#define KOKKOSKERNELS_INST_MEMSPACE_HOSTSPACE" >> KokkosKernels_config.tmp )
endif
ifeq ($(KOKKOSKERNELS_INTERNAL_INST_MEMSPACE_HBWSPACE), 1)
tmp := $(shell echo "\#define KOKKOSKERNELS_INST_MEMSPACE_HBWSPACE" >> KokkosKernels_config.tmp )
endif
ifeq ($(KOKKOSKERNELS_INTERNAL_INST_MEMSPACE_CUDASPACE), 1)
tmp := $(shell echo "\#define KOKKOSKERNELS_INST_MEMSPACE_CUDASPACE" >> KokkosKernels_config.tmp )
endif
ifeq ($(KOKKOSKERNELS_INTERNAL_INST_MEMSPACE_CUDAUVMSPACE), 1)
tmp := $(shell echo "\#define KOKKOSKERNELS_INST_MEMSPACE_CUDAUVMSPACE" >> KokkosKernels_config.tmp )
endif
ifeq ($(KOKKOSKERNELS_INTERNAL_INST_EXECSPACE_CUDA), 1)
ifeq ($(KOKKOSKERNELS_INTERNAL_INST_MEMSPACE_CUDASPACE), 0)
ifeq ($(KOKKOSKERNELS_INTERNAL_INST_MEMSPACE_CUDAUVMSPACE), 0)
tmp := $(shell echo "\#define KOKKOSKERNELS_INST_MEMSPACE_CUDASPACE" >> KokkosKernels_config.tmp )
endif
endif
endif
#==== Third Party Libraries =================================================
tmp := $(shell echo "" >> KokkosKernels_config.tmp)
tmp := $(shell echo "/* ---------------------------------------------" >> KokkosKernels_config.tmp)
tmp := $(shell echo "Third Party Libraries:" >> KokkosKernels_config.tmp)
tmp := $(shell echo " ---------------------------------------------*/" >> KokkosKernels_config.tmp)
ifeq (${KOKKOSKERNELS_INTERNAL_ENABLE_BLAS}, 1)
KOKKOSKERNELS_LIBS += ${BLAS_LIBS}
tmp := $(shell echo "\#define KOKKOSKERNELS_ENABLE_TPL_BLAS" >> KokkosKernels_config.tmp )
endif
ifeq (${KOKKOSKERNELS_INTERNAL_ENABLE_MKL}, 1)
KOKKOSKERNELS_CPPFLAGS += -I${MKL_PATH}/include
KOKKOSKERNELS_LIBS += ${MKL_LIBS}
tmp := $(shell echo "\#define KOKKOSKERNELS_ENABLE_TPL_MKL" >> KokkosKernels_config.tmp )
endif
ifeq (${KOKKOSKERNELS_INTERNAL_ENABLE_CUSPARSE}, 1)
KOKKOS_INTERNAL_NVCC_PATH := $(shell which nvcc)
CUDA_PATH ?= $(KOKKOS_INTERNAL_NVCC_PATH:/bin/nvcc=)
KOKKOSKERNELS_CPPFLAGS += -I${CUDA_PATH}/include
KOKKOSKERNELS_LDFLAGS += -L${CUDA_PATH}/lib
KOKKOSKERNELS_LIBS += -lcusparse
tmp := $(shell echo "\#define KOKKOSKERNELS_ENABLE_TPL_CUSPARSE" >> KokkosKernels_config.tmp )
endif
ifeq (${KOKKOSKERNELS_INTERNAL_ENABLE_CUBLAS}, 1)
KOKKOS_INTERNAL_NVCC_PATH := $(shell which nvcc)
CUDA_PATH ?= $(KOKKOS_INTERNAL_NVCC_PATH:/bin/nvcc=)
KOKKOSKERNELS_CPPFLAGS += -I${CUDA_PATH}/include
KOKKOSKERNELS_LDFLAGS += -L${CUDA_PATH}/lib
KOKKOSKERNELS_LIBS += -lcublas
tmp := $(shell echo "\#define KOKKOSKERNELS_ENABLE_TPL_CUBLAS" >> KokkosKernels_config.tmp )
endif
tmp := $(shell echo "\#if defined(KOKKOSKERNELS_ENABLE_TPL_MKL)" >> KokkosKernels_config.tmp )
tmp := $(shell echo "\#if !defined(KOKKOSKERNELS_ENABLE_TPL_BLAS)" >> KokkosKernels_config.tmp )
tmp := $(shell echo "\#define KOKKOSKERNELS_ENABLE_TPL_BLAS" >> KokkosKernels_config.tmp )
tmp := $(shell echo "\#endif" >> KokkosKernels_config.tmp )
tmp := $(shell echo "\#endif" >> KokkosKernels_config.tmp )
#==== Options =================================================
tmp := $(shell echo "" >> KokkosKernels_config.tmp)
tmp := $(shell echo "/* ---------------------------------------------" >> KokkosKernels_config.tmp)
tmp := $(shell echo "Optional Settings:" >> KokkosKernels_config.tmp)
tmp := $(shell echo " ---------------------------------------------*/" >> KokkosKernels_config.tmp)
KOKKOSKERNELS_INTERNAL_ETI_ONLY := $(strip $(shell echo $(KOKKOSKERNELS_OPTIONS) | grep "eti-only" | wc -l))
ifeq (${KOKKOSKERNELS_INTERNAL_ETI_ONLY}, 1)
tmp := $(shell echo "\#define KOKKOSKERNELS_ETI_ONLY" >> KokkosKernels_config.tmp )
endif
#==== Put in guard for library compilations ===========================
tmp := $(shell echo "" >> KokkosKernels_config.tmp)
tmp := $(shell echo "\#ifndef KOKKOSKERNELS_IMPL_COMPILE_LIBRARY" >> KokkosKernels_config.tmp)
tmp := $(shell echo "\#define KOKKOSKERNELS_IMPL_COMPILE_LIBRARY false" >> KokkosKernels_config.tmp)
tmp := $(shell echo "\#endif " >> KokkosKernels_config.tmp)
tmp := $(shell echo "" >> KokkosKernels_config.tmp)
#==== Endif the file =================================================
tmp := $(shell echo "\#endif // KOKKOSKERNELS_CONFIG_H_" >> KokkosKernels_config.tmp)
#==== Update the config file if necessary =================================================
KOKKOSKERNELS_INTERNAL_LS_CONFIG := $(shell ls KokkosKernels_config.h)
ifeq ($(KOKKOSKERNELS_INTERNAL_LS_CONFIG), KokkosKernels_config.h)
KOKKOSKERNELS_INTERNAL_NEW_CONFIG := $(strip $(shell diff KokkosKernels_config.h KokkosKernels_config.tmp | grep define | wc -l))
else
KOKKOSKERNELS_INTERNAL_NEW_CONFIG := 1
endif
ifneq ($(KOKKOSKERNELS_INTERNAL_NEW_CONFIG), 0)
tmp := $(shell cp KokkosKernels_config.tmp KokkosKernels_config.h)
endif
#include $(KOKKOSKERNELS_PATH)/Makefile.generate_eti_files
#-------------------------------------------------------------------------
#-----Add src Files-------------------------------------
#-------------------------------------------------------------------------
KOKKOSKERNELS_INTERNAL_SRC_BLAS =
KOKKOSKERNELS_INTERNAL_SRC_SPARSE =
ifeq ($(KOKKOSKERNELS_INTERNAL_INST_EXECSPACE_SERIAL), 1)
ifeq ($(KOKKOSKERNELS_INTERNAL_INST_DOUBLE), 1)
KOKKOSKERNELS_INTERNAL_SRC_BLAS += $(wildcard ${KOKKOSKERNELS_PATH}/src/impl/generated_specializations_cpp/*/KokkosBlas*eti_spec_inst_double*Serial*.cpp)
KOKKOSKERNELS_INTERNAL_SRC_SPARSE += $(wildcard ${KOKKOSKERNELS_PATH}/src/impl/generated_specializations_cpp/*/KokkosSparse*eti_spec_inst_double*Serial*.cpp)
endif
ifeq ($(KOKKOSKERNELS_INTERNAL_INST_FLOAT), 1)
KOKKOSKERNELS_INTERNAL_SRC_BLAS += $(wildcard ${KOKKOSKERNELS_PATH}/src/impl/generated_specializations_cpp/*/KokkosBlas*eti_spec_inst_float*Serial*.cpp)
KOKKOSKERNELS_INTERNAL_SRC_SPARSE += $(wildcard ${KOKKOSKERNELS_PATH}/src/impl/generated_specializations_cpp/*/KokkosSparse*eti_spec_inst_float*Serial*.cpp)
endif
ifeq ($(KOKKOSKERNELS_INTERNAL_INST_COMPLEX_DOUBLE_), 1)
KOKKOSKERNELS_INTERNAL_SRC_BLAS += $(wildcard ${KOKKOSKERNELS_PATH}/src/impl/generated_specializations_cpp/*/KokkosBlas*eti_spec_inst_Kokkos_complex_double*Serial*.cpp)
KOKKOSKERNELS_INTERNAL_SRC_SPARSE += $(wildcard ${KOKKOSKERNELS_PATH}/src/impl/generated_specializations_cpp/*/KokkosSparse*eti_spec_inst_Kokkos_complex_double*Serial*.cpp)
endif
ifeq ($(KOKKOSKERNELS_INTERNAL_INST_COMPLEX_FLOAT_), 1)
KOKKOSKERNELS_INTERNAL_SRC_BLAS += $(wildcard ${KOKKOSKERNELS_PATH}/src/impl/generated_specializations_cpp/*/KokkosBlas*eti_spec_inst_Kokkos_complex_float*Serial*.cpp)
KOKKOSKERNELS_INTERNAL_SRC_SPARSE += $(wildcard ${KOKKOSKERNELS_PATH}/src/impl/generated_specializations_cpp/*/KokkosSparse*eti_spec_inst_Kokkos_complex_float*Serial*.cpp)
endif
endif
ifeq ($(KOKKOSKERNELS_INTERNAL_INST_EXECSPACE_OPENMP), 1)
ifeq ($(KOKKOSKERNELS_INTERNAL_INST_DOUBLE), 1)
KOKKOSKERNELS_INTERNAL_SRC_BLAS += $(wildcard ${KOKKOSKERNELS_PATH}/src/impl/generated_specializations_cpp/*/KokkosBlas*eti_spec_inst_double*OpenMP_*.cpp)
KOKKOSKERNELS_INTERNAL_SRC_SPARSE += $(wildcard ${KOKKOSKERNELS_PATH}/src/impl/generated_specializations_cpp/*/KokkosSparse*eti_spec_inst_double*OpenMP_*.cpp)
endif
ifeq ($(KOKKOSKERNELS_INTERNAL_INST_FLOAT), 1)
KOKKOSKERNELS_INTERNAL_SRC_BLAS += $(wildcard ${KOKKOSKERNELS_PATH}/src/impl/generated_specializations_cpp/*/KokkosBlas*eti_spec_inst_float*OpenMP_*.cpp)
KOKKOSKERNELS_INTERNAL_SRC_SPARSE += $(wildcard ${KOKKOSKERNELS_PATH}/src/impl/generated_specializations_cpp/*/KokkosSparse*eti_spec_inst_float*OpenMP_*.cpp)
endif
ifeq ($(KOKKOSKERNELS_INTERNAL_INST_COMPLEX_DOUBLE_), 1)
KOKKOSKERNELS_INTERNAL_SRC_BLAS += $(wildcard ${KOKKOSKERNELS_PATH}/src/impl/generated_specializations_cpp/*/KokkosBlas*eti_spec_inst_Kokkos_complex_double*OpenMP_*.cpp)
KOKKOSKERNELS_INTERNAL_SRC_SPARSE += $(wildcard ${KOKKOSKERNELS_PATH}/src/impl/generated_specializations_cpp/*/KokkosSparse*eti_spec_inst_Kokkos_complex_double*OpenMP_*.cpp)
endif
ifeq ($(KOKKOSKERNELS_INTERNAL_INST_COMPLEX_FLOAT_), 1)
KOKKOSKERNELS_INTERNAL_SRC_BLAS += $(wildcard ${KOKKOSKERNELS_PATH}/src/impl/generated_specializations_cpp/*/KokkosBlas*eti_spec_inst_Kokkos_complex_float*OpenMP_*.cpp)
KOKKOSKERNELS_INTERNAL_SRC_SPARSE += $(wildcard ${KOKKOSKERNELS_PATH}/src/impl/generated_specializations_cpp/*/KokkosSparse*eti_spec_inst_Kokkos_complex_float*OpenMP_*.cpp)
endif
endif
ifeq ($(KOKKOSKERNELS_INTERNAL_INST_EXECSPACE_THREADS), 1)
ifeq ($(KOKKOSKERNELS_INTERNAL_INST_DOUBLE), 1)
KOKKOSKERNELS_INTERNAL_SRC_BLAS += $(wildcard ${KOKKOSKERNELS_PATH}/src/impl/generated_specializations_cpp/*/KokkosBlas*eti_spec_inst_double*Threads_*.cpp)
KOKKOSKERNELS_INTERNAL_SRC_SPARSE += $(wildcard ${KOKKOSKERNELS_PATH}/src/impl/generated_specializations_cpp/*/KokkosSparse*eti_spec_inst_double*Threads_*.cpp)
endif
ifeq ($(KOKKOSKERNELS_INTERNAL_INST_FLOAT), 1)
KOKKOSKERNELS_INTERNAL_SRC_BLAS += $(wildcard ${KOKKOSKERNELS_PATH}/src/impl/generated_specializations_cpp/*/KokkosBlas*eti_spec_inst_float*Threads_*.cpp)
KOKKOSKERNELS_INTERNAL_SRC_SPARSE += $(wildcard ${KOKKOSKERNELS_PATH}/src/impl/generated_specializations_cpp/*/KokkosSparse*eti_spec_inst_float*Threads_*.cpp)
endif
ifeq ($(KOKKOSKERNELS_INTERNAL_INST_COMPLEX_DOUBLE_), 1)
KOKKOSKERNELS_INTERNAL_SRC_BLAS += $(wildcard ${KOKKOSKERNELS_PATH}/src/impl/generated_specializations_cpp/*/KokkosBlas*eti_spec_inst_Kokkos_complex_double*Threads_*.cpp)
KOKKOSKERNELS_INTERNAL_SRC_SPARSE += $(wildcard ${KOKKOSKERNELS_PATH}/src/impl/generated_specializations_cpp/*/KokkosSparse*eti_spec_inst_Kokkos_complex_double*Threads_*.cpp)
endif
ifeq ($(KOKKOSKERNELS_INTERNAL_INST_COMPLEX_FLOAT_), 1)
KOKKOSKERNELS_INTERNAL_SRC_BLAS += $(wildcard ${KOKKOSKERNELS_PATH}/src/impl/generated_specializations_cpp/*/KokkosBlas*eti_spec_inst_Kokkos_complex_float*Threads_*.cpp)
KOKKOSKERNELS_INTERNAL_SRC_SPARSE += $(wildcard ${KOKKOSKERNELS_PATH}/src/impl/generated_specializations_cpp/*/KokkosSparse*eti_spec_inst_Kokkos_complex_float*Threads_*.cpp)
endif
endif
ifeq ($(KOKKOSKERNELS_INTERNAL_INST_EXECSPACE_CUDA), 1)
ifeq ($(KOKKOSKERNELS_INTERNAL_INST_DOUBLE), 1)
KOKKOSKERNELS_INTERNAL_SRC_BLAS += $(wildcard ${KOKKOSKERNELS_PATH}/src/impl/generated_specializations_cpp/*/KokkosBlas*eti_spec_inst_double*Cuda_*.cpp)
KOKKOSKERNELS_INTERNAL_SRC_SPARSE += $(wildcard ${KOKKOSKERNELS_PATH}/src/impl/generated_specializations_cpp/*/KokkosSparse*eti_spec_inst_double*Cuda_*.cpp)
endif
ifeq ($(KOKKOSKERNELS_INTERNAL_INST_FLOAT), 1)
KOKKOSKERNELS_INTERNAL_SRC_BLAS += $(wildcard ${KOKKOSKERNELS_PATH}/src/impl/generated_specializations_cpp/*/KokkosBlas*eti_spec_inst_float*Cuda_*.cpp)
KOKKOSKERNELS_INTERNAL_SRC_SPARSE += $(wildcard ${KOKKOSKERNELS_PATH}/src/impl/generated_specializations_cpp/*/KokkosSparse*eti_spec_inst_float*Cuda_*.cpp)
endif
ifeq ($(KOKKOSKERNELS_INTERNAL_INST_COMPLEX_DOUBLE_), 1)
KOKKOSKERNELS_INTERNAL_SRC_BLAS += $(wildcard ${KOKKOSKERNELS_PATH}/src/impl/generated_specializations_cpp/*/KokkosBlas*eti_spec_inst_Kokkos_complex_double*Cuda_*.cpp)
KOKKOSKERNELS_INTERNAL_SRC_SPARSE += $(wildcard ${KOKKOSKERNELS_PATH}/src/impl/generated_specializations_cpp/*/KokkosSparse*eti_spec_inst_Kokkos_complex_double*Cuda_*.cpp)
endif
ifeq ($(KOKKOSKERNELS_INTERNAL_INST_COMPLEX_FLOAT_), 1)
KOKKOSKERNELS_INTERNAL_SRC_BLAS += $(wildcard ${KOKKOSKERNELS_PATH}/src/impl/generated_specializations_cpp/*/KokkosBlas*eti_spec_inst_Kokkos_complex_float*Cuda_*.cpp)
KOKKOSKERNELS_INTERNAL_SRC_SPARSE += $(wildcard ${KOKKOSKERNELS_PATH}/src/impl/generated_specializations_cpp/*/KokkosSparse*eti_spec_inst_Kokkos_complex_float*Cuda_*.cpp)
endif
endif
KOKKOSKERNELS_INTERNAL_HEADERS = $(wildcard ${KOKKOSKERNELS_PATH}/src/impl/*.hpp)
KOKKOSKERNELS_INTERNAL_HEADERS += $(wildcard ${KOKKOSKERNELS_PATH}/src/impl/generated_specializations_hpp/*/*eti_spec*.hpp)
vpath %.cpp $(sort $(dir $(KOKKOSKERNELS_INTERNAL_SRC_SPARSE)))
vpath %.cpp $(sort $(dir $(KOKKOSKERNELS_INTERNAL_SRC_BLAS)))
DEPFLAGS = -M
ifeq ($(KOKKOS_OS),CYGWIN)
COPY_FLAG = -u
endif
ifeq ($(KOKKOS_OS),Linux)
COPY_FLAG = -u
endif
ifeq ($(KOKKOS_OS),Darwin)
COPY_FLAG =
endif
KOKKOSKERNELS_INTERNAL_SRC_BLAS_NODIR = $(notdir $(KOKKOSKERNELS_INTERNAL_SRC_BLAS))
KOKKOSKERNELS_INTERNAL_SRC_SPARSE_NODIR = $(notdir $(KOKKOSKERNELS_INTERNAL_SRC_SPARSE))
KOKKOSKERNELS_INTERNAL_OBJ_BLAS = $(KOKKOSKERNELS_INTERNAL_SRC_BLAS_NODIR:.cpp=.o)
KOKKOSKERNELS_INTERNAL_OBJ_SPARSE = $(KOKKOSKERNELS_INTERNAL_SRC_SPARSE_NODIR:.cpp=.o)
KOKKOSKERNELS_CPP_DEPENDS = $(KOKKOSKERNELS_INTERNAL_HEADERS) KokkosKernels_config.h
KokkosKernels_config.h:
kokkoskernels-build-lib: $(KOKKOSKERNELS_INTERNAL_LIBRARY)
$(KOKKOSKERNELS_INTERNAL_LIBRARY): $(KOKKOSKERNELS_INTERNAL_OBJ_SPARSE) $(KOKKOSKERNELS_INTERNAL_OBJ_BLAS)
ar cr ${KOKKOSKERNELS_INTERNAL_LIBRARY} $(KOKKOSKERNELS_INTERNAL_OBJ_SPARSE) $(KOKKOSKERNELS_INTERNAL_OBJ_BLAS)
ranlib ${KOKKOSKERNELS_INTERNAL_LIBRARY}
kokkoskernels-clean: kokkos-clean
rm -f *.o $(KOKKOSKERNELS_INTERNAL_LIBRARY) KokkosKernels_config.h KokkosKernels_config.tmp
# Compilation rules
$(filter %.o,$(KOKKOSKERNELS_INTERNAL_OBJ_BLAS)): %.o:%.cpp $(KOKKOS_CPP_DEPENDS) ${KOKKOSKERNELS_CPP_DEPENDS} KokkosKernels_config.h
$(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOSKERNELS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) $(EXTRA_INC) -c $<
$(filter %.o,$(KOKKOSKERNELS_INTERNAL_OBJ_SPARSE)): %.o:%.cpp $(KOKKOS_CPP_DEPENDS) ${KOKKOSKERNELS_CPP_DEPENDS} KokkosKernels_config.h
$(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOSKERNELS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) $(EXTRA_INC) -c $<