forked from hypre-space/hypre
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
134 lines (127 loc) · 3.58 KB
/
CMakeLists.txt
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
# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other
# HYPRE Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
set(HDRS
HYPRE_seq_mv.h
seq_mv.h
)
set(SRCS
csr_matop.c
csr_matrix.c
csr_matvec.c
genpart.c
HYPRE_csr_matrix.c
HYPRE_mapped_matrix.c
HYPRE_multiblock_matrix.c
HYPRE_vector.c
mapped_matrix.c
multiblock_matrix.c
vector_batched.c
csr_matop_device.c
csr_matrix_cuda_utils.c
csr_matvec_device.c
csr_matvec_oomp.c
csr_spadd_device.c
csr_spgemm_device.c
csr_spgemm_device_cusparse.c
csr_spgemm_device_numblocks.c
csr_spgemm_device_numer.c
csr_spgemm_device_numer1.c
csr_spgemm_device_numer2.c
csr_spgemm_device_numer3.c
csr_spgemm_device_numer4.c
csr_spgemm_device_numer5.c
csr_spgemm_device_numer6.c
csr_spgemm_device_numer7.c
csr_spgemm_device_numer8.c
csr_spgemm_device_numer9.c
csr_spgemm_device_numer10.c
csr_spgemm_device_onemklsparse.c
csr_spgemm_device_rocsparse.c
csr_spgemm_device_rowest.c
csr_spgemm_device_symbl.c
csr_spgemm_device_symbl1.c
csr_spgemm_device_symbl2.c
csr_spgemm_device_symbl3.c
csr_spgemm_device_symbl4.c
csr_spgemm_device_symbl5.c
csr_spgemm_device_symbl6.c
csr_spgemm_device_symbl7.c
csr_spgemm_device_symbl8.c
csr_spgemm_device_symbl9.c
csr_spgemm_device_symbl10.c
csr_spgemm_device_util.c
csr_spmv_device.c
csr_sptrans_device.c
vector.c
vector_device.c
)
# Autogenerate csr_spgemm_device_numer$ files
file(READ "csr_spgemm_device_numer.in" CONTENTS)
foreach(number RANGE 1 10)
# Check if file exists, then don't recreate
set(fn "csr_spgemm_device_numer${number}.c")
if (NOT EXISTS ${fn})
file(WRITE ${fn} "#define HYPRE_SPGEMM_BIN ${number}")
file(APPEND ${fn} "${CONTENTS}")
endif (NOT EXISTS ${fn})
endforeach(number RANGE 1 10)
# Autogenerate csr_spgemm_device_symbl$ files
file(READ "csr_spgemm_device_symbl.in" CONTENTS)
foreach(number RANGE 1 10)
set(fn "csr_spgemm_device_symbl${number}.c")
if (NOT EXISTS ${fn})
file(WRITE ${fn} "#define HYPRE_SPGEMM_BIN ${number}")
file(APPEND ${fn} "${CONTENTS}")
endif (NOT EXISTS ${fn})
endforeach(number RANGE 1 10)
target_sources(${PROJECT_NAME}
PRIVATE ${SRCS}
${HDRS}
)
if (HYPRE_USING_CUDA OR HYPRE_USING_SYCL)
set(GPU_SRCS
csr_matop_device.c
csr_matrix_cuda_utils.c
csr_matvec_device.c
csr_matvec_oomp.c
csr_spadd_device.c
csr_spgemm_device.c
csr_spgemm_device_cusparse.c
csr_spgemm_device_numblocks.c
csr_spgemm_device_numer.c
csr_spgemm_device_numer1.c
csr_spgemm_device_numer2.c
csr_spgemm_device_numer3.c
csr_spgemm_device_numer4.c
csr_spgemm_device_numer5.c
csr_spgemm_device_numer6.c
csr_spgemm_device_numer7.c
csr_spgemm_device_numer8.c
csr_spgemm_device_numer9.c
csr_spgemm_device_numer10.c
csr_spgemm_device_onemklsparse.c
csr_spgemm_device_rocsparse.c
csr_spgemm_device_rowest.c
csr_spgemm_device_symbl.c
csr_spgemm_device_symbl1.c
csr_spgemm_device_symbl2.c
csr_spgemm_device_symbl3.c
csr_spgemm_device_symbl4.c
csr_spgemm_device_symbl5.c
csr_spgemm_device_symbl6.c
csr_spgemm_device_symbl7.c
csr_spgemm_device_symbl8.c
csr_spgemm_device_symbl9.c
csr_spgemm_device_symbl10.c
csr_spgemm_device_util.c
csr_spmv_device.c
csr_sptrans_device.c
vector_device.c
)
convert_filenames_to_full_paths(GPU_SRCS)
set(HYPRE_GPU_SOURCES ${HYPRE_GPU_SOURCES} ${GPU_SRCS} PARENT_SCOPE)
endif ()
convert_filenames_to_full_paths(HDRS)
set(HYPRE_HEADERS ${HYPRE_HEADERS} ${HDRS} PARENT_SCOPE)